From 7e4d86dbb87022538858d7c49ff113e893d6ab35 Mon Sep 17 00:00:00 2001 From: Matthew Wampler-Doty Date: Thu, 5 Mar 2015 00:06:20 -0500 Subject: [PATCH 001/461] Refactoring everything into src/ for a little sanity --- CMakeLists.txt | 39 ++++++ compiler.h | 33 +++++ data_sizes.h | 247 ++++++++++++++++++++++++++++++++++++++ endian.h | 74 ++++++++++++ ethash.h | 93 +++++++++++++++ fnv.h | 38 ++++++ internal.c | 298 ++++++++++++++++++++++++++++++++++++++++++++++ internal.h | 48 ++++++++ sha3.c | 151 +++++++++++++++++++++++ sha3.h | 27 +++++ sha3_cryptopp.cpp | 34 ++++++ sha3_cryptopp.h | 15 +++ util.c | 41 +++++++ util.h | 47 ++++++++ 14 files changed, 1185 insertions(+) create mode 100644 CMakeLists.txt create mode 100644 compiler.h create mode 100644 data_sizes.h create mode 100644 endian.h create mode 100644 ethash.h create mode 100644 fnv.h create mode 100644 internal.c create mode 100644 internal.h create mode 100644 sha3.c create mode 100644 sha3.h create mode 100644 sha3_cryptopp.cpp create mode 100644 sha3_cryptopp.h create mode 100644 util.c create mode 100644 util.h diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 000000000..7bc147af7 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,39 @@ +set(LIBRARY ethash) + +if (CPPETHEREUM) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") +#else () +endif () + +set(CMAKE_BUILD_TYPE Release) + +if (NOT MSVC) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99") +endif() + +set(FILES util.c + util.h + internal.c + ethash.h + endian.h + compiler.h + fnv.h + data_sizes.h) + +if (NOT CRYPTOPP_FOUND) + find_package(CryptoPP 5.6.2) +endif() + +if (CRYPTOPP_FOUND) + add_definitions(-DWITH_CRYPTOPP) + include_directories( ${CRYPTOPP_INCLUDE_DIRS} ) + list(APPEND FILES sha3_cryptopp.cpp sha3_cryptopp.h) +else() + list(APPEND FILES sha3.c sha3.h) +endif() + +add_library(${LIBRARY} ${FILES}) + +if (CRYPTOPP_FOUND) + TARGET_LINK_LIBRARIES(${LIBRARY} ${CRYPTOPP_LIBRARIES}) +endif() diff --git a/compiler.h b/compiler.h new file mode 100644 index 000000000..9695871cd --- /dev/null +++ b/compiler.h @@ -0,0 +1,33 @@ +/* + This file is part of cpp-ethereum. + + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file compiler.h + * @date 2014 + */ +#pragma once + +// Visual Studio doesn't support the inline keyword in C mode +#if defined(_MSC_VER) && !defined(__cplusplus) +#define inline __inline +#endif + +// pretend restrict is a standard keyword +#if defined(_MSC_VER) +#define restrict __restrict +#else +#define restrict __restrict__ +#endif + diff --git a/data_sizes.h b/data_sizes.h new file mode 100644 index 000000000..ccdf554a8 --- /dev/null +++ b/data_sizes.h @@ -0,0 +1,247 @@ +/* + This file is part of cpp-ethereum. + + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software FoundationUUU,either version 3 of the LicenseUUU,or + (at your option) any later version. + + cpp-ethereum is distributed in the hope that it will be usefulU, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If notUUU,see . +*/ + +/** @file data_sizes.h +* @author Matthew Wampler-Doty +* @date 2015 +*/ + +// TODO: Update this after ~3.5 years + +#pragma once + +#include +#include "compiler.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#include + +// 500 Epochs worth of tabulated DAG sizes (~3.5 Years) + +// Generated with the following Mathematica Code: +// GetDataSizes[n_] := Module[{ +// DAGSizeBytesInit = 2^30, +// MixBytes = 128, +// DAGGrowth = 113000000, +// j = 0}, +// Reap[ +// While[j < n, +// Module[{i = +// Floor[(DAGSizeBytesInit + DAGGrowth * j) / MixBytes]}, +// While[! PrimeQ[i], i--]; +// Sow[i*MixBytes]; j++]]]][[2]][[1]] + +static const size_t dag_sizes[] = { + 1073739904U, 1186739584U, 1299741568U, 1412741248U, 1525741696U, + 1638736768U, 1751741312U, 1864740736U, 1977740672U, 2090740864U, + 2203740544U, 2316741248U, 2429739392U, 2542740352U, 2655741824U, + 2768739712U, 2881740416U, 2994741632U, 3107740544U, 3220741504U, + 3333738112U, 3446741632U, 3559741312U, 3672740224U, 3785740928U, + 3898738304U, 4011741824U, 4124739712U, 4237735808U, 4350740864U, + 4463741824U, 4576741504U, 4689741184U, 4802739328U, 4915741568U, + 5028740224U, 5141740672U, 5254738304U, 5367741824U, 5480737664U, + 5593738112U, 5706741632U, 5819740544U, 5932734592U, 6045739904U, + 6158740096U, 6271740032U, 6384731776U, 6497732992U, 6610740352U, + 6723741056U, 6836741504U, 6949740416U, 7062740096U, 7175741824U, + 7288740224U, 7401741184U, 7514741632U, 7627741568U, 7740739712U, + 7853739136U, 7966740352U, 8079741568U, 8192739712U, 8305738624U, + 8418740864U, 8531740288U, 8644740736U, 8757735808U, 8870738816U, + 8983739264U, 9096740992U, 9209740928U, 9322739584U, 9435741824U, + 9548741504U, 9661739392U, 9774738304U, 9887741312U, 10000738688U, + 10113739136U, 10226741632U, 10339739776U, 10452741248U, 10565740928U, + 10678736512U, 10791734656U, 10904741248U, 11017738112U, 11130741632U, + 11243741312U, 11356739456U, 11469740416U, 11582734976U, 11695739008U, + 11808741248U, 11921734784U, 12034739072U, 12147741568U, 12260737408U, + 12373741696U, 12486738304U, 12599740544U, 12712740224U, 12825741184U, + 12938736256U, 13051741312U, 13164737408U, 13277738368U, 13390738048U, + 13503741824U, 13616741504U, 13729737088U, 13842740096U, 13955741312U, + 14068741504U, 14181740416U, 14294741632U, 14407739776U, 14520740224U, + 14633740928U, 14746736512U, 14859741824U, 14972740736U, 15085740928U, + 15198738304U, 15311732096U, 15424740736U, 15537739904U, 15650741632U, + 15763741568U, 15876737152U, 15989741696U, 16102740608U, 16215741056U, + 16328741248U, 16441740416U, 16554737792U, 16667740288U, 16780740992U, + 16893738112U, 17006741632U, 17119739008U, 17232735616U, 17345739392U, + 17458740352U, 17571736192U, 17684739712U, 17797739392U, 17910740096U, + 18023741312U, 18136740736U, 18249738112U, 18362738816U, 18475735424U, + 18588740224U, 18701738368U, 18814736768U, 18927737216U, 19040739968U, + 19153739648U, 19266736768U, 19379737984U, 19492739456U, 19605738368U, + 19718740352U, 19831741312U, 19944736384U, 20057741696U, 20170741376U, + 20283741824U, 20396737408U, 20509741696U, 20622741376U, 20735739008U, + 20848741504U, 20961740672U, 21074739328U, 21187740032U, 21300739456U, + 21413741696U, 21526740608U, 21639741824U, 21752737408U, 21865741696U, + 21978741376U, 22091741824U, 22204738432U, 22317740672U, 22430740096U, + 22543736704U, 22656741248U, 22769739904U, 22882739584U, 22995740288U, + 23108740736U, 23221740928U, 23334741376U, 23447737216U, 23560740992U, + 23673741184U, 23786740864U, 23899737728U, 24012741248U, 24125734784U, + 24238736512U, 24351741824U, 24464740736U, 24577737088U, 24690741632U, + 24803739776U, 24916740736U, 25029740416U, 25142740864U, 25255741568U, + 25368741248U, 25481740672U, 25594741376U, 25707741568U, 25820741504U, + 25933730432U, 26046739072U, 26159741824U, 26272741504U, 26385740672U, + 26498740096U, 26611741568U, 26724740992U, 26837739904U, 26950735232U, + 27063738496U, 27176741248U, 27289741184U, 27402740864U, 27515740544U, + 27628737152U, 27741740672U, 27854741632U, 27967740544U, 28080739712U, + 28193738368U, 28306741376U, 28419737728U, 28532739968U, 28645739648U, + 28758740096U, 28871741312U, 28984739456U, 29097740416U, 29210740864U, + 29323741312U, 29436740224U, 29549741696U, 29662738304U, 29775741568U, + 29888741504U, 30001740928U, 30114737024U, 30227735168U, 30340737664U, + 30453738368U, 30566737024U, 30679733632U, 30792740224U, 30905740928U, + 31018740352U, 31131740032U, 31244738944U, 31357737344U, 31470741376U, + 31583740544U, 31696740224U, 31809738112U, 31922739328U, 32035737472U, + 32148740992U, 32261741696U, 32374740352U, 32487741824U, 32600740736U, + 32713739648U, 32826740608U, 32939729792U, 33052740992U, 33165740672U, + 33278739584U, 33391741312U, 33504739712U, 33617740928U, 33730740608U, + 33843738496U, 33956739968U, 34069741696U, 34182739328U, 34295741824U, + 34408739968U, 34521740672U, 34634736512U, 34747741568U, 34860741248U, + 34973739392U, 35086738304U, 35199741056U, 35312736896U, 35425741184U, + 35538741376U, 35651740288U, 35764737152U, 35877741184U, 35990739584U, + 36103740544U, 36216740992U, 36329739392U, 36442737536U, 36555741568U, + 36668740736U, 36781741184U, 36894737024U, 37007741312U, 37120739456U, + 37233741184U, 37346736256U, 37459736192U, 37572734336U, 37685739904U, + 37798740352U, 37911737728U, 38024741504U, 38137739648U, 38250740608U, + 38363741824U, 38476740992U, 38589741184U, 38702740096U, 38815741312U, + 38928741248U, 39041738368U, 39154739584U, 39267741824U, 39380739712U, + 39493735808U, 39606741632U, 39719741312U, 39832741504U, 39945739648U, + 40058740352U, 40171740032U, 40284740992U, 40397740672U, 40510740352U, + 40623740288U, 40736738176U, 40849737856U, 40962741376U, 41075739776U, + 41188737664U, 41301735808U, 41414738048U, 41527741312U, 41640740992U, + 41753739904U, 41866739072U, 41979738496U, 42092740736U, 42205739648U, + 42318740608U, 42431741312U, 42544738688U, 42657741184U, 42770738048U, + 42883741568U, 42996741248U, 43109740928U, 43222736512U, 43335741056U, + 43448730496U, 43561740416U, 43674741632U, 43787740544U, 43900741504U, + 44013739648U, 44126740864U, 44239740544U, 44352741248U, 44465738368U, + 44578735232U, 44691739264U, 44804741504U, 44917741696U, 45030741376U, + 45143741824U, 45256740992U, 45369739136U, 45482740096U, 45595739776U, + 45708739712U, 45821740672U, 45934741376U, 46047741056U, 46160741248U, + 46273737088U, 46386740864U, 46499739008U, 46612739968U, 46725735296U, + 46838740864U, 46951741568U, 47064737152U, 47177741696U, 47290741376U, + 47403738752U, 47516741248U, 47629739648U, 47742741632U, 47855737984U, + 47968740224U, 48081738368U, 48194741632U, 48307739264U, 48420739712U, + 48533739136U, 48646738304U, 48759741824U, 48872741504U, 48985739392U, + 49098741376U, 49211741056U, 49324740992U, 49437738368U, 49550740864U, + 49663735424U, 49776737408U, 49889740672U, 50002738816U, 50115738752U, + 50228739712U, 50341741696U, 50454736768U, 50567738752U, 50680739968U, + 50793736832U, 50906734976U, 51019741568U, 51132739456U, 51245741696U, + 51358741376U, 51471741056U, 51584738944U, 51697734272U, 51810739072U, + 51923736448U, 52036740736U, 52149741184U, 52262737024U, 52375738496U, + 52488740992U, 52601739136U, 52714740352U, 52827736448U, 52940738176U, + 53053741696U, 53166740864U, 53279741824U, 53392741504U, 53505739136U, + 53618739584U, 53731741312U, 53844741248U, 53957741696U, 54070741376U, + 54183740288U, 54296741504U, 54409741696U, 54522739072U, 54635737472U, + 54748741504U, 54861736064U, 54974740096U, 55087741568U, 55200733568U, + 55313741696U, 55426734464U, 55539741056U, 55652741504U, 55765741184U, + 55878741376U, 55991730304U, 56104740992U, 56217740672U, 56330731648U, + 56443737472U, 56556724352U, 56669740672U, 56782739072U, 56895740032U, + 57008741248U, 57121741696U, 57234740096U, 57347741312U, 57460741504U +}; + +// 500 Epochs worth of tabulated DAG sizes (~3.5 Years) + +// Generated with the following Mathematica Code: +// GetCacheSizes[n_] := Module[{ +// DAGSizeBytesInit = 2^30, +// MixBytes = 128, +// DAGGrowth = 113000000, +// HashBytes = 64, +// DAGParents = 1024, +// j = 0}, +// Reap[ +// While[j < n, +// Module[{i = Floor[(DAGSizeBytesInit + DAGGrowth * j) / (DAGParents * HashBytes)]}, +// While[! PrimeQ[i], i--]; +// Sow[i*HashBytes]; j++]]]][[2]][[1]] + +const size_t cache_sizes[] = { + 1048384U, 1158208U, 1268416U, 1377856U, 1489856U, 1599296U, 1710656U, + 1820608U, 1930816U, 2041024U, 2151872U, 2261696U, 2371904U, 2482624U, + 2593216U, 2703296U, 2814016U, 2924224U, 3034816U, 3144896U, 3255488U, + 3365312U, 3475904U, 3586624U, 3696064U, 3806272U, 3917504U, 4027456U, + 4138304U, 4248512U, 4359104U, 4469312U, 4579264U, 4689728U, 4797376U, + 4909888U, 5020096U, 5131328U, 5241664U, 5351744U, 5461312U, 5572544U, + 5683264U, 5793472U, 5903552U, 6014144U, 6121664U, 6235072U, 6344896U, + 6454592U, 6565952U, 6675904U, 6786112U, 6896704U, 7006784U, 7117888U, + 7228096U, 7338304U, 7448768U, 7557952U, 7669184U, 7779776U, 7889216U, + 8000192U, 8110912U, 8220736U, 8331712U, 8441536U, 8552384U, 8662592U, + 8772928U, 8883136U, 8993728U, 9103168U, 9214528U, 9323968U, 9434816U, + 9545152U, 9655616U, 9766336U, 9876544U, 9986624U, 10097344U, 10207424U, + 10316864U, 10427968U, 10538432U, 10649152U, 10758976U, 10869568U, 10979776U, + 11089472U, 11200832U, 11309632U, 11420608U, 11531584U, 11641792U, 11751104U, + 11862976U, 11973184U, 12083264U, 12193856U, 12304064U, 12414656U, 12524608U, + 12635072U, 12745792U, 12855616U, 12965824U, 13076416U, 13187008U, 13297216U, + 13407808U, 13518016U, 13627072U, 13738688U, 13848256U, 13959488U, 14069696U, + 14180288U, 14290624U, 14399552U, 14511424U, 14621504U, 14732096U, 14841664U, + 14951744U, 15062336U, 15172672U, 15283264U, 15393088U, 15504448U, 15614272U, + 15723712U, 15834944U, 15945152U, 16055744U, 16165696U, 16277056U, 16387136U, + 16494784U, 16607936U, 16718272U, 16828736U, 16938176U, 17048384U, 17159872U, + 17266624U, 17380544U, 17490496U, 17600192U, 17711296U, 17821376U, 17931968U, + 18041152U, 18152896U, 18261952U, 18373568U, 18483392U, 18594112U, 18703936U, + 18814912U, 18924992U, 19034944U, 19145408U, 19256128U, 19366208U, 19477184U, + 19587136U, 19696576U, 19808192U, 19916992U, 20028352U, 20137664U, 20249024U, + 20358848U, 20470336U, 20580544U, 20689472U, 20801344U, 20911424U, 21020096U, + 21130688U, 21242176U, 21352384U, 21462208U, 21573824U, 21683392U, 21794624U, + 21904448U, 22013632U, 22125248U, 22235968U, 22344512U, 22456768U, 22566848U, + 22677056U, 22786496U, 22897984U, 23008064U, 23118272U, 23228992U, 23338816U, + 23449408U, 23560256U, 23670464U, 23780672U, 23891264U, 24001216U, 24110656U, + 24221888U, 24332608U, 24442688U, 24552512U, 24662464U, 24773696U, 24884032U, + 24994496U, 25105216U, 25215296U, 25324864U, 25435712U, 25546432U, 25655744U, + 25767232U, 25876672U, 25986368U, 26098112U, 26207936U, 26318912U, 26428736U, + 26539712U, 26650048U, 26760256U, 26869184U, 26979776U, 27091136U, 27201728U, + 27311552U, 27422272U, 27532352U, 27642304U, 27752896U, 27863744U, 27973952U, + 28082752U, 28194752U, 28305344U, 28415168U, 28524992U, 28636352U, 28746304U, + 28857152U, 28967104U, 29077184U, 29187904U, 29298496U, 29408576U, 29518912U, + 29628992U, 29739968U, 29850176U, 29960512U, 30070336U, 30180544U, 30290752U, + 30398912U, 30512192U, 30622784U, 30732992U, 30842176U, 30953536U, 31063744U, + 31174336U, 31284544U, 31395136U, 31504448U, 31615552U, 31725632U, 31835072U, + 31946176U, 32057024U, 32167232U, 32277568U, 32387008U, 32497984U, 32608832U, + 32719168U, 32829376U, 32939584U, 33050048U, 33160768U, 33271232U, 33381184U, + 33491648U, 33601856U, 33712576U, 33822016U, 33932992U, 34042816U, 34153024U, + 34263104U, 34373824U, 34485056U, 34594624U, 34704832U, 34816064U, 34926272U, + 35036224U, 35146816U, 35255104U, 35367104U, 35478208U, 35588416U, 35698496U, + 35808832U, 35918656U, 36029888U, 36139456U, 36250688U, 36360512U, 36471104U, + 36581696U, 36691136U, 36802112U, 36912448U, 37022912U, 37132864U, 37242944U, + 37354048U, 37464512U, 37574848U, 37684928U, 37794752U, 37904704U, 38015552U, + 38125888U, 38236864U, 38345792U, 38457152U, 38567744U, 38678336U, 38787776U, + 38897216U, 39009088U, 39117632U, 39230144U, 39340352U, 39450304U, 39560384U, + 39671488U, 39781312U, 39891392U, 40002112U, 40112704U, 40223168U, 40332608U, + 40443968U, 40553792U, 40664768U, 40774208U, 40884416U, 40993984U, 41105984U, + 41215424U, 41326528U, 41436992U, 41546048U, 41655872U, 41768128U, 41878336U, + 41988928U, 42098752U, 42209344U, 42319168U, 42429248U, 42540352U, 42649792U, + 42761024U, 42871616U, 42981824U, 43092032U, 43201856U, 43312832U, 43423552U, + 43533632U, 43643584U, 43753792U, 43864384U, 43974976U, 44084032U, 44195392U, + 44306368U, 44415296U, 44526016U, 44637248U, 44746816U, 44858048U, 44967872U, + 45078848U, 45188288U, 45299264U, 45409216U, 45518272U, 45630272U, 45740224U, + 45850432U, 45960896U, 46069696U, 46182208U, 46292416U, 46402624U, 46512064U, + 46623296U, 46733888U, 46843712U, 46953664U, 47065024U, 47175104U, 47285696U, + 47395904U, 47506496U, 47615296U, 47726912U, 47837632U, 47947712U, 48055232U, + 48168128U, 48277952U, 48387392U, 48499648U, 48609472U, 48720064U, 48830272U, + 48940096U, 49050944U, 49160896U, 49271744U, 49381568U, 49492288U, 49602752U, + 49712576U, 49822016U, 49934272U, 50042816U, 50154304U, 50264128U, 50374336U, + 50484416U, 50596288U, 50706752U, 50816704U, 50927168U, 51035456U, 51146944U, + 51258176U, 51366976U, 51477824U, 51589568U, 51699776U, 51809728U, 51920576U, + 52030016U, 52140736U, 52251328U, 52361152U, 52470592U, 52582592U, 52691776U, + 52803136U, 52912576U, 53020736U, 53132224U, 53242688U, 53354816U, 53465536U, + 53575232U, 53685568U, 53796544U, 53906752U, 54016832U, 54126656U, 54236992U, + 54347456U, 54457408U, 54569024U, 54679232U, 54789184U, 54899776U, 55008832U, + 55119296U, 55231168U, 55341248U, 55451584U, 55562048U, 55672256U, 55782208U, + 55893184U, 56002112U, 56113216U +}; + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/endian.h b/endian.h new file mode 100644 index 000000000..9ca842e47 --- /dev/null +++ b/endian.h @@ -0,0 +1,74 @@ +#pragma once + +#include +#include "compiler.h" + +static const uint8_t BitReverseTable256[] = + { + 0x00, 0x80, 0x40, 0xC0, 0x20, 0xA0, 0x60, 0xE0, 0x10, 0x90, 0x50, 0xD0, 0x30, 0xB0, 0x70, 0xF0, + 0x08, 0x88, 0x48, 0xC8, 0x28, 0xA8, 0x68, 0xE8, 0x18, 0x98, 0x58, 0xD8, 0x38, 0xB8, 0x78, 0xF8, + 0x04, 0x84, 0x44, 0xC4, 0x24, 0xA4, 0x64, 0xE4, 0x14, 0x94, 0x54, 0xD4, 0x34, 0xB4, 0x74, 0xF4, + 0x0C, 0x8C, 0x4C, 0xCC, 0x2C, 0xAC, 0x6C, 0xEC, 0x1C, 0x9C, 0x5C, 0xDC, 0x3C, 0xBC, 0x7C, 0xFC, + 0x02, 0x82, 0x42, 0xC2, 0x22, 0xA2, 0x62, 0xE2, 0x12, 0x92, 0x52, 0xD2, 0x32, 0xB2, 0x72, 0xF2, + 0x0A, 0x8A, 0x4A, 0xCA, 0x2A, 0xAA, 0x6A, 0xEA, 0x1A, 0x9A, 0x5A, 0xDA, 0x3A, 0xBA, 0x7A, 0xFA, + 0x06, 0x86, 0x46, 0xC6, 0x26, 0xA6, 0x66, 0xE6, 0x16, 0x96, 0x56, 0xD6, 0x36, 0xB6, 0x76, 0xF6, + 0x0E, 0x8E, 0x4E, 0xCE, 0x2E, 0xAE, 0x6E, 0xEE, 0x1E, 0x9E, 0x5E, 0xDE, 0x3E, 0xBE, 0x7E, 0xFE, + 0x01, 0x81, 0x41, 0xC1, 0x21, 0xA1, 0x61, 0xE1, 0x11, 0x91, 0x51, 0xD1, 0x31, 0xB1, 0x71, 0xF1, + 0x09, 0x89, 0x49, 0xC9, 0x29, 0xA9, 0x69, 0xE9, 0x19, 0x99, 0x59, 0xD9, 0x39, 0xB9, 0x79, 0xF9, + 0x05, 0x85, 0x45, 0xC5, 0x25, 0xA5, 0x65, 0xE5, 0x15, 0x95, 0x55, 0xD5, 0x35, 0xB5, 0x75, 0xF5, + 0x0D, 0x8D, 0x4D, 0xCD, 0x2D, 0xAD, 0x6D, 0xED, 0x1D, 0x9D, 0x5D, 0xDD, 0x3D, 0xBD, 0x7D, 0xFD, + 0x03, 0x83, 0x43, 0xC3, 0x23, 0xA3, 0x63, 0xE3, 0x13, 0x93, 0x53, 0xD3, 0x33, 0xB3, 0x73, 0xF3, + 0x0B, 0x8B, 0x4B, 0xCB, 0x2B, 0xAB, 0x6B, 0xEB, 0x1B, 0x9B, 0x5B, 0xDB, 0x3B, 0xBB, 0x7B, 0xFB, + 0x07, 0x87, 0x47, 0xC7, 0x27, 0xA7, 0x67, 0xE7, 0x17, 0x97, 0x57, 0xD7, 0x37, 0xB7, 0x77, 0xF7, + 0x0F, 0x8F, 0x4F, 0xCF, 0x2F, 0xAF, 0x6F, 0xEF, 0x1F, 0x9F, 0x5F, 0xDF, 0x3F, 0xBF, 0x7F, 0xFF + }; + +static inline uint32_t bitfn_swap32(uint32_t a) { + return (BitReverseTable256[a & 0xff] << 24) | + (BitReverseTable256[(a >> 8) & 0xff] << 16) | + (BitReverseTable256[(a >> 16) & 0xff] << 8) | + (BitReverseTable256[(a >> 24) & 0xff]); +} + +static inline uint64_t bitfn_swap64(uint64_t a) { + return ((uint64_t) bitfn_swap32((uint32_t) (a >> 32))) | + (((uint64_t) bitfn_swap32((uint32_t) a)) << 32); +} + +#if defined(__MINGW32__) || defined(_WIN32) + # define LITTLE_ENDIAN 1234 + # define BYTE_ORDER LITTLE_ENDIAN +#elif defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__) + # include +#elif defined(__OpenBSD__) || defined(__SVR4) + # include +#elif defined(__APPLE__) +# include +#elif defined( BSD ) && (BSD >= 199103) + # include +#elif defined( __QNXNTO__ ) && defined( __LITTLEENDIAN__ ) + # define LITTLE_ENDIAN 1234 + # define BYTE_ORDER LITTLE_ENDIAN +#elif defined( __QNXNTO__ ) && defined( __BIGENDIAN__ ) + # define BIG_ENDIAN 1234 + # define BYTE_ORDER BIG_ENDIAN +#else + +# include + +#endif + + +#if LITTLE_ENDIAN == BYTE_ORDER + +#define fix_endian32(x) (x) +#define fix_endian64(x) (x) + +#elif BIG_ENDIAN == BYTE_ORDER + +#define fix_endian32(x) bitfn_swap32(x) +#define fix_endian64(x) bitfn_swap64(x) + +#else +# error "endian not supported" +#endif // BYTE_ORDER \ No newline at end of file diff --git a/ethash.h b/ethash.h new file mode 100644 index 000000000..ae1d17ac7 --- /dev/null +++ b/ethash.h @@ -0,0 +1,93 @@ +/* + This file is part of cpp-ethereum. + + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file ethash.h +* @date 2015 +*/ +#pragma once + +#include +#include +#include +#include +#include "compiler.h" + +#define REVISION 19 +#define DAGSIZE_BYTES_INIT 1073741824U // 2**30 +#define DAG_GROWTH 113000000U +#define EPOCH_LENGTH 30000U +#define MIX_BYTES 128 +#define DAG_PARENTS 256 +#define CACHE_ROUNDS 3 +#define ACCESSES 64 + +#ifdef __cplusplus +extern "C" { +#endif + +typedef struct ethash_params { + size_t full_size; // Size of full data set (in bytes, multiple of mix size (128)). + size_t cache_size; // Size of compute cache (in bytes, multiple of node size (64)). +} ethash_params; + +typedef struct ethash_return_value { + uint8_t result[32]; + uint8_t mix_hash[32]; +} ethash_return_value; + +size_t ethash_get_datasize(const uint32_t block_number); +size_t ethash_get_cachesize(const uint32_t block_number); + +// initialize the parameters +static inline void ethash_params_init(ethash_params *params, const uint32_t block_number) { + params->full_size = ethash_get_datasize(block_number); + params->cache_size = ethash_get_cachesize(block_number); +} + +typedef struct ethash_cache { + void *mem; +} ethash_cache; + +void ethash_mkcache(ethash_cache *cache, ethash_params const *params, const uint8_t seed[32]); +void ethash_compute_full_data(void *mem, ethash_params const *params, ethash_cache const *cache); +void ethash_full(ethash_return_value *ret, void const *full_mem, ethash_params const *params, const uint8_t header_hash[32], const uint64_t nonce); +void ethash_light(ethash_return_value *ret, ethash_cache const *cache, ethash_params const *params, const uint8_t header_hash[32], const uint64_t nonce); + +static inline void ethash_prep_light(void *cache, ethash_params const *params, const uint8_t seed[32]) { ethash_cache c; c.mem = cache; ethash_mkcache(&c, params, seed); } +static inline void ethash_compute_light(ethash_return_value *ret, void const *cache, ethash_params const *params, const uint8_t header_hash[32], const uint64_t nonce) { ethash_cache c; c.mem = (void*)cache; ethash_light(ret, &c, params, header_hash, nonce); } +static inline void ethash_prep_full(void *full, ethash_params const *params, void const *cache) { ethash_cache c; c.mem = (void*)cache; ethash_compute_full_data(full, params, &c); } +static inline void ethash_compute_full(ethash_return_value *ret, void const *full, ethash_params const *params, const uint8_t header_hash[32], const uint64_t nonce) { ethash_full(ret, full, params, header_hash, nonce); } + +static inline int ethash_check_difficulty( + const uint8_t hash[32], + const uint8_t difficulty[32]) { + // Difficulty is big endian + for (int i = 0; i < 32; i++) { + if (hash[i] == difficulty[i]) continue; + return hash[i] < difficulty[i]; + } + return 0; +} + +int ethash_quick_check_difficulty( + const uint8_t header_hash[32], + const uint64_t nonce, + const uint8_t mix_hash[32], + const uint8_t difficulty[32]); + +#ifdef __cplusplus +} +#endif diff --git a/fnv.h b/fnv.h new file mode 100644 index 000000000..edabeaae2 --- /dev/null +++ b/fnv.h @@ -0,0 +1,38 @@ +/* + This file is part of cpp-ethereum. + + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file fnv.h +* @author Matthew Wampler-Doty +* @date 2015 +*/ + +#pragma once +#include +#include "compiler.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#define FNV_PRIME 0x01000193 + +static inline uint32_t fnv_hash(const uint32_t x, const uint32_t y) { + return x*FNV_PRIME ^ y; +} + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/internal.c b/internal.c new file mode 100644 index 000000000..a2b82d375 --- /dev/null +++ b/internal.c @@ -0,0 +1,298 @@ +/* + This file is part of cpp-ethereum. + + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file dash.cpp +* @author Tim Hughes +* @author Matthew Wampler-Doty +* @date 2015 +*/ + +#include +#include +#include +#include "ethash.h" +#include "fnv.h" +#include "endian.h" +#include "internal.h" +#include "data_sizes.h" + +#ifdef WITH_CRYPTOPP + +#include "sha3_cryptopp.h" + +#else +#include "sha3.h" +#endif // WITH_CRYPTOPP + +size_t ethash_get_datasize(const uint32_t block_number) { + assert(block_number / EPOCH_LENGTH < 500); + return dag_sizes[block_number / EPOCH_LENGTH]; +} + +size_t ethash_get_cachesize(const uint32_t block_number) { + assert(block_number / EPOCH_LENGTH < 500); + return cache_sizes[block_number / EPOCH_LENGTH]; +} + +// Follows Sergio's "STRICT MEMORY HARD HASHING FUNCTIONS" (2014) +// https://bitslog.files.wordpress.com/2013/12/memohash-v0-3.pdf +// SeqMemoHash(s, R, N) +void static ethash_compute_cache_nodes( + node *const nodes, + ethash_params const *params, + const uint8_t seed[32]) { + assert((params->cache_size % sizeof(node)) == 0); + uint32_t const num_nodes = (uint32_t)(params->cache_size / sizeof(node)); + + SHA3_512(nodes[0].bytes, seed, 32); + + for (unsigned i = 1; i != num_nodes; ++i) { + SHA3_512(nodes[i].bytes, nodes[i - 1].bytes, 64); + } + + for (unsigned j = 0; j != CACHE_ROUNDS; j++) { + for (unsigned i = 0; i != num_nodes; i++) { + uint32_t const idx = nodes[i].words[0] % num_nodes; + node data; + data = nodes[(num_nodes - 1 + i) % num_nodes]; + for (unsigned w = 0; w != NODE_WORDS; ++w) + { + data.words[w] ^= nodes[idx].words[w]; + } + SHA3_512(nodes[i].bytes, data.bytes, sizeof(data)); + } + } + + // now perform endian conversion +#if BYTE_ORDER != LITTLE_ENDIAN + for (unsigned w = 0; w != (num_nodes*NODE_WORDS); ++w) + { + nodes->words[w] = fix_endian32(nodes->words[w]); + } +#endif +} + +void ethash_mkcache( + ethash_cache *cache, + ethash_params const *params, + const uint8_t seed[32]) { + node *nodes = (node *) cache->mem; + ethash_compute_cache_nodes(nodes, params, seed); +} + +void ethash_calculate_dag_item( + node *const ret, + const unsigned node_index, + const struct ethash_params *params, + const struct ethash_cache *cache) { + + uint32_t num_parent_nodes = (uint32_t)(params->cache_size / sizeof(node)); + node const *cache_nodes = (node const *) cache->mem; + node const *init = &cache_nodes[node_index % num_parent_nodes]; + + memcpy(ret, init, sizeof(node)); + ret->words[0] ^= node_index; + SHA3_512(ret->bytes, ret->bytes, sizeof(node)); + +#if defined(_M_X64) && ENABLE_SSE + __m128i const fnv_prime = _mm_set1_epi32(FNV_PRIME); + __m128i xmm0 = ret->xmm[0]; + __m128i xmm1 = ret->xmm[1]; + __m128i xmm2 = ret->xmm[2]; + __m128i xmm3 = ret->xmm[3]; +#endif + + for (unsigned i = 0; i != DAG_PARENTS; ++i) + { + uint32_t parent_index = ((node_index ^ i)*FNV_PRIME ^ ret->words[i % NODE_WORDS]) % num_parent_nodes; + node const *parent = &cache_nodes[parent_index]; + + #if defined(_M_X64) && ENABLE_SSE + { + xmm0 = _mm_mullo_epi32(xmm0, fnv_prime); + xmm1 = _mm_mullo_epi32(xmm1, fnv_prime); + xmm2 = _mm_mullo_epi32(xmm2, fnv_prime); + xmm3 = _mm_mullo_epi32(xmm3, fnv_prime); + xmm0 = _mm_xor_si128(xmm0, parent->xmm[0]); + xmm1 = _mm_xor_si128(xmm1, parent->xmm[1]); + xmm2 = _mm_xor_si128(xmm2, parent->xmm[2]); + xmm3 = _mm_xor_si128(xmm3, parent->xmm[3]); + + // have to write to ret as values are used to compute index + ret->xmm[0] = xmm0; + ret->xmm[1] = xmm1; + ret->xmm[2] = xmm2; + ret->xmm[3] = xmm3; + } + #else + { + for (unsigned w = 0; w != NODE_WORDS; ++w) { + ret->words[w] = fnv_hash(ret->words[w], parent->words[w]); + } + } + #endif + } + + SHA3_512(ret->bytes, ret->bytes, sizeof(node)); +} + +void ethash_compute_full_data( + void *mem, + ethash_params const *params, + ethash_cache const *cache) { + assert((params->full_size % (sizeof(uint32_t) * MIX_WORDS)) == 0); + assert((params->full_size % sizeof(node)) == 0); + node *full_nodes = mem; + + // now compute full nodes + for (unsigned n = 0; n != (params->full_size / sizeof(node)); ++n) { + ethash_calculate_dag_item(&(full_nodes[n]), n, params, cache); + } +} + +static void ethash_hash( + ethash_return_value * ret, + node const *full_nodes, + ethash_cache const *cache, + ethash_params const *params, + const uint8_t header_hash[32], + const uint64_t nonce) { + + assert((params->full_size % MIX_WORDS) == 0); + + // pack hash and nonce together into first 40 bytes of s_mix + assert(sizeof(node)*8 == 512); + node s_mix[MIX_NODES + 1]; + memcpy(s_mix[0].bytes, header_hash, 32); + +#if BYTE_ORDER != LITTLE_ENDIAN + s_mix[0].double_words[4] = fix_endian64(nonce); +#else + s_mix[0].double_words[4] = nonce; +#endif + + // compute sha3-512 hash and replicate across mix + SHA3_512(s_mix->bytes, s_mix->bytes, 40); + +#if BYTE_ORDER != LITTLE_ENDIAN + for (unsigned w = 0; w != 16; ++w) { + s_mix[0].words[w] = fix_endian32(s_mix[0].words[w]); + } +#endif + + node* const mix = s_mix + 1; + for (unsigned w = 0; w != MIX_WORDS; ++w) { + mix->words[w] = s_mix[0].words[w % NODE_WORDS]; + } + + unsigned const + page_size = sizeof(uint32_t) * MIX_WORDS, + num_full_pages = (unsigned)(params->full_size / page_size); + + + for (unsigned i = 0; i != ACCESSES; ++i) + { + uint32_t const index = ((s_mix->words[0] ^ i)*FNV_PRIME ^ mix->words[i % MIX_WORDS]) % num_full_pages; + + for (unsigned n = 0; n != MIX_NODES; ++n) + { + const node * dag_node = &full_nodes[MIX_NODES * index + n]; + + if (!full_nodes) { + node tmp_node; + ethash_calculate_dag_item(&tmp_node, index * MIX_NODES + n, params, cache); + dag_node = &tmp_node; + } + + #if defined(_M_X64) && ENABLE_SSE + { + __m128i fnv_prime = _mm_set1_epi32(FNV_PRIME); + __m128i xmm0 = _mm_mullo_epi32(fnv_prime, mix[n].xmm[0]); + __m128i xmm1 = _mm_mullo_epi32(fnv_prime, mix[n].xmm[1]); + __m128i xmm2 = _mm_mullo_epi32(fnv_prime, mix[n].xmm[2]); + __m128i xmm3 = _mm_mullo_epi32(fnv_prime, mix[n].xmm[3]); + mix[n].xmm[0] = _mm_xor_si128(xmm0, dag_node->xmm[0]); + mix[n].xmm[1] = _mm_xor_si128(xmm1, dag_node->xmm[1]); + mix[n].xmm[2] = _mm_xor_si128(xmm2, dag_node->xmm[2]); + mix[n].xmm[3] = _mm_xor_si128(xmm3, dag_node->xmm[3]); + } + #else + { + for (unsigned w = 0; w != NODE_WORDS; ++w) { + mix[n].words[w] = fnv_hash(mix[n].words[w], dag_node->words[w]); + } + } + #endif + } + + } + + // compress mix + for (unsigned w = 0; w != MIX_WORDS; w += 4) + { + uint32_t reduction = mix->words[w+0]; + reduction = reduction*FNV_PRIME ^ mix->words[w+1]; + reduction = reduction*FNV_PRIME ^ mix->words[w+2]; + reduction = reduction*FNV_PRIME ^ mix->words[w+3]; + mix->words[w/4] = reduction; + } + +#if BYTE_ORDER != LITTLE_ENDIAN + for (unsigned w = 0; w != MIX_WORDS/4; ++w) { + mix->words[w] = fix_endian32(mix->words[w]); + } +#endif + + memcpy(ret->mix_hash, mix->bytes, 32); + // final Keccak hash + SHA3_256(ret->result, s_mix->bytes, 64+32); // Keccak-256(s + compressed_mix) +} + +void ethash_quick_hash( + uint8_t return_hash[32], + const uint8_t header_hash[32], + const uint64_t nonce, + const uint8_t mix_hash[32]) { + + uint8_t buf[64+32]; + memcpy(buf, header_hash, 32); +#if BYTE_ORDER != LITTLE_ENDIAN + nonce = fix_endian64(nonce); +#endif + memcpy(&(buf[32]), &nonce, 8); + SHA3_512(buf, buf, 40); + memcpy(&(buf[64]), mix_hash, 32); + SHA3_256(return_hash, buf, 64+32); +} + +int ethash_quick_check_difficulty( + const uint8_t header_hash[32], + const uint64_t nonce, + const uint8_t mix_hash[32], + const uint8_t difficulty[32]) { + + uint8_t return_hash[32]; + ethash_quick_hash(return_hash, header_hash, nonce, mix_hash); + return ethash_check_difficulty(return_hash, difficulty); +} + +void ethash_full(ethash_return_value * ret, void const *full_mem, ethash_params const *params, const uint8_t previous_hash[32], const uint64_t nonce) { + ethash_hash(ret, (node const *) full_mem, NULL, params, previous_hash, nonce); +} + +void ethash_light(ethash_return_value * ret, ethash_cache const *cache, ethash_params const *params, const uint8_t previous_hash[32], const uint64_t nonce) { + ethash_hash(ret, NULL, cache, params, previous_hash, nonce); +} diff --git a/internal.h b/internal.h new file mode 100644 index 000000000..bcbacdaa4 --- /dev/null +++ b/internal.h @@ -0,0 +1,48 @@ +#pragma once +#include "compiler.h" +#include "endian.h" +#include "ethash.h" + +#define ENABLE_SSE 1 + +#if defined(_M_X64) && ENABLE_SSE +#include +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +// compile time settings +#define NODE_WORDS (64/4) +#define MIX_WORDS (MIX_BYTES/4) +#define MIX_NODES (MIX_WORDS / NODE_WORDS) +#include + +typedef union node { + uint8_t bytes[NODE_WORDS * 4]; + uint32_t words[NODE_WORDS]; + uint64_t double_words[NODE_WORDS / 2]; + +#if defined(_M_X64) && ENABLE_SSE + __m128i xmm[NODE_WORDS/4]; +#endif + +} node; + +void ethash_calculate_dag_item( + node *const ret, + const unsigned node_index, + ethash_params const *params, + ethash_cache const *cache +); + +void ethash_quick_hash( + uint8_t return_hash[32], + const uint8_t header_hash[32], + const uint64_t nonce, + const uint8_t mix_hash[32]); + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/sha3.c b/sha3.c new file mode 100644 index 000000000..0c28230b8 --- /dev/null +++ b/sha3.c @@ -0,0 +1,151 @@ +/** libkeccak-tiny +* +* A single-file implementation of SHA-3 and SHAKE. +* +* Implementor: David Leon Gil +* License: CC0, attribution kindly requested. Blame taken too, +* but not liability. +*/ +#include "sha3.h" + +#include +#include +#include +#include + +/******** The Keccak-f[1600] permutation ********/ + +/*** Constants. ***/ +static const uint8_t rho[24] = \ + { 1, 3, 6, 10, 15, 21, + 28, 36, 45, 55, 2, 14, + 27, 41, 56, 8, 25, 43, + 62, 18, 39, 61, 20, 44}; +static const uint8_t pi[24] = \ + {10, 7, 11, 17, 18, 3, + 5, 16, 8, 21, 24, 4, + 15, 23, 19, 13, 12, 2, + 20, 14, 22, 9, 6, 1}; +static const uint64_t RC[24] = \ + {1ULL, 0x8082ULL, 0x800000000000808aULL, 0x8000000080008000ULL, + 0x808bULL, 0x80000001ULL, 0x8000000080008081ULL, 0x8000000000008009ULL, + 0x8aULL, 0x88ULL, 0x80008009ULL, 0x8000000aULL, + 0x8000808bULL, 0x800000000000008bULL, 0x8000000000008089ULL, 0x8000000000008003ULL, + 0x8000000000008002ULL, 0x8000000000000080ULL, 0x800aULL, 0x800000008000000aULL, + 0x8000000080008081ULL, 0x8000000000008080ULL, 0x80000001ULL, 0x8000000080008008ULL}; + +/*** Helper macros to unroll the permutation. ***/ +#define rol(x, s) (((x) << s) | ((x) >> (64 - s))) +#define REPEAT6(e) e e e e e e +#define REPEAT24(e) REPEAT6(e e e e) +#define REPEAT5(e) e e e e e +#define FOR5(v, s, e) \ + v = 0; \ + REPEAT5(e; v += s;) + +/*** Keccak-f[1600] ***/ +static inline void keccakf(void* state) { + uint64_t* a = (uint64_t*)state; + uint64_t b[5] = {0}; + uint64_t t = 0; + uint8_t x, y; + + for (int i = 0; i < 24; i++) { + // Theta + FOR5(x, 1, + b[x] = 0; + FOR5(y, 5, + b[x] ^= a[x + y]; )) + FOR5(x, 1, + FOR5(y, 5, + a[y + x] ^= b[(x + 4) % 5] ^ rol(b[(x + 1) % 5], 1); )) + // Rho and pi + t = a[1]; + x = 0; + REPEAT24(b[0] = a[pi[x]]; + a[pi[x]] = rol(t, rho[x]); + t = b[0]; + x++; ) + // Chi + FOR5(y, + 5, + FOR5(x, 1, + b[x] = a[y + x];) + FOR5(x, 1, + a[y + x] = b[x] ^ ((~b[(x + 1) % 5]) & b[(x + 2) % 5]); )) + // Iota + a[0] ^= RC[i]; + } +} + +/******** The FIPS202-defined functions. ********/ + +/*** Some helper macros. ***/ + +#define _(S) do { S } while (0) +#define FOR(i, ST, L, S) \ + _(for (size_t i = 0; i < L; i += ST) { S; }) +#define mkapply_ds(NAME, S) \ + static inline void NAME(uint8_t* dst, \ + const uint8_t* src, \ + size_t len) { \ + FOR(i, 1, len, S); \ + } +#define mkapply_sd(NAME, S) \ + static inline void NAME(const uint8_t* src, \ + uint8_t* dst, \ + size_t len) { \ + FOR(i, 1, len, S); \ + } + +mkapply_ds(xorin, dst[i] ^= src[i]) // xorin +mkapply_sd(setout, dst[i] = src[i]) // setout + +#define P keccakf +#define Plen 200 + +// Fold P*F over the full blocks of an input. +#define foldP(I, L, F) \ + while (L >= rate) { \ + F(a, I, rate); \ + P(a); \ + I += rate; \ + L -= rate; \ + } + +/** The sponge-based hash construction. **/ +static inline int hash(uint8_t* out, size_t outlen, + const uint8_t* in, size_t inlen, + size_t rate, uint8_t delim) { + if ((out == NULL) || ((in == NULL) && inlen != 0) || (rate >= Plen)) { + return -1; + } + uint8_t a[Plen] = {0}; + // Absorb input. + foldP(in, inlen, xorin); + // Xor in the DS and pad frame. + a[inlen] ^= delim; + a[rate - 1] ^= 0x80; + // Xor in the last block. + xorin(a, in, inlen); + // Apply P + P(a); + // Squeeze output. + foldP(out, outlen, setout); + setout(a, out, outlen); + memset(a, 0, 200); + return 0; +} + +#define defsha3(bits) \ + int sha3_##bits(uint8_t* out, size_t outlen, \ + const uint8_t* in, size_t inlen) { \ + if (outlen > (bits/8)) { \ + return -1; \ + } \ + return hash(out, outlen, in, inlen, 200 - (bits / 4), 0x01); \ + } + +/*** FIPS202 SHA3 FOFs ***/ +defsha3(256) +defsha3(512) \ No newline at end of file diff --git a/sha3.h b/sha3.h new file mode 100644 index 000000000..36a0a5301 --- /dev/null +++ b/sha3.h @@ -0,0 +1,27 @@ +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +#include "compiler.h" +#include +#include + +#define decsha3(bits) \ + int sha3_##bits(uint8_t*, size_t, const uint8_t*, size_t); + +decsha3(256) +decsha3(512) + +static inline void SHA3_256(uint8_t * const ret, uint8_t const *data, const size_t size) { + sha3_256(ret, 32, data, size); +} + +static inline void SHA3_512(uint8_t * const ret, uint8_t const *data, const size_t size) { + sha3_512(ret, 64, data, size); +} + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/sha3_cryptopp.cpp b/sha3_cryptopp.cpp new file mode 100644 index 000000000..9454ce04a --- /dev/null +++ b/sha3_cryptopp.cpp @@ -0,0 +1,34 @@ +/* + This file is part of cpp-ethereum. + + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ + +/** @file sha3.cpp +* @author Tim Hughes +* @date 2015 +*/ + +#include +#include + +extern "C" { +void SHA3_256(uint8_t *const ret, const uint8_t *data, size_t size) { + CryptoPP::SHA3_256().CalculateDigest(ret, data, size); +} + +void SHA3_512(uint8_t *const ret, const uint8_t *data, size_t size) { + CryptoPP::SHA3_512().CalculateDigest(ret, data, size); +} +} \ No newline at end of file diff --git a/sha3_cryptopp.h b/sha3_cryptopp.h new file mode 100644 index 000000000..f910960e1 --- /dev/null +++ b/sha3_cryptopp.h @@ -0,0 +1,15 @@ +#pragma once + +#include "compiler.h" +#include + +#ifdef __cplusplus +extern "C" { +#endif + +void SHA3_256(uint8_t *const ret, const uint8_t *data, size_t size); +void SHA3_512(uint8_t *const ret, const uint8_t *data, size_t size); + +#ifdef __cplusplus +} +#endif \ No newline at end of file diff --git a/util.c b/util.c new file mode 100644 index 000000000..fbf268b7d --- /dev/null +++ b/util.c @@ -0,0 +1,41 @@ +/* + This file is part of cpp-ethereum. + + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file util.c + * @author Tim Hughes + * @date 2015 + */ +#include +#include +#include "util.h" + +#ifdef _MSC_VER + +// foward declare without all of Windows.h +__declspec(dllimport) void __stdcall OutputDebugStringA(const char* lpOutputString); + +void debugf(const char *str, ...) +{ + va_list args; + va_start(args, str); + + char buf[1<<16]; + _vsnprintf_s(buf, sizeof(buf), sizeof(buf), str, args); + buf[sizeof(buf)-1] = '\0'; + OutputDebugStringA(buf); +} + +#endif diff --git a/util.h b/util.h new file mode 100644 index 000000000..2f59076f6 --- /dev/null +++ b/util.h @@ -0,0 +1,47 @@ +/* + This file is part of cpp-ethereum. + + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file util.h + * @author Tim Hughes + * @date 2015 + */ +#pragma once +#include +#include "compiler.h" + +#ifdef __cplusplus +extern "C" { +#endif + +#ifdef _MSC_VER +void debugf(const char *str, ...); +#else +#define debugf printf +#endif + +static inline uint32_t min_u32(uint32_t a, uint32_t b) +{ + return a < b ? a : b; +} + +static inline uint32_t clamp_u32(uint32_t x, uint32_t min_, uint32_t max_) +{ + return x < min_ ? min_ : (x > max_ ? max_ : x); +} + +#ifdef __cplusplus +} +#endif From 534fcfd4648c1e9cd02ce0348fb8a95482ee9354 Mon Sep 17 00:00:00 2001 From: Matthew Wampler-Doty Date: Fri, 6 Mar 2015 05:52:30 -0500 Subject: [PATCH 002/461] Updating data sizes for Rev 20 --- data_sizes.h | 908 ++++++++++++++++++++++++++++++++++++++++----------- ethash.h | 6 +- 2 files changed, 724 insertions(+), 190 deletions(-) diff --git a/data_sizes.h b/data_sizes.h index ccdf554a8..a10d4c42c 100644 --- a/data_sizes.h +++ b/data_sizes.h @@ -33,213 +33,745 @@ extern "C" { #include -// 500 Epochs worth of tabulated DAG sizes (~3.5 Years) +// 2048 Epochs worth of tabulated DAG sizes // Generated with the following Mathematica Code: + // GetDataSizes[n_] := Module[{ -// DAGSizeBytesInit = 2^30, +// DataSetSizeBytesInit = 2^30, // MixBytes = 128, -// DAGGrowth = 113000000, +// DataSetGrowth = 2^23, // j = 0}, // Reap[ // While[j < n, // Module[{i = -// Floor[(DAGSizeBytesInit + DAGGrowth * j) / MixBytes]}, +// Floor[(DataSetSizeBytesInit + DataSetGrowth * j) / MixBytes]}, // While[! PrimeQ[i], i--]; // Sow[i*MixBytes]; j++]]]][[2]][[1]] static const size_t dag_sizes[] = { - 1073739904U, 1186739584U, 1299741568U, 1412741248U, 1525741696U, - 1638736768U, 1751741312U, 1864740736U, 1977740672U, 2090740864U, - 2203740544U, 2316741248U, 2429739392U, 2542740352U, 2655741824U, - 2768739712U, 2881740416U, 2994741632U, 3107740544U, 3220741504U, - 3333738112U, 3446741632U, 3559741312U, 3672740224U, 3785740928U, - 3898738304U, 4011741824U, 4124739712U, 4237735808U, 4350740864U, - 4463741824U, 4576741504U, 4689741184U, 4802739328U, 4915741568U, - 5028740224U, 5141740672U, 5254738304U, 5367741824U, 5480737664U, - 5593738112U, 5706741632U, 5819740544U, 5932734592U, 6045739904U, - 6158740096U, 6271740032U, 6384731776U, 6497732992U, 6610740352U, - 6723741056U, 6836741504U, 6949740416U, 7062740096U, 7175741824U, - 7288740224U, 7401741184U, 7514741632U, 7627741568U, 7740739712U, - 7853739136U, 7966740352U, 8079741568U, 8192739712U, 8305738624U, - 8418740864U, 8531740288U, 8644740736U, 8757735808U, 8870738816U, - 8983739264U, 9096740992U, 9209740928U, 9322739584U, 9435741824U, - 9548741504U, 9661739392U, 9774738304U, 9887741312U, 10000738688U, - 10113739136U, 10226741632U, 10339739776U, 10452741248U, 10565740928U, - 10678736512U, 10791734656U, 10904741248U, 11017738112U, 11130741632U, - 11243741312U, 11356739456U, 11469740416U, 11582734976U, 11695739008U, - 11808741248U, 11921734784U, 12034739072U, 12147741568U, 12260737408U, - 12373741696U, 12486738304U, 12599740544U, 12712740224U, 12825741184U, - 12938736256U, 13051741312U, 13164737408U, 13277738368U, 13390738048U, - 13503741824U, 13616741504U, 13729737088U, 13842740096U, 13955741312U, - 14068741504U, 14181740416U, 14294741632U, 14407739776U, 14520740224U, - 14633740928U, 14746736512U, 14859741824U, 14972740736U, 15085740928U, - 15198738304U, 15311732096U, 15424740736U, 15537739904U, 15650741632U, - 15763741568U, 15876737152U, 15989741696U, 16102740608U, 16215741056U, - 16328741248U, 16441740416U, 16554737792U, 16667740288U, 16780740992U, - 16893738112U, 17006741632U, 17119739008U, 17232735616U, 17345739392U, - 17458740352U, 17571736192U, 17684739712U, 17797739392U, 17910740096U, - 18023741312U, 18136740736U, 18249738112U, 18362738816U, 18475735424U, - 18588740224U, 18701738368U, 18814736768U, 18927737216U, 19040739968U, - 19153739648U, 19266736768U, 19379737984U, 19492739456U, 19605738368U, - 19718740352U, 19831741312U, 19944736384U, 20057741696U, 20170741376U, - 20283741824U, 20396737408U, 20509741696U, 20622741376U, 20735739008U, - 20848741504U, 20961740672U, 21074739328U, 21187740032U, 21300739456U, - 21413741696U, 21526740608U, 21639741824U, 21752737408U, 21865741696U, - 21978741376U, 22091741824U, 22204738432U, 22317740672U, 22430740096U, - 22543736704U, 22656741248U, 22769739904U, 22882739584U, 22995740288U, - 23108740736U, 23221740928U, 23334741376U, 23447737216U, 23560740992U, - 23673741184U, 23786740864U, 23899737728U, 24012741248U, 24125734784U, - 24238736512U, 24351741824U, 24464740736U, 24577737088U, 24690741632U, - 24803739776U, 24916740736U, 25029740416U, 25142740864U, 25255741568U, - 25368741248U, 25481740672U, 25594741376U, 25707741568U, 25820741504U, - 25933730432U, 26046739072U, 26159741824U, 26272741504U, 26385740672U, - 26498740096U, 26611741568U, 26724740992U, 26837739904U, 26950735232U, - 27063738496U, 27176741248U, 27289741184U, 27402740864U, 27515740544U, - 27628737152U, 27741740672U, 27854741632U, 27967740544U, 28080739712U, - 28193738368U, 28306741376U, 28419737728U, 28532739968U, 28645739648U, - 28758740096U, 28871741312U, 28984739456U, 29097740416U, 29210740864U, - 29323741312U, 29436740224U, 29549741696U, 29662738304U, 29775741568U, - 29888741504U, 30001740928U, 30114737024U, 30227735168U, 30340737664U, - 30453738368U, 30566737024U, 30679733632U, 30792740224U, 30905740928U, - 31018740352U, 31131740032U, 31244738944U, 31357737344U, 31470741376U, - 31583740544U, 31696740224U, 31809738112U, 31922739328U, 32035737472U, - 32148740992U, 32261741696U, 32374740352U, 32487741824U, 32600740736U, - 32713739648U, 32826740608U, 32939729792U, 33052740992U, 33165740672U, - 33278739584U, 33391741312U, 33504739712U, 33617740928U, 33730740608U, - 33843738496U, 33956739968U, 34069741696U, 34182739328U, 34295741824U, - 34408739968U, 34521740672U, 34634736512U, 34747741568U, 34860741248U, - 34973739392U, 35086738304U, 35199741056U, 35312736896U, 35425741184U, - 35538741376U, 35651740288U, 35764737152U, 35877741184U, 35990739584U, - 36103740544U, 36216740992U, 36329739392U, 36442737536U, 36555741568U, - 36668740736U, 36781741184U, 36894737024U, 37007741312U, 37120739456U, - 37233741184U, 37346736256U, 37459736192U, 37572734336U, 37685739904U, - 37798740352U, 37911737728U, 38024741504U, 38137739648U, 38250740608U, - 38363741824U, 38476740992U, 38589741184U, 38702740096U, 38815741312U, - 38928741248U, 39041738368U, 39154739584U, 39267741824U, 39380739712U, - 39493735808U, 39606741632U, 39719741312U, 39832741504U, 39945739648U, - 40058740352U, 40171740032U, 40284740992U, 40397740672U, 40510740352U, - 40623740288U, 40736738176U, 40849737856U, 40962741376U, 41075739776U, - 41188737664U, 41301735808U, 41414738048U, 41527741312U, 41640740992U, - 41753739904U, 41866739072U, 41979738496U, 42092740736U, 42205739648U, - 42318740608U, 42431741312U, 42544738688U, 42657741184U, 42770738048U, - 42883741568U, 42996741248U, 43109740928U, 43222736512U, 43335741056U, - 43448730496U, 43561740416U, 43674741632U, 43787740544U, 43900741504U, - 44013739648U, 44126740864U, 44239740544U, 44352741248U, 44465738368U, - 44578735232U, 44691739264U, 44804741504U, 44917741696U, 45030741376U, - 45143741824U, 45256740992U, 45369739136U, 45482740096U, 45595739776U, - 45708739712U, 45821740672U, 45934741376U, 46047741056U, 46160741248U, - 46273737088U, 46386740864U, 46499739008U, 46612739968U, 46725735296U, - 46838740864U, 46951741568U, 47064737152U, 47177741696U, 47290741376U, - 47403738752U, 47516741248U, 47629739648U, 47742741632U, 47855737984U, - 47968740224U, 48081738368U, 48194741632U, 48307739264U, 48420739712U, - 48533739136U, 48646738304U, 48759741824U, 48872741504U, 48985739392U, - 49098741376U, 49211741056U, 49324740992U, 49437738368U, 49550740864U, - 49663735424U, 49776737408U, 49889740672U, 50002738816U, 50115738752U, - 50228739712U, 50341741696U, 50454736768U, 50567738752U, 50680739968U, - 50793736832U, 50906734976U, 51019741568U, 51132739456U, 51245741696U, - 51358741376U, 51471741056U, 51584738944U, 51697734272U, 51810739072U, - 51923736448U, 52036740736U, 52149741184U, 52262737024U, 52375738496U, - 52488740992U, 52601739136U, 52714740352U, 52827736448U, 52940738176U, - 53053741696U, 53166740864U, 53279741824U, 53392741504U, 53505739136U, - 53618739584U, 53731741312U, 53844741248U, 53957741696U, 54070741376U, - 54183740288U, 54296741504U, 54409741696U, 54522739072U, 54635737472U, - 54748741504U, 54861736064U, 54974740096U, 55087741568U, 55200733568U, - 55313741696U, 55426734464U, 55539741056U, 55652741504U, 55765741184U, - 55878741376U, 55991730304U, 56104740992U, 56217740672U, 56330731648U, - 56443737472U, 56556724352U, 56669740672U, 56782739072U, 56895740032U, - 57008741248U, 57121741696U, 57234740096U, 57347741312U, 57460741504U + 1073739904U, 1082130304U, 1090514816U, 1098906752U, 1107293056U, + 1115684224U, 1124070016U, 1132461952U, 1140849536U, 1149232768U, + 1157627776U, 1166013824U, 1174404736U, 1182786944U, 1191180416U, + 1199568512U, 1207958912U, 1216345216U, 1224732032U, 1233124736U, + 1241513344U, 1249902464U, 1258290304U, 1266673792U, 1275067264U, + 1283453312U, 1291844992U, 1300234112U, 1308619904U, 1317010048U, + 1325397376U, 1333787776U, 1342176128U, 1350561664U, 1358954368U, + 1367339392U, 1375731584U, 1384118144U, 1392507008U, 1400897408U, + 1409284736U, 1417673344U, 1426062464U, 1434451072U, 1442839168U, + 1451229056U, 1459615616U, 1468006016U, 1476394112U, 1484782976U, + 1493171584U, 1501559168U, 1509948032U, 1518337664U, 1526726528U, + 1535114624U, 1543503488U, 1551892096U, 1560278656U, 1568669056U, + 1577056384U, 1585446272U, 1593831296U, 1602219392U, 1610610304U, + 1619000192U, 1627386752U, 1635773824U, 1644164224U, 1652555648U, + 1660943488U, 1669332608U, 1677721216U, 1686109312U, 1694497664U, + 1702886272U, 1711274624U, 1719661184U, 1728047744U, 1736434816U, + 1744829056U, 1753218944U, 1761606272U, 1769995904U, 1778382464U, + 1786772864U, 1795157888U, 1803550592U, 1811937664U, 1820327552U, + 1828711552U, 1837102976U, 1845488768U, 1853879936U, 1862269312U, + 1870656896U, 1879048064U, 1887431552U, 1895825024U, 1904212096U, + 1912601216U, 1920988544U, 1929379456U, 1937765504U, 1946156672U, + 1954543232U, 1962932096U, 1971321728U, 1979707264U, 1988093056U, + 1996487552U, 2004874624U, 2013262208U, 2021653888U, 2030039936U, + 2038430848U, 2046819968U, 2055208576U, 2063596672U, 2071981952U, + 2080373632U, 2088762752U, 2097149056U, 2105539712U, 2113928576U, + 2122315136U, 2130700672U, 2139092608U, 2147483264U, 2155872128U, + 2164257664U, 2172642176U, 2181035392U, 2189426048U, 2197814912U, + 2206203008U, 2214587264U, 2222979712U, 2231367808U, 2239758208U, + 2248145024U, 2256527744U, 2264922752U, 2273312128U, 2281701248U, + 2290086272U, 2298476672U, 2306867072U, 2315251072U, 2323639168U, + 2332032128U, 2340420224U, 2348808064U, 2357196416U, 2365580416U, + 2373966976U, 2382363008U, 2390748544U, 2399139968U, 2407530368U, + 2415918976U, 2424307328U, 2432695424U, 2441084288U, 2449472384U, + 2457861248U, 2466247808U, 2474637184U, 2483026816U, 2491414144U, + 2499803776U, 2508191872U, 2516582272U, 2524970368U, 2533359232U, + 2541743488U, 2550134144U, 2558525056U, 2566913408U, 2575301504U, + 2583686528U, 2592073856U, 2600467328U, 2608856192U, 2617240448U, + 2625631616U, 2634022016U, 2642407552U, 2650796416U, 2659188352U, + 2667574912U, 2675965312U, 2684352896U, 2692738688U, 2701130624U, + 2709518464U, 2717907328U, 2726293376U, 2734685056U, 2743073152U, + 2751462016U, 2759851648U, 2768232832U, 2776625536U, 2785017728U, + 2793401984U, 2801794432U, 2810182016U, 2818571648U, 2826959488U, + 2835349376U, 2843734144U, 2852121472U, 2860514432U, 2868900992U, + 2877286784U, 2885676928U, 2894069632U, 2902451584U, 2910843008U, + 2919234688U, 2927622784U, 2936011648U, 2944400768U, 2952789376U, + 2961177728U, 2969565568U, 2977951616U, 2986338944U, 2994731392U, + 3003120256U, 3011508352U, 3019895936U, 3028287104U, 3036675968U, + 3045063808U, 3053452928U, 3061837696U, 3070228352U, 3078615424U, + 3087003776U, 3095394944U, 3103782272U, 3112173184U, 3120562048U, + 3128944768U, 3137339264U, 3145725056U, 3154109312U, 3162505088U, + 3170893184U, 3179280256U, 3187669376U, 3196056704U, 3204445568U, + 3212836736U, 3221224064U, 3229612928U, 3238002304U, 3246391168U, + 3254778496U, 3263165824U, 3271556224U, 3279944576U, 3288332416U, + 3296719232U, 3305110912U, 3313500032U, 3321887104U, 3330273152U, + 3338658944U, 3347053184U, 3355440512U, 3363827072U, 3372220288U, + 3380608384U, 3388997504U, 3397384576U, 3405774208U, 3414163072U, + 3422551936U, 3430937984U, 3439328384U, 3447714176U, 3456104576U, + 3464493952U, 3472883584U, 3481268864U, 3489655168U, 3498048896U, + 3506434432U, 3514826368U, 3523213952U, 3531603584U, 3539987072U, + 3548380288U, 3556763264U, 3565157248U, 3573545344U, 3581934464U, + 3590324096U, 3598712704U, 3607098752U, 3615488384U, 3623877248U, + 3632265856U, 3640646528U, 3649043584U, 3657430144U, 3665821568U, + 3674207872U, 3682597504U, 3690984832U, 3699367808U, 3707764352U, + 3716152448U, 3724541056U, 3732925568U, 3741318016U, 3749706368U, + 3758091136U, 3766481536U, 3774872704U, 3783260032U, 3791650432U, + 3800036224U, 3808427648U, 3816815488U, 3825204608U, 3833592704U, + 3841981568U, 3850370432U, 3858755968U, 3867147904U, 3875536256U, + 3883920512U, 3892313728U, 3900702592U, 3909087872U, 3917478784U, + 3925868416U, 3934256512U, 3942645376U, 3951032192U, 3959422336U, + 3967809152U, 3976200064U, 3984588416U, 3992974976U, 4001363584U, + 4009751168U, 4018141312U, 4026530432U, 4034911616U, 4043308928U, + 4051695488U, 4060084352U, 4068472448U, 4076862848U, 4085249408U, + 4093640576U, 4102028416U, 4110413696U, 4118805632U, 4127194496U, + 4135583104U, 4143971968U, 4152360832U, 4160746112U, 4169135744U, + 4177525888U, 4185912704U, 4194303616U, 4202691968U, 4211076736U, + 4219463552U, 4227855488U, 4236246656U, 4244633728U, 4253022848U, + 4261412224U, 4269799808U, 4278184832U, 4286578048U, 4294962304U, + 4303349632U, 4311743104U, 4320130432U, 4328521088U, 4336909184U, + 4345295488U, 4353687424U, 4362073472U, 4370458496U, 4378852736U, + 4387238528U, 4395630208U, 4404019072U, 4412407424U, 4420790656U, + 4429182848U, 4437571456U, 4445962112U, 4454344064U, 4462738048U, + 4471119232U, 4479516544U, 4487904128U, 4496289664U, 4504682368U, + 4513068416U, 4521459584U, 4529846144U, 4538232704U, 4546619776U, + 4555010176U, 4563402112U, 4571790208U, 4580174464U, 4588567936U, + 4596957056U, 4605344896U, 4613734016U, 4622119808U, 4630511488U, + 4638898816U, 4647287936U, 4655675264U, 4664065664U, 4672451968U, + 4680842624U, 4689231488U, 4697620352U, 4706007424U, 4714397056U, + 4722786176U, 4731173248U, 4739562368U, 4747951744U, 4756340608U, + 4764727936U, 4773114496U, 4781504384U, 4789894784U, 4798283648U, + 4806667648U, 4815059584U, 4823449472U, 4831835776U, 4840226176U, + 4848612224U, 4857003392U, 4865391488U, 4873780096U, 4882169728U, + 4890557312U, 4898946944U, 4907333248U, 4915722368U, 4924110976U, + 4932499328U, 4940889728U, 4949276032U, 4957666432U, 4966054784U, + 4974438016U, 4982831488U, 4991221376U, 4999607168U, 5007998848U, + 5016386432U, 5024763776U, 5033164672U, 5041544576U, 5049941888U, + 5058329728U, 5066717056U, 5075107456U, 5083494272U, 5091883904U, + 5100273536U, 5108662144U, 5117048192U, 5125436032U, 5133827456U, + 5142215296U, 5150605184U, 5158993024U, 5167382144U, 5175769472U, + 5184157568U, 5192543872U, 5200936064U, 5209324928U, 5217711232U, + 5226102656U, 5234490496U, 5242877312U, 5251263872U, 5259654016U, + 5268040832U, 5276434304U, 5284819328U, 5293209728U, 5301598592U, + 5309986688U, 5318374784U, 5326764416U, 5335151488U, 5343542144U, + 5351929472U, 5360319872U, 5368706944U, 5377096576U, 5385484928U, + 5393871232U, 5402263424U, 5410650496U, 5419040384U, 5427426944U, + 5435816576U, 5444205952U, 5452594816U, 5460981376U, 5469367936U, + 5477760896U, 5486148736U, 5494536832U, 5502925952U, 5511315328U, + 5519703424U, 5528089984U, 5536481152U, 5544869504U, 5553256064U, + 5561645696U, 5570032768U, 5578423936U, 5586811264U, 5595193216U, + 5603585408U, 5611972736U, 5620366208U, 5628750464U, 5637143936U, + 5645528192U, 5653921408U, 5662310272U, 5670694784U, 5679082624U, + 5687474048U, 5695864448U, 5704251008U, 5712641408U, 5721030272U, + 5729416832U, 5737806208U, 5746194304U, 5754583936U, 5762969984U, + 5771358592U, 5779748224U, 5788137856U, 5796527488U, 5804911232U, + 5813300608U, 5821692544U, 5830082176U, 5838468992U, 5846855552U, + 5855247488U, 5863636096U, 5872024448U, 5880411008U, 5888799872U, + 5897186432U, 5905576832U, 5913966976U, 5922352768U, 5930744704U, + 5939132288U, 5947522432U, 5955911296U, 5964299392U, 5972688256U, + 5981074304U, 5989465472U, 5997851008U, 6006241408U, 6014627968U, + 6023015552U, 6031408256U, 6039796096U, 6048185216U, 6056574848U, + 6064963456U, 6073351808U, 6081736064U, 6090128768U, 6098517632U, + 6106906496U, 6115289216U, 6123680896U, 6132070016U, 6140459648U, + 6148849024U, 6157237376U, 6165624704U, 6174009728U, 6182403712U, + 6190792064U, 6199176064U, 6207569792U, 6215952256U, 6224345216U, + 6232732544U, 6241124224U, 6249510272U, 6257899136U, 6266287744U, + 6274676864U, 6283065728U, 6291454336U, 6299843456U, 6308232064U, + 6316620928U, 6325006208U, 6333395584U, 6341784704U, 6350174848U, + 6358562176U, 6366951296U, 6375337856U, 6383729536U, 6392119168U, + 6400504192U, 6408895616U, 6417283456U, 6425673344U, 6434059136U, + 6442444672U, 6450837376U, 6459223424U, 6467613056U, 6476004224U, + 6484393088U, 6492781952U, 6501170048U, 6509555072U, 6517947008U, + 6526336384U, 6534725504U, 6543112832U, 6551500672U, 6559888768U, + 6568278656U, 6576662912U, 6585055616U, 6593443456U, 6601834112U, + 6610219648U, 6618610304U, 6626999168U, 6635385472U, 6643777408U, + 6652164224U, 6660552832U, 6668941952U, 6677330048U, 6685719424U, + 6694107776U, 6702493568U, 6710882176U, 6719274112U, 6727662976U, + 6736052096U, 6744437632U, 6752825984U, 6761213824U, 6769604224U, + 6777993856U, 6786383488U, 6794770816U, 6803158144U, 6811549312U, + 6819937664U, 6828326528U, 6836706176U, 6845101696U, 6853491328U, + 6861880448U, 6870269312U, 6878655104U, 6887046272U, 6895433344U, + 6903822208U, 6912212864U, 6920596864U, 6928988288U, 6937377152U, + 6945764992U, 6954149248U, 6962544256U, 6970928768U, 6979317376U, + 6987709312U, 6996093824U, 7004487296U, 7012875392U, 7021258624U, + 7029652352U, 7038038912U, 7046427776U, 7054818944U, 7063207808U, + 7071595136U, 7079980928U, 7088372608U, 7096759424U, 7105149824U, + 7113536896U, 7121928064U, 7130315392U, 7138699648U, 7147092352U, + 7155479168U, 7163865728U, 7172249984U, 7180648064U, 7189036672U, + 7197424768U, 7205810816U, 7214196608U, 7222589824U, 7230975104U, + 7239367552U, 7247755904U, 7256145536U, 7264533376U, 7272921472U, + 7281308032U, 7289694848U, 7298088832U, 7306471808U, 7314864512U, + 7323253888U, 7331643008U, 7340029568U, 7348419712U, 7356808832U, + 7365196672U, 7373585792U, 7381973888U, 7390362752U, 7398750592U, + 7407138944U, 7415528576U, 7423915648U, 7432302208U, 7440690304U, + 7449080192U, 7457472128U, 7465860992U, 7474249088U, 7482635648U, + 7491023744U, 7499412608U, 7507803008U, 7516192384U, 7524579968U, + 7532967296U, 7541358464U, 7549745792U, 7558134656U, 7566524032U, + 7574912896U, 7583300992U, 7591690112U, 7600075136U, 7608466816U, + 7616854912U, 7625244544U, 7633629824U, 7642020992U, 7650410368U, + 7658794112U, 7667187328U, 7675574912U, 7683961984U, 7692349568U, + 7700739712U, 7709130368U, 7717519232U, 7725905536U, 7734295424U, + 7742683264U, 7751069056U, 7759457408U, 7767849088U, 7776238208U, + 7784626816U, 7793014912U, 7801405312U, 7809792128U, 7818179968U, + 7826571136U, 7834957184U, 7843347328U, 7851732352U, 7860124544U, + 7868512384U, 7876902016U, 7885287808U, 7893679744U, 7902067072U, + 7910455936U, 7918844288U, 7927230848U, 7935622784U, 7944009344U, + 7952400256U, 7960786048U, 7969176704U, 7977565312U, 7985953408U, + 7994339968U, 8002730368U, 8011119488U, 8019508096U, 8027896192U, + 8036285056U, 8044674688U, 8053062272U, 8061448832U, 8069838464U, + 8078227328U, 8086616704U, 8095006592U, 8103393664U, 8111783552U, + 8120171392U, 8128560256U, 8136949376U, 8145336704U, 8153726848U, + 8162114944U, 8170503296U, 8178891904U, 8187280768U, 8195669632U, + 8204058496U, 8212444544U, 8220834176U, 8229222272U, 8237612672U, + 8246000768U, 8254389376U, 8262775168U, 8271167104U, 8279553664U, + 8287944064U, 8296333184U, 8304715136U, 8313108352U, 8321497984U, + 8329885568U, 8338274432U, 8346663296U, 8355052928U, 8363441536U, + 8371828352U, 8380217984U, 8388606592U, 8396996224U, 8405384576U, + 8413772672U, 8422161536U, 8430549376U, 8438939008U, 8447326592U, + 8455715456U, 8464104832U, 8472492928U, 8480882048U, 8489270656U, + 8497659776U, 8506045312U, 8514434944U, 8522823808U, 8531208832U, + 8539602304U, 8547990656U, 8556378752U, 8564768384U, 8573154176U, + 8581542784U, 8589933952U, 8598322816U, 8606705024U, 8615099264U, + 8623487872U, 8631876992U, 8640264064U, 8648653952U, 8657040256U, + 8665430656U, 8673820544U, 8682209152U, 8690592128U, 8698977152U, + 8707374464U, 8715763328U, 8724151424U, 8732540032U, 8740928384U, + 8749315712U, 8757704576U, 8766089344U, 8774480768U, 8782871936U, + 8791260032U, 8799645824U, 8808034432U, 8816426368U, 8824812928U, + 8833199488U, 8841591424U, 8849976448U, 8858366336U, 8866757248U, + 8875147136U, 8883532928U, 8891923328U, 8900306816U, 8908700288U, + 8917088384U, 8925478784U, 8933867392U, 8942250368U, 8950644608U, + 8959032704U, 8967420544U, 8975809664U, 8984197504U, 8992584064U, + 9000976256U, 9009362048U, 9017752448U, 9026141312U, 9034530688U, + 9042917504U, 9051307904U, 9059694208U, 9068084864U, 9076471424U, + 9084861824U, 9093250688U, 9101638528U, 9110027648U, 9118416512U, + 9126803584U, 9135188096U, 9143581312U, 9151969664U, 9160356224U, + 9168747136U, 9177134464U, 9185525632U, 9193910144U, 9202302848U, + 9210690688U, 9219079552U, 9227465344U, 9235854464U, 9244244864U, + 9252633472U, 9261021824U, 9269411456U, 9277799296U, 9286188928U, + 9294574208U, 9302965888U, 9311351936U, 9319740032U, 9328131968U, + 9336516736U, 9344907392U, 9353296768U, 9361685888U, 9370074752U, + 9378463616U, 9386849408U, 9395239808U, 9403629184U, 9412016512U, + 9420405376U, 9428795008U, 9437181568U, 9445570688U, 9453960832U, + 9462346624U, 9470738048U, 9479121536U, 9487515008U, 9495903616U, + 9504289664U, 9512678528U, 9521067904U, 9529456256U, 9537843584U, + 9546233728U, 9554621312U, 9563011456U, 9571398784U, 9579788672U, + 9588178304U, 9596567168U, 9604954496U, 9613343104U, 9621732992U, + 9630121856U, 9638508416U, 9646898816U, 9655283584U, 9663675776U, + 9672061312U, 9680449664U, 9688840064U, 9697230464U, 9705617536U, + 9714003584U, 9722393984U, 9730772608U, 9739172224U, 9747561088U, + 9755945344U, 9764338816U, 9772726144U, 9781116544U, 9789503872U, + 9797892992U, 9806282624U, 9814670464U, 9823056512U, 9831439232U, + 9839833984U, 9848224384U, 9856613504U, 9865000576U, 9873391232U, + 9881772416U, 9890162816U, 9898556288U, 9906940544U, 9915333248U, + 9923721088U, 9932108672U, 9940496512U, 9948888448U, 9957276544U, + 9965666176U, 9974048384U, 9982441088U, 9990830464U, 9999219584U, + 10007602816U, 10015996544U, 10024385152U, 10032774016U, 10041163648U, + 10049548928U, 10057940096U, 10066329472U, 10074717824U, 10083105152U, + 10091495296U, 10099878784U, 10108272256U, 10116660608U, 10125049216U, + 10133437312U, 10141825664U, 10150213504U, 10158601088U, 10166991232U, + 10175378816U, 10183766144U, 10192157312U, 10200545408U, 10208935552U, + 10217322112U, 10225712768U, 10234099328U, 10242489472U, 10250876032U, + 10259264896U, 10267656064U, 10276042624U, 10284429184U, 10292820352U, + 10301209472U, 10309598848U, 10317987712U, 10326375296U, 10334763392U, + 10343153536U, 10351541632U, 10359930752U, 10368318592U, 10376707456U, + 10385096576U, 10393484672U, 10401867136U, 10410262144U, 10418647424U, + 10427039104U, 10435425664U, 10443810176U, 10452203648U, 10460589952U, + 10468982144U, 10477369472U, 10485759104U, 10494147712U, 10502533504U, + 10510923392U, 10519313536U, 10527702656U, 10536091264U, 10544478592U, + 10552867712U, 10561255808U, 10569642368U, 10578032768U, 10586423168U, + 10594805632U, 10603200128U, 10611588992U, 10619976064U, 10628361344U, + 10636754048U, 10645143424U, 10653531776U, 10661920384U, 10670307968U, + 10678696832U, 10687086464U, 10695475072U, 10703863168U, 10712246144U, + 10720639616U, 10729026688U, 10737414784U, 10745806208U, 10754190976U, + 10762581376U, 10770971264U, 10779356288U, 10787747456U, 10796135552U, + 10804525184U, 10812915584U, 10821301888U, 10829692288U, 10838078336U, + 10846469248U, 10854858368U, 10863247232U, 10871631488U, 10880023424U, + 10888412032U, 10896799616U, 10905188992U, 10913574016U, 10921964672U, + 10930352768U, 10938742912U, 10947132544U, 10955518592U, 10963909504U, + 10972298368U, 10980687488U, 10989074816U, 10997462912U, 11005851776U, + 11014241152U, 11022627712U, 11031017344U, 11039403904U, 11047793024U, + 11056184704U, 11064570752U, 11072960896U, 11081343872U, 11089737856U, + 11098128256U, 11106514816U, 11114904448U, 11123293568U, 11131680128U, + 11140065152U, 11148458368U, 11156845696U, 11165236864U, 11173624192U, + 11182013824U, 11190402688U, 11198790784U, 11207179136U, 11215568768U, + 11223957376U, 11232345728U, 11240734592U, 11249122688U, 11257511296U, + 11265899648U, 11274285952U, 11282675584U, 11291065472U, 11299452544U, + 11307842432U, 11316231296U, 11324616832U, 11333009024U, 11341395584U, + 11349782656U, 11358172288U, 11366560384U, 11374950016U, 11383339648U, + 11391721856U, 11400117376U, 11408504192U, 11416893568U, 11425283456U, + 11433671552U, 11442061184U, 11450444672U, 11458837888U, 11467226752U, + 11475611776U, 11484003968U, 11492392064U, 11500780672U, 11509169024U, + 11517550976U, 11525944448U, 11534335616U, 11542724224U, 11551111808U, + 11559500672U, 11567890304U, 11576277376U, 11584667008U, 11593056128U, + 11601443456U, 11609830016U, 11618221952U, 11626607488U, 11634995072U, + 11643387776U, 11651775104U, 11660161664U, 11668552576U, 11676940928U, + 11685330304U, 11693718656U, 11702106496U, 11710496128U, 11718882688U, + 11727273088U, 11735660416U, 11744050048U, 11752437376U, 11760824704U, + 11769216128U, 11777604736U, 11785991296U, 11794381952U, 11802770048U, + 11811157888U, 11819548544U, 11827932544U, 11836324736U, 11844713344U, + 11853100928U, 11861486464U, 11869879936U, 11878268032U, 11886656896U, + 11895044992U, 11903433088U, 11911822976U, 11920210816U, 11928600448U, + 11936987264U, 11945375872U, 11953761152U, 11962151296U, 11970543488U, + 11978928512U, 11987320448U, 11995708288U, 12004095104U, 12012486272U, + 12020875136U, 12029255552U, 12037652096U, 12046039168U, 12054429568U, + 12062813824U, 12071206528U, 12079594624U, 12087983744U, 12096371072U, + 12104759936U, 12113147264U, 12121534592U, 12129924992U, 12138314624U, + 12146703232U, 12155091584U, 12163481216U, 12171864704U, 12180255872U, + 12188643968U, 12197034112U, 12205424512U, 12213811328U, 12222199424U, + 12230590336U, 12238977664U, 12247365248U, 12255755392U, 12264143488U, + 12272531584U, 12280920448U, 12289309568U, 12297694592U, 12306086528U, + 12314475392U, 12322865024U, 12331253632U, 12339640448U, 12348029312U, + 12356418944U, 12364805248U, 12373196672U, 12381580928U, 12389969024U, + 12398357632U, 12406750592U, 12415138432U, 12423527552U, 12431916416U, + 12440304512U, 12448692352U, 12457081216U, 12465467776U, 12473859968U, + 12482245504U, 12490636672U, 12499025536U, 12507411584U, 12515801728U, + 12524190592U, 12532577152U, 12540966272U, 12549354368U, 12557743232U, + 12566129536U, 12574523264U, 12582911872U, 12591299456U, 12599688064U, + 12608074624U, 12616463488U, 12624845696U, 12633239936U, 12641631616U, + 12650019968U, 12658407296U, 12666795136U, 12675183232U, 12683574656U, + 12691960192U, 12700350592U, 12708740224U, 12717128576U, 12725515904U, + 12733906816U, 12742295168U, 12750680192U, 12759071872U, 12767460736U, + 12775848832U, 12784236928U, 12792626816U, 12801014656U, 12809404288U, + 12817789312U, 12826181504U, 12834568832U, 12842954624U, 12851345792U, + 12859732352U, 12868122496U, 12876512128U, 12884901248U, 12893289088U, + 12901672832U, 12910067584U, 12918455168U, 12926842496U, 12935232896U, + 12943620736U, 12952009856U, 12960396928U, 12968786816U, 12977176192U, + 12985563776U, 12993951104U, 13002341504U, 13010730368U, 13019115392U, + 13027506304U, 13035895168U, 13044272512U, 13052673152U, 13061062528U, + 13069446272U, 13077838976U, 13086227072U, 13094613632U, 13103000192U, + 13111393664U, 13119782528U, 13128157568U, 13136559232U, 13144945024U, + 13153329536U, 13161724288U, 13170111872U, 13178502784U, 13186884736U, + 13195279744U, 13203667072U, 13212057472U, 13220445824U, 13228832128U, + 13237221248U, 13245610624U, 13254000512U, 13262388352U, 13270777472U, + 13279166336U, 13287553408U, 13295943296U, 13304331904U, 13312719488U, + 13321108096U, 13329494656U, 13337885824U, 13346274944U, 13354663808U, + 13363051136U, 13371439232U, 13379825024U, 13388210816U, 13396605056U, + 13404995456U, 13413380224U, 13421771392U, 13430159744U, 13438546048U, + 13446937216U, 13455326848U, 13463708288U, 13472103808U, 13480492672U, + 13488875648U, 13497269888U, 13505657728U, 13514045312U, 13522435712U, + 13530824576U, 13539210112U, 13547599232U, 13555989376U, 13564379008U, + 13572766336U, 13581154432U, 13589544832U, 13597932928U, 13606320512U, + 13614710656U, 13623097472U, 13631477632U, 13639874944U, 13648264064U, + 13656652928U, 13665041792U, 13673430656U, 13681818496U, 13690207616U, + 13698595712U, 13706982272U, 13715373184U, 13723762048U, 13732150144U, + 13740536704U, 13748926592U, 13757316224U, 13765700992U, 13774090112U, + 13782477952U, 13790869376U, 13799259008U, 13807647872U, 13816036736U, + 13824425344U, 13832814208U, 13841202304U, 13849591424U, 13857978752U, + 13866368896U, 13874754688U, 13883145344U, 13891533184U, 13899919232U, + 13908311168U, 13916692096U, 13925085056U, 13933473152U, 13941866368U, + 13950253696U, 13958643584U, 13967032192U, 13975417216U, 13983807616U, + 13992197504U, 14000582272U, 14008973696U, 14017363072U, 14025752192U, + 14034137984U, 14042528384U, 14050918016U, 14059301504U, 14067691648U, + 14076083584U, 14084470144U, 14092852352U, 14101249664U, 14109635968U, + 14118024832U, 14126407552U, 14134804352U, 14143188608U, 14151577984U, + 14159968384U, 14168357248U, 14176741504U, 14185127296U, 14193521024U, + 14201911424U, 14210301824U, 14218685056U, 14227067264U, 14235467392U, + 14243855488U, 14252243072U, 14260630144U, 14269021568U, 14277409408U, + 14285799296U, 14294187904U, 14302571392U, 14310961792U, 14319353728U, + 14327738752U, 14336130944U, 14344518784U, 14352906368U, 14361296512U, + 14369685376U, 14378071424U, 14386462592U, 14394848128U, 14403230848U, + 14411627392U, 14420013952U, 14428402304U, 14436793472U, 14445181568U, + 14453569664U, 14461959808U, 14470347904U, 14478737024U, 14487122816U, + 14495511424U, 14503901824U, 14512291712U, 14520677504U, 14529064832U, + 14537456768U, 14545845632U, 14554234496U, 14562618496U, 14571011456U, + 14579398784U, 14587789184U, 14596172672U, 14604564608U, 14612953984U, + 14621341312U, 14629724288U, 14638120832U, 14646503296U, 14654897536U, + 14663284864U, 14671675264U, 14680061056U, 14688447616U, 14696835968U, + 14705228416U, 14713616768U, 14722003328U, 14730392192U, 14738784128U, + 14747172736U, 14755561088U, 14763947648U, 14772336512U, 14780725376U, + 14789110144U, 14797499776U, 14805892736U, 14814276992U, 14822670208U, + 14831056256U, 14839444352U, 14847836032U, 14856222848U, 14864612992U, + 14872997504U, 14881388672U, 14889775744U, 14898165376U, 14906553472U, + 14914944896U, 14923329664U, 14931721856U, 14940109696U, 14948497024U, + 14956887424U, 14965276544U, 14973663616U, 14982053248U, 14990439808U, + 14998830976U, 15007216768U, 15015605888U, 15023995264U, 15032385152U, + 15040768384U, 15049154944U, 15057549184U, 15065939072U, 15074328448U, + 15082715008U, 15091104128U, 15099493504U, 15107879296U, 15116269184U, + 15124659584U, 15133042304U, 15141431936U, 15149824384U, 15158214272U, + 15166602368U, 15174991232U, 15183378304U, 15191760512U, 15200154496U, + 15208542592U, 15216931712U, 15225323392U, 15233708416U, 15242098048U, + 15250489216U, 15258875264U, 15267265408U, 15275654528U, 15284043136U, + 15292431488U, 15300819584U, 15309208192U, 15317596544U, 15325986176U, + 15334374784U, 15342763648U, 15351151744U, 15359540608U, 15367929728U, + 15376318336U, 15384706432U, 15393092992U, 15401481856U, 15409869952U, + 15418258816U, 15426649984U, 15435037568U, 15443425664U, 15451815296U, + 15460203392U, 15468589184U, 15476979328U, 15485369216U, 15493755776U, + 15502146944U, 15510534272U, 15518924416U, 15527311232U, 15535699072U, + 15544089472U, 15552478336U, 15560866688U, 15569254528U, 15577642624U, + 15586031488U, 15594419072U, 15602809472U, 15611199104U, 15619586432U, + 15627975296U, 15636364928U, 15644753792U, 15653141888U, 15661529216U, + 15669918848U, 15678305152U, 15686696576U, 15695083136U, 15703474048U, + 15711861632U, 15720251264U, 15728636288U, 15737027456U, 15745417088U, + 15753804928U, 15762194048U, 15770582656U, 15778971008U, 15787358336U, + 15795747712U, 15804132224U, 15812523392U, 15820909696U, 15829300096U, + 15837691264U, 15846071936U, 15854466944U, 15862855808U, 15871244672U, + 15879634816U, 15888020608U, 15896409728U, 15904799104U, 15913185152U, + 15921577088U, 15929966464U, 15938354816U, 15946743424U, 15955129472U, + 15963519872U, 15971907968U, 15980296064U, 15988684928U, 15997073024U, + 16005460864U, 16013851264U, 16022241152U, 16030629248U, 16039012736U, + 16047406976U, 16055794816U, 16064181376U, 16072571264U, 16080957824U, + 16089346688U, 16097737856U, 16106125184U, 16114514816U, 16122904192U, + 16131292544U, 16139678848U, 16148066944U, 16156453504U, 16164839552U, + 16173236096U, 16181623424U, 16190012032U, 16198401152U, 16206790528U, + 16215177344U, 16223567744U, 16231956352U, 16240344704U, 16248731008U, + 16257117824U, 16265504384U, 16273898624U, 16282281856U, 16290668672U, + 16299064192U, 16307449216U, 16315842176U, 16324230016U, 16332613504U, + 16341006464U, 16349394304U, 16357783168U, 16366172288U, 16374561664U, + 16382951296U, 16391337856U, 16399726208U, 16408116352U, 16416505472U, + 16424892032U, 16433282176U, 16441668224U, 16450058624U, 16458448768U, + 16466836864U, 16475224448U, 16483613056U, 16492001408U, 16500391808U, + 16508779648U, 16517166976U, 16525555328U, 16533944192U, 16542330752U, + 16550719616U, 16559110528U, 16567497088U, 16575888512U, 16584274816U, + 16592665472U, 16601051008U, 16609442944U, 16617832064U, 16626218624U, + 16634607488U, 16642996096U, 16651385728U, 16659773824U, 16668163712U, + 16676552576U, 16684938112U, 16693328768U, 16701718144U, 16710095488U, + 16718492288U, 16726883968U, 16735272832U, 16743661184U, 16752049792U, + 16760436608U, 16768827008U, 16777214336U, 16785599104U, 16793992832U, + 16802381696U, 16810768768U, 16819151744U, 16827542656U, 16835934848U, + 16844323712U, 16852711552U, 16861101952U, 16869489536U, 16877876864U, + 16886265728U, 16894653056U, 16903044736U, 16911431296U, 16919821696U, + 16928207488U, 16936592768U, 16944987776U, 16953375616U, 16961763968U, + 16970152832U, 16978540928U, 16986929536U, 16995319168U, 17003704448U, + 17012096896U, 17020481152U, 17028870784U, 17037262208U, 17045649536U, + 17054039936U, 17062426496U, 17070814336U, 17079205504U, 17087592064U, + 17095978112U, 17104369024U, 17112759424U, 17121147776U, 17129536384U, + 17137926016U, 17146314368U, 17154700928U, 17163089792U, 17171480192U, + 17179864192U, 17188256896U, 17196644992U, 17205033856U, 17213423488U, + 17221811072U, 17230198912U, 17238588032U, 17246976896U, 17255360384U, + 17263754624U, 17272143232U, 17280530048U, 17288918912U, 17297309312U, + 17305696384U, 17314085504U, 17322475136U, 17330863744U, 17339252096U, + 17347640192U, 17356026496U, 17364413824U, 17372796544U, 17381190016U, + 17389583488U, 17397972608U, 17406360704U, 17414748544U, 17423135872U, + 17431527296U, 17439915904U, 17448303232U, 17456691584U, 17465081728U, + 17473468288U, 17481857408U, 17490247552U, 17498635904U, 17507022464U, + 17515409024U, 17523801728U, 17532189824U, 17540577664U, 17548966016U, + 17557353344U, 17565741184U, 17574131584U, 17582519168U, 17590907008U, + 17599296128U, 17607687808U, 17616076672U, 17624455808U, 17632852352U, + 17641238656U, 17649630848U, 17658018944U, 17666403968U, 17674794112U, + 17683178368U, 17691573376U, 17699962496U, 17708350592U, 17716739968U, + 17725126528U, 17733517184U, 17741898112U, 17750293888U, 17758673024U, + 17767070336U, 17775458432U, 17783848832U, 17792236928U, 17800625536U, + 17809012352U, 17817402752U, 17825785984U, 17834178944U, 17842563968U, + 17850955648U, 17859344512U, 17867732864U, 17876119424U, 17884511872U, + 17892900224U, 17901287296U, 17909677696U, 17918058112U, 17926451072U, + 17934843776U, 17943230848U, 17951609216U, 17960008576U, 17968397696U, + 17976784256U, 17985175424U, 17993564032U, 18001952128U, 18010339712U, + 18018728576U, 18027116672U, 18035503232U, 18043894144U, 18052283264U, + 18060672128U, 18069056384U, 18077449856U, 18085837184U, 18094225792U, + 18102613376U, 18111004544U, 18119388544U, 18127781248U, 18136170368U, + 18144558976U, 18152947328U, 18161336192U, 18169724288U, 18178108544U, + 18186498944U, 18194886784U, 18203275648U, 18211666048U, 18220048768U, + 18228444544U, 18236833408U, 18245220736U }; -// 500 Epochs worth of tabulated DAG sizes (~3.5 Years) // Generated with the following Mathematica Code: + // GetCacheSizes[n_] := Module[{ -// DAGSizeBytesInit = 2^30, -// MixBytes = 128, -// DAGGrowth = 113000000, -// HashBytes = 64, -// DAGParents = 1024, -// j = 0}, -// Reap[ -// While[j < n, -// Module[{i = Floor[(DAGSizeBytesInit + DAGGrowth * j) / (DAGParents * HashBytes)]}, -// While[! PrimeQ[i], i--]; -// Sow[i*HashBytes]; j++]]]][[2]][[1]] +// DataSetSizeBytesInit = 2^30, +// MixBytes = 128, +// DataSetGrowth = 2^23, +// HashBytes = 64, +// CacheMultiplier = 1024, +// j = 0}, +// Reap[ +// While[j < n, +// Module[{i = Floor[(DataSetSizeBytesInit + DataSetGrowth * j) / (CacheMultiplier * HashBytes)]}, +// While[! PrimeQ[i], i--]; +// Sow[i*HashBytes]; j++]]]][[2]][[1]] const size_t cache_sizes[] = { - 1048384U, 1158208U, 1268416U, 1377856U, 1489856U, 1599296U, 1710656U, - 1820608U, 1930816U, 2041024U, 2151872U, 2261696U, 2371904U, 2482624U, - 2593216U, 2703296U, 2814016U, 2924224U, 3034816U, 3144896U, 3255488U, - 3365312U, 3475904U, 3586624U, 3696064U, 3806272U, 3917504U, 4027456U, - 4138304U, 4248512U, 4359104U, 4469312U, 4579264U, 4689728U, 4797376U, - 4909888U, 5020096U, 5131328U, 5241664U, 5351744U, 5461312U, 5572544U, - 5683264U, 5793472U, 5903552U, 6014144U, 6121664U, 6235072U, 6344896U, - 6454592U, 6565952U, 6675904U, 6786112U, 6896704U, 7006784U, 7117888U, - 7228096U, 7338304U, 7448768U, 7557952U, 7669184U, 7779776U, 7889216U, - 8000192U, 8110912U, 8220736U, 8331712U, 8441536U, 8552384U, 8662592U, - 8772928U, 8883136U, 8993728U, 9103168U, 9214528U, 9323968U, 9434816U, - 9545152U, 9655616U, 9766336U, 9876544U, 9986624U, 10097344U, 10207424U, - 10316864U, 10427968U, 10538432U, 10649152U, 10758976U, 10869568U, 10979776U, - 11089472U, 11200832U, 11309632U, 11420608U, 11531584U, 11641792U, 11751104U, - 11862976U, 11973184U, 12083264U, 12193856U, 12304064U, 12414656U, 12524608U, - 12635072U, 12745792U, 12855616U, 12965824U, 13076416U, 13187008U, 13297216U, - 13407808U, 13518016U, 13627072U, 13738688U, 13848256U, 13959488U, 14069696U, - 14180288U, 14290624U, 14399552U, 14511424U, 14621504U, 14732096U, 14841664U, - 14951744U, 15062336U, 15172672U, 15283264U, 15393088U, 15504448U, 15614272U, - 15723712U, 15834944U, 15945152U, 16055744U, 16165696U, 16277056U, 16387136U, - 16494784U, 16607936U, 16718272U, 16828736U, 16938176U, 17048384U, 17159872U, - 17266624U, 17380544U, 17490496U, 17600192U, 17711296U, 17821376U, 17931968U, - 18041152U, 18152896U, 18261952U, 18373568U, 18483392U, 18594112U, 18703936U, - 18814912U, 18924992U, 19034944U, 19145408U, 19256128U, 19366208U, 19477184U, - 19587136U, 19696576U, 19808192U, 19916992U, 20028352U, 20137664U, 20249024U, - 20358848U, 20470336U, 20580544U, 20689472U, 20801344U, 20911424U, 21020096U, - 21130688U, 21242176U, 21352384U, 21462208U, 21573824U, 21683392U, 21794624U, - 21904448U, 22013632U, 22125248U, 22235968U, 22344512U, 22456768U, 22566848U, - 22677056U, 22786496U, 22897984U, 23008064U, 23118272U, 23228992U, 23338816U, - 23449408U, 23560256U, 23670464U, 23780672U, 23891264U, 24001216U, 24110656U, - 24221888U, 24332608U, 24442688U, 24552512U, 24662464U, 24773696U, 24884032U, - 24994496U, 25105216U, 25215296U, 25324864U, 25435712U, 25546432U, 25655744U, - 25767232U, 25876672U, 25986368U, 26098112U, 26207936U, 26318912U, 26428736U, - 26539712U, 26650048U, 26760256U, 26869184U, 26979776U, 27091136U, 27201728U, - 27311552U, 27422272U, 27532352U, 27642304U, 27752896U, 27863744U, 27973952U, - 28082752U, 28194752U, 28305344U, 28415168U, 28524992U, 28636352U, 28746304U, - 28857152U, 28967104U, 29077184U, 29187904U, 29298496U, 29408576U, 29518912U, - 29628992U, 29739968U, 29850176U, 29960512U, 30070336U, 30180544U, 30290752U, - 30398912U, 30512192U, 30622784U, 30732992U, 30842176U, 30953536U, 31063744U, - 31174336U, 31284544U, 31395136U, 31504448U, 31615552U, 31725632U, 31835072U, - 31946176U, 32057024U, 32167232U, 32277568U, 32387008U, 32497984U, 32608832U, - 32719168U, 32829376U, 32939584U, 33050048U, 33160768U, 33271232U, 33381184U, - 33491648U, 33601856U, 33712576U, 33822016U, 33932992U, 34042816U, 34153024U, - 34263104U, 34373824U, 34485056U, 34594624U, 34704832U, 34816064U, 34926272U, - 35036224U, 35146816U, 35255104U, 35367104U, 35478208U, 35588416U, 35698496U, - 35808832U, 35918656U, 36029888U, 36139456U, 36250688U, 36360512U, 36471104U, - 36581696U, 36691136U, 36802112U, 36912448U, 37022912U, 37132864U, 37242944U, - 37354048U, 37464512U, 37574848U, 37684928U, 37794752U, 37904704U, 38015552U, - 38125888U, 38236864U, 38345792U, 38457152U, 38567744U, 38678336U, 38787776U, - 38897216U, 39009088U, 39117632U, 39230144U, 39340352U, 39450304U, 39560384U, - 39671488U, 39781312U, 39891392U, 40002112U, 40112704U, 40223168U, 40332608U, - 40443968U, 40553792U, 40664768U, 40774208U, 40884416U, 40993984U, 41105984U, - 41215424U, 41326528U, 41436992U, 41546048U, 41655872U, 41768128U, 41878336U, - 41988928U, 42098752U, 42209344U, 42319168U, 42429248U, 42540352U, 42649792U, - 42761024U, 42871616U, 42981824U, 43092032U, 43201856U, 43312832U, 43423552U, - 43533632U, 43643584U, 43753792U, 43864384U, 43974976U, 44084032U, 44195392U, - 44306368U, 44415296U, 44526016U, 44637248U, 44746816U, 44858048U, 44967872U, - 45078848U, 45188288U, 45299264U, 45409216U, 45518272U, 45630272U, 45740224U, - 45850432U, 45960896U, 46069696U, 46182208U, 46292416U, 46402624U, 46512064U, - 46623296U, 46733888U, 46843712U, 46953664U, 47065024U, 47175104U, 47285696U, - 47395904U, 47506496U, 47615296U, 47726912U, 47837632U, 47947712U, 48055232U, - 48168128U, 48277952U, 48387392U, 48499648U, 48609472U, 48720064U, 48830272U, - 48940096U, 49050944U, 49160896U, 49271744U, 49381568U, 49492288U, 49602752U, - 49712576U, 49822016U, 49934272U, 50042816U, 50154304U, 50264128U, 50374336U, - 50484416U, 50596288U, 50706752U, 50816704U, 50927168U, 51035456U, 51146944U, - 51258176U, 51366976U, 51477824U, 51589568U, 51699776U, 51809728U, 51920576U, - 52030016U, 52140736U, 52251328U, 52361152U, 52470592U, 52582592U, 52691776U, - 52803136U, 52912576U, 53020736U, 53132224U, 53242688U, 53354816U, 53465536U, - 53575232U, 53685568U, 53796544U, 53906752U, 54016832U, 54126656U, 54236992U, - 54347456U, 54457408U, 54569024U, 54679232U, 54789184U, 54899776U, 55008832U, - 55119296U, 55231168U, 55341248U, 55451584U, 55562048U, 55672256U, 55782208U, - 55893184U, 56002112U, 56113216U + 1048384U, 1055552U, 1064512U, 1072832U, 1080896U, 1089344U, 1096768U, + 1104448U, 1113664U, 1121216U, 1130176U, 1138624U, 1146304U, 1155008U, + 1162816U, 1171264U, 1179328U, 1187392U, 1195456U, 1203392U, 1210816U, + 1220416U, 1227712U, 1236416U, 1244608U, 1253312U, 1261376U, 1268416U, + 1277632U, 1285696U, 1294016U, 1302208U, 1310656U, 1318336U, 1326784U, + 1334848U, 1342912U, 1350848U, 1359808U, 1366208U, 1376192U, 1383488U, + 1392448U, 1400384U, 1408832U, 1416512U, 1425344U, 1433408U, 1440704U, + 1449664U, 1458112U, 1466048U, 1474496U, 1482688U, 1490752U, 1498688U, + 1507136U, 1515328U, 1523264U, 1531456U, 1539904U, 1547584U, 1556288U, + 1564352U, 1572544U, 1580608U, 1588544U, 1596992U, 1605568U, 1612096U, + 1621952U, 1630144U, 1637696U, 1645888U, 1654336U, 1662784U, 1671104U, + 1679168U, 1686848U, 1695296U, 1702208U, 1711168U, 1720256U, 1727552U, + 1736128U, 1744576U, 1751488U, 1760576U, 1769408U, 1777472U, 1785664U, + 1793984U, 1801664U, 1810112U, 1818304U, 1826624U, 1834816U, 1842752U, + 1851328U, 1858112U, 1867456U, 1875904U, 1883968U, 1892288U, 1899712U, + 1908416U, 1916608U, 1924544U, 1932992U, 1940672U, 1948736U, 1956928U, + 1965632U, 1973824U, 1982144U, 1989824U, 1998784U, 2006848U, 2014784U, + 2022848U, 2031424U, 2038976U, 2047424U, 2055616U, 2064064U, 2072384U, + 2080448U, 2088512U, 2095936U, 2104768U, 2113472U, 2121664U, 2127808U, + 2137792U, 2146112U, 2153408U, 2162624U, 2170304U, 2178496U, 2186944U, + 2195392U, 2203456U, 2211136U, 2219968U, 2227648U, 2236096U, 2244416U, + 2250944U, 2260928U, 2268736U, 2276672U, 2283328U, 2293696U, 2301632U, + 2309312U, 2317888U, 2325952U, 2334656U, 2342848U, 2350144U, 2358848U, + 2366656U, 2375488U, 2383552U, 2391616U, 2400064U, 2407616U, 2415808U, + 2424256U, 2432704U, 2439616U, 2448704U, 2457152U, 2464064U, 2473792U, + 2482112U, 2489792U, 2497472U, 2506432U, 2514752U, 2522816U, 2531264U, + 2539456U, 2547136U, 2555456U, 2564032U, 2572096U, 2578496U, 2587712U, + 2595776U, 2604736U, 2613056U, 2620736U, 2629184U, 2637632U, 2645824U, + 2653888U, 2662208U, 2670016U, 2678464U, 2686912U, 2694464U, 2703296U, + 2710976U, 2719424U, 2727104U, 2736064U, 2743232U, 2752192U, 2760512U, + 2768704U, 2777024U, 2785088U, 2792512U, 2800576U, 2809024U, 2817856U, + 2826176U, 2833984U, 2840896U, 2850752U, 2858048U, 2867008U, 2875328U, + 2883392U, 2891584U, 2899648U, 2908096U, 2915648U, 2924224U, 2932672U, + 2940736U, 2948672U, 2956736U, 2964928U, 2973248U, 2981824U, 2988992U, + 2997184U, 3005248U, 3013952U, 3022144U, 3030592U, 3037376U, 3046976U, + 3055552U, 3063616U, 3070784U, 3079744U, 3087808U, 3096512U, 3103808U, + 3111872U, 3121088U, 3128896U, 3137216U, 3144896U, 3153856U, 3161152U, + 3169984U, 3178432U, 3186496U, 3194816U, 3203008U, 3210176U, 3218624U, + 3227072U, 3235264U, 3243712U, 3250496U, 3259456U, 3268544U, 3276736U, + 3283648U, 3292736U, 3301184U, 3308224U, 3317696U, 3324736U, 3333184U, + 3342272U, 3348544U, 3357248U, 3365312U, 3374912U, 3383104U, 3390784U, + 3399488U, 3407296U, 3414976U, 3424192U, 3432256U, 3440576U, 3448768U, + 3456832U, 3464896U, 3473216U, 3480128U, 3489344U, 3497408U, 3505856U, + 3514048U, 3521344U, 3530432U, 3538624U, 3546304U, 3555008U, 3563072U, + 3571648U, 3579712U, 3587392U, 3595456U, 3603904U, 3612352U, 3620416U, + 3628864U, 3636928U, 3645248U, 3652928U, 3660992U, 3669184U, 3677888U, + 3685952U, 3694528U, 3702592U, 3710528U, 3719104U, 3727168U, 3735488U, + 3742784U, 3751232U, 3759424U, 3765184U, 3775808U, 3783872U, 3792832U, + 3800768U, 3808832U, 3816256U, 3825344U, 3832768U, 3841856U, 3849536U, + 3857344U, 3866432U, 3874496U, 3882304U, 3890752U, 3899072U, 3907264U, + 3914816U, 3923008U, 3930688U, 3939904U, 3947968U, 3956416U, 3964736U, + 3972544U, 3981248U, 3988928U, 3997376U, 4005824U, 4012864U, 4020928U, + 4030144U, 4038592U, 4045504U, 4054592U, 4063168U, 4071104U, 4079552U, + 4087232U, 4095808U, 4103872U, 4111168U, 4120384U, 4127936U, 4136512U, + 4144832U, 4153024U, 4160704U, 4169408U, 4177216U, 4186048U, 4193344U, + 4202048U, 4210496U, 4217536U, 4227008U, 4235072U, 4243264U, 4251584U, + 4259392U, 4267712U, 4275776U, 4284352U, 4291904U, 4300096U, 4307648U, + 4316992U, 4325056U, 4333376U, 4341056U, 4349888U, 4357568U, 4366016U, + 4374464U, 4382528U, 4390208U, 4398656U, 4407232U, 4413632U, 4423616U, + 4431808U, 4439744U, 4447936U, 4455872U, 4463296U, 4472128U, 4480576U, + 4489024U, 4497344U, 4505152U, 4512448U, 4520896U, 4530112U, 4537664U, + 4546496U, 4554688U, 4562752U, 4570816U, 4579264U, 4586944U, 4595648U, + 4603712U, 4611392U, 4619072U, 4628032U, 4635584U, 4643776U, 4652864U, + 4660672U, 4669376U, 4677056U, 4684096U, 4693184U, 4702144U, 4710208U, + 4718528U, 4726336U, 4734272U, 4742464U, 4750784U, 4759232U, 4767296U, + 4775872U, 4783808U, 4791872U, 4797376U, 4808512U, 4816192U, 4825024U, + 4832704U, 4841024U, 4849472U, 4856512U, 4865984U, 4874176U, 4882112U, + 4889792U, 4898752U, 4906688U, 4913984U, 4922816U, 4931008U, 4938944U, + 4946624U, 4955584U, 4964032U, 4972096U, 4980032U, 4988864U, 4997056U, + 5004992U, 5012288U, 5020096U, 5029312U, 5037632U, 5045696U, 5052224U, + 5062592U, 5070784U, 5078848U, 5086784U, 5095232U, 5100736U, 5111488U, + 5119936U, 5127104U, 5136064U, 5143616U, 5151424U, 5160256U, 5168704U, + 5175232U, 5185472U, 5192384U, 5199296U, 5209664U, 5218112U, 5225536U, + 5233472U, 5242816U, 5250496U, 5258944U, 5267264U, 5274944U, 5283776U, + 5290048U, 5300032U, 5308096U, 5316544U, 5323328U, 5331904U, 5340736U, + 5349056U, 5356864U, 5365312U, 5372096U, 5381696U, 5390272U, 5398336U, + 5405888U, 5413696U, 5422784U, 5430976U, 5439424U, 5446976U, 5455808U, + 5463616U, 5471168U, 5480128U, 5488064U, 5494592U, 5504704U, 5513152U, + 5521216U, 5529536U, 5536576U, 5544256U, 5554112U, 5559616U, 5570368U, + 5577664U, 5586752U, 5594944U, 5603008U, 5611456U, 5619392U, 5627584U, + 5634368U, 5643328U, 5651264U, 5659328U, 5667008U, 5675584U, 5684416U, + 5692864U, 5701568U, 5709632U, 5717056U, 5725376U, 5734336U, 5740096U, + 5750336U, 5758912U, 5766848U, 5775296U, 5782976U, 5790784U, 5799616U, + 5807936U, 5815232U, 5823808U, 5832256U, 5840192U, 5848768U, 5856832U, + 5864896U, 5873344U, 5879872U, 5888576U, 5897792U, 5905216U, 5914432U, + 5920448U, 5930944U, 5938624U, 5947328U, 5955392U, 5963456U, 5971648U, + 5979328U, 5988032U, 5995712U, 6003904U, 6012736U, 6021056U, 6029248U, + 6037184U, 6045632U, 6053312U, 6061376U, 6070208U, 6077504U, 6086464U, + 6094784U, 6101696U, 6110912U, 6118592U, 6127168U, 6135616U, 6143296U, + 6150208U, 6158912U, 6168128U, 6175808U, 6182464U, 6192832U, 6201152U, + 6209344U, 6217664U, 6224576U, 6233408U, 6241472U, 6249664U, 6258496U, + 6266816U, 6275008U, 6281152U, 6291136U, 6299456U, 6306752U, 6314816U, + 6323776U, 6332096U, 6339392U, 6348224U, 6356288U, 6364096U, 6373184U, + 6381376U, 6389696U, 6397504U, 6404416U, 6413632U, 6421952U, 6430016U, + 6437824U, 6446912U, 6454592U, 6463168U, 6471616U, 6478144U, 6487232U, + 6496192U, 6504128U, 6511936U, 6520256U, 6528832U, 6536896U, 6544576U, + 6553408U, 6561472U, 6569792U, 6577216U, 6586304U, 6592448U, 6601024U, + 6610624U, 6619072U, 6627136U, 6634816U, 6643264U, 6650816U, 6659776U, + 6667712U, 6675904U, 6682688U, 6691904U, 6700864U, 6709184U, 6717376U, + 6724544U, 6733504U, 6741824U, 6749888U, 6756032U, 6766528U, 6773056U, + 6782912U, 6790976U, 6798016U, 6807488U, 6815168U, 6823744U, 6832064U, + 6840128U, 6847552U, 6855872U, 6864064U, 6872128U, 6880576U, 6889408U, + 6897472U, 6905792U, 6913472U, 6920896U, 6930368U, 6938432U, 6946624U, + 6953536U, 6963136U, 6971072U, 6979136U, 6986944U, 6995392U, 7003712U, + 7012288U, 7019072U, 7028416U, 7036352U, 7044416U, 7051712U, 7060672U, + 7069376U, 7077568U, 7085504U, 7092544U, 7102016U, 7110592U, 7118656U, + 7126208U, 7135168U, 7143104U, 7150912U, 7159744U, 7167808U, 7175744U, + 7184192U, 7191232U, 7200448U, 7207744U, 7216576U, 7224128U, 7233472U, + 7241536U, 7249856U, 7256512U, 7264832U, 7274048U, 7282112U, 7290176U, + 7298752U, 7306688U, 7315136U, 7322816U, 7331392U, 7339456U, 7347776U, + 7356224U, 7364288U, 7371712U, 7380928U, 7387456U, 7396544U, 7404352U, + 7413568U, 7421632U, 7429696U, 7436864U, 7446464U, 7454144U, 7461952U, + 7470784U, 7478336U, 7487296U, 7495616U, 7503424U, 7511872U, 7520192U, + 7527616U, 7536448U, 7544512U, 7551424U, 7560128U, 7568576U, 7577536U, + 7583552U, 7592512U, 7600448U, 7610048U, 7618496U, 7626176U, 7634752U, + 7642816U, 7651264U, 7659328U, 7667008U, 7675456U, 7683136U, 7691584U, + 7700416U, 7707584U, 7716416U, 7724224U, 7733056U, 7740608U, 7749184U, + 7756096U, 7765952U, 7774016U, 7781824U, 7790528U, 7798592U, 7805888U, + 7814336U, 7822784U, 7831232U, 7839296U, 7847104U, 7855552U, 7863616U, + 7872448U, 7880128U, 7888576U, 7896256U, 7905088U, 7912768U, 7920448U, + 7928768U, 7937344U, 7945792U, 7953728U, 7959488U, 7970752U, 7978816U, + 7987136U, 7994816U, 8003392U, 8011712U, 8019904U, 8027456U, 8035264U, + 8044352U, 8052544U, 8060224U, 8069056U, 8076736U, 8084672U, 8093504U, + 8101312U, 8110016U, 8117696U, 8125888U, 8134592U, 8142016U, 8149952U, + 8159168U, 8166976U, 8175296U, 8183488U, 8191808U, 8199616U, 8207296U, + 8216128U, 8224576U, 8232256U, 8241088U, 8248256U, 8257472U, 8264128U, + 8273728U, 8281792U, 8290112U, 8297152U, 8305216U, 8314816U, 8322752U, + 8330944U, 8339392U, 8347072U, 8355392U, 8363968U, 8371904U, 8379328U, + 8388544U, 8394944U, 8404544U, 8412736U, 8421184U, 8429504U, 8437696U, + 8445376U, 8452544U, 8460736U, 8470208U, 8478016U, 8486848U, 8494144U, + 8503232U, 8511296U, 8519488U, 8527424U, 8534464U, 8543936U, 8552384U, + 8558912U, 8568128U, 8575936U, 8584256U, 8593216U, 8601536U, 8608832U, + 8616896U, 8625728U, 8634176U, 8641856U, 8649664U, 8658112U, 8666176U, + 8674112U, 8682944U, 8691136U, 8699456U, 8707648U, 8716096U, 8724416U, + 8732608U, 8740672U, 8748352U, 8756032U, 8764864U, 8773568U, 8781376U, + 8789824U, 8796992U, 8806208U, 8814272U, 8822336U, 8830912U, 8838848U, + 8847296U, 8854336U, 8863552U, 8871488U, 8879296U, 8887616U, 8894528U, + 8904512U, 8911424U, 8920768U, 8928704U, 8936128U, 8944576U, 8953664U, + 8960576U, 8970176U, 8977984U, 8986304U, 8994112U, 9002432U, 9011008U, + 9018176U, 9026624U, 9035584U, 9043904U, 9052096U, 9059264U, 9068096U, + 9075904U, 9084224U, 9092288U, 9100352U, 9108928U, 9116992U, 9125824U, + 9133504U, 9141824U, 9150272U, 9157952U, 9164608U, 9174848U, 9182912U, + 9190976U, 9199552U, 9205312U, 9215936U, 9222592U, 9232192U, 9240512U, + 9248704U, 9256256U, 9264832U, 9272896U, 9281344U, 9288896U, 9297088U, + 9305536U, 9313984U, 9322304U, 9329728U, 9337792U, 9346112U, 9355072U, + 9363136U, 9371072U, 9378752U, 9387712U, 9395648U, 9404224U, 9411008U, + 9420608U, 9428416U, 9436864U, 9445312U, 9453376U, 9460928U, 9468736U, + 9477824U, 9485248U, 9493696U, 9502144U, 9509056U, 9518528U, 9527104U, + 9535424U, 9543616U, 9551296U, 9559744U, 9568192U, 9576256U, 9584576U, + 9591872U, 9600704U, 9608384U, 9615808U, 9624512U, 9633472U, 9641536U, + 9649856U, 9658048U, 9665728U, 9674432U, 9682496U, 9691072U, 9699136U, + 9707072U, 9715136U, 9722176U, 9732032U, 9740096U, 9747904U, 9756352U, + 9764288U, 9771584U, 9780544U, 9789376U, 9796928U, 9804224U, 9813952U, + 9822016U, 9829696U, 9838016U, 9845824U, 9852992U, 9863104U, 9870656U, + 9878464U, 9887552U, 9895744U, 9903808U, 9912128U, 9920192U, 9927616U, + 9936064U, 9944768U, 9952576U, 9960128U, 9969472U, 9977152U, 9985216U, + 9994048U, 10001216U, 10007744U, 10018496U, 10026944U, 10035136U, 10042432U, + 10051264U, 10059584U, 10067648U, 10075712U, 10083904U, 10091456U, 10100672U, + 10108864U, 10116928U, 10124864U, 10133056U, 10140736U, 10149824U, 10156736U, + 10165952U, 10173376U, 10182208U, 10190528U, 10198336U, 10206272U, 10213696U, + 10223296U, 10231744U, 10238656U, 10247488U, 10256192U, 10263872U, 10272448U, + 10280896U, 10288448U, 10296512U, 10305088U, 10313536U, 10321088U, 10330048U, + 10337984U, 10346176U, 10354112U, 10362304U, 10369088U, 10377152U, 10386752U, + 10394816U, 10403648U, 10411712U, 10418624U, 10427968U, 10436032U, 10444736U, + 10452928U, 10459712U, 10468672U, 10476608U, 10484416U, 10491328U, 10501952U, + 10509376U, 10517824U, 10526528U, 10534336U, 10542656U, 10549696U, 10559168U, + 10566592U, 10575808U, 10583488U, 10590656U, 10599488U, 10607936U, 10616768U, + 10624832U, 10630336U, 10640576U, 10649536U, 10655168U, 10665152U, 10674112U, + 10682176U, 10690496U, 10698176U, 10705216U, 10715072U, 10722752U, 10731328U, + 10739264U, 10746688U, 10754752U, 10761664U, 10770752U, 10779712U, 10787776U, + 10796608U, 10803392U, 10812352U, 10821056U, 10828736U, 10837952U, 10846144U, + 10853824U, 10861376U, 10869952U, 10877248U, 10887104U, 10895296U, 10903232U, + 10910912U, 10918976U, 10927936U, 10935872U, 10944448U, 10952384U, 10960832U, + 10968512U, 10977088U, 10985024U, 10992832U, 11000896U, 11009984U, 11018048U, + 11026112U, 11034304U, 11042624U, 11050432U, 11058368U, 11064512U, 11075392U, + 11083712U, 11091776U, 11099584U, 11107904U, 11115968U, 11124416U, 11131712U, + 11141056U, 11148608U, 11157184U, 11165248U, 11173312U, 11180992U, 11189056U, + 11197376U, 11206592U, 11214656U, 11222336U, 11230784U, 11238464U, 11246528U, + 11254976U, 11263552U, 11271872U, 11279552U, 11288512U, 11296576U, 11304256U, + 11312192U, 11320768U, 11329216U, 11336384U, 11345216U, 11352512U, 11362112U, + 11369408U, 11378624U, 11386688U, 11394496U, 11402816U, 11411264U, 11418688U, + 11427776U, 11435584U, 11444032U, 11452096U, 11459648U, 11467072U, 11476928U, + 11484992U, 11493184U, 11500352U, 11509312U, 11517248U, 11524928U, 11534144U, + 11542208U, 11550272U, 11556416U, 11566784U, 11574208U, 11581376U, 11589568U, + 11599552U, 11607104U, 11616064U, 11623616U, 11632576U, 11639872U, 11648704U, + 11657024U, 11664704U, 11672896U, 11681216U, 11689792U, 11697856U, 11705536U, + 11714368U, 11722688U, 11730496U, 11737408U, 11745728U, 11754304U, 11763008U, + 11770816U, 11779648U, 11788096U, 11795776U, 11804608U, 11812544U, 11820992U, + 11829184U, 11837248U, 11844928U, 11852096U, 11860928U, 11869888U, 11878336U, + 11886272U, 11894336U, 11902144U, 11910848U, 11919296U, 11925952U, 11934784U, + 11943616U, 11951552U, 11960128U, 11968192U, 11976512U, 11983168U, 11992768U, + 12000832U, 12008896U, 12016832U, 12025408U, 12033856U, 12042176U, 12049984U, + 12058048U, 12066112U, 12073792U, 12082624U, 12091328U, 12098752U, 12106816U, + 12115904U, 12124096U, 12131776U, 12140224U, 12148672U, 12156736U, 12164032U, + 12173248U, 12181184U, 12186176U, 12197824U, 12205888U, 12213952U, 12218944U, + 12230336U, 12238784U, 12246592U, 12254272U, 12262336U, 12269888U, 12279104U, + 12287936U, 12295744U, 12304064U, 12312512U, 12319936U, 12328768U, 12337088U, + 12344896U, 12352832U, 12361408U, 12368704U, 12377152U, 12384832U, 12394432U, + 12402496U, 12409024U, 12417728U, 12426688U, 12433216U, 12443584U, 12450752U, + 12459968U, 12468032U, 12475712U, 12484544U, 12492608U, 12500416U, 12508352U, + 12517184U, 12525376U, 12532288U, 12541888U, 12549568U, 12556864U, 12565568U, + 12574528U, 12582208U, 12590528U, 12598592U, 12607424U, 12615488U, 12623552U, + 12631744U, 12638656U, 12647744U, 12656576U, 12664768U, 12672832U, 12680896U, + 12688576U, 12697408U, 12704192U, 12713408U, 12721216U, 12729664U, 12738496U, + 12745792U, 12754496U, 12762688U, 12769472U, 12779456U, 12787648U, 12795712U, + 12804032U, 12812224U, 12819008U, 12828352U, 12836672U, 12844736U, 12851648U, + 12859456U, 12868672U, 12877504U, 12885568U, 12892864U, 12902336U, 12909376U, + 12918208U, 12926656U, 12934976U, 12942784U, 12951104U, 12959552U, 12967744U, + 12976064U, 12984256U, 12991936U, 12999488U, 13007936U, 13016768U, 13021504U, + 13033024U, 13041472U, 13049408U, 13057472U, 13065664U, 13072064U, 13081408U, + 13089344U, 13098688U, 13107008U, 13115072U, 13122752U, 13130944U, 13139648U, + 13147712U, 13155776U, 13162432U, 13172672U, 13180864U, 13188928U, 13196992U, + 13203392U, 13213504U, 13219264U, 13228736U, 13236928U, 13244992U, 13253056U, + 13262528U, 13269952U, 13278784U, 13285952U, 13295552U, 13303616U, 13311808U, + 13319744U, 13328192U, 13336256U, 13344704U, 13352384U, 13360576U, 13369024U, + 13377344U, 13385408U, 13393216U, 13401664U, 13410112U, 13418176U, 13426496U, + 13434688U, 13442368U, 13451072U, 13459136U, 13466944U, 13475648U, 13482944U, + 13491904U, 13500352U, 13508288U, 13516736U, 13524416U, 13532224U, 13541312U, + 13549504U, 13556288U, 13564736U, 13573184U, 13581376U, 13587008U, 13598656U, + 13605952U, 13612864U, 13622464U, 13631168U, 13639616U, 13647808U, 13655104U, + 13663424U, 13671872U, 13680064U, 13688768U, 13696576U, 13705024U, 13712576U, + 13721536U, 13729216U, 13737664U, 13746112U, 13753024U, 13759552U, 13770304U, + 13777856U, 13786688U, 13793984U, 13802176U, 13811264U, 13819328U, 13827904U, + 13835456U, 13844416U, 13851584U, 13860544U, 13868992U, 13877056U, 13884608U, + 13893184U, 13901248U, 13909696U, 13917632U, 13925056U, 13934528U, 13942336U, + 13950784U, 13959104U, 13966912U, 13975232U, 13982656U, 13991872U, 13999936U, + 14007872U, 14016064U, 14024512U, 14032064U, 14040896U, 14049088U, 14057408U, + 14065088U, 14072896U, 14081344U, 14089664U, 14097856U, 14106304U, 14114752U, + 14122688U, 14130752U, 14138816U, 14147008U, 14155072U, 14163904U, 14170432U, + 14180288U, 14187328U, 14196032U, 14204864U, 14212672U, 14220736U, 14229056U, + 14237504U, 14245568U, 14253632U, 14261824U, 14269888U, 14278592U, 14286656U, + 14293696U, 14302784U, 14309696U, 14317504U, 14326336U, 14335936U, 14343232U, + 14352064U, 14359232U, 14368064U, 14376512U, 14384576U, 14393024U, 14401472U, + 14409536U, 14416832U, 14424512U, 14433856U, 14440768U, 14449984U, 14458816U, + 14465728U, 14474816U, 14482112U, 14491328U, 14499392U, 14506816U, 14516032U, + 14524352U, 14531392U, 14540224U, 14547392U, 14556992U, 14565184U, 14573248U, + 14580928U, 14588864U, 14596928U, 14606272U, 14613824U, 14622656U, 14630464U, + 14638912U, 14646976U, 14655296U, 14661952U, 14671808U, 14679872U, 14687936U, + 14696384U, 14704576U, 14710336U, 14720192U, 14729152U, 14736448U, 14745152U, + 14752448U, 14761792U, 14769856U, 14777024U, 14785984U, 14792384U, 14802752U, + 14810816U, 14819264U, 14827328U, 14835136U, 14843072U, 14851264U, 14860096U, + 14867648U, 14876096U, 14884544U, 14892736U, 14900672U, 14907968U, 14917312U, + 14924864U, 14933824U, 14939968U, 14950336U, 14957632U, 14966464U, 14974912U, + 14982592U, 14991296U, 14999104U, 15006272U, 15015232U, 15023936U, 15031616U, + 15040448U, 15047488U, 15055552U, 15063616U, 15073216U, 15079744U, 15088064U, + 15097664U, 15105344U, 15113792U, 15122368U, 15130048U, 15137728U, 15146176U, + 15154112U, 15162688U, 15171392U, 15179456U, 15187264U, 15194176U, 15204032U, + 15212224U, 15220544U, 15227456U, 15237056U, 15245248U, 15253184U, 15261632U, + 15269824U, 15277376U, 15285824U, 15293888U, 15301568U, 15310784U, 15318848U, + 15325504U, 15335104U, 15343168U, 15350848U, 15359936U, 15367232U, 15373376U, + 15384256U, 15392576U, 15400384U, 15408832U, 15417152U, 15424832U, 15433024U, + 15441344U, 15449152U, 15457088U, 15466432U, 15474112U, 15482816U, 15488576U, + 15499072U, 15505856U, 15514816U, 15523264U, 15531584U, 15540032U, 15547328U, + 15553984U, 15564608U, 15571904U, 15579968U, 15589312U, 15597376U, 15605696U, + 15612992U, 15621824U, 15630016U, 15638464U, 15646144U, 15654592U, 15662912U, + 15671104U, 15677248U, 15686848U, 15693376U, 15701696U, 15712064U, 15720256U, + 15728576U, 15736384U, 15744704U, 15752512U, 15761344U, 15769024U, 15777728U, + 15785152U, 15793984U, 15802048U, 15809984U, 15817024U, 15825856U, 15834944U, + 15843008U, 15849664U, 15859136U, 15866432U, 15876032U, 15884096U, 15892288U, + 15900608U, 15908416U, 15916864U, 15924928U, 15930176U, 15941056U, 15949504U, + 15957824U, 15965632U, 15973952U, 15982528U, 15990592U, 15998272U, 16006976U, + 16012736U, 16023104U, 16031296U, 16039616U, 16048064U, 16055744U, 16064192U, + 16071488U, 16080832U, 16088768U, 16097216U, 16104896U, 16112704U, 16121792U, + 16129856U, 16138048U, 16146112U, 16154176U, 16162624U, 16170688U, 16177856U, + 16186816U, 16195136U, 16202176U, 16211648U, 16220096U, 16228288U, 16235584U, + 16244672U, 16252864U, 16260544U, 16269248U, 16277056U, 16285504U, 16291648U, + 16301632U, 16309312U, 16318144U, 16326208U, 16333888U, 16342336U, 16351168U, + 16359232U, 16367552U, 16375616U, 16383296U, 16391744U, 16398016U, 16407616U, + 16415936U, 16424896U, 16432448U, 16440896U, 16449088U, 16457024U, 16465472U, + 16474048U, 16481216U, 16490048U, 16498624U, 16505792U, 16513984U, 16523072U, + 16531136U, 16538944U, 16547264U, 16555328U, 16563776U, 16570816U, 16578112U, + 16587712U, 16596544U, 16604992U, 16613312U, 16620608U, 16629568U, 16637888U, + 16645696U, 16653632U, 16661696U, 16669888U, 16677568U, 16686272U, 16695232U, + 16703168U, 16710464U, 16719424U, 16726592U, 16733888U, 16744384U, 16752448U, + 16760768U, 16768448U, 16776896U, 16785344U, 16793536U, 16801216U, 16809664U, + 16818112U, 16826176U, 16833472U, 16842688U, 16850752U, 16859072U, 16866368U, + 16875328U, 16883392U, 16891712U, 16899776U, 16907456U, 16915264U, 16924352U, + 16931776U, 16940608U, 16949056U, 16957376U, 16965056U, 16973248U, 16981696U, + 16990144U, 16997056U, 17005888U, 17014208U, 17021504U, 17031104U, 17039296U, + 17046976U, 17055424U, 17062592U, 17070016U, 17079488U, 17087936U, 17096512U, + 17104576U, 17113024U, 17121088U, 17129408U, 17136832U, 17145664U, 17152832U, + 17161792U, 17170112U, 17177792U, 17186368U, 17194304U, 17202496U, 17211328U, + 17218624U, 17227712U, 17233984U, 17243584U, 17251904U, 17259712U, 17266624U, + 17276608U, 17284672U, 17292224U, 17301056U, 17309632U, 17317568U, 17326016U, + 17333824U, 17342272U, 17350208U, 17358784U, 17366848U, 17374912U, 17382592U, + 17390656U, 17399488U, 17406784U, 17413952U, 17423936U, 17432512U, 17440448U, + 17447744U, 17456704U, 17464768U, 17472064U, 17481536U, 17489344U, 17495488U, + 17505728U, 17513792U, 17522368U, 17530816U, 17538112U, 17546944U, 17555264U, + 17563072U, 17569856U, 17579456U, 17587904U, 17596352U, 17603776U, 17611712U, + 17620672U, 17628992U, 17637184U, 17645504U, 17653568U, 17661632U, 17669824U, + 17677376U, 17686208U, 17693888U, 17702336U, 17710144U, 17718208U, 17726528U, + 17734336U, 17743808U, 17751872U, 17759936U, 17766592U, 17776448U, 17784512U, + 17791936U, 17801152U, 17809216U, 17817152U }; #ifdef __cplusplus diff --git a/ethash.h b/ethash.h index ae1d17ac7..82421b868 100644 --- a/ethash.h +++ b/ethash.h @@ -14,6 +14,7 @@ You should have received a copy of the GNU General Public License along with cpp-ethereum. If not, see . */ + /** @file ethash.h * @date 2015 */ @@ -25,9 +26,10 @@ #include #include "compiler.h" -#define REVISION 19 +#define REVISION 20 #define DAGSIZE_BYTES_INIT 1073741824U // 2**30 -#define DAG_GROWTH 113000000U +#define DAG_GROWTH 8388608U // 2**23 +#define CACHE_MULTIPLIER 1024 #define EPOCH_LENGTH 30000U #define MIX_BYTES 128 #define DAG_PARENTS 256 From c33972f4a01be00b249d270fd38e4a3c54064c7d Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Sat, 7 Mar 2015 11:36:35 +0100 Subject: [PATCH 003/461] Merge branch 'master' of github.com:ethereum/ethash --- ethash.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ethash.h b/ethash.h index 82421b868..3dd75288c 100644 --- a/ethash.h +++ b/ethash.h @@ -79,9 +79,9 @@ static inline int ethash_check_difficulty( // Difficulty is big endian for (int i = 0; i < 32; i++) { if (hash[i] == difficulty[i]) continue; - return hash[i] < difficulty[i]; + return hash[i] < difficulty[i]; } - return 0; + return 1; } int ethash_quick_check_difficulty( From bbd3c14c0065ad9e933418a25e06711148b947dd Mon Sep 17 00:00:00 2001 From: Matthew Wampler-Doty Date: Mon, 9 Mar 2015 02:19:08 -0400 Subject: [PATCH 004/461] tidying up --- ethash.h | 3 ++- internal.c | 52 ++++++++++++++++++++++++++-------------------------- 2 files changed, 28 insertions(+), 27 deletions(-) diff --git a/ethash.h b/ethash.h index 82421b868..5a1a43f42 100644 --- a/ethash.h +++ b/ethash.h @@ -32,6 +32,7 @@ #define CACHE_MULTIPLIER 1024 #define EPOCH_LENGTH 30000U #define MIX_BYTES 128 +#define HASH_BYTES 64 #define DAG_PARENTS 256 #define CACHE_ROUNDS 3 #define ACCESSES 64 @@ -60,7 +61,7 @@ static inline void ethash_params_init(ethash_params *params, const uint32_t bloc } typedef struct ethash_cache { - void *mem; + void *mem; } ethash_cache; void ethash_mkcache(ethash_cache *cache, ethash_params const *params, const uint8_t seed[32]); diff --git a/internal.c b/internal.c index a2b82d375..07c4a4498 100644 --- a/internal.c +++ b/internal.c @@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License along with cpp-ethereum. If not, see . */ -/** @file dash.cpp +/** @file internal.c * @author Tim Hughes * @author Matthew Wampler-Doty * @date 2015 @@ -68,10 +68,10 @@ void static ethash_compute_cache_nodes( uint32_t const idx = nodes[i].words[0] % num_nodes; node data; data = nodes[(num_nodes - 1 + i) % num_nodes]; - for (unsigned w = 0; w != NODE_WORDS; ++w) - { - data.words[w] ^= nodes[idx].words[w]; - } + for (unsigned w = 0; w != NODE_WORDS; ++w) + { + data.words[w] ^= nodes[idx].words[w]; + } SHA3_512(nodes[i].bytes, data.bytes, sizeof(data)); } } @@ -103,9 +103,9 @@ void ethash_calculate_dag_item( node const *cache_nodes = (node const *) cache->mem; node const *init = &cache_nodes[node_index % num_parent_nodes]; - memcpy(ret, init, sizeof(node)); - ret->words[0] ^= node_index; - SHA3_512(ret->bytes, ret->bytes, sizeof(node)); + memcpy(ret, init, sizeof(node)); + ret->words[0] ^= node_index; + SHA3_512(ret->bytes, ret->bytes, sizeof(node)); #if defined(_M_X64) && ENABLE_SSE __m128i const fnv_prime = _mm_set1_epi32(FNV_PRIME); @@ -116,11 +116,11 @@ void ethash_calculate_dag_item( #endif for (unsigned i = 0; i != DAG_PARENTS; ++i) - { + { uint32_t parent_index = ((node_index ^ i)*FNV_PRIME ^ ret->words[i % NODE_WORDS]) % num_parent_nodes; node const *parent = &cache_nodes[parent_index]; - #if defined(_M_X64) && ENABLE_SSE + #if defined(_M_X64) && ENABLE_SSE { xmm0 = _mm_mullo_epi32(xmm0, fnv_prime); xmm1 = _mm_mullo_epi32(xmm1, fnv_prime); @@ -143,10 +143,10 @@ void ethash_calculate_dag_item( ret->words[w] = fnv_hash(ret->words[w], parent->words[w]); } } - #endif + #endif } - SHA3_512(ret->bytes, ret->bytes, sizeof(node)); + SHA3_512(ret->bytes, ret->bytes, sizeof(node)); } void ethash_compute_full_data( @@ -204,11 +204,11 @@ static void ethash_hash( for (unsigned i = 0; i != ACCESSES; ++i) - { + { uint32_t const index = ((s_mix->words[0] ^ i)*FNV_PRIME ^ mix->words[i % MIX_WORDS]) % num_full_pages; for (unsigned n = 0; n != MIX_NODES; ++n) - { + { const node * dag_node = &full_nodes[MIX_NODES * index + n]; if (!full_nodes) { @@ -217,7 +217,7 @@ static void ethash_hash( dag_node = &tmp_node; } - #if defined(_M_X64) && ENABLE_SSE + #if defined(_M_X64) && ENABLE_SSE { __m128i fnv_prime = _mm_set1_epi32(FNV_PRIME); __m128i xmm0 = _mm_mullo_epi32(fnv_prime, mix[n].xmm[0]); @@ -240,15 +240,15 @@ static void ethash_hash( } - // compress mix - for (unsigned w = 0; w != MIX_WORDS; w += 4) - { - uint32_t reduction = mix->words[w+0]; - reduction = reduction*FNV_PRIME ^ mix->words[w+1]; - reduction = reduction*FNV_PRIME ^ mix->words[w+2]; - reduction = reduction*FNV_PRIME ^ mix->words[w+3]; - mix->words[w/4] = reduction; - } + // compress mix + for (unsigned w = 0; w != MIX_WORDS; w += 4) + { + uint32_t reduction = mix->words[w+0]; + reduction = reduction*FNV_PRIME ^ mix->words[w+1]; + reduction = reduction*FNV_PRIME ^ mix->words[w+2]; + reduction = reduction*FNV_PRIME ^ mix->words[w+3]; + mix->words[w/4] = reduction; + } #if BYTE_ORDER != LITTLE_ENDIAN for (unsigned w = 0; w != MIX_WORDS/4; ++w) { @@ -258,7 +258,7 @@ static void ethash_hash( memcpy(ret->mix_hash, mix->bytes, 32); // final Keccak hash - SHA3_256(ret->result, s_mix->bytes, 64+32); // Keccak-256(s + compressed_mix) + SHA3_256(ret->result, s_mix->bytes, 64+32); // Keccak-256(s + compressed_mix) } void ethash_quick_hash( @@ -295,4 +295,4 @@ void ethash_full(ethash_return_value * ret, void const *full_mem, ethash_params void ethash_light(ethash_return_value * ret, ethash_cache const *cache, ethash_params const *params, const uint8_t previous_hash[32], const uint64_t nonce) { ethash_hash(ret, NULL, cache, params, previous_hash, nonce); -} +} \ No newline at end of file From 729ff686cc3485e4cf66a5e8eee46f4e501c5355 Mon Sep 17 00:00:00 2001 From: Matthew Wampler-Doty Date: Mon, 9 Mar 2015 13:05:41 -0400 Subject: [PATCH 005/461] bikeshedding --- internal.c | 6 +++--- sha3_cryptopp.cpp | 8 ++++---- util.h | 8 ++++---- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/internal.c b/internal.c index 07c4a4498..698441a3f 100644 --- a/internal.c +++ b/internal.c @@ -1,12 +1,12 @@ /* - This file is part of cpp-ethereum. + This file is part of ethash. - cpp-ethereum is free software: you can redistribute it and/or modify + ethash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - cpp-ethereum is distributed in the hope that it will be useful, + ethash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. diff --git a/sha3_cryptopp.cpp b/sha3_cryptopp.cpp index 9454ce04a..6cbbcad8f 100644 --- a/sha3_cryptopp.cpp +++ b/sha3_cryptopp.cpp @@ -1,18 +1,18 @@ /* - This file is part of cpp-ethereum. + This file is part of ethash. - cpp-ethereum is free software: you can redistribute it and/or modify + ethash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - cpp-ethereum is distributed in the hope that it will be useful, + ethash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with cpp-ethereum. If not, see . + along with ethash. If not, see . */ /** @file sha3.cpp diff --git a/util.h b/util.h index 2f59076f6..ba8957815 100644 --- a/util.h +++ b/util.h @@ -1,18 +1,18 @@ /* - This file is part of cpp-ethereum. + This file is part of ethash. - cpp-ethereum is free software: you can redistribute it and/or modify + ethash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - cpp-ethereum is distributed in the hope that it will be useful, + ethash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with cpp-ethereum. If not, see . + along with ethash. If not, see . */ /** @file util.h * @author Tim Hughes From 7835d8f54003e0cd487cb1aa10f0a4e1cea1f580 Mon Sep 17 00:00:00 2001 From: Matthew Wampler-Doty Date: Mon, 9 Mar 2015 13:08:42 -0400 Subject: [PATCH 006/461] tidying up --- CMakeLists.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 7bc147af7..38fc821c0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,7 +2,6 @@ set(LIBRARY ethash) if (CPPETHEREUM) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC") -#else () endif () set(CMAKE_BUILD_TYPE Release) From 2bb0cebe69e57125b24774565c41ffe8c0c1ece5 Mon Sep 17 00:00:00 2001 From: Matthew Wampler-Doty Date: Mon, 9 Mar 2015 14:18:17 -0400 Subject: [PATCH 007/461] Changing bounds checks --- data_sizes.h | 4 ++-- internal.c | 67 ++++++++++++++++++++++++---------------------------- 2 files changed, 33 insertions(+), 38 deletions(-) diff --git a/data_sizes.h b/data_sizes.h index a10d4c42c..18112f412 100644 --- a/data_sizes.h +++ b/data_sizes.h @@ -49,7 +49,7 @@ extern "C" { // While[! PrimeQ[i], i--]; // Sow[i*MixBytes]; j++]]]][[2]][[1]] -static const size_t dag_sizes[] = { +static const size_t dag_sizes[2048] = { 1073739904U, 1082130304U, 1090514816U, 1098906752U, 1107293056U, 1115684224U, 1124070016U, 1132461952U, 1140849536U, 1149232768U, 1157627776U, 1166013824U, 1174404736U, 1182786944U, 1191180416U, @@ -478,7 +478,7 @@ static const size_t dag_sizes[] = { // While[! PrimeQ[i], i--]; // Sow[i*HashBytes]; j++]]]][[2]][[1]] -const size_t cache_sizes[] = { +const size_t cache_sizes[2048] = { 1048384U, 1055552U, 1064512U, 1072832U, 1080896U, 1089344U, 1096768U, 1104448U, 1113664U, 1121216U, 1130176U, 1138624U, 1146304U, 1155008U, 1162816U, 1171264U, 1179328U, 1187392U, 1195456U, 1203392U, 1210816U, diff --git a/internal.c b/internal.c index 698441a3f..cba08d116 100644 --- a/internal.c +++ b/internal.c @@ -38,12 +38,12 @@ #endif // WITH_CRYPTOPP size_t ethash_get_datasize(const uint32_t block_number) { - assert(block_number / EPOCH_LENGTH < 500); + assert(block_number / EPOCH_LENGTH < 2048); return dag_sizes[block_number / EPOCH_LENGTH]; } size_t ethash_get_cachesize(const uint32_t block_number) { - assert(block_number / EPOCH_LENGTH < 500); + assert(block_number / EPOCH_LENGTH < 2048); return cache_sizes[block_number / EPOCH_LENGTH]; } @@ -55,7 +55,7 @@ void static ethash_compute_cache_nodes( ethash_params const *params, const uint8_t seed[32]) { assert((params->cache_size % sizeof(node)) == 0); - uint32_t const num_nodes = (uint32_t)(params->cache_size / sizeof(node)); + uint32_t const num_nodes = (uint32_t) (params->cache_size / sizeof(node)); SHA3_512(nodes[0].bytes, seed, 32); @@ -68,8 +68,7 @@ void static ethash_compute_cache_nodes( uint32_t const idx = nodes[i].words[0] % num_nodes; node data; data = nodes[(num_nodes - 1 + i) % num_nodes]; - for (unsigned w = 0; w != NODE_WORDS; ++w) - { + for (unsigned w = 0; w != NODE_WORDS; ++w) { data.words[w] ^= nodes[idx].words[w]; } SHA3_512(nodes[i].bytes, data.bytes, sizeof(data)); @@ -86,7 +85,7 @@ void static ethash_compute_cache_nodes( } void ethash_mkcache( - ethash_cache *cache, + ethash_cache *cache, ethash_params const *params, const uint8_t seed[32]) { node *nodes = (node *) cache->mem; @@ -99,7 +98,7 @@ void ethash_calculate_dag_item( const struct ethash_params *params, const struct ethash_cache *cache) { - uint32_t num_parent_nodes = (uint32_t)(params->cache_size / sizeof(node)); + uint32_t num_parent_nodes = (uint32_t) (params->cache_size / sizeof(node)); node const *cache_nodes = (node const *) cache->mem; node const *init = &cache_nodes[node_index % num_parent_nodes]; @@ -115,12 +114,11 @@ void ethash_calculate_dag_item( __m128i xmm3 = ret->xmm[3]; #endif - for (unsigned i = 0; i != DAG_PARENTS; ++i) - { - uint32_t parent_index = ((node_index ^ i)*FNV_PRIME ^ ret->words[i % NODE_WORDS]) % num_parent_nodes; + for (unsigned i = 0; i != DAG_PARENTS; ++i) { + uint32_t parent_index = ((node_index ^ i) * FNV_PRIME ^ ret->words[i % NODE_WORDS]) % num_parent_nodes; node const *parent = &cache_nodes[parent_index]; - #if defined(_M_X64) && ENABLE_SSE +#if defined(_M_X64) && ENABLE_SSE { xmm0 = _mm_mullo_epi32(xmm0, fnv_prime); xmm1 = _mm_mullo_epi32(xmm1, fnv_prime); @@ -143,7 +141,7 @@ void ethash_calculate_dag_item( ret->words[w] = fnv_hash(ret->words[w], parent->words[w]); } } - #endif +#endif } SHA3_512(ret->bytes, ret->bytes, sizeof(node)); @@ -164,7 +162,7 @@ void ethash_compute_full_data( } static void ethash_hash( - ethash_return_value * ret, + ethash_return_value *ret, node const *full_nodes, ethash_cache const *cache, ethash_params const *params, @@ -174,7 +172,7 @@ static void ethash_hash( assert((params->full_size % MIX_WORDS) == 0); // pack hash and nonce together into first 40 bytes of s_mix - assert(sizeof(node)*8 == 512); + assert(sizeof(node) * 8 == 512); node s_mix[MIX_NODES + 1]; memcpy(s_mix[0].bytes, header_hash, 32); @@ -193,23 +191,21 @@ static void ethash_hash( } #endif - node* const mix = s_mix + 1; + node *const mix = s_mix + 1; for (unsigned w = 0; w != MIX_WORDS; ++w) { mix->words[w] = s_mix[0].words[w % NODE_WORDS]; } unsigned const page_size = sizeof(uint32_t) * MIX_WORDS, - num_full_pages = (unsigned)(params->full_size / page_size); + num_full_pages = (unsigned) (params->full_size / page_size); - for (unsigned i = 0; i != ACCESSES; ++i) - { - uint32_t const index = ((s_mix->words[0] ^ i)*FNV_PRIME ^ mix->words[i % MIX_WORDS]) % num_full_pages; + for (unsigned i = 0; i != ACCESSES; ++i) { + uint32_t const index = ((s_mix->words[0] ^ i) * FNV_PRIME ^ mix->words[i % MIX_WORDS]) % num_full_pages; - for (unsigned n = 0; n != MIX_NODES; ++n) - { - const node * dag_node = &full_nodes[MIX_NODES * index + n]; + for (unsigned n = 0; n != MIX_NODES; ++n) { + const node *dag_node = &full_nodes[MIX_NODES * index + n]; if (!full_nodes) { node tmp_node; @@ -217,7 +213,7 @@ static void ethash_hash( dag_node = &tmp_node; } - #if defined(_M_X64) && ENABLE_SSE +#if defined(_M_X64) && ENABLE_SSE { __m128i fnv_prime = _mm_set1_epi32(FNV_PRIME); __m128i xmm0 = _mm_mullo_epi32(fnv_prime, mix[n].xmm[0]); @@ -235,19 +231,18 @@ static void ethash_hash( mix[n].words[w] = fnv_hash(mix[n].words[w], dag_node->words[w]); } } - #endif +#endif } } // compress mix - for (unsigned w = 0; w != MIX_WORDS; w += 4) - { - uint32_t reduction = mix->words[w+0]; - reduction = reduction*FNV_PRIME ^ mix->words[w+1]; - reduction = reduction*FNV_PRIME ^ mix->words[w+2]; - reduction = reduction*FNV_PRIME ^ mix->words[w+3]; - mix->words[w/4] = reduction; + for (unsigned w = 0; w != MIX_WORDS; w += 4) { + uint32_t reduction = mix->words[w + 0]; + reduction = reduction * FNV_PRIME ^ mix->words[w + 1]; + reduction = reduction * FNV_PRIME ^ mix->words[w + 2]; + reduction = reduction * FNV_PRIME ^ mix->words[w + 3]; + mix->words[w / 4] = reduction; } #if BYTE_ORDER != LITTLE_ENDIAN @@ -258,7 +253,7 @@ static void ethash_hash( memcpy(ret->mix_hash, mix->bytes, 32); // final Keccak hash - SHA3_256(ret->result, s_mix->bytes, 64+32); // Keccak-256(s + compressed_mix) + SHA3_256(ret->result, s_mix->bytes, 64 + 32); // Keccak-256(s + compressed_mix) } void ethash_quick_hash( @@ -267,7 +262,7 @@ void ethash_quick_hash( const uint64_t nonce, const uint8_t mix_hash[32]) { - uint8_t buf[64+32]; + uint8_t buf[64 + 32]; memcpy(buf, header_hash, 32); #if BYTE_ORDER != LITTLE_ENDIAN nonce = fix_endian64(nonce); @@ -275,7 +270,7 @@ void ethash_quick_hash( memcpy(&(buf[32]), &nonce, 8); SHA3_512(buf, buf, 40); memcpy(&(buf[64]), mix_hash, 32); - SHA3_256(return_hash, buf, 64+32); + SHA3_256(return_hash, buf, 64 + 32); } int ethash_quick_check_difficulty( @@ -289,10 +284,10 @@ int ethash_quick_check_difficulty( return ethash_check_difficulty(return_hash, difficulty); } -void ethash_full(ethash_return_value * ret, void const *full_mem, ethash_params const *params, const uint8_t previous_hash[32], const uint64_t nonce) { +void ethash_full(ethash_return_value *ret, void const *full_mem, ethash_params const *params, const uint8_t previous_hash[32], const uint64_t nonce) { ethash_hash(ret, (node const *) full_mem, NULL, params, previous_hash, nonce); } -void ethash_light(ethash_return_value * ret, ethash_cache const *cache, ethash_params const *params, const uint8_t previous_hash[32], const uint64_t nonce) { +void ethash_light(ethash_return_value *ret, ethash_cache const *cache, ethash_params const *params, const uint8_t previous_hash[32], const uint64_t nonce) { ethash_hash(ret, NULL, cache, params, previous_hash, nonce); } \ No newline at end of file From 32ca9b74d3d5803ef0398cebdaba1111827e590f Mon Sep 17 00:00:00 2001 From: Matthew Wampler-Doty Date: Tue, 10 Mar 2015 12:35:29 -0400 Subject: [PATCH 008/461] changing cpp-ethereum to ethash --- ethash.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ethash.h b/ethash.h index 5a1a43f42..fcdac0280 100644 --- a/ethash.h +++ b/ethash.h @@ -1,18 +1,18 @@ /* - This file is part of cpp-ethereum. + This file is part of ethash. - cpp-ethereum is free software: you can redistribute it and/or modify + ethash is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. - cpp-ethereum is distributed in the hope that it will be useful, + ethash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with cpp-ethereum. If not, see . + along with ethash. If not, see . */ /** @file ethash.h From 657f7894078b0f6a79b17a9373f2d3eee9bcf3eb Mon Sep 17 00:00:00 2001 From: Matthew Wampler-Doty Date: Tue, 10 Mar 2015 12:42:44 -0400 Subject: [PATCH 009/461] Reformating one liners --- ethash.h | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/ethash.h b/ethash.h index fcdac0280..5491f4a4e 100644 --- a/ethash.h +++ b/ethash.h @@ -69,10 +69,24 @@ void ethash_compute_full_data(void *mem, ethash_params const *params, ethash_cac void ethash_full(ethash_return_value *ret, void const *full_mem, ethash_params const *params, const uint8_t header_hash[32], const uint64_t nonce); void ethash_light(ethash_return_value *ret, ethash_cache const *cache, ethash_params const *params, const uint8_t header_hash[32], const uint64_t nonce); -static inline void ethash_prep_light(void *cache, ethash_params const *params, const uint8_t seed[32]) { ethash_cache c; c.mem = cache; ethash_mkcache(&c, params, seed); } -static inline void ethash_compute_light(ethash_return_value *ret, void const *cache, ethash_params const *params, const uint8_t header_hash[32], const uint64_t nonce) { ethash_cache c; c.mem = (void*)cache; ethash_light(ret, &c, params, header_hash, nonce); } -static inline void ethash_prep_full(void *full, ethash_params const *params, void const *cache) { ethash_cache c; c.mem = (void*)cache; ethash_compute_full_data(full, params, &c); } -static inline void ethash_compute_full(ethash_return_value *ret, void const *full, ethash_params const *params, const uint8_t header_hash[32], const uint64_t nonce) { ethash_full(ret, full, params, header_hash, nonce); } +static inline void ethash_prep_light(void *cache, ethash_params const *params, const uint8_t seed[32]) { + ethash_cache c; + c.mem = cache; + ethash_mkcache(&c, params, seed); +} +static inline void ethash_compute_light(ethash_return_value *ret, void const *cache, ethash_params const *params, const uint8_t header_hash[32], const uint64_t nonce) { + ethash_cache c; + c.mem = (void *) cache; + ethash_light(ret, &c, params, header_hash, nonce); +} +static inline void ethash_prep_full(void *full, ethash_params const *params, void const *cache) { + ethash_cache c; + c.mem = (void *) cache; + ethash_compute_full_data(full, params, &c); +} +static inline void ethash_compute_full(ethash_return_value *ret, void const *full, ethash_params const *params, const uint8_t header_hash[32], const uint64_t nonce) { + ethash_full(ret, full, params, header_hash, nonce); +} static inline int ethash_check_difficulty( const uint8_t hash[32], From a238f4244f19c9df00ded94090b94cf811d59201 Mon Sep 17 00:00:00 2001 From: Matthew Wampler-Doty Date: Tue, 10 Mar 2015 15:24:07 -0400 Subject: [PATCH 010/461] Updating data size stuff --- data_sizes.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/data_sizes.h b/data_sizes.h index 18112f412..94ee6f0e9 100644 --- a/data_sizes.h +++ b/data_sizes.h @@ -20,8 +20,6 @@ * @date 2015 */ -// TODO: Update this after ~3.5 years - #pragma once #include @@ -33,7 +31,7 @@ extern "C" { #include -// 2048 Epochs worth of tabulated DAG sizes +// 2048 Epochs (~20 years) worth of tabulated DAG sizes // Generated with the following Mathematica Code: From fa9e13139f2290625b5e3e244da2f14d0b33730f Mon Sep 17 00:00:00 2001 From: Matthew Wampler-Doty Date: Tue, 10 Mar 2015 15:24:54 -0400 Subject: [PATCH 011/461] Introducing get_seedhash --- ethash.h | 7 ++++++- internal.c | 7 +++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ethash.h b/ethash.h index 5491f4a4e..bcbe2d7ef 100644 --- a/ethash.h +++ b/ethash.h @@ -68,26 +68,31 @@ void ethash_mkcache(ethash_cache *cache, ethash_params const *params, const uint void ethash_compute_full_data(void *mem, ethash_params const *params, ethash_cache const *cache); void ethash_full(ethash_return_value *ret, void const *full_mem, ethash_params const *params, const uint8_t header_hash[32], const uint64_t nonce); void ethash_light(ethash_return_value *ret, ethash_cache const *cache, ethash_params const *params, const uint8_t header_hash[32], const uint64_t nonce); +void ethash_get_seedhash(uint8_t seedhash[32], const uint32_t block_number); static inline void ethash_prep_light(void *cache, ethash_params const *params, const uint8_t seed[32]) { ethash_cache c; c.mem = cache; ethash_mkcache(&c, params, seed); } + static inline void ethash_compute_light(ethash_return_value *ret, void const *cache, ethash_params const *params, const uint8_t header_hash[32], const uint64_t nonce) { ethash_cache c; c.mem = (void *) cache; ethash_light(ret, &c, params, header_hash, nonce); } + static inline void ethash_prep_full(void *full, ethash_params const *params, void const *cache) { ethash_cache c; c.mem = (void *) cache; ethash_compute_full_data(full, params, &c); } + static inline void ethash_compute_full(ethash_return_value *ret, void const *full, ethash_params const *params, const uint8_t header_hash[32], const uint64_t nonce) { ethash_full(ret, full, params, header_hash, nonce); } +// Returns if hash is less than or equal to difficulty static inline int ethash_check_difficulty( const uint8_t hash[32], const uint8_t difficulty[32]) { @@ -96,7 +101,7 @@ static inline int ethash_check_difficulty( if (hash[i] == difficulty[i]) continue; return hash[i] < difficulty[i]; } - return 0; + return 1; } int ethash_quick_check_difficulty( diff --git a/internal.c b/internal.c index cba08d116..3144bf8d6 100644 --- a/internal.c +++ b/internal.c @@ -273,6 +273,13 @@ void ethash_quick_hash( SHA3_256(return_hash, buf, 64 + 32); } +void ethash_get_seedhash(uint8_t seedhash[32], const uint32_t block_number) { + memset(seedhash,0,32); + const uint32_t epochs = block_number / EPOCH_LENGTH; + for (uint32_t i = 0 ; i < epochs ; ++i) + SHA3_256(seedhash, seedhash, 32); +} + int ethash_quick_check_difficulty( const uint8_t header_hash[32], const uint64_t nonce, From 367527f1ca3cfb86b76a59e476ecea5a4a439e2c Mon Sep 17 00:00:00 2001 From: Matthew Wampler-Doty Date: Tue, 10 Mar 2015 17:53:15 -0400 Subject: [PATCH 012/461] Refactoring names to match spec --- ethash.h | 6 +++--- internal.c | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/ethash.h b/ethash.h index bcbe2d7ef..63e58612c 100644 --- a/ethash.h +++ b/ethash.h @@ -27,13 +27,13 @@ #include "compiler.h" #define REVISION 20 -#define DAGSIZE_BYTES_INIT 1073741824U // 2**30 -#define DAG_GROWTH 8388608U // 2**23 +#define DATASET_BYTES_INIT 1073741824U // 2**30 +#define DATASET_BYTES_GROWTH 8388608U // 2**23 #define CACHE_MULTIPLIER 1024 #define EPOCH_LENGTH 30000U #define MIX_BYTES 128 #define HASH_BYTES 64 -#define DAG_PARENTS 256 +#define DATASET_PARENTS 256 #define CACHE_ROUNDS 3 #define ACCESSES 64 diff --git a/internal.c b/internal.c index 3144bf8d6..0a7e767e7 100644 --- a/internal.c +++ b/internal.c @@ -114,7 +114,7 @@ void ethash_calculate_dag_item( __m128i xmm3 = ret->xmm[3]; #endif - for (unsigned i = 0; i != DAG_PARENTS; ++i) { + for (unsigned i = 0; i != DATASET_PARENTS; ++i) { uint32_t parent_index = ((node_index ^ i) * FNV_PRIME ^ ret->words[i % NODE_WORDS]) % num_parent_nodes; node const *parent = &cache_nodes[parent_index]; @@ -274,9 +274,9 @@ void ethash_quick_hash( } void ethash_get_seedhash(uint8_t seedhash[32], const uint32_t block_number) { - memset(seedhash,0,32); + memset(seedhash, 0, 32); const uint32_t epochs = block_number / EPOCH_LENGTH; - for (uint32_t i = 0 ; i < epochs ; ++i) + for (uint32_t i = 0; i < epochs; ++i) SHA3_256(seedhash, seedhash, 32); } From 95b19d20fe519bb3983351d44864ebeed0aace7d Mon Sep 17 00:00:00 2001 From: Matthew Wampler-Doty Date: Tue, 10 Mar 2015 20:10:32 -0700 Subject: [PATCH 013/461] Bump to latest revision --- ethash.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethash.h b/ethash.h index 63e58612c..6d8a69a0a 100644 --- a/ethash.h +++ b/ethash.h @@ -26,7 +26,7 @@ #include #include "compiler.h" -#define REVISION 20 +#define REVISION 22 #define DATASET_BYTES_INIT 1073741824U // 2**30 #define DATASET_BYTES_GROWTH 8388608U // 2**23 #define CACHE_MULTIPLIER 1024 From 46ade2d870059e5075673264517bfdd0eaeeed35 Mon Sep 17 00:00:00 2001 From: Matthew Wampler-Doty Date: Thu, 12 Mar 2015 11:25:42 -0700 Subject: [PATCH 014/461] Updating data sizes, version bump --- data_sizes.h | 641 +++++++++++++++++++++++++++------------------------ ethash.h | 5 +- 2 files changed, 341 insertions(+), 305 deletions(-) diff --git a/data_sizes.h b/data_sizes.h index 94ee6f0e9..3b747b3ea 100644 --- a/data_sizes.h +++ b/data_sizes.h @@ -35,17 +35,18 @@ extern "C" { // Generated with the following Mathematica Code: -// GetDataSizes[n_] := Module[{ -// DataSetSizeBytesInit = 2^30, -// MixBytes = 128, -// DataSetGrowth = 2^23, +// GetCacheSizes[n_] := Module[{ +// CacheSizeBytesInit = 2^24, +// CacheGrowth = 2^17, +// HashBytes = 64, // j = 0}, -// Reap[ -// While[j < n, -// Module[{i = -// Floor[(DataSetSizeBytesInit + DataSetGrowth * j) / MixBytes]}, -// While[! PrimeQ[i], i--]; -// Sow[i*MixBytes]; j++]]]][[2]][[1]] +// Reap[ +// While[j < n, +// Module[{i = +// Floor[(CacheSizeBytesInit + CacheGrowth * j) / HashBytes]}, +// While[! PrimeQ[i], i--]; +// Sow[i*HashBytes]; j++]]]][[2]][[1]] + static const size_t dag_sizes[2048] = { 1073739904U, 1082130304U, 1090514816U, 1098906752U, 1107293056U, @@ -477,299 +478,333 @@ static const size_t dag_sizes[2048] = { // Sow[i*HashBytes]; j++]]]][[2]][[1]] const size_t cache_sizes[2048] = { - 1048384U, 1055552U, 1064512U, 1072832U, 1080896U, 1089344U, 1096768U, - 1104448U, 1113664U, 1121216U, 1130176U, 1138624U, 1146304U, 1155008U, - 1162816U, 1171264U, 1179328U, 1187392U, 1195456U, 1203392U, 1210816U, - 1220416U, 1227712U, 1236416U, 1244608U, 1253312U, 1261376U, 1268416U, - 1277632U, 1285696U, 1294016U, 1302208U, 1310656U, 1318336U, 1326784U, - 1334848U, 1342912U, 1350848U, 1359808U, 1366208U, 1376192U, 1383488U, - 1392448U, 1400384U, 1408832U, 1416512U, 1425344U, 1433408U, 1440704U, - 1449664U, 1458112U, 1466048U, 1474496U, 1482688U, 1490752U, 1498688U, - 1507136U, 1515328U, 1523264U, 1531456U, 1539904U, 1547584U, 1556288U, - 1564352U, 1572544U, 1580608U, 1588544U, 1596992U, 1605568U, 1612096U, - 1621952U, 1630144U, 1637696U, 1645888U, 1654336U, 1662784U, 1671104U, - 1679168U, 1686848U, 1695296U, 1702208U, 1711168U, 1720256U, 1727552U, - 1736128U, 1744576U, 1751488U, 1760576U, 1769408U, 1777472U, 1785664U, - 1793984U, 1801664U, 1810112U, 1818304U, 1826624U, 1834816U, 1842752U, - 1851328U, 1858112U, 1867456U, 1875904U, 1883968U, 1892288U, 1899712U, - 1908416U, 1916608U, 1924544U, 1932992U, 1940672U, 1948736U, 1956928U, - 1965632U, 1973824U, 1982144U, 1989824U, 1998784U, 2006848U, 2014784U, - 2022848U, 2031424U, 2038976U, 2047424U, 2055616U, 2064064U, 2072384U, - 2080448U, 2088512U, 2095936U, 2104768U, 2113472U, 2121664U, 2127808U, - 2137792U, 2146112U, 2153408U, 2162624U, 2170304U, 2178496U, 2186944U, - 2195392U, 2203456U, 2211136U, 2219968U, 2227648U, 2236096U, 2244416U, - 2250944U, 2260928U, 2268736U, 2276672U, 2283328U, 2293696U, 2301632U, - 2309312U, 2317888U, 2325952U, 2334656U, 2342848U, 2350144U, 2358848U, - 2366656U, 2375488U, 2383552U, 2391616U, 2400064U, 2407616U, 2415808U, - 2424256U, 2432704U, 2439616U, 2448704U, 2457152U, 2464064U, 2473792U, - 2482112U, 2489792U, 2497472U, 2506432U, 2514752U, 2522816U, 2531264U, - 2539456U, 2547136U, 2555456U, 2564032U, 2572096U, 2578496U, 2587712U, - 2595776U, 2604736U, 2613056U, 2620736U, 2629184U, 2637632U, 2645824U, - 2653888U, 2662208U, 2670016U, 2678464U, 2686912U, 2694464U, 2703296U, - 2710976U, 2719424U, 2727104U, 2736064U, 2743232U, 2752192U, 2760512U, - 2768704U, 2777024U, 2785088U, 2792512U, 2800576U, 2809024U, 2817856U, - 2826176U, 2833984U, 2840896U, 2850752U, 2858048U, 2867008U, 2875328U, - 2883392U, 2891584U, 2899648U, 2908096U, 2915648U, 2924224U, 2932672U, - 2940736U, 2948672U, 2956736U, 2964928U, 2973248U, 2981824U, 2988992U, - 2997184U, 3005248U, 3013952U, 3022144U, 3030592U, 3037376U, 3046976U, - 3055552U, 3063616U, 3070784U, 3079744U, 3087808U, 3096512U, 3103808U, - 3111872U, 3121088U, 3128896U, 3137216U, 3144896U, 3153856U, 3161152U, - 3169984U, 3178432U, 3186496U, 3194816U, 3203008U, 3210176U, 3218624U, - 3227072U, 3235264U, 3243712U, 3250496U, 3259456U, 3268544U, 3276736U, - 3283648U, 3292736U, 3301184U, 3308224U, 3317696U, 3324736U, 3333184U, - 3342272U, 3348544U, 3357248U, 3365312U, 3374912U, 3383104U, 3390784U, - 3399488U, 3407296U, 3414976U, 3424192U, 3432256U, 3440576U, 3448768U, - 3456832U, 3464896U, 3473216U, 3480128U, 3489344U, 3497408U, 3505856U, - 3514048U, 3521344U, 3530432U, 3538624U, 3546304U, 3555008U, 3563072U, - 3571648U, 3579712U, 3587392U, 3595456U, 3603904U, 3612352U, 3620416U, - 3628864U, 3636928U, 3645248U, 3652928U, 3660992U, 3669184U, 3677888U, - 3685952U, 3694528U, 3702592U, 3710528U, 3719104U, 3727168U, 3735488U, - 3742784U, 3751232U, 3759424U, 3765184U, 3775808U, 3783872U, 3792832U, - 3800768U, 3808832U, 3816256U, 3825344U, 3832768U, 3841856U, 3849536U, - 3857344U, 3866432U, 3874496U, 3882304U, 3890752U, 3899072U, 3907264U, - 3914816U, 3923008U, 3930688U, 3939904U, 3947968U, 3956416U, 3964736U, - 3972544U, 3981248U, 3988928U, 3997376U, 4005824U, 4012864U, 4020928U, - 4030144U, 4038592U, 4045504U, 4054592U, 4063168U, 4071104U, 4079552U, - 4087232U, 4095808U, 4103872U, 4111168U, 4120384U, 4127936U, 4136512U, - 4144832U, 4153024U, 4160704U, 4169408U, 4177216U, 4186048U, 4193344U, - 4202048U, 4210496U, 4217536U, 4227008U, 4235072U, 4243264U, 4251584U, - 4259392U, 4267712U, 4275776U, 4284352U, 4291904U, 4300096U, 4307648U, - 4316992U, 4325056U, 4333376U, 4341056U, 4349888U, 4357568U, 4366016U, - 4374464U, 4382528U, 4390208U, 4398656U, 4407232U, 4413632U, 4423616U, - 4431808U, 4439744U, 4447936U, 4455872U, 4463296U, 4472128U, 4480576U, - 4489024U, 4497344U, 4505152U, 4512448U, 4520896U, 4530112U, 4537664U, - 4546496U, 4554688U, 4562752U, 4570816U, 4579264U, 4586944U, 4595648U, - 4603712U, 4611392U, 4619072U, 4628032U, 4635584U, 4643776U, 4652864U, - 4660672U, 4669376U, 4677056U, 4684096U, 4693184U, 4702144U, 4710208U, - 4718528U, 4726336U, 4734272U, 4742464U, 4750784U, 4759232U, 4767296U, - 4775872U, 4783808U, 4791872U, 4797376U, 4808512U, 4816192U, 4825024U, - 4832704U, 4841024U, 4849472U, 4856512U, 4865984U, 4874176U, 4882112U, - 4889792U, 4898752U, 4906688U, 4913984U, 4922816U, 4931008U, 4938944U, - 4946624U, 4955584U, 4964032U, 4972096U, 4980032U, 4988864U, 4997056U, - 5004992U, 5012288U, 5020096U, 5029312U, 5037632U, 5045696U, 5052224U, - 5062592U, 5070784U, 5078848U, 5086784U, 5095232U, 5100736U, 5111488U, - 5119936U, 5127104U, 5136064U, 5143616U, 5151424U, 5160256U, 5168704U, - 5175232U, 5185472U, 5192384U, 5199296U, 5209664U, 5218112U, 5225536U, - 5233472U, 5242816U, 5250496U, 5258944U, 5267264U, 5274944U, 5283776U, - 5290048U, 5300032U, 5308096U, 5316544U, 5323328U, 5331904U, 5340736U, - 5349056U, 5356864U, 5365312U, 5372096U, 5381696U, 5390272U, 5398336U, - 5405888U, 5413696U, 5422784U, 5430976U, 5439424U, 5446976U, 5455808U, - 5463616U, 5471168U, 5480128U, 5488064U, 5494592U, 5504704U, 5513152U, - 5521216U, 5529536U, 5536576U, 5544256U, 5554112U, 5559616U, 5570368U, - 5577664U, 5586752U, 5594944U, 5603008U, 5611456U, 5619392U, 5627584U, - 5634368U, 5643328U, 5651264U, 5659328U, 5667008U, 5675584U, 5684416U, - 5692864U, 5701568U, 5709632U, 5717056U, 5725376U, 5734336U, 5740096U, - 5750336U, 5758912U, 5766848U, 5775296U, 5782976U, 5790784U, 5799616U, - 5807936U, 5815232U, 5823808U, 5832256U, 5840192U, 5848768U, 5856832U, - 5864896U, 5873344U, 5879872U, 5888576U, 5897792U, 5905216U, 5914432U, - 5920448U, 5930944U, 5938624U, 5947328U, 5955392U, 5963456U, 5971648U, - 5979328U, 5988032U, 5995712U, 6003904U, 6012736U, 6021056U, 6029248U, - 6037184U, 6045632U, 6053312U, 6061376U, 6070208U, 6077504U, 6086464U, - 6094784U, 6101696U, 6110912U, 6118592U, 6127168U, 6135616U, 6143296U, - 6150208U, 6158912U, 6168128U, 6175808U, 6182464U, 6192832U, 6201152U, - 6209344U, 6217664U, 6224576U, 6233408U, 6241472U, 6249664U, 6258496U, - 6266816U, 6275008U, 6281152U, 6291136U, 6299456U, 6306752U, 6314816U, - 6323776U, 6332096U, 6339392U, 6348224U, 6356288U, 6364096U, 6373184U, - 6381376U, 6389696U, 6397504U, 6404416U, 6413632U, 6421952U, 6430016U, - 6437824U, 6446912U, 6454592U, 6463168U, 6471616U, 6478144U, 6487232U, - 6496192U, 6504128U, 6511936U, 6520256U, 6528832U, 6536896U, 6544576U, - 6553408U, 6561472U, 6569792U, 6577216U, 6586304U, 6592448U, 6601024U, - 6610624U, 6619072U, 6627136U, 6634816U, 6643264U, 6650816U, 6659776U, - 6667712U, 6675904U, 6682688U, 6691904U, 6700864U, 6709184U, 6717376U, - 6724544U, 6733504U, 6741824U, 6749888U, 6756032U, 6766528U, 6773056U, - 6782912U, 6790976U, 6798016U, 6807488U, 6815168U, 6823744U, 6832064U, - 6840128U, 6847552U, 6855872U, 6864064U, 6872128U, 6880576U, 6889408U, - 6897472U, 6905792U, 6913472U, 6920896U, 6930368U, 6938432U, 6946624U, - 6953536U, 6963136U, 6971072U, 6979136U, 6986944U, 6995392U, 7003712U, - 7012288U, 7019072U, 7028416U, 7036352U, 7044416U, 7051712U, 7060672U, - 7069376U, 7077568U, 7085504U, 7092544U, 7102016U, 7110592U, 7118656U, - 7126208U, 7135168U, 7143104U, 7150912U, 7159744U, 7167808U, 7175744U, - 7184192U, 7191232U, 7200448U, 7207744U, 7216576U, 7224128U, 7233472U, - 7241536U, 7249856U, 7256512U, 7264832U, 7274048U, 7282112U, 7290176U, - 7298752U, 7306688U, 7315136U, 7322816U, 7331392U, 7339456U, 7347776U, - 7356224U, 7364288U, 7371712U, 7380928U, 7387456U, 7396544U, 7404352U, - 7413568U, 7421632U, 7429696U, 7436864U, 7446464U, 7454144U, 7461952U, - 7470784U, 7478336U, 7487296U, 7495616U, 7503424U, 7511872U, 7520192U, - 7527616U, 7536448U, 7544512U, 7551424U, 7560128U, 7568576U, 7577536U, - 7583552U, 7592512U, 7600448U, 7610048U, 7618496U, 7626176U, 7634752U, - 7642816U, 7651264U, 7659328U, 7667008U, 7675456U, 7683136U, 7691584U, - 7700416U, 7707584U, 7716416U, 7724224U, 7733056U, 7740608U, 7749184U, - 7756096U, 7765952U, 7774016U, 7781824U, 7790528U, 7798592U, 7805888U, - 7814336U, 7822784U, 7831232U, 7839296U, 7847104U, 7855552U, 7863616U, - 7872448U, 7880128U, 7888576U, 7896256U, 7905088U, 7912768U, 7920448U, - 7928768U, 7937344U, 7945792U, 7953728U, 7959488U, 7970752U, 7978816U, - 7987136U, 7994816U, 8003392U, 8011712U, 8019904U, 8027456U, 8035264U, - 8044352U, 8052544U, 8060224U, 8069056U, 8076736U, 8084672U, 8093504U, - 8101312U, 8110016U, 8117696U, 8125888U, 8134592U, 8142016U, 8149952U, - 8159168U, 8166976U, 8175296U, 8183488U, 8191808U, 8199616U, 8207296U, - 8216128U, 8224576U, 8232256U, 8241088U, 8248256U, 8257472U, 8264128U, - 8273728U, 8281792U, 8290112U, 8297152U, 8305216U, 8314816U, 8322752U, - 8330944U, 8339392U, 8347072U, 8355392U, 8363968U, 8371904U, 8379328U, - 8388544U, 8394944U, 8404544U, 8412736U, 8421184U, 8429504U, 8437696U, - 8445376U, 8452544U, 8460736U, 8470208U, 8478016U, 8486848U, 8494144U, - 8503232U, 8511296U, 8519488U, 8527424U, 8534464U, 8543936U, 8552384U, - 8558912U, 8568128U, 8575936U, 8584256U, 8593216U, 8601536U, 8608832U, - 8616896U, 8625728U, 8634176U, 8641856U, 8649664U, 8658112U, 8666176U, - 8674112U, 8682944U, 8691136U, 8699456U, 8707648U, 8716096U, 8724416U, - 8732608U, 8740672U, 8748352U, 8756032U, 8764864U, 8773568U, 8781376U, - 8789824U, 8796992U, 8806208U, 8814272U, 8822336U, 8830912U, 8838848U, - 8847296U, 8854336U, 8863552U, 8871488U, 8879296U, 8887616U, 8894528U, - 8904512U, 8911424U, 8920768U, 8928704U, 8936128U, 8944576U, 8953664U, - 8960576U, 8970176U, 8977984U, 8986304U, 8994112U, 9002432U, 9011008U, - 9018176U, 9026624U, 9035584U, 9043904U, 9052096U, 9059264U, 9068096U, - 9075904U, 9084224U, 9092288U, 9100352U, 9108928U, 9116992U, 9125824U, - 9133504U, 9141824U, 9150272U, 9157952U, 9164608U, 9174848U, 9182912U, - 9190976U, 9199552U, 9205312U, 9215936U, 9222592U, 9232192U, 9240512U, - 9248704U, 9256256U, 9264832U, 9272896U, 9281344U, 9288896U, 9297088U, - 9305536U, 9313984U, 9322304U, 9329728U, 9337792U, 9346112U, 9355072U, - 9363136U, 9371072U, 9378752U, 9387712U, 9395648U, 9404224U, 9411008U, - 9420608U, 9428416U, 9436864U, 9445312U, 9453376U, 9460928U, 9468736U, - 9477824U, 9485248U, 9493696U, 9502144U, 9509056U, 9518528U, 9527104U, - 9535424U, 9543616U, 9551296U, 9559744U, 9568192U, 9576256U, 9584576U, - 9591872U, 9600704U, 9608384U, 9615808U, 9624512U, 9633472U, 9641536U, - 9649856U, 9658048U, 9665728U, 9674432U, 9682496U, 9691072U, 9699136U, - 9707072U, 9715136U, 9722176U, 9732032U, 9740096U, 9747904U, 9756352U, - 9764288U, 9771584U, 9780544U, 9789376U, 9796928U, 9804224U, 9813952U, - 9822016U, 9829696U, 9838016U, 9845824U, 9852992U, 9863104U, 9870656U, - 9878464U, 9887552U, 9895744U, 9903808U, 9912128U, 9920192U, 9927616U, - 9936064U, 9944768U, 9952576U, 9960128U, 9969472U, 9977152U, 9985216U, - 9994048U, 10001216U, 10007744U, 10018496U, 10026944U, 10035136U, 10042432U, - 10051264U, 10059584U, 10067648U, 10075712U, 10083904U, 10091456U, 10100672U, - 10108864U, 10116928U, 10124864U, 10133056U, 10140736U, 10149824U, 10156736U, - 10165952U, 10173376U, 10182208U, 10190528U, 10198336U, 10206272U, 10213696U, - 10223296U, 10231744U, 10238656U, 10247488U, 10256192U, 10263872U, 10272448U, - 10280896U, 10288448U, 10296512U, 10305088U, 10313536U, 10321088U, 10330048U, - 10337984U, 10346176U, 10354112U, 10362304U, 10369088U, 10377152U, 10386752U, - 10394816U, 10403648U, 10411712U, 10418624U, 10427968U, 10436032U, 10444736U, - 10452928U, 10459712U, 10468672U, 10476608U, 10484416U, 10491328U, 10501952U, - 10509376U, 10517824U, 10526528U, 10534336U, 10542656U, 10549696U, 10559168U, - 10566592U, 10575808U, 10583488U, 10590656U, 10599488U, 10607936U, 10616768U, - 10624832U, 10630336U, 10640576U, 10649536U, 10655168U, 10665152U, 10674112U, - 10682176U, 10690496U, 10698176U, 10705216U, 10715072U, 10722752U, 10731328U, - 10739264U, 10746688U, 10754752U, 10761664U, 10770752U, 10779712U, 10787776U, - 10796608U, 10803392U, 10812352U, 10821056U, 10828736U, 10837952U, 10846144U, - 10853824U, 10861376U, 10869952U, 10877248U, 10887104U, 10895296U, 10903232U, - 10910912U, 10918976U, 10927936U, 10935872U, 10944448U, 10952384U, 10960832U, - 10968512U, 10977088U, 10985024U, 10992832U, 11000896U, 11009984U, 11018048U, - 11026112U, 11034304U, 11042624U, 11050432U, 11058368U, 11064512U, 11075392U, - 11083712U, 11091776U, 11099584U, 11107904U, 11115968U, 11124416U, 11131712U, - 11141056U, 11148608U, 11157184U, 11165248U, 11173312U, 11180992U, 11189056U, - 11197376U, 11206592U, 11214656U, 11222336U, 11230784U, 11238464U, 11246528U, - 11254976U, 11263552U, 11271872U, 11279552U, 11288512U, 11296576U, 11304256U, - 11312192U, 11320768U, 11329216U, 11336384U, 11345216U, 11352512U, 11362112U, - 11369408U, 11378624U, 11386688U, 11394496U, 11402816U, 11411264U, 11418688U, - 11427776U, 11435584U, 11444032U, 11452096U, 11459648U, 11467072U, 11476928U, - 11484992U, 11493184U, 11500352U, 11509312U, 11517248U, 11524928U, 11534144U, - 11542208U, 11550272U, 11556416U, 11566784U, 11574208U, 11581376U, 11589568U, - 11599552U, 11607104U, 11616064U, 11623616U, 11632576U, 11639872U, 11648704U, - 11657024U, 11664704U, 11672896U, 11681216U, 11689792U, 11697856U, 11705536U, - 11714368U, 11722688U, 11730496U, 11737408U, 11745728U, 11754304U, 11763008U, - 11770816U, 11779648U, 11788096U, 11795776U, 11804608U, 11812544U, 11820992U, - 11829184U, 11837248U, 11844928U, 11852096U, 11860928U, 11869888U, 11878336U, - 11886272U, 11894336U, 11902144U, 11910848U, 11919296U, 11925952U, 11934784U, - 11943616U, 11951552U, 11960128U, 11968192U, 11976512U, 11983168U, 11992768U, - 12000832U, 12008896U, 12016832U, 12025408U, 12033856U, 12042176U, 12049984U, - 12058048U, 12066112U, 12073792U, 12082624U, 12091328U, 12098752U, 12106816U, - 12115904U, 12124096U, 12131776U, 12140224U, 12148672U, 12156736U, 12164032U, - 12173248U, 12181184U, 12186176U, 12197824U, 12205888U, 12213952U, 12218944U, - 12230336U, 12238784U, 12246592U, 12254272U, 12262336U, 12269888U, 12279104U, - 12287936U, 12295744U, 12304064U, 12312512U, 12319936U, 12328768U, 12337088U, - 12344896U, 12352832U, 12361408U, 12368704U, 12377152U, 12384832U, 12394432U, - 12402496U, 12409024U, 12417728U, 12426688U, 12433216U, 12443584U, 12450752U, - 12459968U, 12468032U, 12475712U, 12484544U, 12492608U, 12500416U, 12508352U, - 12517184U, 12525376U, 12532288U, 12541888U, 12549568U, 12556864U, 12565568U, - 12574528U, 12582208U, 12590528U, 12598592U, 12607424U, 12615488U, 12623552U, - 12631744U, 12638656U, 12647744U, 12656576U, 12664768U, 12672832U, 12680896U, - 12688576U, 12697408U, 12704192U, 12713408U, 12721216U, 12729664U, 12738496U, - 12745792U, 12754496U, 12762688U, 12769472U, 12779456U, 12787648U, 12795712U, - 12804032U, 12812224U, 12819008U, 12828352U, 12836672U, 12844736U, 12851648U, - 12859456U, 12868672U, 12877504U, 12885568U, 12892864U, 12902336U, 12909376U, - 12918208U, 12926656U, 12934976U, 12942784U, 12951104U, 12959552U, 12967744U, - 12976064U, 12984256U, 12991936U, 12999488U, 13007936U, 13016768U, 13021504U, - 13033024U, 13041472U, 13049408U, 13057472U, 13065664U, 13072064U, 13081408U, - 13089344U, 13098688U, 13107008U, 13115072U, 13122752U, 13130944U, 13139648U, - 13147712U, 13155776U, 13162432U, 13172672U, 13180864U, 13188928U, 13196992U, - 13203392U, 13213504U, 13219264U, 13228736U, 13236928U, 13244992U, 13253056U, - 13262528U, 13269952U, 13278784U, 13285952U, 13295552U, 13303616U, 13311808U, - 13319744U, 13328192U, 13336256U, 13344704U, 13352384U, 13360576U, 13369024U, - 13377344U, 13385408U, 13393216U, 13401664U, 13410112U, 13418176U, 13426496U, - 13434688U, 13442368U, 13451072U, 13459136U, 13466944U, 13475648U, 13482944U, - 13491904U, 13500352U, 13508288U, 13516736U, 13524416U, 13532224U, 13541312U, - 13549504U, 13556288U, 13564736U, 13573184U, 13581376U, 13587008U, 13598656U, - 13605952U, 13612864U, 13622464U, 13631168U, 13639616U, 13647808U, 13655104U, - 13663424U, 13671872U, 13680064U, 13688768U, 13696576U, 13705024U, 13712576U, - 13721536U, 13729216U, 13737664U, 13746112U, 13753024U, 13759552U, 13770304U, - 13777856U, 13786688U, 13793984U, 13802176U, 13811264U, 13819328U, 13827904U, - 13835456U, 13844416U, 13851584U, 13860544U, 13868992U, 13877056U, 13884608U, - 13893184U, 13901248U, 13909696U, 13917632U, 13925056U, 13934528U, 13942336U, - 13950784U, 13959104U, 13966912U, 13975232U, 13982656U, 13991872U, 13999936U, - 14007872U, 14016064U, 14024512U, 14032064U, 14040896U, 14049088U, 14057408U, - 14065088U, 14072896U, 14081344U, 14089664U, 14097856U, 14106304U, 14114752U, - 14122688U, 14130752U, 14138816U, 14147008U, 14155072U, 14163904U, 14170432U, - 14180288U, 14187328U, 14196032U, 14204864U, 14212672U, 14220736U, 14229056U, - 14237504U, 14245568U, 14253632U, 14261824U, 14269888U, 14278592U, 14286656U, - 14293696U, 14302784U, 14309696U, 14317504U, 14326336U, 14335936U, 14343232U, - 14352064U, 14359232U, 14368064U, 14376512U, 14384576U, 14393024U, 14401472U, - 14409536U, 14416832U, 14424512U, 14433856U, 14440768U, 14449984U, 14458816U, - 14465728U, 14474816U, 14482112U, 14491328U, 14499392U, 14506816U, 14516032U, - 14524352U, 14531392U, 14540224U, 14547392U, 14556992U, 14565184U, 14573248U, - 14580928U, 14588864U, 14596928U, 14606272U, 14613824U, 14622656U, 14630464U, - 14638912U, 14646976U, 14655296U, 14661952U, 14671808U, 14679872U, 14687936U, - 14696384U, 14704576U, 14710336U, 14720192U, 14729152U, 14736448U, 14745152U, - 14752448U, 14761792U, 14769856U, 14777024U, 14785984U, 14792384U, 14802752U, - 14810816U, 14819264U, 14827328U, 14835136U, 14843072U, 14851264U, 14860096U, - 14867648U, 14876096U, 14884544U, 14892736U, 14900672U, 14907968U, 14917312U, - 14924864U, 14933824U, 14939968U, 14950336U, 14957632U, 14966464U, 14974912U, - 14982592U, 14991296U, 14999104U, 15006272U, 15015232U, 15023936U, 15031616U, - 15040448U, 15047488U, 15055552U, 15063616U, 15073216U, 15079744U, 15088064U, - 15097664U, 15105344U, 15113792U, 15122368U, 15130048U, 15137728U, 15146176U, - 15154112U, 15162688U, 15171392U, 15179456U, 15187264U, 15194176U, 15204032U, - 15212224U, 15220544U, 15227456U, 15237056U, 15245248U, 15253184U, 15261632U, - 15269824U, 15277376U, 15285824U, 15293888U, 15301568U, 15310784U, 15318848U, - 15325504U, 15335104U, 15343168U, 15350848U, 15359936U, 15367232U, 15373376U, - 15384256U, 15392576U, 15400384U, 15408832U, 15417152U, 15424832U, 15433024U, - 15441344U, 15449152U, 15457088U, 15466432U, 15474112U, 15482816U, 15488576U, - 15499072U, 15505856U, 15514816U, 15523264U, 15531584U, 15540032U, 15547328U, - 15553984U, 15564608U, 15571904U, 15579968U, 15589312U, 15597376U, 15605696U, - 15612992U, 15621824U, 15630016U, 15638464U, 15646144U, 15654592U, 15662912U, - 15671104U, 15677248U, 15686848U, 15693376U, 15701696U, 15712064U, 15720256U, - 15728576U, 15736384U, 15744704U, 15752512U, 15761344U, 15769024U, 15777728U, - 15785152U, 15793984U, 15802048U, 15809984U, 15817024U, 15825856U, 15834944U, - 15843008U, 15849664U, 15859136U, 15866432U, 15876032U, 15884096U, 15892288U, - 15900608U, 15908416U, 15916864U, 15924928U, 15930176U, 15941056U, 15949504U, - 15957824U, 15965632U, 15973952U, 15982528U, 15990592U, 15998272U, 16006976U, - 16012736U, 16023104U, 16031296U, 16039616U, 16048064U, 16055744U, 16064192U, - 16071488U, 16080832U, 16088768U, 16097216U, 16104896U, 16112704U, 16121792U, - 16129856U, 16138048U, 16146112U, 16154176U, 16162624U, 16170688U, 16177856U, - 16186816U, 16195136U, 16202176U, 16211648U, 16220096U, 16228288U, 16235584U, - 16244672U, 16252864U, 16260544U, 16269248U, 16277056U, 16285504U, 16291648U, - 16301632U, 16309312U, 16318144U, 16326208U, 16333888U, 16342336U, 16351168U, - 16359232U, 16367552U, 16375616U, 16383296U, 16391744U, 16398016U, 16407616U, - 16415936U, 16424896U, 16432448U, 16440896U, 16449088U, 16457024U, 16465472U, - 16474048U, 16481216U, 16490048U, 16498624U, 16505792U, 16513984U, 16523072U, - 16531136U, 16538944U, 16547264U, 16555328U, 16563776U, 16570816U, 16578112U, - 16587712U, 16596544U, 16604992U, 16613312U, 16620608U, 16629568U, 16637888U, - 16645696U, 16653632U, 16661696U, 16669888U, 16677568U, 16686272U, 16695232U, - 16703168U, 16710464U, 16719424U, 16726592U, 16733888U, 16744384U, 16752448U, - 16760768U, 16768448U, 16776896U, 16785344U, 16793536U, 16801216U, 16809664U, - 16818112U, 16826176U, 16833472U, 16842688U, 16850752U, 16859072U, 16866368U, - 16875328U, 16883392U, 16891712U, 16899776U, 16907456U, 16915264U, 16924352U, - 16931776U, 16940608U, 16949056U, 16957376U, 16965056U, 16973248U, 16981696U, - 16990144U, 16997056U, 17005888U, 17014208U, 17021504U, 17031104U, 17039296U, - 17046976U, 17055424U, 17062592U, 17070016U, 17079488U, 17087936U, 17096512U, - 17104576U, 17113024U, 17121088U, 17129408U, 17136832U, 17145664U, 17152832U, - 17161792U, 17170112U, 17177792U, 17186368U, 17194304U, 17202496U, 17211328U, - 17218624U, 17227712U, 17233984U, 17243584U, 17251904U, 17259712U, 17266624U, - 17276608U, 17284672U, 17292224U, 17301056U, 17309632U, 17317568U, 17326016U, - 17333824U, 17342272U, 17350208U, 17358784U, 17366848U, 17374912U, 17382592U, - 17390656U, 17399488U, 17406784U, 17413952U, 17423936U, 17432512U, 17440448U, - 17447744U, 17456704U, 17464768U, 17472064U, 17481536U, 17489344U, 17495488U, - 17505728U, 17513792U, 17522368U, 17530816U, 17538112U, 17546944U, 17555264U, - 17563072U, 17569856U, 17579456U, 17587904U, 17596352U, 17603776U, 17611712U, - 17620672U, 17628992U, 17637184U, 17645504U, 17653568U, 17661632U, 17669824U, - 17677376U, 17686208U, 17693888U, 17702336U, 17710144U, 17718208U, 17726528U, - 17734336U, 17743808U, 17751872U, 17759936U, 17766592U, 17776448U, 17784512U, - 17791936U, 17801152U, 17809216U, 17817152U + 16776896U, 16907456U, 17039296U, 17170112U, 17301056U, 17432512U, 17563072U, + 17693888U, 17824192U, 17955904U, 18087488U, 18218176U, 18349504U, 18481088U, + 18611392U, 18742336U, 18874304U, 19004224U, 19135936U, 19267264U, 19398208U, + 19529408U, 19660096U, 19791424U, 19922752U, 20053952U, 20184896U, 20315968U, + 20446912U, 20576576U, 20709184U, 20840384U, 20971072U, 21102272U, 21233216U, + 21364544U, 21494848U, 21626816U, 21757376U, 21887552U, 22019392U, 22151104U, + 22281536U, 22412224U, 22543936U, 22675264U, 22806464U, 22935872U, 23068096U, + 23198272U, 23330752U, 23459008U, 23592512U, 23723968U, 23854912U, 23986112U, + 24116672U, 24247616U, 24378688U, 24509504U, 24640832U, 24772544U, 24903488U, + 25034432U, 25165376U, 25296704U, 25427392U, 25558592U, 25690048U, 25820096U, + 25951936U, 26081728U, 26214208U, 26345024U, 26476096U, 26606656U, 26737472U, + 26869184U, 26998208U, 27131584U, 27262528U, 27393728U, 27523904U, 27655744U, + 27786688U, 27917888U, 28049344U, 28179904U, 28311488U, 28441792U, 28573504U, + 28700864U, 28835648U, 28966208U, 29096768U, 29228608U, 29359808U, 29490752U, + 29621824U, 29752256U, 29882816U, 30014912U, 30144448U, 30273728U, 30406976U, + 30538432U, 30670784U, 30799936U, 30932672U, 31063744U, 31195072U, 31325248U, + 31456192U, 31588288U, 31719232U, 31850432U, 31981504U, 32110784U, 32243392U, + 32372672U, 32505664U, 32636608U, 32767808U, 32897344U, 33029824U, 33160768U, + 33289664U, 33423296U, 33554368U, 33683648U, 33816512U, 33947456U, 34076992U, + 34208704U, 34340032U, 34471744U, 34600256U, 34734016U, 34864576U, 34993984U, + 35127104U, 35258176U, 35386688U, 35518528U, 35650624U, 35782336U, 35910976U, + 36044608U, 36175808U, 36305728U, 36436672U, 36568384U, 36699968U, 36830656U, + 36961984U, 37093312U, 37223488U, 37355072U, 37486528U, 37617472U, 37747904U, + 37879232U, 38009792U, 38141888U, 38272448U, 38403392U, 38535104U, 38660672U, + 38795584U, 38925632U, 39059264U, 39190336U, 39320768U, 39452096U, 39581632U, + 39713984U, 39844928U, 39974848U, 40107968U, 40238144U, 40367168U, 40500032U, + 40631744U, 40762816U, 40894144U, 41023552U, 41155904U, 41286208U, 41418304U, + 41547712U, 41680448U, 41811904U, 41942848U, 42073792U, 42204992U, 42334912U, + 42467008U, 42597824U, 42729152U, 42860096U, 42991552U, 43122368U, 43253696U, + 43382848U, 43515712U, 43646912U, 43777088U, 43907648U, 44039104U, 44170432U, + 44302144U, 44433344U, 44564288U, 44694976U, 44825152U, 44956864U, 45088448U, + 45219008U, 45350464U, 45481024U, 45612608U, 45744064U, 45874496U, 46006208U, + 46136768U, 46267712U, 46399424U, 46529344U, 46660672U, 46791488U, 46923328U, + 47053504U, 47185856U, 47316928U, 47447872U, 47579072U, 47710144U, 47839936U, + 47971648U, 48103232U, 48234176U, 48365248U, 48496192U, 48627136U, 48757312U, + 48889664U, 49020736U, 49149248U, 49283008U, 49413824U, 49545152U, 49675712U, + 49807168U, 49938368U, 50069056U, 50200256U, 50331584U, 50462656U, 50593472U, + 50724032U, 50853952U, 50986048U, 51117632U, 51248576U, 51379904U, 51510848U, + 51641792U, 51773248U, 51903296U, 52035136U, 52164032U, 52297664U, 52427968U, + 52557376U, 52690112U, 52821952U, 52952896U, 53081536U, 53213504U, 53344576U, + 53475776U, 53608384U, 53738816U, 53870528U, 54000832U, 54131776U, 54263744U, + 54394688U, 54525248U, 54655936U, 54787904U, 54918592U, 55049152U, 55181248U, + 55312064U, 55442752U, 55574336U, 55705024U, 55836224U, 55967168U, 56097856U, + 56228672U, 56358592U, 56490176U, 56621888U, 56753728U, 56884928U, 57015488U, + 57146816U, 57278272U, 57409216U, 57540416U, 57671104U, 57802432U, 57933632U, + 58064576U, 58195264U, 58326976U, 58457408U, 58588864U, 58720192U, 58849984U, + 58981696U, 59113024U, 59243456U, 59375552U, 59506624U, 59637568U, 59768512U, + 59897792U, 60030016U, 60161984U, 60293056U, 60423872U, 60554432U, 60683968U, + 60817216U, 60948032U, 61079488U, 61209664U, 61341376U, 61471936U, 61602752U, + 61733696U, 61865792U, 61996736U, 62127808U, 62259136U, 62389568U, 62520512U, + 62651584U, 62781632U, 62910784U, 63045056U, 63176128U, 63307072U, 63438656U, + 63569216U, 63700928U, 63831616U, 63960896U, 64093888U, 64225088U, 64355392U, + 64486976U, 64617664U, 64748608U, 64879424U, 65009216U, 65142464U, 65273792U, + 65402816U, 65535424U, 65666752U, 65797696U, 65927744U, 66060224U, 66191296U, + 66321344U, 66453056U, 66584384U, 66715328U, 66846656U, 66977728U, 67108672U, + 67239104U, 67370432U, 67501888U, 67631296U, 67763776U, 67895104U, 68026304U, + 68157248U, 68287936U, 68419264U, 68548288U, 68681408U, 68811968U, 68942912U, + 69074624U, 69205568U, 69337024U, 69467584U, 69599168U, 69729472U, 69861184U, + 69989824U, 70122944U, 70253888U, 70385344U, 70515904U, 70647232U, 70778816U, + 70907968U, 71040832U, 71171648U, 71303104U, 71432512U, 71564992U, 71695168U, + 71826368U, 71958464U, 72089536U, 72219712U, 72350144U, 72482624U, 72613568U, + 72744512U, 72875584U, 73006144U, 73138112U, 73268672U, 73400128U, 73530944U, + 73662272U, 73793344U, 73924544U, 74055104U, 74185792U, 74316992U, 74448832U, + 74579392U, 74710976U, 74841664U, 74972864U, 75102784U, 75233344U, 75364544U, + 75497024U, 75627584U, 75759296U, 75890624U, 76021696U, 76152256U, 76283072U, + 76414144U, 76545856U, 76676672U, 76806976U, 76937792U, 77070016U, 77200832U, + 77331392U, 77462464U, 77593664U, 77725376U, 77856448U, 77987776U, 78118336U, + 78249664U, 78380992U, 78511424U, 78642496U, 78773056U, 78905152U, 79033664U, + 79166656U, 79297472U, 79429568U, 79560512U, 79690816U, 79822784U, 79953472U, + 80084672U, 80214208U, 80346944U, 80477632U, 80608576U, 80740288U, 80870848U, + 81002048U, 81133504U, 81264448U, 81395648U, 81525952U, 81657536U, 81786304U, + 81919808U, 82050112U, 82181312U, 82311616U, 82443968U, 82573376U, 82705984U, + 82835776U, 82967744U, 83096768U, 83230528U, 83359552U, 83491264U, 83622464U, + 83753536U, 83886016U, 84015296U, 84147776U, 84277184U, 84409792U, 84540608U, + 84672064U, 84803008U, 84934336U, 85065152U, 85193792U, 85326784U, 85458496U, + 85589312U, 85721024U, 85851968U, 85982656U, 86112448U, 86244416U, 86370112U, + 86506688U, 86637632U, 86769344U, 86900672U, 87031744U, 87162304U, 87293632U, + 87424576U, 87555392U, 87687104U, 87816896U, 87947968U, 88079168U, 88211264U, + 88341824U, 88473152U, 88603712U, 88735424U, 88862912U, 88996672U, 89128384U, + 89259712U, 89390272U, 89521984U, 89652544U, 89783872U, 89914816U, 90045376U, + 90177088U, 90307904U, 90438848U, 90569152U, 90700096U, 90832832U, 90963776U, + 91093696U, 91223744U, 91356992U, 91486784U, 91618496U, 91749824U, 91880384U, + 92012224U, 92143552U, 92273344U, 92405696U, 92536768U, 92666432U, 92798912U, + 92926016U, 93060544U, 93192128U, 93322816U, 93453632U, 93583936U, 93715136U, + 93845056U, 93977792U, 94109504U, 94240448U, 94371776U, 94501184U, 94632896U, + 94764224U, 94895552U, 95023424U, 95158208U, 95287744U, 95420224U, 95550016U, + 95681216U, 95811904U, 95943872U, 96075328U, 96203584U, 96337856U, 96468544U, + 96599744U, 96731072U, 96860992U, 96992576U, 97124288U, 97254848U, 97385536U, + 97517248U, 97647808U, 97779392U, 97910464U, 98041408U, 98172608U, 98303168U, + 98434496U, 98565568U, 98696768U, 98827328U, 98958784U, 99089728U, 99220928U, + 99352384U, 99482816U, 99614272U, 99745472U, 99876416U, 100007104U, + 100138048U, 100267072U, 100401088U, 100529984U, 100662592U, 100791872U, + 100925248U, 101056064U, 101187392U, 101317952U, 101449408U, 101580608U, + 101711296U, 101841728U, 101973824U, 102104896U, 102235712U, 102366016U, + 102498112U, 102628672U, 102760384U, 102890432U, 103021888U, 103153472U, + 103284032U, 103415744U, 103545152U, 103677248U, 103808576U, 103939648U, + 104070976U, 104201792U, 104332736U, 104462528U, 104594752U, 104725952U, + 104854592U, 104988608U, 105118912U, 105247808U, 105381184U, 105511232U, + 105643072U, 105774784U, 105903296U, 106037056U, 106167872U, 106298944U, + 106429504U, 106561472U, 106691392U, 106822592U, 106954304U, 107085376U, + 107216576U, 107346368U, 107478464U, 107609792U, 107739712U, 107872192U, + 108003136U, 108131392U, 108265408U, 108396224U, 108527168U, 108657344U, + 108789568U, 108920384U, 109049792U, 109182272U, 109312576U, 109444928U, + 109572928U, 109706944U, 109837888U, 109969088U, 110099648U, 110230976U, + 110362432U, 110492992U, 110624704U, 110755264U, 110886208U, 111017408U, + 111148864U, 111279296U, 111410752U, 111541952U, 111673024U, 111803456U, + 111933632U, 112066496U, 112196416U, 112328512U, 112457792U, 112590784U, + 112715968U, 112852672U, 112983616U, 113114944U, 113244224U, 113376448U, + 113505472U, 113639104U, 113770304U, 113901376U, 114031552U, 114163264U, + 114294592U, 114425536U, 114556864U, 114687424U, 114818624U, 114948544U, + 115080512U, 115212224U, 115343296U, 115473472U, 115605184U, 115736128U, + 115867072U, 115997248U, 116128576U, 116260288U, 116391488U, 116522944U, + 116652992U, 116784704U, 116915648U, 117046208U, 117178304U, 117308608U, + 117440192U, 117569728U, 117701824U, 117833024U, 117964096U, 118094656U, + 118225984U, 118357312U, 118489024U, 118617536U, 118749632U, 118882112U, + 119012416U, 119144384U, 119275328U, 119406016U, 119537344U, 119668672U, + 119798464U, 119928896U, 120061376U, 120192832U, 120321728U, 120454336U, + 120584512U, 120716608U, 120848192U, 120979136U, 121109056U, 121241408U, + 121372352U, 121502912U, 121634752U, 121764416U, 121895744U, 122027072U, + 122157632U, 122289088U, 122421184U, 122550592U, 122682944U, 122813888U, + 122945344U, 123075776U, 123207488U, 123338048U, 123468736U, 123600704U, + 123731264U, 123861952U, 123993664U, 124124608U, 124256192U, 124386368U, + 124518208U, 124649024U, 124778048U, 124911296U, 125041088U, 125173696U, + 125303744U, 125432896U, 125566912U, 125696576U, 125829056U, 125958592U, + 126090304U, 126221248U, 126352832U, 126483776U, 126615232U, 126746432U, + 126876608U, 127008704U, 127139392U, 127270336U, 127401152U, 127532224U, + 127663552U, 127794752U, 127925696U, 128055232U, 128188096U, 128319424U, + 128449856U, 128581312U, 128712256U, 128843584U, 128973632U, 129103808U, + 129236288U, 129365696U, 129498944U, 129629888U, 129760832U, 129892288U, + 130023104U, 130154048U, 130283968U, 130416448U, 130547008U, 130678336U, + 130807616U, 130939456U, 131071552U, 131202112U, 131331776U, 131464384U, + 131594048U, 131727296U, 131858368U, 131987392U, 132120256U, 132250816U, + 132382528U, 132513728U, 132644672U, 132774976U, 132905792U, 133038016U, + 133168832U, 133299392U, 133429312U, 133562048U, 133692992U, 133823296U, + 133954624U, 134086336U, 134217152U, 134348608U, 134479808U, 134607296U, + 134741056U, 134872384U, 135002944U, 135134144U, 135265472U, 135396544U, + 135527872U, 135659072U, 135787712U, 135921472U, 136052416U, 136182848U, + 136313792U, 136444864U, 136576448U, 136707904U, 136837952U, 136970048U, + 137099584U, 137232064U, 137363392U, 137494208U, 137625536U, 137755712U, + 137887424U, 138018368U, 138149824U, 138280256U, 138411584U, 138539584U, + 138672832U, 138804928U, 138936128U, 139066688U, 139196864U, 139328704U, + 139460032U, 139590208U, 139721024U, 139852864U, 139984576U, 140115776U, + 140245696U, 140376512U, 140508352U, 140640064U, 140769856U, 140902336U, + 141032768U, 141162688U, 141294016U, 141426496U, 141556544U, 141687488U, + 141819584U, 141949888U, 142080448U, 142212544U, 142342336U, 142474432U, + 142606144U, 142736192U, 142868288U, 142997824U, 143129408U, 143258944U, + 143392448U, 143523136U, 143653696U, 143785024U, 143916992U, 144045632U, + 144177856U, 144309184U, 144440768U, 144570688U, 144701888U, 144832448U, + 144965056U, 145096384U, 145227584U, 145358656U, 145489856U, 145620928U, + 145751488U, 145883072U, 146011456U, 146144704U, 146275264U, 146407232U, + 146538176U, 146668736U, 146800448U, 146931392U, 147062336U, 147193664U, + 147324224U, 147455936U, 147586624U, 147717056U, 147848768U, 147979456U, + 148110784U, 148242368U, 148373312U, 148503232U, 148635584U, 148766144U, + 148897088U, 149028416U, 149159488U, 149290688U, 149420224U, 149551552U, + 149683136U, 149814976U, 149943616U, 150076352U, 150208064U, 150338624U, + 150470464U, 150600256U, 150732224U, 150862784U, 150993088U, 151125952U, + 151254976U, 151388096U, 151519168U, 151649728U, 151778752U, 151911104U, + 152042944U, 152174144U, 152304704U, 152435648U, 152567488U, 152698816U, + 152828992U, 152960576U, 153091648U, 153222976U, 153353792U, 153484096U, + 153616192U, 153747008U, 153878336U, 154008256U, 154139968U, 154270912U, + 154402624U, 154533824U, 154663616U, 154795712U, 154926272U, 155057984U, + 155188928U, 155319872U, 155450816U, 155580608U, 155712064U, 155843392U, + 155971136U, 156106688U, 156237376U, 156367424U, 156499264U, 156630976U, + 156761536U, 156892352U, 157024064U, 157155008U, 157284416U, 157415872U, + 157545536U, 157677248U, 157810496U, 157938112U, 158071744U, 158203328U, + 158334656U, 158464832U, 158596288U, 158727616U, 158858048U, 158988992U, + 159121216U, 159252416U, 159381568U, 159513152U, 159645632U, 159776192U, + 159906496U, 160038464U, 160169536U, 160300352U, 160430656U, 160563008U, + 160693952U, 160822208U, 160956352U, 161086784U, 161217344U, 161349184U, + 161480512U, 161611456U, 161742272U, 161873216U, 162002752U, 162135872U, + 162266432U, 162397888U, 162529216U, 162660032U, 162790976U, 162922048U, + 163052096U, 163184576U, 163314752U, 163446592U, 163577408U, 163707968U, + 163839296U, 163969984U, 164100928U, 164233024U, 164364224U, 164494912U, + 164625856U, 164756672U, 164887616U, 165019072U, 165150016U, 165280064U, + 165412672U, 165543104U, 165674944U, 165805888U, 165936832U, 166067648U, + 166198336U, 166330048U, 166461248U, 166591552U, 166722496U, 166854208U, + 166985408U, 167116736U, 167246656U, 167378368U, 167508416U, 167641024U, + 167771584U, 167903168U, 168034112U, 168164032U, 168295744U, 168427456U, + 168557632U, 168688448U, 168819136U, 168951616U, 169082176U, 169213504U, + 169344832U, 169475648U, 169605952U, 169738048U, 169866304U, 169999552U, + 170131264U, 170262464U, 170393536U, 170524352U, 170655424U, 170782016U, + 170917696U, 171048896U, 171179072U, 171310784U, 171439936U, 171573184U, + 171702976U, 171835072U, 171966272U, 172097216U, 172228288U, 172359232U, + 172489664U, 172621376U, 172747712U, 172883264U, 173014208U, 173144512U, + 173275072U, 173407424U, 173539136U, 173669696U, 173800768U, 173931712U, + 174063424U, 174193472U, 174325696U, 174455744U, 174586816U, 174718912U, + 174849728U, 174977728U, 175109696U, 175242688U, 175374272U, 175504832U, + 175636288U, 175765696U, 175898432U, 176028992U, 176159936U, 176291264U, + 176422592U, 176552512U, 176684864U, 176815424U, 176946496U, 177076544U, + 177209152U, 177340096U, 177470528U, 177600704U, 177731648U, 177864256U, + 177994816U, 178126528U, 178257472U, 178387648U, 178518464U, 178650176U, + 178781888U, 178912064U, 179044288U, 179174848U, 179305024U, 179436736U, + 179568448U, 179698496U, 179830208U, 179960512U, 180092608U, 180223808U, + 180354752U, 180485696U, 180617152U, 180748096U, 180877504U, 181009984U, + 181139264U, 181272512U, 181402688U, 181532608U, 181663168U, 181795136U, + 181926592U, 182057536U, 182190016U, 182320192U, 182451904U, 182582336U, + 182713792U, 182843072U, 182976064U, 183107264U, 183237056U, 183368384U, + 183494848U, 183631424U, 183762752U, 183893824U, 184024768U, 184154816U, + 184286656U, 184417984U, 184548928U, 184680128U, 184810816U, 184941248U, + 185072704U, 185203904U, 185335616U, 185465408U, 185596352U, 185727296U, + 185859904U, 185989696U, 186121664U, 186252992U, 186383552U, 186514112U, + 186645952U, 186777152U, 186907328U, 187037504U, 187170112U, 187301824U, + 187429184U, 187562048U, 187693504U, 187825472U, 187957184U, 188087104U, + 188218304U, 188349376U, 188481344U, 188609728U, 188743616U, 188874304U, + 189005248U, 189136448U, 189265088U, 189396544U, 189528128U, 189660992U, + 189791936U, 189923264U, 190054208U, 190182848U, 190315072U, 190447424U, + 190577984U, 190709312U, 190840768U, 190971328U, 191102656U, 191233472U, + 191364032U, 191495872U, 191626816U, 191758016U, 191888192U, 192020288U, + 192148928U, 192282176U, 192413504U, 192542528U, 192674752U, 192805952U, + 192937792U, 193068608U, 193198912U, 193330496U, 193462208U, 193592384U, + 193723456U, 193854272U, 193985984U, 194116672U, 194247232U, 194379712U, + 194508352U, 194641856U, 194772544U, 194900672U, 195035072U, 195166016U, + 195296704U, 195428032U, 195558592U, 195690304U, 195818176U, 195952576U, + 196083392U, 196214336U, 196345792U, 196476736U, 196607552U, 196739008U, + 196869952U, 197000768U, 197130688U, 197262784U, 197394368U, 197523904U, + 197656384U, 197787584U, 197916608U, 198049472U, 198180544U, 198310208U, + 198442432U, 198573632U, 198705088U, 198834368U, 198967232U, 199097792U, + 199228352U, 199360192U, 199491392U, 199621696U, 199751744U, 199883968U, + 200014016U, 200146624U, 200276672U, 200408128U, 200540096U, 200671168U, + 200801984U, 200933312U, 201062464U, 201194944U, 201326144U, 201457472U, + 201588544U, 201719744U, 201850816U, 201981632U, 202111552U, 202244032U, + 202374464U, 202505152U, 202636352U, 202767808U, 202898368U, 203030336U, + 203159872U, 203292608U, 203423296U, 203553472U, 203685824U, 203816896U, + 203947712U, 204078272U, 204208192U, 204341056U, 204472256U, 204603328U, + 204733888U, 204864448U, 204996544U, 205125568U, 205258304U, 205388864U, + 205517632U, 205650112U, 205782208U, 205913536U, 206044736U, 206176192U, + 206307008U, 206434496U, 206569024U, 206700224U, 206831168U, 206961856U, + 207093056U, 207223616U, 207355328U, 207486784U, 207616832U, 207749056U, + 207879104U, 208010048U, 208141888U, 208273216U, 208404032U, 208534336U, + 208666048U, 208796864U, 208927424U, 209059264U, 209189824U, 209321792U, + 209451584U, 209582656U, 209715136U, 209845568U, 209976896U, 210106432U, + 210239296U, 210370112U, 210501568U, 210630976U, 210763712U, 210894272U, + 211024832U, 211156672U, 211287616U, 211418176U, 211549376U, 211679296U, + 211812032U, 211942592U, 212074432U, 212204864U, 212334016U, 212467648U, + 212597824U, 212727616U, 212860352U, 212991424U, 213120832U, 213253952U, + 213385024U, 213515584U, 213645632U, 213777728U, 213909184U, 214040128U, + 214170688U, 214302656U, 214433728U, 214564544U, 214695232U, 214826048U, + 214956992U, 215089088U, 215219776U, 215350592U, 215482304U, 215613248U, + 215743552U, 215874752U, 216005312U, 216137024U, 216267328U, 216399296U, + 216530752U, 216661696U, 216790592U, 216923968U, 217054528U, 217183168U, + 217316672U, 217448128U, 217579072U, 217709504U, 217838912U, 217972672U, + 218102848U, 218233024U, 218364736U, 218496832U, 218627776U, 218759104U, + 218888896U, 219021248U, 219151936U, 219281728U, 219413056U, 219545024U, + 219675968U, 219807296U, 219938624U, 220069312U, 220200128U, 220331456U, + 220461632U, 220592704U, 220725184U, 220855744U, 220987072U, 221117888U, + 221249216U, 221378368U, 221510336U, 221642048U, 221772736U, 221904832U, + 222031808U, 222166976U, 222297536U, 222428992U, 222559936U, 222690368U, + 222820672U, 222953152U, 223083968U, 223213376U, 223345984U, 223476928U, + 223608512U, 223738688U, 223869376U, 224001472U, 224132672U, 224262848U, + 224394944U, 224524864U, 224657344U, 224788288U, 224919488U, 225050432U, + 225181504U, 225312704U, 225443776U, 225574592U, 225704768U, 225834176U, + 225966784U, 226097216U, 226229824U, 226360384U, 226491712U, 226623424U, + 226754368U, 226885312U, 227015104U, 227147456U, 227278528U, 227409472U, + 227539904U, 227669696U, 227802944U, 227932352U, 228065216U, 228196288U, + 228326464U, 228457792U, 228588736U, 228720064U, 228850112U, 228981056U, + 229113152U, 229243328U, 229375936U, 229505344U, 229636928U, 229769152U, + 229894976U, 230030272U, 230162368U, 230292416U, 230424512U, 230553152U, + 230684864U, 230816704U, 230948416U, 231079616U, 231210944U, 231342016U, + 231472448U, 231603776U, 231733952U, 231866176U, 231996736U, 232127296U, + 232259392U, 232388672U, 232521664U, 232652608U, 232782272U, 232914496U, + 233043904U, 233175616U, 233306816U, 233438528U, 233569984U, 233699776U, + 233830592U, 233962688U, 234092224U, 234221888U, 234353984U, 234485312U, + 234618304U, 234749888U, 234880832U, 235011776U, 235142464U, 235274048U, + 235403456U, 235535936U, 235667392U, 235797568U, 235928768U, 236057152U, + 236190272U, 236322752U, 236453312U, 236583616U, 236715712U, 236846528U, + 236976448U, 237108544U, 237239104U, 237371072U, 237501632U, 237630784U, + 237764416U, 237895232U, 238026688U, 238157632U, 238286912U, 238419392U, + 238548032U, 238681024U, 238812608U, 238941632U, 239075008U, 239206336U, + 239335232U, 239466944U, 239599168U, 239730496U, 239861312U, 239992384U, + 240122816U, 240254656U, 240385856U, 240516928U, 240647872U, 240779072U, + 240909632U, 241040704U, 241171904U, 241302848U, 241433408U, 241565248U, + 241696192U, 241825984U, 241958848U, 242088256U, 242220224U, 242352064U, + 242481856U, 242611648U, 242744896U, 242876224U, 243005632U, 243138496U, + 243268672U, 243400384U, 243531712U, 243662656U, 243793856U, 243924544U, + 244054592U, 244187072U, 244316608U, 244448704U, 244580032U, 244710976U, + 244841536U, 244972864U, 245104448U, 245233984U, 245365312U, 245497792U, + 245628736U, 245759936U, 245889856U, 246021056U, 246152512U, 246284224U, + 246415168U, 246545344U, 246675904U, 246808384U, 246939584U, 247070144U, + 247199552U, 247331648U, 247463872U, 247593536U, 247726016U, 247857088U, + 247987648U, 248116928U, 248249536U, 248380736U, 248512064U, 248643008U, + 248773312U, 248901056U, 249036608U, 249167552U, 249298624U, 249429184U, + 249560512U, 249692096U, 249822784U, 249954112U, 250085312U, 250215488U, + 250345792U, 250478528U, 250608704U, 250739264U, 250870976U, 251002816U, + 251133632U, 251263552U, 251395136U, 251523904U, 251657792U, 251789248U, + 251919424U, 252051392U, 252182464U, 252313408U, 252444224U, 252575552U, + 252706624U, 252836032U, 252968512U, 253099712U, 253227584U, 253361728U, + 253493056U, 253623488U, 253754432U, 253885504U, 254017216U, 254148032U, + 254279488U, 254410432U, 254541376U, 254672576U, 254803264U, 254933824U, + 255065792U, 255196736U, 255326528U, 255458752U, 255589952U, 255721408U, + 255851072U, 255983296U, 256114624U, 256244416U, 256374208U, 256507712U, + 256636096U, 256768832U, 256900544U, 257031616U, 257162176U, 257294272U, + 257424448U, 257555776U, 257686976U, 257818432U, 257949632U, 258079552U, + 258211136U, 258342464U, 258473408U, 258603712U, 258734656U, 258867008U, + 258996544U, 259127744U, 259260224U, 259391296U, 259522112U, 259651904U, + 259784384U, 259915328U, 260045888U, 260175424U, 260308544U, 260438336U, + 260570944U, 260700992U, 260832448U, 260963776U, 261092672U, 261226304U, + 261356864U, 261487936U, 261619648U, 261750592U, 261879872U, 262011968U, + 262143424U, 262274752U, 262404416U, 262537024U, 262667968U, 262799296U, + 262928704U, 263061184U, 263191744U, 263322944U, 263454656U, 263585216U, + 263716672U, 263847872U, 263978944U, 264108608U, 264241088U, 264371648U, + 264501184U, 264632768U, 264764096U, 264895936U, 265024576U, 265158464U, + 265287488U, 265418432U, 265550528U, 265681216U, 265813312U, 265943488U, + 266075968U, 266206144U, 266337728U, 266468032U, 266600384U, 266731072U, + 266862272U, 266993344U, 267124288U, 267255616U, 267386432U, 267516992U, + 267648704U, 267777728U, 267910592U, 268040512U, 268172096U, 268302784U, + 268435264U, 268566208U, 268696256U, 268828096U, 268959296U, 269090368U, + 269221312U, 269352256U, 269482688U, 269614784U, 269745856U, 269876416U, + 270007616U, 270139328U, 270270272U, 270401216U, 270531904U, 270663616U, + 270791744U, 270924736U, 271056832U, 271186112U, 271317184U, 271449536U, + 271580992U, 271711936U, 271843136U, 271973056U, 272105408U, 272236352U, + 272367296U, 272498368U, 272629568U, 272759488U, 272891456U, 273022784U, + 273153856U, 273284672U, 273415616U, 273547072U, 273677632U, 273808448U, + 273937088U, 274071488U, 274200896U, 274332992U, 274463296U, 274595392U, + 274726208U, 274857536U, 274988992U, 275118656U, 275250496U, 275382208U, + 275513024U, 275643968U, 275775296U, 275906368U, 276037184U, 276167872U, + 276297664U, 276429376U, 276560576U, 276692672U, 276822976U, 276955072U, + 277085632U, 277216832U, 277347008U, 277478848U, 277609664U, 277740992U, + 277868608U, 278002624U, 278134336U, 278265536U, 278395328U, 278526784U, + 278657728U, 278789824U, 278921152U, 279052096U, 279182912U, 279313088U, + 279443776U, 279576256U, 279706048U, 279838528U, 279969728U, 280099648U, + 280230976U, 280361408U, 280493632U, 280622528U, 280755392U, 280887104U, + 281018176U, 281147968U, 281278912U, 281411392U, 281542592U, 281673152U, + 281803712U, 281935552U, 282066496U, 282197312U, 282329024U, 282458816U, + 282590272U, 282720832U, 282853184U, 282983744U, 283115072U, 283246144U, + 283377344U, 283508416U, 283639744U, 283770304U, 283901504U, 284032576U, + 284163136U, 284294848U, 284426176U, 284556992U, 284687296U, 284819264U, + 284950208U, 285081536U }; #ifdef __cplusplus diff --git a/ethash.h b/ethash.h index 6d8a69a0a..a7159de65 100644 --- a/ethash.h +++ b/ethash.h @@ -26,10 +26,11 @@ #include #include "compiler.h" -#define REVISION 22 +#define REVISION 23 #define DATASET_BYTES_INIT 1073741824U // 2**30 #define DATASET_BYTES_GROWTH 8388608U // 2**23 -#define CACHE_MULTIPLIER 1024 +#define CACHE_BYTES_INIT 1073741824U // 2**24 +#define CACHE_BYTES_GROWTH 131072U // 2**17 #define EPOCH_LENGTH 30000U #define MIX_BYTES 128 #define HASH_BYTES 64 From d7452447f6b1b4addd52e88fb69bfc04ec6caaae Mon Sep 17 00:00:00 2001 From: Tim Hughes Date: Fri, 13 Mar 2015 01:07:47 +0000 Subject: [PATCH 015/461] Fixes for OpenCL 1.1 --- internal.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal.h b/internal.h index bcbacdaa4..ddd06e8f4 100644 --- a/internal.h +++ b/internal.h @@ -3,7 +3,7 @@ #include "endian.h" #include "ethash.h" -#define ENABLE_SSE 1 +#define ENABLE_SSE 0 #if defined(_M_X64) && ENABLE_SSE #include From a3a47204a51015f66c866eff575ce037d79389fc Mon Sep 17 00:00:00 2001 From: chriseth Date: Mon, 23 Mar 2015 17:39:15 +0100 Subject: [PATCH 016/461] Sizes hold values with more than 32 bits and thus should not be size_t. --- data_sizes.h | 4 ++-- ethash.h | 8 ++++---- internal.c | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/data_sizes.h b/data_sizes.h index 3b747b3ea..cf52ae4f8 100644 --- a/data_sizes.h +++ b/data_sizes.h @@ -48,7 +48,7 @@ extern "C" { // Sow[i*HashBytes]; j++]]]][[2]][[1]] -static const size_t dag_sizes[2048] = { +static const uint64_t dag_sizes[2048] = { 1073739904U, 1082130304U, 1090514816U, 1098906752U, 1107293056U, 1115684224U, 1124070016U, 1132461952U, 1140849536U, 1149232768U, 1157627776U, 1166013824U, 1174404736U, 1182786944U, 1191180416U, @@ -477,7 +477,7 @@ static const size_t dag_sizes[2048] = { // While[! PrimeQ[i], i--]; // Sow[i*HashBytes]; j++]]]][[2]][[1]] -const size_t cache_sizes[2048] = { +const uint64_t cache_sizes[2048] = { 16776896U, 16907456U, 17039296U, 17170112U, 17301056U, 17432512U, 17563072U, 17693888U, 17824192U, 17955904U, 18087488U, 18218176U, 18349504U, 18481088U, 18611392U, 18742336U, 18874304U, 19004224U, 19135936U, 19267264U, 19398208U, diff --git a/ethash.h b/ethash.h index a7159de65..b5ea8113c 100644 --- a/ethash.h +++ b/ethash.h @@ -43,8 +43,8 @@ extern "C" { #endif typedef struct ethash_params { - size_t full_size; // Size of full data set (in bytes, multiple of mix size (128)). - size_t cache_size; // Size of compute cache (in bytes, multiple of node size (64)). + uint64_t full_size; // Size of full data set (in bytes, multiple of mix size (128)). + uint64_t cache_size; // Size of compute cache (in bytes, multiple of node size (64)). } ethash_params; typedef struct ethash_return_value { @@ -52,8 +52,8 @@ typedef struct ethash_return_value { uint8_t mix_hash[32]; } ethash_return_value; -size_t ethash_get_datasize(const uint32_t block_number); -size_t ethash_get_cachesize(const uint32_t block_number); +uint64_t ethash_get_datasize(const uint32_t block_number); +uint64_t ethash_get_cachesize(const uint32_t block_number); // initialize the parameters static inline void ethash_params_init(ethash_params *params, const uint32_t block_number) { diff --git a/internal.c b/internal.c index 0a7e767e7..fed865094 100644 --- a/internal.c +++ b/internal.c @@ -37,12 +37,12 @@ #include "sha3.h" #endif // WITH_CRYPTOPP -size_t ethash_get_datasize(const uint32_t block_number) { +uint64_t ethash_get_datasize(const uint32_t block_number) { assert(block_number / EPOCH_LENGTH < 2048); return dag_sizes[block_number / EPOCH_LENGTH]; } -size_t ethash_get_cachesize(const uint32_t block_number) { +uint64_t ethash_get_cachesize(const uint32_t block_number) { assert(block_number / EPOCH_LENGTH < 2048); return cache_sizes[block_number / EPOCH_LENGTH]; } From 43b7db8220f108e4187815700abd75136473f4a2 Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Tue, 24 Mar 2015 17:38:12 +0100 Subject: [PATCH 017/461] Adding io.h and io_posix.c - DAG and memo file creation will now be taken care of in libethash itself. - To that end we crete a very minimal IO module for ethash. - Depending on the target system io_posix or io_win32 will be used. - Implemented ethash_io_prepare() for posix --- CMakeLists.txt | 6 ++++ io.h | 53 ++++++++++++++++++++++++++++++++ io_posix.c | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 141 insertions(+) create mode 100644 io.h create mode 100644 io_posix.c diff --git a/CMakeLists.txt b/CMakeLists.txt index 38fc821c0..9287cb70b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -19,6 +19,12 @@ set(FILES util.c fnv.h data_sizes.h) +if (MSVC) + list(APPEND FILES io_win32.c) +else() + list(APPEND FILES io_posix.c) +endif() + if (NOT CRYPTOPP_FOUND) find_package(CryptoPP 5.6.2) endif() diff --git a/io.h b/io.h new file mode 100644 index 000000000..55fea239e --- /dev/null +++ b/io.h @@ -0,0 +1,53 @@ +/* + This file is part of ethash. + + ethash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ethash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with ethash. If not, see . +*/ +/** @file io.h + * @author Lefteris Karapetsas + * @date 2015 + */ +#pragma once +#include +#include +#include +#include "ethash.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Prepares io for ethash + * @param dirname A null terminated c-string of the path of the ethash + * data directory. If it does not exist it's created. + * @param block_number The current block number. Used in seedhash calculation. + * @returns True if all went fine, and false if there was any kind + * of error + */ +bool ethash_io_prepare(char const *dirname, uint32_t block_number); +void ethash_io_write(); +static inline void ethash_io_serialize_info(uint32_t revision, + uint32_t block_number, + char *output) +{ + // if .info is only consumed locally we don't really care about endianess + memcpy(output, &revision, 4); + ethash_get_seedhash((uint8_t*)(output + 4), block_number); +} + + +#ifdef __cplusplus +} +#endif diff --git a/io_posix.c b/io_posix.c new file mode 100644 index 000000000..2944aeb37 --- /dev/null +++ b/io_posix.c @@ -0,0 +1,82 @@ +/* + This file is part of ethash. + + ethash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ethash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with ethash. If not, see . +*/ +/** @file io_posix.c + * @author Lefteris Karapetsas + * @date 2015 + */ +#include "io.h" +#include +#include +#include +#include +#include +#include +#include + +static const char DAG_FILE_NAME[] = "full"; +static const char DAG_MEMO_NAME[] = "full.info"; +static const unsigned int DAG_MEMO_BYTESIZE = 36; + +bool ethash_io_prepare(char const *dirname, uint32_t block_number) +{ + char read_buffer[DAG_MEMO_BYTESIZE]; + char expect_buffer[DAG_MEMO_BYTESIZE]; + bool ret = false; + + // assert directory exists, full owner permissions and read/search for others + int rc = mkdir(dirname, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH); + if (rc == -1 && errno != EEXIST) { + goto end; + } + + // try to open memo file + char *memofile = malloc(strlen(dirname) + sizeof(DAG_MEMO_NAME)); + if (!memofile) { + goto end; + } + + FILE *f = fopen(memofile, "rb"); + if (!f) { + // file does not exist, so no checking happens. All is fine. + ret = true; + goto free_memo; + } + + if (fread(read_buffer, 1, DAG_MEMO_BYTESIZE, f) != DAG_MEMO_BYTESIZE) { + goto free_memo; + } + + ethash_io_serialize_info(REVISION, block_number, expect_buffer); + if (memcmp(read_buffer, expect_buffer, DAG_MEMO_BYTESIZE) != 0) { + // we have different memo contents so delete the memo file + if (unlink(memofile) != 0) { + goto free_memo; + } + } + + ret = true; + +free_memo: + free(memofile); +end: + return ret; +} + +void ethash_io_write() +{ +} + From 383865e1914284db8089051701655552286fe68d Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Wed, 25 Mar 2015 13:28:50 +0100 Subject: [PATCH 018/461] ethash_io_write and win32 specific code - adding ethash_io_write() function - only ethash_io_prepare() invoke system dependent functions so it's the only one going in system specific source files. --- CMakeLists.txt | 1 + io.c | 92 ++++++++++++++++++++++++++++++++++++++++++++++++++ io.h | 64 ++++++++++++++++++++++++++++++++--- io_posix.c | 30 +++++++--------- io_win32.c | 73 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 238 insertions(+), 22 deletions(-) create mode 100644 io.c create mode 100644 io_win32.c diff --git a/CMakeLists.txt b/CMakeLists.txt index 9287cb70b..c92240086 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,6 +12,7 @@ endif() set(FILES util.c util.h + io.c internal.c ethash.h endian.h diff --git a/io.c b/io.c new file mode 100644 index 000000000..c28047bb2 --- /dev/null +++ b/io.c @@ -0,0 +1,92 @@ +/* + This file is part of ethash. + + ethash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ethash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with ethash. If not, see . +*/ +/** @file io.c + * @author Lefteris Karapetsas + * @date 2015 + */ +#include "io.h" +#include +#include + +// silly macro to save some typing +#define PASS_ARR(c_) (c_), sizeof(c_) + +static bool ethash_io_write_file(char const *dirname, + char const* filename, + size_t filename_length, + void const* data, + size_t data_size) +{ + bool ret = false; + char *fullname = ethash_io_create_filename(dirname, filename, filename_length); + if (!fullname) { + return false; + } + FILE *f = fopen(fullname, "wb"); + if (!f) { + goto free_name; + } + if (data_size != fwrite(data, 1, data_size, f)) { + goto close; + } + + ret = true; +close: + fclose(f); +free_name: + free(fullname); + return ret; +} + +bool ethash_io_write(char const *dirname, + uint32_t block_number, + void const* cache, + uint8_t **data, + size_t *data_size) +{ + ethash_params p; + char info_buffer[DAG_MEMO_BYTESIZE]; + + p.cache_size = ethash_get_cachesize(block_number); + p.full_size = ethash_get_datasize(block_number); + // allocate the bytes + uint8_t *temp_data_ptr = malloc(p.full_size); + if (!(*temp_data_ptr)) { + goto end; + } + ethash_prep_full(temp_data_ptr, &p, cache); + + if (!ethash_io_write_file(dirname, PASS_ARR(DAG_FILE_NAME), temp_data_ptr, p.full_size)) { + goto fail_free; + } + + ethash_io_serialize_info(REVISION, block_number, info_buffer); + if (!ethash_io_write_file(dirname, PASS_ARR(DAG_MEMO_NAME), info_buffer, DAG_MEMO_BYTESIZE)) { + goto fail_free; + } + + *data = temp_data_ptr; + *data_size = p.full_size; + return true; + +fail_free: + free(temp_data_ptr); +end: + return false; +} + +#undef PASS_ARR diff --git a/io.h b/io.h index 55fea239e..82e910713 100644 --- a/io.h +++ b/io.h @@ -28,16 +28,57 @@ extern "C" { #endif +static const char DAG_FILE_NAME[] = "full"; +static const char DAG_MEMO_NAME[] = "full.info"; +static const unsigned int DAG_MEMO_BYTESIZE = 36; + +/// Possible return values of @see ethash_io_prepare +enum ethash_io_rc { + ETHASH_IO_FAIL = 0, ///< There has been an IO failure + ETHASH_IO_MEMO_MISMATCH, ///< Memo file either did not exist or there was content mismatch + ETHASH_IO_MEMO_MATCH, ///< Memo file existed and contents matched. No need to do anything +}; + /** * Prepares io for ethash + * + * Create the DAG directory if it does not exist, and check if the memo file matches. + * If it does not match then it's deleted to pave the way for @ref ethash_io_write() + * * @param dirname A null terminated c-string of the path of the ethash * data directory. If it does not exist it's created. * @param block_number The current block number. Used in seedhash calculation. - * @returns True if all went fine, and false if there was any kind - * of error + * @return For possible return values @see enum ethash_io_rc */ -bool ethash_io_prepare(char const *dirname, uint32_t block_number); -void ethash_io_write(); +enum ethash_io_rc ethash_io_prepare(char const *dirname, uint32_t block_number); +/** + * Fully computes data and writes it to the file on disk. + * + * This function should be called after @see ethash_io_prepare() and only if + * its return value is @c ETHASH_IO_MEMO_MISMATCH. Will write both the full data + * and the memo file. + * + * @param[in] dirname A null terminated c-string of the path of the ethash + * data directory. Has to exist. + * @param[in] block_number The current block number. + * @param[in] cache The cache data. Would have usually been calulated by + * @see ethash_prep_light(). + * @param[out] data Pass a pointer to uint8_t by reference here. If the + * function is succesfull then this point to the allocated + * data calculated by @see ethash_prep_full(). Memory + * ownership is transfered to the callee. Remember that + * you eventually need to free this with a call to free(). + * @param[out] data_size Pass a size_t by value. If the function is succesfull + * then this will contain the number of bytes allocated + * for @a data. + * @return True for success and false in case of failure. + */ +bool ethash_io_write(char const *dirname, + uint32_t block_number, + void const* cache, + uint8_t **data, + size_t *data_size); + static inline void ethash_io_serialize_info(uint32_t revision, uint32_t block_number, char *output) @@ -47,6 +88,21 @@ static inline void ethash_io_serialize_info(uint32_t revision, ethash_get_seedhash((uint8_t*)(output + 4), block_number); } +static inline char *ethash_io_create_filename(char const *dirname, + char const* filename, + size_t filename_length) +{ + char *name = malloc(strlen(dirname) + filename_length); + if (!name) { + return NULL; + } + + name[0] = '\0'; + strcat(name, dirname); + strcat(name, filename); + return name; +} + #ifdef __cplusplus } diff --git a/io_posix.c b/io_posix.c index 2944aeb37..5eeedf199 100644 --- a/io_posix.c +++ b/io_posix.c @@ -18,24 +18,20 @@ * @author Lefteris Karapetsas * @date 2015 */ + #include "io.h" #include #include #include #include -#include #include #include -static const char DAG_FILE_NAME[] = "full"; -static const char DAG_MEMO_NAME[] = "full.info"; -static const unsigned int DAG_MEMO_BYTESIZE = 36; - -bool ethash_io_prepare(char const *dirname, uint32_t block_number) +enum ethash_io_rc ethash_io_prepare(char const *dirname, uint32_t block_number) { char read_buffer[DAG_MEMO_BYTESIZE]; char expect_buffer[DAG_MEMO_BYTESIZE]; - bool ret = false; + enum ethash_io_rc ret = ETHASH_IO_FAIL; // assert directory exists, full owner permissions and read/search for others int rc = mkdir(dirname, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH); @@ -43,40 +39,38 @@ bool ethash_io_prepare(char const *dirname, uint32_t block_number) goto end; } - // try to open memo file - char *memofile = malloc(strlen(dirname) + sizeof(DAG_MEMO_NAME)); + char *memofile = ethash_io_create_filename(dirname, DAG_MEMO_NAME, sizeof(DAG_MEMO_NAME)); if (!memofile) { goto end; } + // try to open memo file FILE *f = fopen(memofile, "rb"); if (!f) { // file does not exist, so no checking happens. All is fine. - ret = true; + ret = ETHASH_IO_MEMO_MISMATCH; goto free_memo; } if (fread(read_buffer, 1, DAG_MEMO_BYTESIZE, f) != DAG_MEMO_BYTESIZE) { - goto free_memo; + goto close; } ethash_io_serialize_info(REVISION, block_number, expect_buffer); if (memcmp(read_buffer, expect_buffer, DAG_MEMO_BYTESIZE) != 0) { // we have different memo contents so delete the memo file if (unlink(memofile) != 0) { - goto free_memo; + ret = ETHASH_IO_MEMO_MISMATCH; + goto close; } } - ret = true; + ret = ETHASH_IO_MEMO_MATCH; +close: + fclose(f); free_memo: free(memofile); end: return ret; } - -void ethash_io_write() -{ -} - diff --git a/io_win32.c b/io_win32.c new file mode 100644 index 000000000..8e99321bc --- /dev/null +++ b/io_win32.c @@ -0,0 +1,73 @@ +/* + This file is part of ethash. + + ethash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ethash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with ethash. If not, see . +*/ +/** @file io_win32.c + * @author Lefteris Karapetsas + * @date 2015 + */ + +#include "io.h" +#include +#include +#include + +enum ethash_io_rc ethash_io_prepare(char const *dirname, uint32_t block_number) +{ + char read_buffer[DAG_MEMO_BYTESIZE]; + char expect_buffer[DAG_MEMO_BYTESIZE]; + enum ethash_io_rc ret = ETHASH_IO_FAIL; + + // assert directory exists + int rc = _mkdir(dirname); + if (rc == -1 && errno != EEXIST) { + goto end; + } + + char *memofile = ethash_io_create_filename(dirname, DAG_MEMO_NAME, sizeof(DAG_MEMO_NAME)); + if (!memofile) { + goto end; + } + + // try to open memo file + FILE *f = fopen(memofile, "rb"); + if (!f) { + // file does not exist, so no checking happens. All is fine. + ret = ETHASH_IO_MEMO_MISMATCH; + goto free_memo; + } + + if (fread(read_buffer, 1, DAG_MEMO_BYTESIZE, f) != DAG_MEMO_BYTESIZE) { + goto close; + } + + ethash_io_serialize_info(REVISION, block_number, expect_buffer); + if (memcmp(read_buffer, expect_buffer, DAG_MEMO_BYTESIZE) != 0) { + // we have different memo contents so delete the memo file + if (_unlink(memofile) != 0) { + ret = ETHASH_IO_MEMO_MISMATCH; + goto close; + } + } + + ret = ETHASH_IO_MEMO_MATCH; + +close: + fclose(f); +free_memo: + free(memofile); +end: + return ret; +} From 219e8e982531aebfc641aaed87d096e563d4cd01 Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Wed, 25 Mar 2015 16:56:50 +0100 Subject: [PATCH 019/461] Correct return value in memofile mismatch --- io_posix.c | 2 +- io_win32.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/io_posix.c b/io_posix.c index 5eeedf199..611d4bf63 100644 --- a/io_posix.c +++ b/io_posix.c @@ -60,9 +60,9 @@ enum ethash_io_rc ethash_io_prepare(char const *dirname, uint32_t block_number) if (memcmp(read_buffer, expect_buffer, DAG_MEMO_BYTESIZE) != 0) { // we have different memo contents so delete the memo file if (unlink(memofile) != 0) { - ret = ETHASH_IO_MEMO_MISMATCH; goto close; } + ret = ETHASH_IO_MEMO_MISMATCH; } ret = ETHASH_IO_MEMO_MATCH; diff --git a/io_win32.c b/io_win32.c index 8e99321bc..7b4f80818 100644 --- a/io_win32.c +++ b/io_win32.c @@ -57,9 +57,9 @@ enum ethash_io_rc ethash_io_prepare(char const *dirname, uint32_t block_number) if (memcmp(read_buffer, expect_buffer, DAG_MEMO_BYTESIZE) != 0) { // we have different memo contents so delete the memo file if (_unlink(memofile) != 0) { - ret = ETHASH_IO_MEMO_MISMATCH; goto close; } + ret = ETHASH_IO_MEMO_MISMATCH; } ret = ETHASH_IO_MEMO_MATCH; From ab389898bd8e4f1cb682426e2eae26843a87b56b Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Wed, 25 Mar 2015 17:32:53 +0100 Subject: [PATCH 020/461] ethash_io_prepare takes seedhash as an argument - Also typedefing a blockhash (uint8_t[32]) as an ethash_blockhash_t --- io.c | 4 +++- io.h | 10 ++++++---- io_posix.c | 4 ++-- io_win32.c | 4 ++-- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/io.c b/io.c index c28047bb2..5d40b711c 100644 --- a/io.c +++ b/io.c @@ -60,6 +60,7 @@ bool ethash_io_write(char const *dirname, { ethash_params p; char info_buffer[DAG_MEMO_BYTESIZE]; + ethash_blockhash_t seedhash; p.cache_size = ethash_get_cachesize(block_number); p.full_size = ethash_get_datasize(block_number); @@ -74,7 +75,8 @@ bool ethash_io_write(char const *dirname, goto fail_free; } - ethash_io_serialize_info(REVISION, block_number, info_buffer); + ethash_get_seedhash((uint8_t*)&seedhash, block_number); + ethash_io_serialize_info(REVISION, seedhash, info_buffer); if (!ethash_io_write_file(dirname, PASS_ARR(DAG_MEMO_NAME), info_buffer, DAG_MEMO_BYTESIZE)) { goto fail_free; } diff --git a/io.h b/io.h index 82e910713..a7912c5ca 100644 --- a/io.h +++ b/io.h @@ -28,6 +28,8 @@ extern "C" { #endif +typedef struct ethash_blockhash { uint8_t b[32]; } ethash_blockhash_t; + static const char DAG_FILE_NAME[] = "full"; static const char DAG_MEMO_NAME[] = "full.info"; static const unsigned int DAG_MEMO_BYTESIZE = 36; @@ -47,10 +49,10 @@ enum ethash_io_rc { * * @param dirname A null terminated c-string of the path of the ethash * data directory. If it does not exist it's created. - * @param block_number The current block number. Used in seedhash calculation. + * @param seedhash The seedhash of the current block number * @return For possible return values @see enum ethash_io_rc */ -enum ethash_io_rc ethash_io_prepare(char const *dirname, uint32_t block_number); +enum ethash_io_rc ethash_io_prepare(char const *dirname, ethash_blockhash_t seedhash); /** * Fully computes data and writes it to the file on disk. * @@ -80,12 +82,12 @@ bool ethash_io_write(char const *dirname, size_t *data_size); static inline void ethash_io_serialize_info(uint32_t revision, - uint32_t block_number, + ethash_blockhash_t seed_hash, char *output) { // if .info is only consumed locally we don't really care about endianess memcpy(output, &revision, 4); - ethash_get_seedhash((uint8_t*)(output + 4), block_number); + memcpy(output + 4, &seed_hash, 32); } static inline char *ethash_io_create_filename(char const *dirname, diff --git a/io_posix.c b/io_posix.c index 611d4bf63..693bdf750 100644 --- a/io_posix.c +++ b/io_posix.c @@ -27,7 +27,7 @@ #include #include -enum ethash_io_rc ethash_io_prepare(char const *dirname, uint32_t block_number) +enum ethash_io_rc ethash_io_prepare(char const *dirname, ethash_blockhash_t seedhash) { char read_buffer[DAG_MEMO_BYTESIZE]; char expect_buffer[DAG_MEMO_BYTESIZE]; @@ -56,7 +56,7 @@ enum ethash_io_rc ethash_io_prepare(char const *dirname, uint32_t block_number) goto close; } - ethash_io_serialize_info(REVISION, block_number, expect_buffer); + ethash_io_serialize_info(REVISION, seedhash, expect_buffer); if (memcmp(read_buffer, expect_buffer, DAG_MEMO_BYTESIZE) != 0) { // we have different memo contents so delete the memo file if (unlink(memofile) != 0) { diff --git a/io_win32.c b/io_win32.c index 7b4f80818..2cabc939a 100644 --- a/io_win32.c +++ b/io_win32.c @@ -24,7 +24,7 @@ #include #include -enum ethash_io_rc ethash_io_prepare(char const *dirname, uint32_t block_number) +enum ethash_io_rc ethash_io_prepare(char const *dirname, ethash_blockhash_t seedhash) { char read_buffer[DAG_MEMO_BYTESIZE]; char expect_buffer[DAG_MEMO_BYTESIZE]; @@ -53,7 +53,7 @@ enum ethash_io_rc ethash_io_prepare(char const *dirname, uint32_t block_number) goto close; } - ethash_io_serialize_info(REVISION, block_number, expect_buffer); + ethash_io_serialize_info(REVISION, seedhash, expect_buffer); if (memcmp(read_buffer, expect_buffer, DAG_MEMO_BYTESIZE) != 0) { // we have different memo contents so delete the memo file if (_unlink(memofile) != 0) { From e4c695f37e0325332bd50c0819e964049310652e Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Wed, 25 Mar 2015 18:31:23 +0100 Subject: [PATCH 021/461] Style fixes --- io.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/io.c b/io.c index 5d40b711c..e7e047faa 100644 --- a/io.c +++ b/io.c @@ -62,11 +62,11 @@ bool ethash_io_write(char const *dirname, char info_buffer[DAG_MEMO_BYTESIZE]; ethash_blockhash_t seedhash; - p.cache_size = ethash_get_cachesize(block_number); - p.full_size = ethash_get_datasize(block_number); + p.cache_size = ethash_get_cachesize(block_number); + p.full_size = ethash_get_datasize(block_number); // allocate the bytes uint8_t *temp_data_ptr = malloc(p.full_size); - if (!(*temp_data_ptr)) { + if (!*temp_data_ptr) { goto end; } ethash_prep_full(temp_data_ptr, &p, cache); From 68f20ca817aa03894d0176ab81bb0a05b735ad0c Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Mon, 30 Mar 2015 12:21:21 +0200 Subject: [PATCH 022/461] Recovering lost commit after rebase - adding back the tests for ethash_io - adding back the travis configuration changes - minor changes to make everything work --- io.c | 19 +++++++------------ io.h | 10 +++++++--- 2 files changed, 14 insertions(+), 15 deletions(-) diff --git a/io.c b/io.c index e7e047faa..dd4f1f9e8 100644 --- a/io.c +++ b/io.c @@ -53,36 +53,31 @@ free_name: } bool ethash_io_write(char const *dirname, - uint32_t block_number, + ethash_params const* params, + ethash_blockhash_t seedhash, void const* cache, uint8_t **data, size_t *data_size) { - ethash_params p; char info_buffer[DAG_MEMO_BYTESIZE]; - ethash_blockhash_t seedhash; - - p.cache_size = ethash_get_cachesize(block_number); - p.full_size = ethash_get_datasize(block_number); // allocate the bytes - uint8_t *temp_data_ptr = malloc(p.full_size); - if (!*temp_data_ptr) { + uint8_t *temp_data_ptr = malloc(params->full_size); + if (!temp_data_ptr) { goto end; } - ethash_prep_full(temp_data_ptr, &p, cache); + ethash_compute_full_data(temp_data_ptr, params, cache); - if (!ethash_io_write_file(dirname, PASS_ARR(DAG_FILE_NAME), temp_data_ptr, p.full_size)) { + if (!ethash_io_write_file(dirname, PASS_ARR(DAG_FILE_NAME), temp_data_ptr, params->full_size)) { goto fail_free; } - ethash_get_seedhash((uint8_t*)&seedhash, block_number); ethash_io_serialize_info(REVISION, seedhash, info_buffer); if (!ethash_io_write_file(dirname, PASS_ARR(DAG_MEMO_NAME), info_buffer, DAG_MEMO_BYTESIZE)) { goto fail_free; } *data = temp_data_ptr; - *data_size = p.full_size; + *data_size = params->full_size; return true; fail_free: diff --git a/io.h b/io.h index a7912c5ca..e4cc1d795 100644 --- a/io.h +++ b/io.h @@ -62,7 +62,9 @@ enum ethash_io_rc ethash_io_prepare(char const *dirname, ethash_blockhash_t seed * * @param[in] dirname A null terminated c-string of the path of the ethash * data directory. Has to exist. - * @param[in] block_number The current block number. + * @param[in] params An ethash_params object containing the full size + * and the cache size + * @param[in] seedhash The seedhash of the current block number * @param[in] cache The cache data. Would have usually been calulated by * @see ethash_prep_light(). * @param[out] data Pass a pointer to uint8_t by reference here. If the @@ -76,7 +78,8 @@ enum ethash_io_rc ethash_io_prepare(char const *dirname, ethash_blockhash_t seed * @return True for success and false in case of failure. */ bool ethash_io_write(char const *dirname, - uint32_t block_number, + ethash_params const* params, + ethash_blockhash_t seedhash, void const* cache, uint8_t **data, size_t *data_size); @@ -94,7 +97,8 @@ static inline char *ethash_io_create_filename(char const *dirname, char const* filename, size_t filename_length) { - char *name = malloc(strlen(dirname) + filename_length); + // in C the cast is not needed, but a C++ compiler will complain for invalid conversion + char *name = (char*)malloc(strlen(dirname) + filename_length); if (!name) { return NULL; } From 206bfe29cf9dd631a5efc5b85e2f069f3accd714 Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Mon, 30 Mar 2015 16:43:23 +0200 Subject: [PATCH 023/461] Fixing build for msvc --- io.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/io.h b/io.h index e4cc1d795..0fa292362 100644 --- a/io.h +++ b/io.h @@ -32,7 +32,8 @@ typedef struct ethash_blockhash { uint8_t b[32]; } ethash_blockhash_t; static const char DAG_FILE_NAME[] = "full"; static const char DAG_MEMO_NAME[] = "full.info"; -static const unsigned int DAG_MEMO_BYTESIZE = 36; +// MSVC thinks that "static const unsigned int" is not a compile time variable. Sorry for the #define :( +#define DAG_MEMO_BYTESIZE 36 /// Possible return values of @see ethash_io_prepare enum ethash_io_rc { From 90fe9cdc62ab372bcee7f3f6a7cedcd63f2e036a Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Tue, 31 Mar 2015 15:16:26 +0200 Subject: [PATCH 024/461] various fixes in the code for the msvc build to work --- io.c | 6 +++--- io.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/io.c b/io.c index dd4f1f9e8..5a8eebae5 100644 --- a/io.c +++ b/io.c @@ -57,17 +57,17 @@ bool ethash_io_write(char const *dirname, ethash_blockhash_t seedhash, void const* cache, uint8_t **data, - size_t *data_size) + uint64_t *data_size) { char info_buffer[DAG_MEMO_BYTESIZE]; // allocate the bytes - uint8_t *temp_data_ptr = malloc(params->full_size); + uint8_t *temp_data_ptr = malloc((size_t)params->full_size); if (!temp_data_ptr) { goto end; } ethash_compute_full_data(temp_data_ptr, params, cache); - if (!ethash_io_write_file(dirname, PASS_ARR(DAG_FILE_NAME), temp_data_ptr, params->full_size)) { + if (!ethash_io_write_file(dirname, PASS_ARR(DAG_FILE_NAME), temp_data_ptr, (size_t)params->full_size)) { goto fail_free; } diff --git a/io.h b/io.h index 0fa292362..dd611754d 100644 --- a/io.h +++ b/io.h @@ -73,7 +73,7 @@ enum ethash_io_rc ethash_io_prepare(char const *dirname, ethash_blockhash_t seed * data calculated by @see ethash_prep_full(). Memory * ownership is transfered to the callee. Remember that * you eventually need to free this with a call to free(). - * @param[out] data_size Pass a size_t by value. If the function is succesfull + * @param[out] data_size Pass a uint64_t by value. If the function is succesfull * then this will contain the number of bytes allocated * for @a data. * @return True for success and false in case of failure. @@ -83,7 +83,7 @@ bool ethash_io_write(char const *dirname, ethash_blockhash_t seedhash, void const* cache, uint8_t **data, - size_t *data_size); + uint64_t *data_size); static inline void ethash_io_serialize_info(uint32_t revision, ethash_blockhash_t seed_hash, From 8e2f9a3ea46d40d695d61d94ca925a93e2e40b92 Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Thu, 26 Mar 2015 13:18:16 +0100 Subject: [PATCH 025/461] ethash_io tests and bug fixes - Adding tests for the functionality offered by ethash_io - ethash_io_write() now accepts ethash_params and seedhash instead of a block number. This is for better modularity but first and foremost for testability via unit tests --- io.h | 1 + 1 file changed, 1 insertion(+) diff --git a/io.h b/io.h index dd611754d..80e45c669 100644 --- a/io.h +++ b/io.h @@ -54,6 +54,7 @@ enum ethash_io_rc { * @return For possible return values @see enum ethash_io_rc */ enum ethash_io_rc ethash_io_prepare(char const *dirname, ethash_blockhash_t seedhash); + /** * Fully computes data and writes it to the file on disk. * From 6d244fe69a1d959dd6fb9d47a26f551ee276f52b Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Wed, 25 Mar 2015 18:18:29 +0100 Subject: [PATCH 026/461] Use ethash_blockhash_t over the codebase - Using a typedef struct instead of passing an array of hard coded length of 32 bytes everywhere. It's much better C practise and also gives us typechecking. - Also corrected style in places I touched. I think a style PR should follow after that. --- ethash.h | 113 ++++++++++++++++++++++++++++------------------ internal.c | 98 ++++++++++++++++++++++------------------ internal.h | 23 ++++------ io.h | 2 - sha3.h | 12 +++-- sha3_cryptopp.cpp | 9 ++-- sha3_cryptopp.h | 8 +++- 7 files changed, 153 insertions(+), 112 deletions(-) diff --git a/ethash.h b/ethash.h index eb3097307..fad964449 100644 --- a/ethash.h +++ b/ethash.h @@ -47,9 +47,26 @@ typedef struct ethash_params { uint64_t cache_size; // Size of compute cache (in bytes, multiple of node size (64)). } ethash_params; +/// Type of a blockhash +typedef struct ethash_blockhash { uint8_t b[32]; } ethash_blockhash_t; +static inline uint8_t ethash_blockhash_get(ethash_blockhash_t const* hash, unsigned int i) +{ + return hash->b[i]; +} + +static inline void ethash_blockhash_set(ethash_blockhash_t *hash, unsigned int i, uint8_t v) +{ + hash->b[i] = v; +} + +static inline void ethash_blockhash_reset(ethash_blockhash_t *hash) +{ + memset(hash, 0, 32); +} + typedef struct ethash_return_value { - uint8_t result[32]; - uint8_t mix_hash[32]; + ethash_blockhash_t result; + ethash_blockhash_t mix_hash; } ethash_return_value; uint64_t ethash_get_datasize(const uint32_t block_number); @@ -65,58 +82,68 @@ typedef struct ethash_cache { void *mem; } ethash_cache; -void ethash_mkcache(ethash_cache *cache, ethash_params const *params, const uint8_t seed[32]); +void ethash_mkcache(ethash_cache *cache, ethash_params const *params, ethash_blockhash_t const *seed); void ethash_compute_full_data(void *mem, ethash_params const *params, ethash_cache const *cache); -void ethash_full(ethash_return_value *ret, void const *full_mem, ethash_params const *params, const uint8_t header_hash[32], const uint64_t nonce); -void ethash_light(ethash_return_value *ret, ethash_cache const *cache, ethash_params const *params, const uint8_t header_hash[32], const uint64_t nonce); -void ethash_get_seedhash(uint8_t seedhash[32], const uint32_t block_number); - -static inline void ethash_prep_light(void *cache, ethash_params const *params, const uint8_t seed[32]) { - ethash_cache c; - c.mem = cache; - ethash_mkcache(&c, params, seed); +void ethash_full(ethash_return_value *ret, + void const *full_mem, + ethash_params const *params, + ethash_blockhash_t const *header_hash, + const uint64_t nonce); +void ethash_light(ethash_return_value *ret, + ethash_cache const *cache, + ethash_params const *params, + ethash_blockhash_t const *header_hash, + const uint64_t nonce); +void ethash_get_seedhash(ethash_blockhash_t *seedhash, const uint32_t block_number); + +static inline void ethash_prep_light(void *cache, ethash_params const *params, ethash_blockhash_t const* seed) +{ + ethash_cache c; + c.mem = cache; + ethash_mkcache(&c, params, seed); } -static inline void ethash_compute_light(ethash_return_value *ret, void const *cache, ethash_params const *params, const uint8_t header_hash[32], const uint64_t nonce) { - ethash_cache c; - c.mem = (void *) cache; - ethash_light(ret, &c, params, header_hash, nonce); +static inline void ethash_compute_light(ethash_return_value *ret, void const *cache, ethash_params const *params, ethash_blockhash_t const *header_hash, const uint64_t nonce) +{ + ethash_cache c; + c.mem = (void *) cache; + ethash_light(ret, &c, params, header_hash, nonce); } -static inline void ethash_prep_full(void *full, ethash_params const *params, void const *cache) { - ethash_cache c; - c.mem = (void *) cache; - ethash_compute_full_data(full, params, &c); +static inline void ethash_prep_full(void *full, ethash_params const *params, void const *cache) +{ + ethash_cache c; + c.mem = (void *) cache; + ethash_compute_full_data(full, params, &c); } -static inline void ethash_compute_full(ethash_return_value *ret, void const *full, ethash_params const *params, const uint8_t header_hash[32], const uint64_t nonce) { - ethash_full(ret, full, params, header_hash, nonce); +static inline void ethash_compute_full(ethash_return_value *ret, + void const *full, + ethash_params const *params, + ethash_blockhash_t const *header_hash, + const uint64_t nonce) +{ + ethash_full(ret, full, params, header_hash, nonce); } -/// @brief Compare two s256-bit big-endian values. -/// @returns 1 if @a a is less than or equal to @a b, 0 otherwise. -/// Both parameters are 256-bit big-endian values. -static inline int ethash_leq_be256(const uint8_t a[32], const uint8_t b[32]) { - // Boundary is big endian - for (int i = 0; i < 32; i++) { - if (a[i] == b[i]) - continue; - return a[i] < b[i]; - } - return 1; +// Returns if hash is less than or equal to difficulty +static inline int ethash_check_difficulty(ethash_blockhash_t const *hash, + ethash_blockhash_t const *difficulty) +{ + // Difficulty is big endian + for (int i = 0; i < 32; i++) { + if (ethash_blockhash_get(hash, i) == ethash_blockhash_get(difficulty, i)) { + continue; + } + return ethash_blockhash_get(hash, i) < ethash_blockhash_get(difficulty, i); + } + return 1; } -/// Perofrms a cursory check on the validity of the nonce. -/// @returns 1 if the nonce may possibly be valid for the given header_hash & boundary. -/// @p boundary equivalent to 2 ^ 256 / block_difficulty, represented as a 256-bit big-endian. -int ethash_preliminary_check_boundary( - const uint8_t header_hash[32], - const uint64_t nonce, - const uint8_t mix_hash[32], - const uint8_t boundary[32]); - -#define ethash_quick_check_difficulty ethash_preliminary_check_boundary -#define ethash_check_difficulty ethash_leq_be256 +int ethash_quick_check_difficulty(ethash_blockhash_t const *header_hash, + const uint64_t nonce, + ethash_blockhash_t const *mix_hash, + ethash_blockhash_t const *difficulty); #ifdef __cplusplus } diff --git a/internal.c b/internal.c index ae9b95065..5009d52f5 100644 --- a/internal.c +++ b/internal.c @@ -50,14 +50,14 @@ uint64_t ethash_get_cachesize(const uint32_t block_number) { // Follows Sergio's "STRICT MEMORY HARD HASHING FUNCTIONS" (2014) // https://bitslog.files.wordpress.com/2013/12/memohash-v0-3.pdf // SeqMemoHash(s, R, N) -void static ethash_compute_cache_nodes( - node *const nodes, - ethash_params const *params, - const uint8_t seed[32]) { +void static ethash_compute_cache_nodes(node *const nodes, + ethash_params const *params, + ethash_blockhash_t const* seed) +{ assert((params->cache_size % sizeof(node)) == 0); uint32_t const num_nodes = (uint32_t) (params->cache_size / sizeof(node)); - SHA3_512(nodes[0].bytes, seed, 32); + SHA3_512(nodes[0].bytes, (uint8_t*)seed, 32); for (unsigned i = 1; i != num_nodes; ++i) { SHA3_512(nodes[i].bytes, nodes[i - 1].bytes, 64); @@ -84,20 +84,19 @@ void static ethash_compute_cache_nodes( #endif } -void ethash_mkcache( - ethash_cache *cache, - ethash_params const *params, - const uint8_t seed[32]) { +void ethash_mkcache(ethash_cache *cache, + ethash_params const *params, + ethash_blockhash_t const* seed) +{ node *nodes = (node *) cache->mem; ethash_compute_cache_nodes(nodes, params, seed); } -void ethash_calculate_dag_item( - node *const ret, - const unsigned node_index, - const struct ethash_params *params, - const struct ethash_cache *cache) { - +void ethash_calculate_dag_item(node *const ret, + const unsigned node_index, + const struct ethash_params *params, + const struct ethash_cache *cache) +{ uint32_t num_parent_nodes = (uint32_t) (params->cache_size / sizeof(node)); node const *cache_nodes = (node const *) cache->mem; node const *init = &cache_nodes[node_index % num_parent_nodes]; @@ -161,13 +160,13 @@ void ethash_compute_full_data( } } -static void ethash_hash( - ethash_return_value *ret, - node const *full_nodes, - ethash_cache const *cache, - ethash_params const *params, - const uint8_t header_hash[32], - const uint64_t nonce) { +static void ethash_hash(ethash_return_value *ret, + node const *full_nodes, + ethash_cache const *cache, + ethash_params const *params, + ethash_blockhash_t const *header_hash, + const uint64_t nonce) +{ assert((params->full_size % MIX_WORDS) == 0); @@ -251,16 +250,16 @@ static void ethash_hash( } #endif - memcpy(ret->mix_hash, mix->bytes, 32); + memcpy(&ret->mix_hash, mix->bytes, 32); // final Keccak hash - SHA3_256(ret->result, s_mix->bytes, 64 + 32); // Keccak-256(s + compressed_mix) + SHA3_256(&ret->result, s_mix->bytes, 64 + 32); // Keccak-256(s + compressed_mix) } -void ethash_quick_hash( - uint8_t return_hash[32], - const uint8_t header_hash[32], - const uint64_t nonce, - const uint8_t mix_hash[32]) { +void ethash_quick_hash(ethash_blockhash_t *return_hash, + ethash_blockhash_t const *header_hash, + const uint64_t nonce, + ethash_blockhash_t const *mix_hash) +{ uint8_t buf[64 + 32]; memcpy(buf, header_hash, 32); @@ -273,28 +272,39 @@ void ethash_quick_hash( SHA3_256(return_hash, buf, 64 + 32); } -void ethash_get_seedhash(uint8_t seedhash[32], const uint32_t block_number) { - memset(seedhash, 0, 32); +void ethash_get_seedhash(ethash_blockhash_t *seedhash, const uint32_t block_number) +{ + ethash_blockhash_reset(seedhash); const uint32_t epochs = block_number / EPOCH_LENGTH; for (uint32_t i = 0; i < epochs; ++i) - SHA3_256(seedhash, seedhash, 32); + SHA3_256(seedhash, (uint8_t*)seedhash, 32); } -int ethash_preliminary_check_boundary( - const uint8_t header_hash[32], - const uint64_t nonce, - const uint8_t mix_hash[32], - const uint8_t difficulty[32]) { +int ethash_quick_check_difficulty(ethash_blockhash_t const *header_hash, + const uint64_t nonce, + ethash_blockhash_t const *mix_hash, + ethash_blockhash_t const *difficulty) +{ - uint8_t return_hash[32]; - ethash_quick_hash(return_hash, header_hash, nonce, mix_hash); - return ethash_leq_be256(return_hash, difficulty); + ethash_blockhash_t return_hash; + ethash_quick_hash(&return_hash, header_hash, nonce, mix_hash); + return ethash_check_difficulty(&return_hash, difficulty); } -void ethash_full(ethash_return_value *ret, void const *full_mem, ethash_params const *params, const uint8_t previous_hash[32], const uint64_t nonce) { - ethash_hash(ret, (node const *) full_mem, NULL, params, previous_hash, nonce); +void ethash_full(ethash_return_value *ret, + void const *full_mem, + ethash_params const *params, + ethash_blockhash_t const *header_hash, + const uint64_t nonce) +{ + ethash_hash(ret, (node const *) full_mem, NULL, params, header_hash, nonce); } -void ethash_light(ethash_return_value *ret, ethash_cache const *cache, ethash_params const *params, const uint8_t previous_hash[32], const uint64_t nonce) { - ethash_hash(ret, NULL, cache, params, previous_hash, nonce); +void ethash_light(ethash_return_value *ret, + ethash_cache const *cache, + ethash_params const *params, + ethash_blockhash_t const *header_hash, + const uint64_t nonce) +{ + ethash_hash(ret, NULL, cache, params, header_hash, nonce); } diff --git a/internal.h b/internal.h index ddd06e8f4..1e19cd1fd 100644 --- a/internal.h +++ b/internal.h @@ -30,19 +30,16 @@ typedef union node { } node; -void ethash_calculate_dag_item( - node *const ret, - const unsigned node_index, - ethash_params const *params, - ethash_cache const *cache -); - -void ethash_quick_hash( - uint8_t return_hash[32], - const uint8_t header_hash[32], - const uint64_t nonce, - const uint8_t mix_hash[32]); +void ethash_calculate_dag_item(node *const ret, + const unsigned node_index, + ethash_params const *params, + ethash_cache const *cache); + +void ethash_quick_hash(ethash_blockhash_t *return_hash, + ethash_blockhash_t const *header_hash, + const uint64_t nonce, + ethash_blockhash_t const *mix_hash); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/io.h b/io.h index 80e45c669..8cf8b69bf 100644 --- a/io.h +++ b/io.h @@ -28,8 +28,6 @@ extern "C" { #endif -typedef struct ethash_blockhash { uint8_t b[32]; } ethash_blockhash_t; - static const char DAG_FILE_NAME[] = "full"; static const char DAG_MEMO_NAME[] = "full.info"; // MSVC thinks that "static const unsigned int" is not a compile time variable. Sorry for the #define :( diff --git a/sha3.h b/sha3.h index 36a0a5301..4974a9bbc 100644 --- a/sha3.h +++ b/sha3.h @@ -8,20 +8,24 @@ extern "C" { #include #include +struct ethash_blockhash; + #define decsha3(bits) \ int sha3_##bits(uint8_t*, size_t, const uint8_t*, size_t); decsha3(256) decsha3(512) -static inline void SHA3_256(uint8_t * const ret, uint8_t const *data, const size_t size) { - sha3_256(ret, 32, data, size); +static inline void SHA3_256(struct ethash_blockhash const* ret, uint8_t const *data, const size_t size) +{ + sha3_256((uint8_t*)ret, 32, data, size); } -static inline void SHA3_512(uint8_t * const ret, uint8_t const *data, const size_t size) { +static inline void SHA3_512(uint8_t const *ret, uint8_t const *data, const size_t size) +{ sha3_512(ret, 64, data, size); } #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/sha3_cryptopp.cpp b/sha3_cryptopp.cpp index 6cbbcad8f..e4d8b1855 100644 --- a/sha3_cryptopp.cpp +++ b/sha3_cryptopp.cpp @@ -19,16 +19,17 @@ * @author Tim Hughes * @date 2015 */ - #include #include extern "C" { -void SHA3_256(uint8_t *const ret, const uint8_t *data, size_t size) { - CryptoPP::SHA3_256().CalculateDigest(ret, data, size); +struct ethash_blockhash; +typedef struct ethash_blockhash ethash_blockhash_t; +void SHA3_256(ethash_blockhash_t const* ret, const uint8_t *data, size_t size) { + CryptoPP::SHA3_256().CalculateDigest((uint8_t*)ret, data, size); } void SHA3_512(uint8_t *const ret, const uint8_t *data, size_t size) { CryptoPP::SHA3_512().CalculateDigest(ret, data, size); } -} \ No newline at end of file +} diff --git a/sha3_cryptopp.h b/sha3_cryptopp.h index f910960e1..6b257b87c 100644 --- a/sha3_cryptopp.h +++ b/sha3_cryptopp.h @@ -2,14 +2,18 @@ #include "compiler.h" #include +#include #ifdef __cplusplus extern "C" { #endif -void SHA3_256(uint8_t *const ret, const uint8_t *data, size_t size); +struct ethash_blockhash; +typedef struct ethash_blockhash ethash_blockhash_t; + +void SHA3_256(ethash_blockhash_t *const ret, const uint8_t *data, size_t size); void SHA3_512(uint8_t *const ret, const uint8_t *data, size_t size); #ifdef __cplusplus } -#endif \ No newline at end of file +#endif From a738504e6758ebbfc4ad5ffc7af27669228e6cb0 Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Wed, 1 Apr 2015 15:59:23 +0200 Subject: [PATCH 027/461] Fixing the travis build after a rebase --- sha3.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sha3.h b/sha3.h index 4974a9bbc..84dca241b 100644 --- a/sha3.h +++ b/sha3.h @@ -21,7 +21,7 @@ static inline void SHA3_256(struct ethash_blockhash const* ret, uint8_t const *d sha3_256((uint8_t*)ret, 32, data, size); } -static inline void SHA3_512(uint8_t const *ret, uint8_t const *data, const size_t size) +static inline void SHA3_512(uint8_t *ret, uint8_t const *data, const size_t size) { sha3_512(ret, 64, data, size); } From 3038852084dddbd05d220fca54b591e83618d74d Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Tue, 7 Apr 2015 13:55:13 +0200 Subject: [PATCH 028/461] Renaming ethash_blockhash_t to ethash_h256_t --- ethash.h | 40 ++++++++++++++++++++-------------------- internal.c | 28 ++++++++++++++-------------- internal.h | 6 +++--- io.c | 2 +- io.h | 6 +++--- io_posix.c | 2 +- io_win32.c | 2 +- sha3.h | 4 ++-- sha3_cryptopp.cpp | 6 +++--- sha3_cryptopp.h | 6 +++--- 10 files changed, 51 insertions(+), 51 deletions(-) diff --git a/ethash.h b/ethash.h index fad964449..ba5d63c8a 100644 --- a/ethash.h +++ b/ethash.h @@ -48,25 +48,25 @@ typedef struct ethash_params { } ethash_params; /// Type of a blockhash -typedef struct ethash_blockhash { uint8_t b[32]; } ethash_blockhash_t; -static inline uint8_t ethash_blockhash_get(ethash_blockhash_t const* hash, unsigned int i) +typedef struct ethash_h256 { uint8_t b[32]; } ethash_h256_t; +static inline uint8_t ethash_h256_get(ethash_h256_t const* hash, unsigned int i) { return hash->b[i]; } -static inline void ethash_blockhash_set(ethash_blockhash_t *hash, unsigned int i, uint8_t v) +static inline void ethash_h256_set(ethash_h256_t *hash, unsigned int i, uint8_t v) { hash->b[i] = v; } -static inline void ethash_blockhash_reset(ethash_blockhash_t *hash) +static inline void ethash_h256_reset(ethash_h256_t *hash) { memset(hash, 0, 32); } typedef struct ethash_return_value { - ethash_blockhash_t result; - ethash_blockhash_t mix_hash; + ethash_h256_t result; + ethash_h256_t mix_hash; } ethash_return_value; uint64_t ethash_get_datasize(const uint32_t block_number); @@ -82,28 +82,28 @@ typedef struct ethash_cache { void *mem; } ethash_cache; -void ethash_mkcache(ethash_cache *cache, ethash_params const *params, ethash_blockhash_t const *seed); +void ethash_mkcache(ethash_cache *cache, ethash_params const *params, ethash_h256_t const *seed); void ethash_compute_full_data(void *mem, ethash_params const *params, ethash_cache const *cache); void ethash_full(ethash_return_value *ret, void const *full_mem, ethash_params const *params, - ethash_blockhash_t const *header_hash, + ethash_h256_t const *header_hash, const uint64_t nonce); void ethash_light(ethash_return_value *ret, ethash_cache const *cache, ethash_params const *params, - ethash_blockhash_t const *header_hash, + ethash_h256_t const *header_hash, const uint64_t nonce); -void ethash_get_seedhash(ethash_blockhash_t *seedhash, const uint32_t block_number); +void ethash_get_seedhash(ethash_h256_t *seedhash, const uint32_t block_number); -static inline void ethash_prep_light(void *cache, ethash_params const *params, ethash_blockhash_t const* seed) +static inline void ethash_prep_light(void *cache, ethash_params const *params, ethash_h256_t const* seed) { ethash_cache c; c.mem = cache; ethash_mkcache(&c, params, seed); } -static inline void ethash_compute_light(ethash_return_value *ret, void const *cache, ethash_params const *params, ethash_blockhash_t const *header_hash, const uint64_t nonce) +static inline void ethash_compute_light(ethash_return_value *ret, void const *cache, ethash_params const *params, ethash_h256_t const *header_hash, const uint64_t nonce) { ethash_cache c; c.mem = (void *) cache; @@ -120,30 +120,30 @@ static inline void ethash_prep_full(void *full, ethash_params const *params, voi static inline void ethash_compute_full(ethash_return_value *ret, void const *full, ethash_params const *params, - ethash_blockhash_t const *header_hash, + ethash_h256_t const *header_hash, const uint64_t nonce) { ethash_full(ret, full, params, header_hash, nonce); } // Returns if hash is less than or equal to difficulty -static inline int ethash_check_difficulty(ethash_blockhash_t const *hash, - ethash_blockhash_t const *difficulty) +static inline int ethash_check_difficulty(ethash_h256_t const *hash, + ethash_h256_t const *difficulty) { // Difficulty is big endian for (int i = 0; i < 32; i++) { - if (ethash_blockhash_get(hash, i) == ethash_blockhash_get(difficulty, i)) { + if (ethash_h256_get(hash, i) == ethash_h256_get(difficulty, i)) { continue; } - return ethash_blockhash_get(hash, i) < ethash_blockhash_get(difficulty, i); + return ethash_h256_get(hash, i) < ethash_h256_get(difficulty, i); } return 1; } -int ethash_quick_check_difficulty(ethash_blockhash_t const *header_hash, +int ethash_quick_check_difficulty(ethash_h256_t const *header_hash, const uint64_t nonce, - ethash_blockhash_t const *mix_hash, - ethash_blockhash_t const *difficulty); + ethash_h256_t const *mix_hash, + ethash_h256_t const *difficulty); #ifdef __cplusplus } diff --git a/internal.c b/internal.c index 5009d52f5..93df9badb 100644 --- a/internal.c +++ b/internal.c @@ -52,7 +52,7 @@ uint64_t ethash_get_cachesize(const uint32_t block_number) { // SeqMemoHash(s, R, N) void static ethash_compute_cache_nodes(node *const nodes, ethash_params const *params, - ethash_blockhash_t const* seed) + ethash_h256_t const* seed) { assert((params->cache_size % sizeof(node)) == 0); uint32_t const num_nodes = (uint32_t) (params->cache_size / sizeof(node)); @@ -86,7 +86,7 @@ void static ethash_compute_cache_nodes(node *const nodes, void ethash_mkcache(ethash_cache *cache, ethash_params const *params, - ethash_blockhash_t const* seed) + ethash_h256_t const* seed) { node *nodes = (node *) cache->mem; ethash_compute_cache_nodes(nodes, params, seed); @@ -164,7 +164,7 @@ static void ethash_hash(ethash_return_value *ret, node const *full_nodes, ethash_cache const *cache, ethash_params const *params, - ethash_blockhash_t const *header_hash, + ethash_h256_t const *header_hash, const uint64_t nonce) { @@ -255,10 +255,10 @@ static void ethash_hash(ethash_return_value *ret, SHA3_256(&ret->result, s_mix->bytes, 64 + 32); // Keccak-256(s + compressed_mix) } -void ethash_quick_hash(ethash_blockhash_t *return_hash, - ethash_blockhash_t const *header_hash, +void ethash_quick_hash(ethash_h256_t *return_hash, + ethash_h256_t const *header_hash, const uint64_t nonce, - ethash_blockhash_t const *mix_hash) + ethash_h256_t const *mix_hash) { uint8_t buf[64 + 32]; @@ -272,21 +272,21 @@ void ethash_quick_hash(ethash_blockhash_t *return_hash, SHA3_256(return_hash, buf, 64 + 32); } -void ethash_get_seedhash(ethash_blockhash_t *seedhash, const uint32_t block_number) +void ethash_get_seedhash(ethash_h256_t *seedhash, const uint32_t block_number) { - ethash_blockhash_reset(seedhash); + ethash_h256_reset(seedhash); const uint32_t epochs = block_number / EPOCH_LENGTH; for (uint32_t i = 0; i < epochs; ++i) SHA3_256(seedhash, (uint8_t*)seedhash, 32); } -int ethash_quick_check_difficulty(ethash_blockhash_t const *header_hash, +int ethash_quick_check_difficulty(ethash_h256_t const *header_hash, const uint64_t nonce, - ethash_blockhash_t const *mix_hash, - ethash_blockhash_t const *difficulty) + ethash_h256_t const *mix_hash, + ethash_h256_t const *difficulty) { - ethash_blockhash_t return_hash; + ethash_h256_t return_hash; ethash_quick_hash(&return_hash, header_hash, nonce, mix_hash); return ethash_check_difficulty(&return_hash, difficulty); } @@ -294,7 +294,7 @@ int ethash_quick_check_difficulty(ethash_blockhash_t const *header_hash, void ethash_full(ethash_return_value *ret, void const *full_mem, ethash_params const *params, - ethash_blockhash_t const *header_hash, + ethash_h256_t const *header_hash, const uint64_t nonce) { ethash_hash(ret, (node const *) full_mem, NULL, params, header_hash, nonce); @@ -303,7 +303,7 @@ void ethash_full(ethash_return_value *ret, void ethash_light(ethash_return_value *ret, ethash_cache const *cache, ethash_params const *params, - ethash_blockhash_t const *header_hash, + ethash_h256_t const *header_hash, const uint64_t nonce) { ethash_hash(ret, NULL, cache, params, header_hash, nonce); diff --git a/internal.h b/internal.h index 1e19cd1fd..34f2d5ba0 100644 --- a/internal.h +++ b/internal.h @@ -35,10 +35,10 @@ void ethash_calculate_dag_item(node *const ret, ethash_params const *params, ethash_cache const *cache); -void ethash_quick_hash(ethash_blockhash_t *return_hash, - ethash_blockhash_t const *header_hash, +void ethash_quick_hash(ethash_h256_t *return_hash, + ethash_h256_t const *header_hash, const uint64_t nonce, - ethash_blockhash_t const *mix_hash); + ethash_h256_t const *mix_hash); #ifdef __cplusplus } diff --git a/io.c b/io.c index 5a8eebae5..e98b4d550 100644 --- a/io.c +++ b/io.c @@ -54,7 +54,7 @@ free_name: bool ethash_io_write(char const *dirname, ethash_params const* params, - ethash_blockhash_t seedhash, + ethash_h256_t seedhash, void const* cache, uint8_t **data, uint64_t *data_size) diff --git a/io.h b/io.h index 8cf8b69bf..f4f3ac0d7 100644 --- a/io.h +++ b/io.h @@ -51,7 +51,7 @@ enum ethash_io_rc { * @param seedhash The seedhash of the current block number * @return For possible return values @see enum ethash_io_rc */ -enum ethash_io_rc ethash_io_prepare(char const *dirname, ethash_blockhash_t seedhash); +enum ethash_io_rc ethash_io_prepare(char const *dirname, ethash_h256_t seedhash); /** * Fully computes data and writes it to the file on disk. @@ -79,13 +79,13 @@ enum ethash_io_rc ethash_io_prepare(char const *dirname, ethash_blockhash_t seed */ bool ethash_io_write(char const *dirname, ethash_params const* params, - ethash_blockhash_t seedhash, + ethash_h256_t seedhash, void const* cache, uint8_t **data, uint64_t *data_size); static inline void ethash_io_serialize_info(uint32_t revision, - ethash_blockhash_t seed_hash, + ethash_h256_t seed_hash, char *output) { // if .info is only consumed locally we don't really care about endianess diff --git a/io_posix.c b/io_posix.c index 693bdf750..b356e10a6 100644 --- a/io_posix.c +++ b/io_posix.c @@ -27,7 +27,7 @@ #include #include -enum ethash_io_rc ethash_io_prepare(char const *dirname, ethash_blockhash_t seedhash) +enum ethash_io_rc ethash_io_prepare(char const *dirname, ethash_h256_t seedhash) { char read_buffer[DAG_MEMO_BYTESIZE]; char expect_buffer[DAG_MEMO_BYTESIZE]; diff --git a/io_win32.c b/io_win32.c index 2cabc939a..02a118f9c 100644 --- a/io_win32.c +++ b/io_win32.c @@ -24,7 +24,7 @@ #include #include -enum ethash_io_rc ethash_io_prepare(char const *dirname, ethash_blockhash_t seedhash) +enum ethash_io_rc ethash_io_prepare(char const *dirname, ethash_h256_t seedhash) { char read_buffer[DAG_MEMO_BYTESIZE]; char expect_buffer[DAG_MEMO_BYTESIZE]; diff --git a/sha3.h b/sha3.h index 84dca241b..8b127247f 100644 --- a/sha3.h +++ b/sha3.h @@ -8,7 +8,7 @@ extern "C" { #include #include -struct ethash_blockhash; +struct ethash_h256; #define decsha3(bits) \ int sha3_##bits(uint8_t*, size_t, const uint8_t*, size_t); @@ -16,7 +16,7 @@ struct ethash_blockhash; decsha3(256) decsha3(512) -static inline void SHA3_256(struct ethash_blockhash const* ret, uint8_t const *data, const size_t size) +static inline void SHA3_256(struct ethash_h256 const* ret, uint8_t const *data, const size_t size) { sha3_256((uint8_t*)ret, 32, data, size); } diff --git a/sha3_cryptopp.cpp b/sha3_cryptopp.cpp index e4d8b1855..144e4719a 100644 --- a/sha3_cryptopp.cpp +++ b/sha3_cryptopp.cpp @@ -23,9 +23,9 @@ #include extern "C" { -struct ethash_blockhash; -typedef struct ethash_blockhash ethash_blockhash_t; -void SHA3_256(ethash_blockhash_t const* ret, const uint8_t *data, size_t size) { +struct ethash_h256; +typedef struct ethash_h256 ethash_h256_t; +void SHA3_256(ethash_h256_t const* ret, const uint8_t *data, size_t size) { CryptoPP::SHA3_256().CalculateDigest((uint8_t*)ret, data, size); } diff --git a/sha3_cryptopp.h b/sha3_cryptopp.h index 6b257b87c..47da9427b 100644 --- a/sha3_cryptopp.h +++ b/sha3_cryptopp.h @@ -8,10 +8,10 @@ extern "C" { #endif -struct ethash_blockhash; -typedef struct ethash_blockhash ethash_blockhash_t; +struct ethash_h256; +typedef struct ethash_h256 ethash_h256_t; -void SHA3_256(ethash_blockhash_t *const ret, const uint8_t *data, size_t size); +void SHA3_256(ethash_h256_t *const ret, const uint8_t *data, size_t size); void SHA3_512(uint8_t *const ret, const uint8_t *data, size_t size); #ifdef __cplusplus From afc1b382d727ff9e1a0ec5913987735c03d3b8ea Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Tue, 7 Apr 2015 17:48:52 +0200 Subject: [PATCH 029/461] Start of new C API implementation - For more details look at: https://github.com/ethereum/wiki/wiki/Ethash-C-API - The functions of the API have all been implemented but are not yet used or tested --- ethash.h | 67 ++++++++++++++++++------------------------- internal.c | 83 +++++++++++++++++++++++++++++++++++++++++++++--------- internal.h | 11 ++++++++ 3 files changed, 108 insertions(+), 53 deletions(-) diff --git a/ethash.h b/ethash.h index ba5d63c8a..ebe89a9f5 100644 --- a/ethash.h +++ b/ethash.h @@ -47,7 +47,7 @@ typedef struct ethash_params { uint64_t cache_size; // Size of compute cache (in bytes, multiple of node size (64)). } ethash_params; -/// Type of a blockhash +/// Type of a seedhash/blockhash e.t.c. typedef struct ethash_h256 { uint8_t b[32]; } ethash_h256_t; static inline uint8_t ethash_h256_get(ethash_h256_t const* hash, unsigned int i) { @@ -64,6 +64,13 @@ static inline void ethash_h256_reset(ethash_h256_t *hash) memset(hash, 0, 32); } +struct ethash_light; +typedef struct ethash_light* ethash_light_t; +struct ethash_full; +typedef struct ethash_full* ethash_full_t; +typedef int(*ethash_callback_t)(unsigned); + +// LTODO: for consistency's sake maybe use ethash_return_value_t? typedef struct ethash_return_value { ethash_h256_t result; ethash_h256_t mix_hash; @@ -84,47 +91,27 @@ typedef struct ethash_cache { void ethash_mkcache(ethash_cache *cache, ethash_params const *params, ethash_h256_t const *seed); void ethash_compute_full_data(void *mem, ethash_params const *params, ethash_cache const *cache); -void ethash_full(ethash_return_value *ret, - void const *full_mem, - ethash_params const *params, - ethash_h256_t const *header_hash, - const uint64_t nonce); -void ethash_light(ethash_return_value *ret, - ethash_cache const *cache, - ethash_params const *params, - ethash_h256_t const *header_hash, - const uint64_t nonce); -void ethash_get_seedhash(ethash_h256_t *seedhash, const uint32_t block_number); -static inline void ethash_prep_light(void *cache, ethash_params const *params, ethash_h256_t const* seed) -{ - ethash_cache c; - c.mem = cache; - ethash_mkcache(&c, params, seed); -} - -static inline void ethash_compute_light(ethash_return_value *ret, void const *cache, ethash_params const *params, ethash_h256_t const *header_hash, const uint64_t nonce) -{ - ethash_cache c; - c.mem = (void *) cache; - ethash_light(ret, &c, params, header_hash, nonce); -} +ethash_light_t ethash_new_light(ethash_params const *params, ethash_h256_t const *seed); +void ethash_delete_light(ethash_light_t light); +void ethash_compute_light(ethash_return_value *ret, + ethash_light_t light, + ethash_params const *params, + const ethash_h256_t *header_hash, + const uint64_t nonce); + +ethash_full_t ethash_new_full(ethash_params const* params, + void const* cache, + const ethash_h256_t *seed, + ethash_callback_t callback); +void ethash_delete_full(ethash_full_t full); +void ethash_compute_full(ethash_return_value *ret, + ethash_full_t full, + ethash_params const *params, + const ethash_h256_t *header_hash, + const uint64_t nonce); -static inline void ethash_prep_full(void *full, ethash_params const *params, void const *cache) -{ - ethash_cache c; - c.mem = (void *) cache; - ethash_compute_full_data(full, params, &c); -} - -static inline void ethash_compute_full(ethash_return_value *ret, - void const *full, - ethash_params const *params, - ethash_h256_t const *header_hash, - const uint64_t nonce) -{ - ethash_full(ret, full, params, header_hash, nonce); -} +void ethash_get_seedhash(ethash_h256_t *seedhash, const uint32_t block_number); // Returns if hash is less than or equal to difficulty static inline int ethash_check_difficulty(ethash_h256_t const *hash, diff --git a/internal.c b/internal.c index 93df9badb..9248f78ed 100644 --- a/internal.c +++ b/internal.c @@ -86,7 +86,7 @@ void static ethash_compute_cache_nodes(node *const nodes, void ethash_mkcache(ethash_cache *cache, ethash_params const *params, - ethash_h256_t const* seed) + ethash_h256_t const *seed) { node *nodes = (node *) cache->mem; ethash_compute_cache_nodes(nodes, params, seed); @@ -291,20 +291,77 @@ int ethash_quick_check_difficulty(ethash_h256_t const *header_hash, return ethash_check_difficulty(&return_hash, difficulty); } -void ethash_full(ethash_return_value *ret, - void const *full_mem, - ethash_params const *params, - ethash_h256_t const *header_hash, - const uint64_t nonce) +ethash_light_t ethash_new_light(ethash_params const *params, ethash_h256_t const *seed) { - ethash_hash(ret, (node const *) full_mem, NULL, params, header_hash, nonce); + struct ethash_light *ret; + ret = malloc(sizeof(*ret)); + if (!ret) { + return NULL; + } + ret->cache.mem = malloc(params->cache_size); + if (!ret->cache.mem) { + goto fail_free_light; + } + ethash_mkcache(ret->cache.mem, params, seed); + return ret; + +fail_free_light: + free(ret); + return NULL; +} + +void ethash_delete_light(ethash_light_t light) +{ + free(light->cache.mem); + free(light); +} + +void ethash_compute_light(ethash_return_value *ret, + ethash_light_t light, + ethash_params const *params, + const ethash_h256_t *header_hash, + const uint64_t nonce) +{ + ethash_hash(ret, NULL, &light->cache, params, header_hash, nonce); +} + +ethash_full_t ethash_new_full(ethash_params const* params, + void const* cache, + const ethash_h256_t *seed, + ethash_callback_t callback) +{ + struct ethash_full *ret; + ret = malloc(sizeof(*ret)); + if (!ret) { + return NULL; + } + ret->cache.mem = (void*)cache; + ret->data = malloc(params->full_size); + if (!ret->data) { + goto fail_free_full; + } + ethash_compute_full_data(ret->data, params, cache); + ret->seed = seed; + ret->callback = callback; + return ret; + +fail_free_full: + free(ret); + return NULL; +} + +void ethash_delete_full(ethash_full_t full) +{ + // should the cache be freed here? Does ethash_full_t take ownership of the cache? + free(full->data); + free(full); } -void ethash_light(ethash_return_value *ret, - ethash_cache const *cache, - ethash_params const *params, - ethash_h256_t const *header_hash, - const uint64_t nonce) +void ethash_compute_full(ethash_return_value *ret, + ethash_full_t full, + ethash_params const *params, + const ethash_h256_t *header_hash, + const uint64_t nonce) { - ethash_hash(ret, NULL, cache, params, header_hash, nonce); + ethash_hash(ret, (node const*)full->data, NULL, params, header_hash, nonce); } diff --git a/internal.h b/internal.h index 34f2d5ba0..8fc7df243 100644 --- a/internal.h +++ b/internal.h @@ -30,6 +30,17 @@ typedef union node { } node; +struct ethash_light { + ethash_cache cache; +}; + +struct ethash_full { + ethash_cache cache; + node *data; + const ethash_h256_t* seed; + ethash_callback_t callback; +}; + void ethash_calculate_dag_item(node *const ret, const unsigned node_index, ethash_params const *params, From 85bf80272f4d05b5aa09e3d8cc8979ed7671132c Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Wed, 8 Apr 2015 10:40:49 +0200 Subject: [PATCH 030/461] Implementing the API functions and adding docstrings --- ethash.h | 81 ++++++++++++++++++++++++++++++++++++--------- internal.c | 96 ++++++++++++++++++++++++++++++++++++------------------ internal.h | 4 +-- 3 files changed, 132 insertions(+), 49 deletions(-) diff --git a/ethash.h b/ethash.h index ebe89a9f5..95cb5fbb1 100644 --- a/ethash.h +++ b/ethash.h @@ -42,9 +42,12 @@ extern "C" { #endif +// LTODO: for consistency's sake maybe use ethash_params_t? typedef struct ethash_params { - uint64_t full_size; // Size of full data set (in bytes, multiple of mix size (128)). - uint64_t cache_size; // Size of compute cache (in bytes, multiple of node size (64)). + /// Size of full data set (in bytes, multiple of mix size (128)). + int64_t full_size; + /// Size of compute cache (in bytes, multiple of node size (64)). + uint64_t cache_size; } ethash_params; /// Type of a seedhash/blockhash e.t.c. @@ -81,31 +84,77 @@ uint64_t ethash_get_cachesize(const uint32_t block_number); // initialize the parameters static inline void ethash_params_init(ethash_params *params, const uint32_t block_number) { - params->full_size = ethash_get_datasize(block_number); - params->cache_size = ethash_get_cachesize(block_number); + params->full_size = ethash_get_datasize(block_number); + params->cache_size = ethash_get_cachesize(block_number); } +// LTODO: for consistency's sake maybe use ethash_cache_t? typedef struct ethash_cache { - void *mem; + void *mem; } ethash_cache; -void ethash_mkcache(ethash_cache *cache, ethash_params const *params, ethash_h256_t const *seed); -void ethash_compute_full_data(void *mem, ethash_params const *params, ethash_cache const *cache); - -ethash_light_t ethash_new_light(ethash_params const *params, ethash_h256_t const *seed); -void ethash_delete_light(ethash_light_t light); -void ethash_compute_light(ethash_return_value *ret, +/** + * Allocate and initialize a new ethash_cache object + * + * @param params The parameters to initialize it with. We are interested in + * the cache_size from here + * @param seed Block seedhash to be used during the computation of the + * cache nodes + * @return Newly allocated ethash_cache on success or NULL in case of + * ERRNOMEM or invalid parameters used for @ref ethash_compute_cache_nodes() + */ +ethash_cache *ethash_cache_new(ethash_params const *params, ethash_h256_t const *seed); +/** + * Frees a previously allocated ethash_cache + * @param c The object to free + */ +void ethash_cache_delete(ethash_cache *c); +bool ethash_compute_full_data(void *mem, ethash_params const *params, ethash_cache const *cache); + +/** + * Allocate and initialize a new ethash_light handler + * + * @param params The parameters to initialize it with. We are interested in + * the cache_size from here + * @param seed Block seedhash to be used during the computation of the + * cache nodes + * @return Newly allocated ethash_light handler or NULL in case of + * ERRNOMEM or invalid parameters used for @ref ethash_compute_cache_nodes() + */ +ethash_light_t ethash_light_new(ethash_params const *params, ethash_h256_t const *seed); +/** + * Frees a previously allocated ethash_light handler + * @param light The light handler to free + */ +void ethash_light_delete(ethash_light_t light); +void ethash_light_compute(ethash_return_value *ret, ethash_light_t light, ethash_params const *params, const ethash_h256_t *header_hash, const uint64_t nonce); - -ethash_full_t ethash_new_full(ethash_params const* params, - void const* cache, +/** + * Allocate and initialize a new ethash_full handler + * + * @param params The parameters to initialize it with. We are interested in + * the full_size from here + * @param cache A cache object to use that was allocated with @ref ethash_cache_new(). + * Iff this function succeeds the ethash_full_t will take memory + * ownership of the cache and free it at deletion. If not then the user + * still has to handle freeing of the cache himself. + * @param seed Block seedhash. TODO: Do we really need this in this function? + * @return Newly allocated ethash_full handler or NULL in case of + * ERRNOMEM or invalid parameters used for @ref ethash_compute_full_data() + */ +ethash_full_t ethash_full_new(ethash_params const* params, + ethash_cache const* cache, const ethash_h256_t *seed, ethash_callback_t callback); -void ethash_delete_full(ethash_full_t full); -void ethash_compute_full(ethash_return_value *ret, +/** + * Frees a previously allocated ethash_full handler + * @param full The light handler to free + */ +void ethash_full_delete(ethash_full_t full); +void ethash_full_compute(ethash_return_value *ret, ethash_full_t full, ethash_params const *params, const ethash_h256_t *header_hash, diff --git a/internal.c b/internal.c index 9248f78ed..602bb6a87 100644 --- a/internal.c +++ b/internal.c @@ -50,11 +50,13 @@ uint64_t ethash_get_cachesize(const uint32_t block_number) { // Follows Sergio's "STRICT MEMORY HARD HASHING FUNCTIONS" (2014) // https://bitslog.files.wordpress.com/2013/12/memohash-v0-3.pdf // SeqMemoHash(s, R, N) -void static ethash_compute_cache_nodes(node *const nodes, +bool static ethash_compute_cache_nodes(node *const nodes, ethash_params const *params, ethash_h256_t const* seed) { - assert((params->cache_size % sizeof(node)) == 0); + if (params->cache_size % sizeof(node) != 0) { + return false; + } uint32_t const num_nodes = (uint32_t) (params->cache_size / sizeof(node)); SHA3_512(nodes[0].bytes, (uint8_t*)seed, 32); @@ -82,14 +84,38 @@ void static ethash_compute_cache_nodes(node *const nodes, nodes->words[w] = fix_endian32(nodes->words[w]); } #endif + return true; } -void ethash_mkcache(ethash_cache *cache, - ethash_params const *params, - ethash_h256_t const *seed) +ethash_cache *ethash_cache_new(ethash_params const *params, ethash_h256_t const *seed) { - node *nodes = (node *) cache->mem; - ethash_compute_cache_nodes(nodes, params, seed); + ethash_cache *ret; + ret = malloc(sizeof(*ret)); + if (!ret) { + return NULL; + } + ret->mem = malloc(params->cache_size); + if (!ret->mem) { + goto fail_free_cache; + } + + node *nodes = (node*)ret->mem; + if (!ethash_compute_cache_nodes(nodes, params, seed)) { + goto fail_free_cache_mem; + } + return ret; + +fail_free_cache_mem: + free(ret->mem); +fail_free_cache: + free(ret); + return NULL; +} + +void ethash_cache_delete(ethash_cache *c) +{ + free(c->mem); + free(c); } void ethash_calculate_dag_item(node *const ret, @@ -146,21 +172,24 @@ void ethash_calculate_dag_item(node *const ret, SHA3_512(ret->bytes, ret->bytes, sizeof(node)); } -void ethash_compute_full_data( - void *mem, - ethash_params const *params, - ethash_cache const *cache) { - assert((params->full_size % (sizeof(uint32_t) * MIX_WORDS)) == 0); - assert((params->full_size % sizeof(node)) == 0); +bool ethash_compute_full_data(void *mem, + ethash_params const *params, + ethash_cache const *cache) +{ + if (params->full_size % (sizeof(uint32_t) * MIX_WORDS) != 0 || + (params->full_size % sizeof(node)) != 0) { + return false; + } node *full_nodes = mem; // now compute full nodes for (unsigned n = 0; n != (params->full_size / sizeof(node)); ++n) { ethash_calculate_dag_item(&(full_nodes[n]), n, params, cache); } + return true; } -static void ethash_hash(ethash_return_value *ret, +static bool ethash_hash(ethash_return_value *ret, node const *full_nodes, ethash_cache const *cache, ethash_params const *params, @@ -168,7 +197,9 @@ static void ethash_hash(ethash_return_value *ret, const uint64_t nonce) { - assert((params->full_size % MIX_WORDS) == 0); + if (params->full_size % MIX_WORDS != 0) { + return false; + } // pack hash and nonce together into first 40 bytes of s_mix assert(sizeof(node) * 8 == 512); @@ -291,18 +322,17 @@ int ethash_quick_check_difficulty(ethash_h256_t const *header_hash, return ethash_check_difficulty(&return_hash, difficulty); } -ethash_light_t ethash_new_light(ethash_params const *params, ethash_h256_t const *seed) +ethash_light_t ethash_light_new(ethash_params const *params, ethash_h256_t const *seed) { struct ethash_light *ret; ret = malloc(sizeof(*ret)); if (!ret) { return NULL; } - ret->cache.mem = malloc(params->cache_size); - if (!ret->cache.mem) { - goto fail_free_light; + ret->cache = ethash_cache_new(params, seed); + if (!ret->cache) { + goto fail_free_light; } - ethash_mkcache(ret->cache.mem, params, seed); return ret; fail_free_light: @@ -310,23 +340,23 @@ fail_free_light: return NULL; } -void ethash_delete_light(ethash_light_t light) +void ethash_light_delete(ethash_light_t light) { - free(light->cache.mem); + ethash_cache_delete(light->cache); free(light); } -void ethash_compute_light(ethash_return_value *ret, +void ethash_light_compute(ethash_return_value *ret, ethash_light_t light, ethash_params const *params, const ethash_h256_t *header_hash, const uint64_t nonce) { - ethash_hash(ret, NULL, &light->cache, params, header_hash, nonce); + ethash_hash(ret, NULL, light->cache, params, header_hash, nonce); } -ethash_full_t ethash_new_full(ethash_params const* params, - void const* cache, +ethash_full_t ethash_full_new(ethash_params const* params, + ethash_cache const* cache, const ethash_h256_t *seed, ethash_callback_t callback) { @@ -335,29 +365,33 @@ ethash_full_t ethash_new_full(ethash_params const* params, if (!ret) { return NULL; } - ret->cache.mem = (void*)cache; + ret->cache = (ethash_cache*)cache; ret->data = malloc(params->full_size); if (!ret->data) { goto fail_free_full; } - ethash_compute_full_data(ret->data, params, cache); + if (!ethash_compute_full_data(ret->data, params, cache)) { + goto fail_free_full_data; + } ret->seed = seed; ret->callback = callback; return ret; +fail_free_full_data: + free(ret->data); fail_free_full: free(ret); return NULL; } -void ethash_delete_full(ethash_full_t full) +void ethash_full_delete(ethash_full_t full) { - // should the cache be freed here? Does ethash_full_t take ownership of the cache? + ethash_cache_delete(full->cache); free(full->data); free(full); } -void ethash_compute_full(ethash_return_value *ret, +void ethash_full_compute(ethash_return_value *ret, ethash_full_t full, ethash_params const *params, const ethash_h256_t *header_hash, diff --git a/internal.h b/internal.h index 8fc7df243..97ac2d125 100644 --- a/internal.h +++ b/internal.h @@ -31,11 +31,11 @@ typedef union node { } node; struct ethash_light { - ethash_cache cache; + ethash_cache *cache; }; struct ethash_full { - ethash_cache cache; + ethash_cache *cache; node *data; const ethash_h256_t* seed; ethash_callback_t callback; From 2a17b256889384cd8d6cc5c7a9e8bcb6e28a5130 Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Wed, 8 Apr 2015 11:37:07 +0200 Subject: [PATCH 031/461] ethash_hash() now returns for success or failure - plus docstrings for the calculation functions - also fixed indexing of a potentially null pointer --- ethash.h | 31 +++++++++++++++++++++++++++++-- internal.c | 30 +++++++++++++++++++++--------- 2 files changed, 50 insertions(+), 11 deletions(-) diff --git a/ethash.h b/ethash.h index 95cb5fbb1..a6bbe97a1 100644 --- a/ethash.h +++ b/ethash.h @@ -127,7 +127,18 @@ ethash_light_t ethash_light_new(ethash_params const *params, ethash_h256_t const * @param light The light handler to free */ void ethash_light_delete(ethash_light_t light); -void ethash_light_compute(ethash_return_value *ret, +/** + * Calculate the light client data + * + * @param ret An object of ethash_return_value to hold the return value + * @param light The light client handler + * @param params The parameters to use + * @param header_hash The header hash to pack into the mix + * @param nonce The nonce to pack into the mix + * @return true if all went well and false if there were invalid + * parameters given. + */ +bool ethash_light_compute(ethash_return_value *ret, ethash_light_t light, ethash_params const *params, const ethash_h256_t *header_hash, @@ -142,6 +153,10 @@ void ethash_light_compute(ethash_return_value *ret, * ownership of the cache and free it at deletion. If not then the user * still has to handle freeing of the cache himself. * @param seed Block seedhash. TODO: Do we really need this in this function? + * @param callback A callback function with signature of @ref ethash_callback_t + * It accepts an unsigned with which a progress of DAG calculation + * can be displayed. If all goes well the callback should return 0. + * If a non-zero value is returned then DAG generation will stop. * @return Newly allocated ethash_full handler or NULL in case of * ERRNOMEM or invalid parameters used for @ref ethash_compute_full_data() */ @@ -154,7 +169,19 @@ ethash_full_t ethash_full_new(ethash_params const* params, * @param full The light handler to free */ void ethash_full_delete(ethash_full_t full); -void ethash_full_compute(ethash_return_value *ret, +/** + * Calculate the full client data + * + * @param ret An object of ethash_return_value to hold the return value + * @param full The full client handler + * @param params The parameters to use + * @param header_hash The header hash to pack into the mix + * @param nonce The nonce to pack into the mix + * @return true if all went well and false if there were invalid + * parameters given or if there was a callback given and + * at some point return a non-zero value + */ +bool ethash_full_compute(ethash_return_value *ret, ethash_full_t full, ethash_params const *params, const ethash_h256_t *header_hash, diff --git a/internal.c b/internal.c index 602bb6a87..03dc8eb25 100644 --- a/internal.c +++ b/internal.c @@ -194,9 +194,9 @@ static bool ethash_hash(ethash_return_value *ret, ethash_cache const *cache, ethash_params const *params, ethash_h256_t const *header_hash, - const uint64_t nonce) + const uint64_t nonce, + ethash_callback_t callback) { - if (params->full_size % MIX_WORDS != 0) { return false; } @@ -235,9 +235,14 @@ static bool ethash_hash(ethash_return_value *ret, uint32_t const index = ((s_mix->words[0] ^ i) * FNV_PRIME ^ mix->words[i % MIX_WORDS]) % num_full_pages; for (unsigned n = 0; n != MIX_NODES; ++n) { - const node *dag_node = &full_nodes[MIX_NODES * index + n]; - - if (!full_nodes) { + const node *dag_node; + if (callback && + callback(((float)(i * n) / (float)(ACCESSES * MIX_NODES) * 100) != 0)) { + return false; + } + if (full_nodes) { + dag_node = &full_nodes[MIX_NODES * index + n]; + } else { node tmp_node; ethash_calculate_dag_item(&tmp_node, index * MIX_NODES + n, params, cache); dag_node = &tmp_node; @@ -284,6 +289,7 @@ static bool ethash_hash(ethash_return_value *ret, memcpy(&ret->mix_hash, mix->bytes, 32); // final Keccak hash SHA3_256(&ret->result, s_mix->bytes, 64 + 32); // Keccak-256(s + compressed_mix) + return true; } void ethash_quick_hash(ethash_h256_t *return_hash, @@ -346,13 +352,13 @@ void ethash_light_delete(ethash_light_t light) free(light); } -void ethash_light_compute(ethash_return_value *ret, +bool ethash_light_compute(ethash_return_value *ret, ethash_light_t light, ethash_params const *params, const ethash_h256_t *header_hash, const uint64_t nonce) { - ethash_hash(ret, NULL, light->cache, params, header_hash, nonce); + return ethash_hash(ret, NULL, light->cache, params, header_hash, nonce, NULL); } ethash_full_t ethash_full_new(ethash_params const* params, @@ -391,11 +397,17 @@ void ethash_full_delete(ethash_full_t full) free(full); } -void ethash_full_compute(ethash_return_value *ret, +bool ethash_full_compute(ethash_return_value *ret, ethash_full_t full, ethash_params const *params, const ethash_h256_t *header_hash, const uint64_t nonce) { - ethash_hash(ret, (node const*)full->data, NULL, params, header_hash, nonce); + return ethash_hash(ret, + (node const*)full->data, + NULL, + params, + header_hash, + nonce, + full->callback); } From 1694c558df3cf7f34e42f3db62c83931117c9b00 Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Wed, 8 Apr 2015 11:56:04 +0200 Subject: [PATCH 032/461] Keep part of the old API for smoother transition --- ethash.h | 23 ++++++++++++++++++++++- internal.c | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 1 deletion(-) diff --git a/ethash.h b/ethash.h index a6bbe97a1..121ba12a2 100644 --- a/ethash.h +++ b/ethash.h @@ -45,7 +45,7 @@ extern "C" { // LTODO: for consistency's sake maybe use ethash_params_t? typedef struct ethash_params { /// Size of full data set (in bytes, multiple of mix size (128)). - int64_t full_size; + uint64_t full_size; /// Size of compute cache (in bytes, multiple of node size (64)). uint64_t cache_size; } ethash_params; @@ -208,6 +208,27 @@ int ethash_quick_check_difficulty(ethash_h256_t const *header_hash, ethash_h256_t const *mix_hash, ethash_h256_t const *difficulty); + +/** + * ========================= + * = DEPRECATED API = + * ========================= + * + * Kept for backwards compatibility with whoever still uses it. Please consider + * switching to the new API (look above) + */ +void ethash_mkcache(ethash_cache *cache, ethash_params const *params, ethash_h256_t const *seed); +void ethash_full(ethash_return_value *ret, + void const *full_mem, + ethash_params const *params, + ethash_h256_t const *header_hash, + const uint64_t nonce); +void ethash_light(ethash_return_value *ret, + ethash_cache const *cache, + ethash_params const *params, + ethash_h256_t const *header_hash, + const uint64_t nonce); + #ifdef __cplusplus } #endif diff --git a/internal.c b/internal.c index 03dc8eb25..181bf4f4b 100644 --- a/internal.c +++ b/internal.c @@ -411,3 +411,36 @@ bool ethash_full_compute(ethash_return_value *ret, nonce, full->callback); } + + +/** + * ========================= + * = DEPRECATED API = + * ========================= + * + * Kept for backwards compatibility with whoever still uses it. Please consider + * switching to the new API (look above) + */ +void ethash_mkcache(ethash_cache *cache, + ethash_params const *params, + ethash_h256_t const* seed) +{ + node *nodes = (node*) cache->mem; + ethash_compute_cache_nodes(nodes, params, seed); +} +void ethash_full(ethash_return_value *ret, + void const *full_mem, + ethash_params const *params, + ethash_h256_t const *header_hash, + const uint64_t nonce) +{ + ethash_hash(ret, (node const *) full_mem, NULL, params, header_hash, nonce, NULL); +} +void ethash_light(ethash_return_value *ret, + ethash_cache const *cache, + ethash_params const *params, + ethash_h256_t const *header_hash, + const uint64_t nonce) +{ + ethash_hash(ret, NULL, cache, params, header_hash, nonce, NULL); +} From 5394bd683470a5d513f87be5ed3fa0ab6b21dfef Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Wed, 8 Apr 2015 17:46:27 +0200 Subject: [PATCH 033/461] new api full/light test and get_cache() - Adding new api full and light client test - Moving the test for the old API into a deprecated section. Will get deleted along with that API. - Adding 2 new functions for light/full clients. One to get the pointer to the cache and one to move it out of the client --- ethash.h | 33 +++++++++++++++++++++++++++++++++ internal.c | 35 +++++++++++++++++++++++++++++++---- 2 files changed, 64 insertions(+), 4 deletions(-) diff --git a/ethash.h b/ethash.h index 121ba12a2..a2cf8dd27 100644 --- a/ethash.h +++ b/ethash.h @@ -143,6 +143,23 @@ bool ethash_light_compute(ethash_return_value *ret, ethash_params const *params, const ethash_h256_t *header_hash, const uint64_t nonce); +/** + * Get a pointer to the cache object held by the light client + * + * @param light The light client whose cache to request + * @return A pointer to the cache held by the light client or NULL if + * there was no cache in the first place + */ +ethash_cache *ethash_light_get_cache(ethash_light_t light); +/** + * Move the memory ownership of the cache somewhere else + * + * @param light The light client whose cache's memory ownership to acquire. + * After this function concludes it will no longer have a cache. + * @return A pointer to the moved cache or NULL if there was no cache in the first place + */ +ethash_cache *ethash_light_acquire_cache(ethash_light_t light); + /** * Allocate and initialize a new ethash_full handler * @@ -186,6 +203,22 @@ bool ethash_full_compute(ethash_return_value *ret, ethash_params const *params, const ethash_h256_t *header_hash, const uint64_t nonce); +/** + * Get a pointer to the cache object held by the full client + * + * @param full The full client whose cache to request + * @return A pointer to the cache held by the full client or NULL + * if there was no cache in the first place + */ +ethash_cache *ethash_full_get_cache(ethash_full_t full); +/** + * Move the memory ownership of the cache somewhere else + * + * @param full The full client whose cache's memory ownership to acquire. + * After this function concludes it will no longer have a cache. + * @return A pointer to the moved cache or NULL if there was no cache in the first place + */ +ethash_cache *ethash_full_acquire_cache(ethash_full_t full); void ethash_get_seedhash(ethash_h256_t *seedhash, const uint32_t block_number); diff --git a/internal.c b/internal.c index 181bf4f4b..61ca89eda 100644 --- a/internal.c +++ b/internal.c @@ -331,7 +331,7 @@ int ethash_quick_check_difficulty(ethash_h256_t const *header_hash, ethash_light_t ethash_light_new(ethash_params const *params, ethash_h256_t const *seed) { struct ethash_light *ret; - ret = malloc(sizeof(*ret)); + ret = calloc(sizeof(*ret), 1); if (!ret) { return NULL; } @@ -348,7 +348,9 @@ fail_free_light: void ethash_light_delete(ethash_light_t light) { - ethash_cache_delete(light->cache); + if (light->cache) { + ethash_cache_delete(light->cache); + } free(light); } @@ -361,13 +363,25 @@ bool ethash_light_compute(ethash_return_value *ret, return ethash_hash(ret, NULL, light->cache, params, header_hash, nonce, NULL); } +ethash_cache *ethash_light_get_cache(ethash_light_t light) +{ + return light->cache; +} + +ethash_cache *ethash_light_acquire_cache(ethash_light_t light) +{ + ethash_cache* ret = light->cache; + light->cache = 0; + return ret; +} + ethash_full_t ethash_full_new(ethash_params const* params, ethash_cache const* cache, const ethash_h256_t *seed, ethash_callback_t callback) { struct ethash_full *ret; - ret = malloc(sizeof(*ret)); + ret = calloc(sizeof(*ret), 1); if (!ret) { return NULL; } @@ -392,7 +406,9 @@ fail_free_full: void ethash_full_delete(ethash_full_t full) { - ethash_cache_delete(full->cache); + if (full->cache) { + ethash_cache_delete(full->cache); + } free(full->data); free(full); } @@ -412,6 +428,17 @@ bool ethash_full_compute(ethash_return_value *ret, full->callback); } +ethash_cache *ethash_full_get_cache(ethash_full_t full) +{ + return full->cache; +} + +ethash_cache *ethash_full_acquire_cache(ethash_full_t full) +{ + ethash_cache* ret = full->cache; + full->cache = 0; + return ret; +} /** * ========================= From 6554ab655ea879b4559724a8c8ce7764167e5ad1 Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Thu, 9 Apr 2015 09:39:52 +0200 Subject: [PATCH 034/461] Add docstring to compute_full_data() --- ethash.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ethash.h b/ethash.h index a2cf8dd27..c4170109e 100644 --- a/ethash.h +++ b/ethash.h @@ -109,7 +109,6 @@ ethash_cache *ethash_cache_new(ethash_params const *params, ethash_h256_t const * @param c The object to free */ void ethash_cache_delete(ethash_cache *c); -bool ethash_compute_full_data(void *mem, ethash_params const *params, ethash_cache const *cache); /** * Allocate and initialize a new ethash_light handler @@ -261,6 +260,15 @@ void ethash_light(ethash_return_value *ret, ethash_params const *params, ethash_h256_t const *header_hash, const uint64_t nonce); +/** + * Compute the memory data for a full node's memory + * + * @param mem A pointer to an ethash full's memory + * @param params The parameters to compute the data with + * @param cache A cache object to use in the calculation + * @return true if all went fine and false for invalid parameters + */ +bool ethash_compute_full_data(void *mem, ethash_params const *params, ethash_cache const *cache); #ifdef __cplusplus } From a66a3c7a274e99153adadd99fc4924d27571bf17 Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Thu, 9 Apr 2015 13:50:44 +0200 Subject: [PATCH 035/461] Remove seed parameter from ethash_full_new() --- ethash.h | 2 -- internal.c | 3 +-- internal.h | 1 - 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/ethash.h b/ethash.h index c4170109e..bc1ac7647 100644 --- a/ethash.h +++ b/ethash.h @@ -168,7 +168,6 @@ ethash_cache *ethash_light_acquire_cache(ethash_light_t light); * Iff this function succeeds the ethash_full_t will take memory * ownership of the cache and free it at deletion. If not then the user * still has to handle freeing of the cache himself. - * @param seed Block seedhash. TODO: Do we really need this in this function? * @param callback A callback function with signature of @ref ethash_callback_t * It accepts an unsigned with which a progress of DAG calculation * can be displayed. If all goes well the callback should return 0. @@ -178,7 +177,6 @@ ethash_cache *ethash_light_acquire_cache(ethash_light_t light); */ ethash_full_t ethash_full_new(ethash_params const* params, ethash_cache const* cache, - const ethash_h256_t *seed, ethash_callback_t callback); /** * Frees a previously allocated ethash_full handler diff --git a/internal.c b/internal.c index 61ca89eda..a9880c334 100644 --- a/internal.c +++ b/internal.c @@ -377,7 +377,6 @@ ethash_cache *ethash_light_acquire_cache(ethash_light_t light) ethash_full_t ethash_full_new(ethash_params const* params, ethash_cache const* cache, - const ethash_h256_t *seed, ethash_callback_t callback) { struct ethash_full *ret; @@ -385,6 +384,7 @@ ethash_full_t ethash_full_new(ethash_params const* params, if (!ret) { return NULL; } + ret->cache = (ethash_cache*)cache; ret->data = malloc(params->full_size); if (!ret->data) { @@ -393,7 +393,6 @@ ethash_full_t ethash_full_new(ethash_params const* params, if (!ethash_compute_full_data(ret->data, params, cache)) { goto fail_free_full_data; } - ret->seed = seed; ret->callback = callback; return ret; diff --git a/internal.h b/internal.h index 97ac2d125..7c2c6293b 100644 --- a/internal.h +++ b/internal.h @@ -37,7 +37,6 @@ struct ethash_light { struct ethash_full { ethash_cache *cache; node *data; - const ethash_h256_t* seed; ethash_callback_t callback; }; From 20216d8ad8a4a8c9b6c835132dd1f457a9366544 Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Fri, 10 Apr 2015 13:39:03 +0200 Subject: [PATCH 036/461] Fix endian swapping code - The endian swapping code was actually doing bit-level swapping. Fixed that now and added some tests. - Also removed ugly #ifdefs from the code and abstracted it all into macros which take care of the #ifdef logic --- endian.h | 70 +++++++++++++++++++++++++----------------------------- internal.c | 34 ++++---------------------- 2 files changed, 37 insertions(+), 67 deletions(-) diff --git a/endian.h b/endian.h index 9ca842e47..06f448b91 100644 --- a/endian.h +++ b/endian.h @@ -3,38 +3,6 @@ #include #include "compiler.h" -static const uint8_t BitReverseTable256[] = - { - 0x00, 0x80, 0x40, 0xC0, 0x20, 0xA0, 0x60, 0xE0, 0x10, 0x90, 0x50, 0xD0, 0x30, 0xB0, 0x70, 0xF0, - 0x08, 0x88, 0x48, 0xC8, 0x28, 0xA8, 0x68, 0xE8, 0x18, 0x98, 0x58, 0xD8, 0x38, 0xB8, 0x78, 0xF8, - 0x04, 0x84, 0x44, 0xC4, 0x24, 0xA4, 0x64, 0xE4, 0x14, 0x94, 0x54, 0xD4, 0x34, 0xB4, 0x74, 0xF4, - 0x0C, 0x8C, 0x4C, 0xCC, 0x2C, 0xAC, 0x6C, 0xEC, 0x1C, 0x9C, 0x5C, 0xDC, 0x3C, 0xBC, 0x7C, 0xFC, - 0x02, 0x82, 0x42, 0xC2, 0x22, 0xA2, 0x62, 0xE2, 0x12, 0x92, 0x52, 0xD2, 0x32, 0xB2, 0x72, 0xF2, - 0x0A, 0x8A, 0x4A, 0xCA, 0x2A, 0xAA, 0x6A, 0xEA, 0x1A, 0x9A, 0x5A, 0xDA, 0x3A, 0xBA, 0x7A, 0xFA, - 0x06, 0x86, 0x46, 0xC6, 0x26, 0xA6, 0x66, 0xE6, 0x16, 0x96, 0x56, 0xD6, 0x36, 0xB6, 0x76, 0xF6, - 0x0E, 0x8E, 0x4E, 0xCE, 0x2E, 0xAE, 0x6E, 0xEE, 0x1E, 0x9E, 0x5E, 0xDE, 0x3E, 0xBE, 0x7E, 0xFE, - 0x01, 0x81, 0x41, 0xC1, 0x21, 0xA1, 0x61, 0xE1, 0x11, 0x91, 0x51, 0xD1, 0x31, 0xB1, 0x71, 0xF1, - 0x09, 0x89, 0x49, 0xC9, 0x29, 0xA9, 0x69, 0xE9, 0x19, 0x99, 0x59, 0xD9, 0x39, 0xB9, 0x79, 0xF9, - 0x05, 0x85, 0x45, 0xC5, 0x25, 0xA5, 0x65, 0xE5, 0x15, 0x95, 0x55, 0xD5, 0x35, 0xB5, 0x75, 0xF5, - 0x0D, 0x8D, 0x4D, 0xCD, 0x2D, 0xAD, 0x6D, 0xED, 0x1D, 0x9D, 0x5D, 0xDD, 0x3D, 0xBD, 0x7D, 0xFD, - 0x03, 0x83, 0x43, 0xC3, 0x23, 0xA3, 0x63, 0xE3, 0x13, 0x93, 0x53, 0xD3, 0x33, 0xB3, 0x73, 0xF3, - 0x0B, 0x8B, 0x4B, 0xCB, 0x2B, 0xAB, 0x6B, 0xEB, 0x1B, 0x9B, 0x5B, 0xDB, 0x3B, 0xBB, 0x7B, 0xFB, - 0x07, 0x87, 0x47, 0xC7, 0x27, 0xA7, 0x67, 0xE7, 0x17, 0x97, 0x57, 0xD7, 0x37, 0xB7, 0x77, 0xF7, - 0x0F, 0x8F, 0x4F, 0xCF, 0x2F, 0xAF, 0x6F, 0xEF, 0x1F, 0x9F, 0x5F, 0xDF, 0x3F, 0xBF, 0x7F, 0xFF - }; - -static inline uint32_t bitfn_swap32(uint32_t a) { - return (BitReverseTable256[a & 0xff] << 24) | - (BitReverseTable256[(a >> 8) & 0xff] << 16) | - (BitReverseTable256[(a >> 16) & 0xff] << 8) | - (BitReverseTable256[(a >> 24) & 0xff]); -} - -static inline uint64_t bitfn_swap64(uint64_t a) { - return ((uint64_t) bitfn_swap32((uint32_t) (a >> 32))) | - (((uint64_t) bitfn_swap32((uint32_t) a)) << 32); -} - #if defined(__MINGW32__) || defined(_WIN32) # define LITTLE_ENDIAN 1234 # define BYTE_ORDER LITTLE_ENDIAN @@ -53,22 +21,48 @@ static inline uint64_t bitfn_swap64(uint64_t a) { # define BIG_ENDIAN 1234 # define BYTE_ORDER BIG_ENDIAN #else - # include +#endif +#if defined(_WIN32) +#include +#define ethash_swap_u32(input_) _byteswap_ulong(input_) +#define ethash_swap_u64(input_) _byteswap_uint64(input_) +#else +#include +#define ethash_swap_u32(input_) __bswap_32(input_) +#define ethash_swap_u64(input_) __bswap_64(input_) #endif #if LITTLE_ENDIAN == BYTE_ORDER -#define fix_endian32(x) (x) -#define fix_endian64(x) (x) +#define fix_endian32(dst_ ,src_) dst_ = src_ +#define fix_endian32_same(val_) +#define fix_endian64(dst_, src_) dst_ = src_ +#define fix_endian64_same(val_) +#define fix_endian_arr32(arr_, size_) +#define fix_endian_arr64(arr_, size_) #elif BIG_ENDIAN == BYTE_ORDER -#define fix_endian32(x) bitfn_swap32(x) -#define fix_endian64(x) bitfn_swap64(x) +#define fix_endian32(dst_, src_) dst_ = ethash_swap_u32(src_) +#define fix_endian32_same(val_) val_ = ethash_swap_u32(val_) +#define fix_endian64(dst_, src_) dst_ = ethash_swap_u64(src_ +#define fix_endian64_same(val_) val_ = ethash_swap_u64(val_) +#define fix_endian_arr32(arr_, size_) \ + do { \ + for (unsigned i_ = 0; i_ < (size_), ++i_) { \ + arr_[i_] = ethash_swap_u32(arr_[i_]); \ + } \ + while (0) +#define fix_endian_arr64(arr_, size_) \ + do { \ + for (unsigned i_ = 0; i_ < (size_), ++i_) { \ + arr_[i_] = ethash_swap_u64(arr_[i_]); \ + } \ + while (0) \ #else # error "endian not supported" -#endif // BYTE_ORDER \ No newline at end of file +#endif // BYTE_ORDER diff --git a/internal.c b/internal.c index a9880c334..8d3e0dbf1 100644 --- a/internal.c +++ b/internal.c @@ -76,14 +76,7 @@ bool static ethash_compute_cache_nodes(node *const nodes, SHA3_512(nodes[i].bytes, data.bytes, sizeof(data)); } } - - // now perform endian conversion -#if BYTE_ORDER != LITTLE_ENDIAN - for (unsigned w = 0; w != (num_nodes*NODE_WORDS); ++w) - { - nodes->words[w] = fix_endian32(nodes->words[w]); - } -#endif + fix_endian_arr32(nodes->words, num_nodes * NODE_WORDS); return true; } @@ -205,21 +198,11 @@ static bool ethash_hash(ethash_return_value *ret, assert(sizeof(node) * 8 == 512); node s_mix[MIX_NODES + 1]; memcpy(s_mix[0].bytes, header_hash, 32); - -#if BYTE_ORDER != LITTLE_ENDIAN - s_mix[0].double_words[4] = fix_endian64(nonce); -#else - s_mix[0].double_words[4] = nonce; -#endif + fix_endian64(s_mix[0].double_words[4], nonce); // compute sha3-512 hash and replicate across mix SHA3_512(s_mix->bytes, s_mix->bytes, 40); - -#if BYTE_ORDER != LITTLE_ENDIAN - for (unsigned w = 0; w != 16; ++w) { - s_mix[0].words[w] = fix_endian32(s_mix[0].words[w]); - } -#endif + fix_endian_arr32(s_mix[0].words, 16); node *const mix = s_mix + 1; for (unsigned w = 0; w != MIX_WORDS; ++w) { @@ -280,12 +263,7 @@ static bool ethash_hash(ethash_return_value *ret, mix->words[w / 4] = reduction; } -#if BYTE_ORDER != LITTLE_ENDIAN - for (unsigned w = 0; w != MIX_WORDS/4; ++w) { - mix->words[w] = fix_endian32(mix->words[w]); - } -#endif - + fix_endian_arr32(mix->words, MIX_WORDS / 4); memcpy(&ret->mix_hash, mix->bytes, 32); // final Keccak hash SHA3_256(&ret->result, s_mix->bytes, 64 + 32); // Keccak-256(s + compressed_mix) @@ -300,9 +278,7 @@ void ethash_quick_hash(ethash_h256_t *return_hash, uint8_t buf[64 + 32]; memcpy(buf, header_hash, 32); -#if BYTE_ORDER != LITTLE_ENDIAN - nonce = fix_endian64(nonce); -#endif + fix_endian64_same(nonce); memcpy(&(buf[32]), &nonce, 8); SHA3_512(buf, buf, 40); memcpy(&(buf[64]), mix_hash, 32); From b78853b2d8193fd0bb67de5d565c3977eab79f2f Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Fri, 10 Apr 2015 15:11:55 +0200 Subject: [PATCH 037/461] Fix msvc compile warnings - Fix some warning due to missing casts - Add wrappers for some functions that msvc considers unsafe --- internal.c | 4 ++-- io.c | 2 +- io.h | 39 ++++++++++++++++++++++++++++++++++++--- io_posix.c | 12 +++++++++++- io_win32.c | 13 ++++++++++++- 5 files changed, 62 insertions(+), 8 deletions(-) diff --git a/internal.c b/internal.c index a9880c334..ea9d74719 100644 --- a/internal.c +++ b/internal.c @@ -94,7 +94,7 @@ ethash_cache *ethash_cache_new(ethash_params const *params, ethash_h256_t const if (!ret) { return NULL; } - ret->mem = malloc(params->cache_size); + ret->mem = malloc((size_t)params->cache_size); if (!ret->mem) { goto fail_free_cache; } @@ -386,7 +386,7 @@ ethash_full_t ethash_full_new(ethash_params const* params, } ret->cache = (ethash_cache*)cache; - ret->data = malloc(params->full_size); + ret->data = malloc((size_t)params->full_size); if (!ret->data) { goto fail_free_full; } diff --git a/io.c b/io.c index e98b4d550..dc72c63a6 100644 --- a/io.c +++ b/io.c @@ -36,7 +36,7 @@ static bool ethash_io_write_file(char const *dirname, if (!fullname) { return false; } - FILE *f = fopen(fullname, "wb"); + FILE *f = ethash_fopen(fullname, "wb"); if (!f) { goto free_name; } diff --git a/io.h b/io.h index f4f3ac0d7..1697b6872 100644 --- a/io.h +++ b/io.h @@ -22,6 +22,7 @@ #include #include #include +#include #include "ethash.h" #ifdef __cplusplus @@ -84,6 +85,37 @@ bool ethash_io_write(char const *dirname, uint8_t **data, uint64_t *data_size); +/** + * An fopen wrapper for no-warnings crossplatform fopen. + * + * Msvc compiler considers fopen to be insecure and suggests to use their + * alternative. This is a wrapper for this alternative. Another way is to + * #define _CRT_SECURE_NO_WARNINGS, but disabling all security warnings does + * not sound like a good idea. + * + * @param file_name The path to the file to open + * @param mode Opening mode. Check fopen() + * @return The FILE* or NULL in failure + */ +FILE *ethash_fopen(const char *file_name, const char *mode); +/** + * An stncat wrapper for no-warnings crossplatform strncat. + * + * Msvc compiler considers strncat to be insecure and suggests to use their + * alternative. This is a wrapper for this alternative. Another way is to + * #define _CRT_SECURE_NO_WARNINGS, but disabling all security warnings does + * not sound like a good idea. + * + * @param des Destination buffer + * @param dest_size Maximum size of the destination buffer. This is the + * extra argument for the MSVC secure strncat + * @param src Souce buffer + * @param count Number of bytes to copy from source + * @return If all is well returns the dest buffer. If there is an + * error returns NULL + */ +char *ethash_strncat(char *dest, size_t dest_size, const char *src, size_t count); + static inline void ethash_io_serialize_info(uint32_t revision, ethash_h256_t seed_hash, char *output) @@ -97,15 +129,16 @@ static inline char *ethash_io_create_filename(char const *dirname, char const* filename, size_t filename_length) { + size_t dirlen = strlen(dirname); // in C the cast is not needed, but a C++ compiler will complain for invalid conversion - char *name = (char*)malloc(strlen(dirname) + filename_length); + char *name = (char*)malloc(dirlen + filename_length + 1); if (!name) { return NULL; } name[0] = '\0'; - strcat(name, dirname); - strcat(name, filename); + ethash_strncat(name, dirlen + filename_length + 1, dirname, dirlen); + ethash_strncat(name, dirlen + filename_length + 1, filename, filename_length); return name; } diff --git a/io_posix.c b/io_posix.c index b356e10a6..7f3d2ec7f 100644 --- a/io_posix.c +++ b/io_posix.c @@ -27,6 +27,16 @@ #include #include +FILE *ethash_fopen(const char *file_name, const char *mode) +{ + return fopen(file_name, mode); +} + +char *ethash_strncat(char *dest, size_t dest_size, const char *src, size_t count) +{ + return strlen(dest) + count + 1 <= dest_size ? strncat(dest, src, count) : NULL; +} + enum ethash_io_rc ethash_io_prepare(char const *dirname, ethash_h256_t seedhash) { char read_buffer[DAG_MEMO_BYTESIZE]; @@ -45,7 +55,7 @@ enum ethash_io_rc ethash_io_prepare(char const *dirname, ethash_h256_t seedhash) } // try to open memo file - FILE *f = fopen(memofile, "rb"); + FILE *f = ethash_fopen(memofile, "rb"); if (!f) { // file does not exist, so no checking happens. All is fine. ret = ETHASH_IO_MEMO_MISMATCH; diff --git a/io_win32.c b/io_win32.c index 02a118f9c..97b81fea1 100644 --- a/io_win32.c +++ b/io_win32.c @@ -24,6 +24,17 @@ #include #include +FILE *ethash_fopen(const char *file_name, const char *mode) +{ + FILE *f; + return fopen_s(&f, file_name, mode) == 0 ? f : NULL; +} + +char *ethash_strncat(char *dest, size_t dest_size, const char *src, size_t count) +{ + return strncat_s(dest, dest_size, src, count) == 0 ? dest : NULL; +} + enum ethash_io_rc ethash_io_prepare(char const *dirname, ethash_h256_t seedhash) { char read_buffer[DAG_MEMO_BYTESIZE]; @@ -42,7 +53,7 @@ enum ethash_io_rc ethash_io_prepare(char const *dirname, ethash_h256_t seedhash) } // try to open memo file - FILE *f = fopen(memofile, "rb"); + FILE *f = ethash_fopen(memofile, "rb"); if (!f) { // file does not exist, so no checking happens. All is fine. ret = ETHASH_IO_MEMO_MISMATCH; From 7fd1dd36f5d9dd096dff142205d156c7e53e1217 Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Fri, 10 Apr 2015 17:13:07 +0200 Subject: [PATCH 038/461] Coding style "adjustment" - Adjusting the coding style for consistency after the talk we had --- data_sizes.h | 1476 ++++++++++++++++++++++----------------------- ethash.h | 102 ++-- internal.c | 578 +++++++++--------- internal.h | 26 +- io.c | 88 +-- io.h | 54 +- io_posix.c | 74 +-- io_win32.c | 76 +-- sha3.c | 194 +++--- sha3.h | 6 +- sha3_cryptopp.cpp | 10 +- util.c | 2 +- 12 files changed, 1345 insertions(+), 1341 deletions(-) diff --git a/data_sizes.h b/data_sizes.h index cf52ae4f8..83cc30bcb 100644 --- a/data_sizes.h +++ b/data_sizes.h @@ -49,416 +49,416 @@ extern "C" { static const uint64_t dag_sizes[2048] = { - 1073739904U, 1082130304U, 1090514816U, 1098906752U, 1107293056U, - 1115684224U, 1124070016U, 1132461952U, 1140849536U, 1149232768U, - 1157627776U, 1166013824U, 1174404736U, 1182786944U, 1191180416U, - 1199568512U, 1207958912U, 1216345216U, 1224732032U, 1233124736U, - 1241513344U, 1249902464U, 1258290304U, 1266673792U, 1275067264U, - 1283453312U, 1291844992U, 1300234112U, 1308619904U, 1317010048U, - 1325397376U, 1333787776U, 1342176128U, 1350561664U, 1358954368U, - 1367339392U, 1375731584U, 1384118144U, 1392507008U, 1400897408U, - 1409284736U, 1417673344U, 1426062464U, 1434451072U, 1442839168U, - 1451229056U, 1459615616U, 1468006016U, 1476394112U, 1484782976U, - 1493171584U, 1501559168U, 1509948032U, 1518337664U, 1526726528U, - 1535114624U, 1543503488U, 1551892096U, 1560278656U, 1568669056U, - 1577056384U, 1585446272U, 1593831296U, 1602219392U, 1610610304U, - 1619000192U, 1627386752U, 1635773824U, 1644164224U, 1652555648U, - 1660943488U, 1669332608U, 1677721216U, 1686109312U, 1694497664U, - 1702886272U, 1711274624U, 1719661184U, 1728047744U, 1736434816U, - 1744829056U, 1753218944U, 1761606272U, 1769995904U, 1778382464U, - 1786772864U, 1795157888U, 1803550592U, 1811937664U, 1820327552U, - 1828711552U, 1837102976U, 1845488768U, 1853879936U, 1862269312U, - 1870656896U, 1879048064U, 1887431552U, 1895825024U, 1904212096U, - 1912601216U, 1920988544U, 1929379456U, 1937765504U, 1946156672U, - 1954543232U, 1962932096U, 1971321728U, 1979707264U, 1988093056U, - 1996487552U, 2004874624U, 2013262208U, 2021653888U, 2030039936U, - 2038430848U, 2046819968U, 2055208576U, 2063596672U, 2071981952U, - 2080373632U, 2088762752U, 2097149056U, 2105539712U, 2113928576U, - 2122315136U, 2130700672U, 2139092608U, 2147483264U, 2155872128U, - 2164257664U, 2172642176U, 2181035392U, 2189426048U, 2197814912U, - 2206203008U, 2214587264U, 2222979712U, 2231367808U, 2239758208U, - 2248145024U, 2256527744U, 2264922752U, 2273312128U, 2281701248U, - 2290086272U, 2298476672U, 2306867072U, 2315251072U, 2323639168U, - 2332032128U, 2340420224U, 2348808064U, 2357196416U, 2365580416U, - 2373966976U, 2382363008U, 2390748544U, 2399139968U, 2407530368U, - 2415918976U, 2424307328U, 2432695424U, 2441084288U, 2449472384U, - 2457861248U, 2466247808U, 2474637184U, 2483026816U, 2491414144U, - 2499803776U, 2508191872U, 2516582272U, 2524970368U, 2533359232U, - 2541743488U, 2550134144U, 2558525056U, 2566913408U, 2575301504U, - 2583686528U, 2592073856U, 2600467328U, 2608856192U, 2617240448U, - 2625631616U, 2634022016U, 2642407552U, 2650796416U, 2659188352U, - 2667574912U, 2675965312U, 2684352896U, 2692738688U, 2701130624U, - 2709518464U, 2717907328U, 2726293376U, 2734685056U, 2743073152U, - 2751462016U, 2759851648U, 2768232832U, 2776625536U, 2785017728U, - 2793401984U, 2801794432U, 2810182016U, 2818571648U, 2826959488U, - 2835349376U, 2843734144U, 2852121472U, 2860514432U, 2868900992U, - 2877286784U, 2885676928U, 2894069632U, 2902451584U, 2910843008U, - 2919234688U, 2927622784U, 2936011648U, 2944400768U, 2952789376U, - 2961177728U, 2969565568U, 2977951616U, 2986338944U, 2994731392U, - 3003120256U, 3011508352U, 3019895936U, 3028287104U, 3036675968U, - 3045063808U, 3053452928U, 3061837696U, 3070228352U, 3078615424U, - 3087003776U, 3095394944U, 3103782272U, 3112173184U, 3120562048U, - 3128944768U, 3137339264U, 3145725056U, 3154109312U, 3162505088U, - 3170893184U, 3179280256U, 3187669376U, 3196056704U, 3204445568U, - 3212836736U, 3221224064U, 3229612928U, 3238002304U, 3246391168U, - 3254778496U, 3263165824U, 3271556224U, 3279944576U, 3288332416U, - 3296719232U, 3305110912U, 3313500032U, 3321887104U, 3330273152U, - 3338658944U, 3347053184U, 3355440512U, 3363827072U, 3372220288U, - 3380608384U, 3388997504U, 3397384576U, 3405774208U, 3414163072U, - 3422551936U, 3430937984U, 3439328384U, 3447714176U, 3456104576U, - 3464493952U, 3472883584U, 3481268864U, 3489655168U, 3498048896U, - 3506434432U, 3514826368U, 3523213952U, 3531603584U, 3539987072U, - 3548380288U, 3556763264U, 3565157248U, 3573545344U, 3581934464U, - 3590324096U, 3598712704U, 3607098752U, 3615488384U, 3623877248U, - 3632265856U, 3640646528U, 3649043584U, 3657430144U, 3665821568U, - 3674207872U, 3682597504U, 3690984832U, 3699367808U, 3707764352U, - 3716152448U, 3724541056U, 3732925568U, 3741318016U, 3749706368U, - 3758091136U, 3766481536U, 3774872704U, 3783260032U, 3791650432U, - 3800036224U, 3808427648U, 3816815488U, 3825204608U, 3833592704U, - 3841981568U, 3850370432U, 3858755968U, 3867147904U, 3875536256U, - 3883920512U, 3892313728U, 3900702592U, 3909087872U, 3917478784U, - 3925868416U, 3934256512U, 3942645376U, 3951032192U, 3959422336U, - 3967809152U, 3976200064U, 3984588416U, 3992974976U, 4001363584U, - 4009751168U, 4018141312U, 4026530432U, 4034911616U, 4043308928U, - 4051695488U, 4060084352U, 4068472448U, 4076862848U, 4085249408U, - 4093640576U, 4102028416U, 4110413696U, 4118805632U, 4127194496U, - 4135583104U, 4143971968U, 4152360832U, 4160746112U, 4169135744U, - 4177525888U, 4185912704U, 4194303616U, 4202691968U, 4211076736U, - 4219463552U, 4227855488U, 4236246656U, 4244633728U, 4253022848U, - 4261412224U, 4269799808U, 4278184832U, 4286578048U, 4294962304U, - 4303349632U, 4311743104U, 4320130432U, 4328521088U, 4336909184U, - 4345295488U, 4353687424U, 4362073472U, 4370458496U, 4378852736U, - 4387238528U, 4395630208U, 4404019072U, 4412407424U, 4420790656U, - 4429182848U, 4437571456U, 4445962112U, 4454344064U, 4462738048U, - 4471119232U, 4479516544U, 4487904128U, 4496289664U, 4504682368U, - 4513068416U, 4521459584U, 4529846144U, 4538232704U, 4546619776U, - 4555010176U, 4563402112U, 4571790208U, 4580174464U, 4588567936U, - 4596957056U, 4605344896U, 4613734016U, 4622119808U, 4630511488U, - 4638898816U, 4647287936U, 4655675264U, 4664065664U, 4672451968U, - 4680842624U, 4689231488U, 4697620352U, 4706007424U, 4714397056U, - 4722786176U, 4731173248U, 4739562368U, 4747951744U, 4756340608U, - 4764727936U, 4773114496U, 4781504384U, 4789894784U, 4798283648U, - 4806667648U, 4815059584U, 4823449472U, 4831835776U, 4840226176U, - 4848612224U, 4857003392U, 4865391488U, 4873780096U, 4882169728U, - 4890557312U, 4898946944U, 4907333248U, 4915722368U, 4924110976U, - 4932499328U, 4940889728U, 4949276032U, 4957666432U, 4966054784U, - 4974438016U, 4982831488U, 4991221376U, 4999607168U, 5007998848U, - 5016386432U, 5024763776U, 5033164672U, 5041544576U, 5049941888U, - 5058329728U, 5066717056U, 5075107456U, 5083494272U, 5091883904U, - 5100273536U, 5108662144U, 5117048192U, 5125436032U, 5133827456U, - 5142215296U, 5150605184U, 5158993024U, 5167382144U, 5175769472U, - 5184157568U, 5192543872U, 5200936064U, 5209324928U, 5217711232U, - 5226102656U, 5234490496U, 5242877312U, 5251263872U, 5259654016U, - 5268040832U, 5276434304U, 5284819328U, 5293209728U, 5301598592U, - 5309986688U, 5318374784U, 5326764416U, 5335151488U, 5343542144U, - 5351929472U, 5360319872U, 5368706944U, 5377096576U, 5385484928U, - 5393871232U, 5402263424U, 5410650496U, 5419040384U, 5427426944U, - 5435816576U, 5444205952U, 5452594816U, 5460981376U, 5469367936U, - 5477760896U, 5486148736U, 5494536832U, 5502925952U, 5511315328U, - 5519703424U, 5528089984U, 5536481152U, 5544869504U, 5553256064U, - 5561645696U, 5570032768U, 5578423936U, 5586811264U, 5595193216U, - 5603585408U, 5611972736U, 5620366208U, 5628750464U, 5637143936U, - 5645528192U, 5653921408U, 5662310272U, 5670694784U, 5679082624U, - 5687474048U, 5695864448U, 5704251008U, 5712641408U, 5721030272U, - 5729416832U, 5737806208U, 5746194304U, 5754583936U, 5762969984U, - 5771358592U, 5779748224U, 5788137856U, 5796527488U, 5804911232U, - 5813300608U, 5821692544U, 5830082176U, 5838468992U, 5846855552U, - 5855247488U, 5863636096U, 5872024448U, 5880411008U, 5888799872U, - 5897186432U, 5905576832U, 5913966976U, 5922352768U, 5930744704U, - 5939132288U, 5947522432U, 5955911296U, 5964299392U, 5972688256U, - 5981074304U, 5989465472U, 5997851008U, 6006241408U, 6014627968U, - 6023015552U, 6031408256U, 6039796096U, 6048185216U, 6056574848U, - 6064963456U, 6073351808U, 6081736064U, 6090128768U, 6098517632U, - 6106906496U, 6115289216U, 6123680896U, 6132070016U, 6140459648U, - 6148849024U, 6157237376U, 6165624704U, 6174009728U, 6182403712U, - 6190792064U, 6199176064U, 6207569792U, 6215952256U, 6224345216U, - 6232732544U, 6241124224U, 6249510272U, 6257899136U, 6266287744U, - 6274676864U, 6283065728U, 6291454336U, 6299843456U, 6308232064U, - 6316620928U, 6325006208U, 6333395584U, 6341784704U, 6350174848U, - 6358562176U, 6366951296U, 6375337856U, 6383729536U, 6392119168U, - 6400504192U, 6408895616U, 6417283456U, 6425673344U, 6434059136U, - 6442444672U, 6450837376U, 6459223424U, 6467613056U, 6476004224U, - 6484393088U, 6492781952U, 6501170048U, 6509555072U, 6517947008U, - 6526336384U, 6534725504U, 6543112832U, 6551500672U, 6559888768U, - 6568278656U, 6576662912U, 6585055616U, 6593443456U, 6601834112U, - 6610219648U, 6618610304U, 6626999168U, 6635385472U, 6643777408U, - 6652164224U, 6660552832U, 6668941952U, 6677330048U, 6685719424U, - 6694107776U, 6702493568U, 6710882176U, 6719274112U, 6727662976U, - 6736052096U, 6744437632U, 6752825984U, 6761213824U, 6769604224U, - 6777993856U, 6786383488U, 6794770816U, 6803158144U, 6811549312U, - 6819937664U, 6828326528U, 6836706176U, 6845101696U, 6853491328U, - 6861880448U, 6870269312U, 6878655104U, 6887046272U, 6895433344U, - 6903822208U, 6912212864U, 6920596864U, 6928988288U, 6937377152U, - 6945764992U, 6954149248U, 6962544256U, 6970928768U, 6979317376U, - 6987709312U, 6996093824U, 7004487296U, 7012875392U, 7021258624U, - 7029652352U, 7038038912U, 7046427776U, 7054818944U, 7063207808U, - 7071595136U, 7079980928U, 7088372608U, 7096759424U, 7105149824U, - 7113536896U, 7121928064U, 7130315392U, 7138699648U, 7147092352U, - 7155479168U, 7163865728U, 7172249984U, 7180648064U, 7189036672U, - 7197424768U, 7205810816U, 7214196608U, 7222589824U, 7230975104U, - 7239367552U, 7247755904U, 7256145536U, 7264533376U, 7272921472U, - 7281308032U, 7289694848U, 7298088832U, 7306471808U, 7314864512U, - 7323253888U, 7331643008U, 7340029568U, 7348419712U, 7356808832U, - 7365196672U, 7373585792U, 7381973888U, 7390362752U, 7398750592U, - 7407138944U, 7415528576U, 7423915648U, 7432302208U, 7440690304U, - 7449080192U, 7457472128U, 7465860992U, 7474249088U, 7482635648U, - 7491023744U, 7499412608U, 7507803008U, 7516192384U, 7524579968U, - 7532967296U, 7541358464U, 7549745792U, 7558134656U, 7566524032U, - 7574912896U, 7583300992U, 7591690112U, 7600075136U, 7608466816U, - 7616854912U, 7625244544U, 7633629824U, 7642020992U, 7650410368U, - 7658794112U, 7667187328U, 7675574912U, 7683961984U, 7692349568U, - 7700739712U, 7709130368U, 7717519232U, 7725905536U, 7734295424U, - 7742683264U, 7751069056U, 7759457408U, 7767849088U, 7776238208U, - 7784626816U, 7793014912U, 7801405312U, 7809792128U, 7818179968U, - 7826571136U, 7834957184U, 7843347328U, 7851732352U, 7860124544U, - 7868512384U, 7876902016U, 7885287808U, 7893679744U, 7902067072U, - 7910455936U, 7918844288U, 7927230848U, 7935622784U, 7944009344U, - 7952400256U, 7960786048U, 7969176704U, 7977565312U, 7985953408U, - 7994339968U, 8002730368U, 8011119488U, 8019508096U, 8027896192U, - 8036285056U, 8044674688U, 8053062272U, 8061448832U, 8069838464U, - 8078227328U, 8086616704U, 8095006592U, 8103393664U, 8111783552U, - 8120171392U, 8128560256U, 8136949376U, 8145336704U, 8153726848U, - 8162114944U, 8170503296U, 8178891904U, 8187280768U, 8195669632U, - 8204058496U, 8212444544U, 8220834176U, 8229222272U, 8237612672U, - 8246000768U, 8254389376U, 8262775168U, 8271167104U, 8279553664U, - 8287944064U, 8296333184U, 8304715136U, 8313108352U, 8321497984U, - 8329885568U, 8338274432U, 8346663296U, 8355052928U, 8363441536U, - 8371828352U, 8380217984U, 8388606592U, 8396996224U, 8405384576U, - 8413772672U, 8422161536U, 8430549376U, 8438939008U, 8447326592U, - 8455715456U, 8464104832U, 8472492928U, 8480882048U, 8489270656U, - 8497659776U, 8506045312U, 8514434944U, 8522823808U, 8531208832U, - 8539602304U, 8547990656U, 8556378752U, 8564768384U, 8573154176U, - 8581542784U, 8589933952U, 8598322816U, 8606705024U, 8615099264U, - 8623487872U, 8631876992U, 8640264064U, 8648653952U, 8657040256U, - 8665430656U, 8673820544U, 8682209152U, 8690592128U, 8698977152U, - 8707374464U, 8715763328U, 8724151424U, 8732540032U, 8740928384U, - 8749315712U, 8757704576U, 8766089344U, 8774480768U, 8782871936U, - 8791260032U, 8799645824U, 8808034432U, 8816426368U, 8824812928U, - 8833199488U, 8841591424U, 8849976448U, 8858366336U, 8866757248U, - 8875147136U, 8883532928U, 8891923328U, 8900306816U, 8908700288U, - 8917088384U, 8925478784U, 8933867392U, 8942250368U, 8950644608U, - 8959032704U, 8967420544U, 8975809664U, 8984197504U, 8992584064U, - 9000976256U, 9009362048U, 9017752448U, 9026141312U, 9034530688U, - 9042917504U, 9051307904U, 9059694208U, 9068084864U, 9076471424U, - 9084861824U, 9093250688U, 9101638528U, 9110027648U, 9118416512U, - 9126803584U, 9135188096U, 9143581312U, 9151969664U, 9160356224U, - 9168747136U, 9177134464U, 9185525632U, 9193910144U, 9202302848U, - 9210690688U, 9219079552U, 9227465344U, 9235854464U, 9244244864U, - 9252633472U, 9261021824U, 9269411456U, 9277799296U, 9286188928U, - 9294574208U, 9302965888U, 9311351936U, 9319740032U, 9328131968U, - 9336516736U, 9344907392U, 9353296768U, 9361685888U, 9370074752U, - 9378463616U, 9386849408U, 9395239808U, 9403629184U, 9412016512U, - 9420405376U, 9428795008U, 9437181568U, 9445570688U, 9453960832U, - 9462346624U, 9470738048U, 9479121536U, 9487515008U, 9495903616U, - 9504289664U, 9512678528U, 9521067904U, 9529456256U, 9537843584U, - 9546233728U, 9554621312U, 9563011456U, 9571398784U, 9579788672U, - 9588178304U, 9596567168U, 9604954496U, 9613343104U, 9621732992U, - 9630121856U, 9638508416U, 9646898816U, 9655283584U, 9663675776U, - 9672061312U, 9680449664U, 9688840064U, 9697230464U, 9705617536U, - 9714003584U, 9722393984U, 9730772608U, 9739172224U, 9747561088U, - 9755945344U, 9764338816U, 9772726144U, 9781116544U, 9789503872U, - 9797892992U, 9806282624U, 9814670464U, 9823056512U, 9831439232U, - 9839833984U, 9848224384U, 9856613504U, 9865000576U, 9873391232U, - 9881772416U, 9890162816U, 9898556288U, 9906940544U, 9915333248U, - 9923721088U, 9932108672U, 9940496512U, 9948888448U, 9957276544U, - 9965666176U, 9974048384U, 9982441088U, 9990830464U, 9999219584U, - 10007602816U, 10015996544U, 10024385152U, 10032774016U, 10041163648U, - 10049548928U, 10057940096U, 10066329472U, 10074717824U, 10083105152U, - 10091495296U, 10099878784U, 10108272256U, 10116660608U, 10125049216U, - 10133437312U, 10141825664U, 10150213504U, 10158601088U, 10166991232U, - 10175378816U, 10183766144U, 10192157312U, 10200545408U, 10208935552U, - 10217322112U, 10225712768U, 10234099328U, 10242489472U, 10250876032U, - 10259264896U, 10267656064U, 10276042624U, 10284429184U, 10292820352U, - 10301209472U, 10309598848U, 10317987712U, 10326375296U, 10334763392U, - 10343153536U, 10351541632U, 10359930752U, 10368318592U, 10376707456U, - 10385096576U, 10393484672U, 10401867136U, 10410262144U, 10418647424U, - 10427039104U, 10435425664U, 10443810176U, 10452203648U, 10460589952U, - 10468982144U, 10477369472U, 10485759104U, 10494147712U, 10502533504U, - 10510923392U, 10519313536U, 10527702656U, 10536091264U, 10544478592U, - 10552867712U, 10561255808U, 10569642368U, 10578032768U, 10586423168U, - 10594805632U, 10603200128U, 10611588992U, 10619976064U, 10628361344U, - 10636754048U, 10645143424U, 10653531776U, 10661920384U, 10670307968U, - 10678696832U, 10687086464U, 10695475072U, 10703863168U, 10712246144U, - 10720639616U, 10729026688U, 10737414784U, 10745806208U, 10754190976U, - 10762581376U, 10770971264U, 10779356288U, 10787747456U, 10796135552U, - 10804525184U, 10812915584U, 10821301888U, 10829692288U, 10838078336U, - 10846469248U, 10854858368U, 10863247232U, 10871631488U, 10880023424U, - 10888412032U, 10896799616U, 10905188992U, 10913574016U, 10921964672U, - 10930352768U, 10938742912U, 10947132544U, 10955518592U, 10963909504U, - 10972298368U, 10980687488U, 10989074816U, 10997462912U, 11005851776U, - 11014241152U, 11022627712U, 11031017344U, 11039403904U, 11047793024U, - 11056184704U, 11064570752U, 11072960896U, 11081343872U, 11089737856U, - 11098128256U, 11106514816U, 11114904448U, 11123293568U, 11131680128U, - 11140065152U, 11148458368U, 11156845696U, 11165236864U, 11173624192U, - 11182013824U, 11190402688U, 11198790784U, 11207179136U, 11215568768U, - 11223957376U, 11232345728U, 11240734592U, 11249122688U, 11257511296U, - 11265899648U, 11274285952U, 11282675584U, 11291065472U, 11299452544U, - 11307842432U, 11316231296U, 11324616832U, 11333009024U, 11341395584U, - 11349782656U, 11358172288U, 11366560384U, 11374950016U, 11383339648U, - 11391721856U, 11400117376U, 11408504192U, 11416893568U, 11425283456U, - 11433671552U, 11442061184U, 11450444672U, 11458837888U, 11467226752U, - 11475611776U, 11484003968U, 11492392064U, 11500780672U, 11509169024U, - 11517550976U, 11525944448U, 11534335616U, 11542724224U, 11551111808U, - 11559500672U, 11567890304U, 11576277376U, 11584667008U, 11593056128U, - 11601443456U, 11609830016U, 11618221952U, 11626607488U, 11634995072U, - 11643387776U, 11651775104U, 11660161664U, 11668552576U, 11676940928U, - 11685330304U, 11693718656U, 11702106496U, 11710496128U, 11718882688U, - 11727273088U, 11735660416U, 11744050048U, 11752437376U, 11760824704U, - 11769216128U, 11777604736U, 11785991296U, 11794381952U, 11802770048U, - 11811157888U, 11819548544U, 11827932544U, 11836324736U, 11844713344U, - 11853100928U, 11861486464U, 11869879936U, 11878268032U, 11886656896U, - 11895044992U, 11903433088U, 11911822976U, 11920210816U, 11928600448U, - 11936987264U, 11945375872U, 11953761152U, 11962151296U, 11970543488U, - 11978928512U, 11987320448U, 11995708288U, 12004095104U, 12012486272U, - 12020875136U, 12029255552U, 12037652096U, 12046039168U, 12054429568U, - 12062813824U, 12071206528U, 12079594624U, 12087983744U, 12096371072U, - 12104759936U, 12113147264U, 12121534592U, 12129924992U, 12138314624U, - 12146703232U, 12155091584U, 12163481216U, 12171864704U, 12180255872U, - 12188643968U, 12197034112U, 12205424512U, 12213811328U, 12222199424U, - 12230590336U, 12238977664U, 12247365248U, 12255755392U, 12264143488U, - 12272531584U, 12280920448U, 12289309568U, 12297694592U, 12306086528U, - 12314475392U, 12322865024U, 12331253632U, 12339640448U, 12348029312U, - 12356418944U, 12364805248U, 12373196672U, 12381580928U, 12389969024U, - 12398357632U, 12406750592U, 12415138432U, 12423527552U, 12431916416U, - 12440304512U, 12448692352U, 12457081216U, 12465467776U, 12473859968U, - 12482245504U, 12490636672U, 12499025536U, 12507411584U, 12515801728U, - 12524190592U, 12532577152U, 12540966272U, 12549354368U, 12557743232U, - 12566129536U, 12574523264U, 12582911872U, 12591299456U, 12599688064U, - 12608074624U, 12616463488U, 12624845696U, 12633239936U, 12641631616U, - 12650019968U, 12658407296U, 12666795136U, 12675183232U, 12683574656U, - 12691960192U, 12700350592U, 12708740224U, 12717128576U, 12725515904U, - 12733906816U, 12742295168U, 12750680192U, 12759071872U, 12767460736U, - 12775848832U, 12784236928U, 12792626816U, 12801014656U, 12809404288U, - 12817789312U, 12826181504U, 12834568832U, 12842954624U, 12851345792U, - 12859732352U, 12868122496U, 12876512128U, 12884901248U, 12893289088U, - 12901672832U, 12910067584U, 12918455168U, 12926842496U, 12935232896U, - 12943620736U, 12952009856U, 12960396928U, 12968786816U, 12977176192U, - 12985563776U, 12993951104U, 13002341504U, 13010730368U, 13019115392U, - 13027506304U, 13035895168U, 13044272512U, 13052673152U, 13061062528U, - 13069446272U, 13077838976U, 13086227072U, 13094613632U, 13103000192U, - 13111393664U, 13119782528U, 13128157568U, 13136559232U, 13144945024U, - 13153329536U, 13161724288U, 13170111872U, 13178502784U, 13186884736U, - 13195279744U, 13203667072U, 13212057472U, 13220445824U, 13228832128U, - 13237221248U, 13245610624U, 13254000512U, 13262388352U, 13270777472U, - 13279166336U, 13287553408U, 13295943296U, 13304331904U, 13312719488U, - 13321108096U, 13329494656U, 13337885824U, 13346274944U, 13354663808U, - 13363051136U, 13371439232U, 13379825024U, 13388210816U, 13396605056U, - 13404995456U, 13413380224U, 13421771392U, 13430159744U, 13438546048U, - 13446937216U, 13455326848U, 13463708288U, 13472103808U, 13480492672U, - 13488875648U, 13497269888U, 13505657728U, 13514045312U, 13522435712U, - 13530824576U, 13539210112U, 13547599232U, 13555989376U, 13564379008U, - 13572766336U, 13581154432U, 13589544832U, 13597932928U, 13606320512U, - 13614710656U, 13623097472U, 13631477632U, 13639874944U, 13648264064U, - 13656652928U, 13665041792U, 13673430656U, 13681818496U, 13690207616U, - 13698595712U, 13706982272U, 13715373184U, 13723762048U, 13732150144U, - 13740536704U, 13748926592U, 13757316224U, 13765700992U, 13774090112U, - 13782477952U, 13790869376U, 13799259008U, 13807647872U, 13816036736U, - 13824425344U, 13832814208U, 13841202304U, 13849591424U, 13857978752U, - 13866368896U, 13874754688U, 13883145344U, 13891533184U, 13899919232U, - 13908311168U, 13916692096U, 13925085056U, 13933473152U, 13941866368U, - 13950253696U, 13958643584U, 13967032192U, 13975417216U, 13983807616U, - 13992197504U, 14000582272U, 14008973696U, 14017363072U, 14025752192U, - 14034137984U, 14042528384U, 14050918016U, 14059301504U, 14067691648U, - 14076083584U, 14084470144U, 14092852352U, 14101249664U, 14109635968U, - 14118024832U, 14126407552U, 14134804352U, 14143188608U, 14151577984U, - 14159968384U, 14168357248U, 14176741504U, 14185127296U, 14193521024U, - 14201911424U, 14210301824U, 14218685056U, 14227067264U, 14235467392U, - 14243855488U, 14252243072U, 14260630144U, 14269021568U, 14277409408U, - 14285799296U, 14294187904U, 14302571392U, 14310961792U, 14319353728U, - 14327738752U, 14336130944U, 14344518784U, 14352906368U, 14361296512U, - 14369685376U, 14378071424U, 14386462592U, 14394848128U, 14403230848U, - 14411627392U, 14420013952U, 14428402304U, 14436793472U, 14445181568U, - 14453569664U, 14461959808U, 14470347904U, 14478737024U, 14487122816U, - 14495511424U, 14503901824U, 14512291712U, 14520677504U, 14529064832U, - 14537456768U, 14545845632U, 14554234496U, 14562618496U, 14571011456U, - 14579398784U, 14587789184U, 14596172672U, 14604564608U, 14612953984U, - 14621341312U, 14629724288U, 14638120832U, 14646503296U, 14654897536U, - 14663284864U, 14671675264U, 14680061056U, 14688447616U, 14696835968U, - 14705228416U, 14713616768U, 14722003328U, 14730392192U, 14738784128U, - 14747172736U, 14755561088U, 14763947648U, 14772336512U, 14780725376U, - 14789110144U, 14797499776U, 14805892736U, 14814276992U, 14822670208U, - 14831056256U, 14839444352U, 14847836032U, 14856222848U, 14864612992U, - 14872997504U, 14881388672U, 14889775744U, 14898165376U, 14906553472U, - 14914944896U, 14923329664U, 14931721856U, 14940109696U, 14948497024U, - 14956887424U, 14965276544U, 14973663616U, 14982053248U, 14990439808U, - 14998830976U, 15007216768U, 15015605888U, 15023995264U, 15032385152U, - 15040768384U, 15049154944U, 15057549184U, 15065939072U, 15074328448U, - 15082715008U, 15091104128U, 15099493504U, 15107879296U, 15116269184U, - 15124659584U, 15133042304U, 15141431936U, 15149824384U, 15158214272U, - 15166602368U, 15174991232U, 15183378304U, 15191760512U, 15200154496U, - 15208542592U, 15216931712U, 15225323392U, 15233708416U, 15242098048U, - 15250489216U, 15258875264U, 15267265408U, 15275654528U, 15284043136U, - 15292431488U, 15300819584U, 15309208192U, 15317596544U, 15325986176U, - 15334374784U, 15342763648U, 15351151744U, 15359540608U, 15367929728U, - 15376318336U, 15384706432U, 15393092992U, 15401481856U, 15409869952U, - 15418258816U, 15426649984U, 15435037568U, 15443425664U, 15451815296U, - 15460203392U, 15468589184U, 15476979328U, 15485369216U, 15493755776U, - 15502146944U, 15510534272U, 15518924416U, 15527311232U, 15535699072U, - 15544089472U, 15552478336U, 15560866688U, 15569254528U, 15577642624U, - 15586031488U, 15594419072U, 15602809472U, 15611199104U, 15619586432U, - 15627975296U, 15636364928U, 15644753792U, 15653141888U, 15661529216U, - 15669918848U, 15678305152U, 15686696576U, 15695083136U, 15703474048U, - 15711861632U, 15720251264U, 15728636288U, 15737027456U, 15745417088U, - 15753804928U, 15762194048U, 15770582656U, 15778971008U, 15787358336U, - 15795747712U, 15804132224U, 15812523392U, 15820909696U, 15829300096U, - 15837691264U, 15846071936U, 15854466944U, 15862855808U, 15871244672U, - 15879634816U, 15888020608U, 15896409728U, 15904799104U, 15913185152U, - 15921577088U, 15929966464U, 15938354816U, 15946743424U, 15955129472U, - 15963519872U, 15971907968U, 15980296064U, 15988684928U, 15997073024U, - 16005460864U, 16013851264U, 16022241152U, 16030629248U, 16039012736U, - 16047406976U, 16055794816U, 16064181376U, 16072571264U, 16080957824U, - 16089346688U, 16097737856U, 16106125184U, 16114514816U, 16122904192U, - 16131292544U, 16139678848U, 16148066944U, 16156453504U, 16164839552U, - 16173236096U, 16181623424U, 16190012032U, 16198401152U, 16206790528U, - 16215177344U, 16223567744U, 16231956352U, 16240344704U, 16248731008U, - 16257117824U, 16265504384U, 16273898624U, 16282281856U, 16290668672U, - 16299064192U, 16307449216U, 16315842176U, 16324230016U, 16332613504U, - 16341006464U, 16349394304U, 16357783168U, 16366172288U, 16374561664U, - 16382951296U, 16391337856U, 16399726208U, 16408116352U, 16416505472U, - 16424892032U, 16433282176U, 16441668224U, 16450058624U, 16458448768U, - 16466836864U, 16475224448U, 16483613056U, 16492001408U, 16500391808U, - 16508779648U, 16517166976U, 16525555328U, 16533944192U, 16542330752U, - 16550719616U, 16559110528U, 16567497088U, 16575888512U, 16584274816U, - 16592665472U, 16601051008U, 16609442944U, 16617832064U, 16626218624U, - 16634607488U, 16642996096U, 16651385728U, 16659773824U, 16668163712U, - 16676552576U, 16684938112U, 16693328768U, 16701718144U, 16710095488U, - 16718492288U, 16726883968U, 16735272832U, 16743661184U, 16752049792U, - 16760436608U, 16768827008U, 16777214336U, 16785599104U, 16793992832U, - 16802381696U, 16810768768U, 16819151744U, 16827542656U, 16835934848U, - 16844323712U, 16852711552U, 16861101952U, 16869489536U, 16877876864U, - 16886265728U, 16894653056U, 16903044736U, 16911431296U, 16919821696U, - 16928207488U, 16936592768U, 16944987776U, 16953375616U, 16961763968U, - 16970152832U, 16978540928U, 16986929536U, 16995319168U, 17003704448U, - 17012096896U, 17020481152U, 17028870784U, 17037262208U, 17045649536U, - 17054039936U, 17062426496U, 17070814336U, 17079205504U, 17087592064U, - 17095978112U, 17104369024U, 17112759424U, 17121147776U, 17129536384U, - 17137926016U, 17146314368U, 17154700928U, 17163089792U, 17171480192U, - 17179864192U, 17188256896U, 17196644992U, 17205033856U, 17213423488U, - 17221811072U, 17230198912U, 17238588032U, 17246976896U, 17255360384U, - 17263754624U, 17272143232U, 17280530048U, 17288918912U, 17297309312U, - 17305696384U, 17314085504U, 17322475136U, 17330863744U, 17339252096U, - 17347640192U, 17356026496U, 17364413824U, 17372796544U, 17381190016U, - 17389583488U, 17397972608U, 17406360704U, 17414748544U, 17423135872U, - 17431527296U, 17439915904U, 17448303232U, 17456691584U, 17465081728U, - 17473468288U, 17481857408U, 17490247552U, 17498635904U, 17507022464U, - 17515409024U, 17523801728U, 17532189824U, 17540577664U, 17548966016U, - 17557353344U, 17565741184U, 17574131584U, 17582519168U, 17590907008U, - 17599296128U, 17607687808U, 17616076672U, 17624455808U, 17632852352U, - 17641238656U, 17649630848U, 17658018944U, 17666403968U, 17674794112U, - 17683178368U, 17691573376U, 17699962496U, 17708350592U, 17716739968U, - 17725126528U, 17733517184U, 17741898112U, 17750293888U, 17758673024U, - 17767070336U, 17775458432U, 17783848832U, 17792236928U, 17800625536U, - 17809012352U, 17817402752U, 17825785984U, 17834178944U, 17842563968U, - 17850955648U, 17859344512U, 17867732864U, 17876119424U, 17884511872U, - 17892900224U, 17901287296U, 17909677696U, 17918058112U, 17926451072U, - 17934843776U, 17943230848U, 17951609216U, 17960008576U, 17968397696U, - 17976784256U, 17985175424U, 17993564032U, 18001952128U, 18010339712U, - 18018728576U, 18027116672U, 18035503232U, 18043894144U, 18052283264U, - 18060672128U, 18069056384U, 18077449856U, 18085837184U, 18094225792U, - 18102613376U, 18111004544U, 18119388544U, 18127781248U, 18136170368U, - 18144558976U, 18152947328U, 18161336192U, 18169724288U, 18178108544U, - 18186498944U, 18194886784U, 18203275648U, 18211666048U, 18220048768U, - 18228444544U, 18236833408U, 18245220736U + 1073739904U, 1082130304U, 1090514816U, 1098906752U, 1107293056U, + 1115684224U, 1124070016U, 1132461952U, 1140849536U, 1149232768U, + 1157627776U, 1166013824U, 1174404736U, 1182786944U, 1191180416U, + 1199568512U, 1207958912U, 1216345216U, 1224732032U, 1233124736U, + 1241513344U, 1249902464U, 1258290304U, 1266673792U, 1275067264U, + 1283453312U, 1291844992U, 1300234112U, 1308619904U, 1317010048U, + 1325397376U, 1333787776U, 1342176128U, 1350561664U, 1358954368U, + 1367339392U, 1375731584U, 1384118144U, 1392507008U, 1400897408U, + 1409284736U, 1417673344U, 1426062464U, 1434451072U, 1442839168U, + 1451229056U, 1459615616U, 1468006016U, 1476394112U, 1484782976U, + 1493171584U, 1501559168U, 1509948032U, 1518337664U, 1526726528U, + 1535114624U, 1543503488U, 1551892096U, 1560278656U, 1568669056U, + 1577056384U, 1585446272U, 1593831296U, 1602219392U, 1610610304U, + 1619000192U, 1627386752U, 1635773824U, 1644164224U, 1652555648U, + 1660943488U, 1669332608U, 1677721216U, 1686109312U, 1694497664U, + 1702886272U, 1711274624U, 1719661184U, 1728047744U, 1736434816U, + 1744829056U, 1753218944U, 1761606272U, 1769995904U, 1778382464U, + 1786772864U, 1795157888U, 1803550592U, 1811937664U, 1820327552U, + 1828711552U, 1837102976U, 1845488768U, 1853879936U, 1862269312U, + 1870656896U, 1879048064U, 1887431552U, 1895825024U, 1904212096U, + 1912601216U, 1920988544U, 1929379456U, 1937765504U, 1946156672U, + 1954543232U, 1962932096U, 1971321728U, 1979707264U, 1988093056U, + 1996487552U, 2004874624U, 2013262208U, 2021653888U, 2030039936U, + 2038430848U, 2046819968U, 2055208576U, 2063596672U, 2071981952U, + 2080373632U, 2088762752U, 2097149056U, 2105539712U, 2113928576U, + 2122315136U, 2130700672U, 2139092608U, 2147483264U, 2155872128U, + 2164257664U, 2172642176U, 2181035392U, 2189426048U, 2197814912U, + 2206203008U, 2214587264U, 2222979712U, 2231367808U, 2239758208U, + 2248145024U, 2256527744U, 2264922752U, 2273312128U, 2281701248U, + 2290086272U, 2298476672U, 2306867072U, 2315251072U, 2323639168U, + 2332032128U, 2340420224U, 2348808064U, 2357196416U, 2365580416U, + 2373966976U, 2382363008U, 2390748544U, 2399139968U, 2407530368U, + 2415918976U, 2424307328U, 2432695424U, 2441084288U, 2449472384U, + 2457861248U, 2466247808U, 2474637184U, 2483026816U, 2491414144U, + 2499803776U, 2508191872U, 2516582272U, 2524970368U, 2533359232U, + 2541743488U, 2550134144U, 2558525056U, 2566913408U, 2575301504U, + 2583686528U, 2592073856U, 2600467328U, 2608856192U, 2617240448U, + 2625631616U, 2634022016U, 2642407552U, 2650796416U, 2659188352U, + 2667574912U, 2675965312U, 2684352896U, 2692738688U, 2701130624U, + 2709518464U, 2717907328U, 2726293376U, 2734685056U, 2743073152U, + 2751462016U, 2759851648U, 2768232832U, 2776625536U, 2785017728U, + 2793401984U, 2801794432U, 2810182016U, 2818571648U, 2826959488U, + 2835349376U, 2843734144U, 2852121472U, 2860514432U, 2868900992U, + 2877286784U, 2885676928U, 2894069632U, 2902451584U, 2910843008U, + 2919234688U, 2927622784U, 2936011648U, 2944400768U, 2952789376U, + 2961177728U, 2969565568U, 2977951616U, 2986338944U, 2994731392U, + 3003120256U, 3011508352U, 3019895936U, 3028287104U, 3036675968U, + 3045063808U, 3053452928U, 3061837696U, 3070228352U, 3078615424U, + 3087003776U, 3095394944U, 3103782272U, 3112173184U, 3120562048U, + 3128944768U, 3137339264U, 3145725056U, 3154109312U, 3162505088U, + 3170893184U, 3179280256U, 3187669376U, 3196056704U, 3204445568U, + 3212836736U, 3221224064U, 3229612928U, 3238002304U, 3246391168U, + 3254778496U, 3263165824U, 3271556224U, 3279944576U, 3288332416U, + 3296719232U, 3305110912U, 3313500032U, 3321887104U, 3330273152U, + 3338658944U, 3347053184U, 3355440512U, 3363827072U, 3372220288U, + 3380608384U, 3388997504U, 3397384576U, 3405774208U, 3414163072U, + 3422551936U, 3430937984U, 3439328384U, 3447714176U, 3456104576U, + 3464493952U, 3472883584U, 3481268864U, 3489655168U, 3498048896U, + 3506434432U, 3514826368U, 3523213952U, 3531603584U, 3539987072U, + 3548380288U, 3556763264U, 3565157248U, 3573545344U, 3581934464U, + 3590324096U, 3598712704U, 3607098752U, 3615488384U, 3623877248U, + 3632265856U, 3640646528U, 3649043584U, 3657430144U, 3665821568U, + 3674207872U, 3682597504U, 3690984832U, 3699367808U, 3707764352U, + 3716152448U, 3724541056U, 3732925568U, 3741318016U, 3749706368U, + 3758091136U, 3766481536U, 3774872704U, 3783260032U, 3791650432U, + 3800036224U, 3808427648U, 3816815488U, 3825204608U, 3833592704U, + 3841981568U, 3850370432U, 3858755968U, 3867147904U, 3875536256U, + 3883920512U, 3892313728U, 3900702592U, 3909087872U, 3917478784U, + 3925868416U, 3934256512U, 3942645376U, 3951032192U, 3959422336U, + 3967809152U, 3976200064U, 3984588416U, 3992974976U, 4001363584U, + 4009751168U, 4018141312U, 4026530432U, 4034911616U, 4043308928U, + 4051695488U, 4060084352U, 4068472448U, 4076862848U, 4085249408U, + 4093640576U, 4102028416U, 4110413696U, 4118805632U, 4127194496U, + 4135583104U, 4143971968U, 4152360832U, 4160746112U, 4169135744U, + 4177525888U, 4185912704U, 4194303616U, 4202691968U, 4211076736U, + 4219463552U, 4227855488U, 4236246656U, 4244633728U, 4253022848U, + 4261412224U, 4269799808U, 4278184832U, 4286578048U, 4294962304U, + 4303349632U, 4311743104U, 4320130432U, 4328521088U, 4336909184U, + 4345295488U, 4353687424U, 4362073472U, 4370458496U, 4378852736U, + 4387238528U, 4395630208U, 4404019072U, 4412407424U, 4420790656U, + 4429182848U, 4437571456U, 4445962112U, 4454344064U, 4462738048U, + 4471119232U, 4479516544U, 4487904128U, 4496289664U, 4504682368U, + 4513068416U, 4521459584U, 4529846144U, 4538232704U, 4546619776U, + 4555010176U, 4563402112U, 4571790208U, 4580174464U, 4588567936U, + 4596957056U, 4605344896U, 4613734016U, 4622119808U, 4630511488U, + 4638898816U, 4647287936U, 4655675264U, 4664065664U, 4672451968U, + 4680842624U, 4689231488U, 4697620352U, 4706007424U, 4714397056U, + 4722786176U, 4731173248U, 4739562368U, 4747951744U, 4756340608U, + 4764727936U, 4773114496U, 4781504384U, 4789894784U, 4798283648U, + 4806667648U, 4815059584U, 4823449472U, 4831835776U, 4840226176U, + 4848612224U, 4857003392U, 4865391488U, 4873780096U, 4882169728U, + 4890557312U, 4898946944U, 4907333248U, 4915722368U, 4924110976U, + 4932499328U, 4940889728U, 4949276032U, 4957666432U, 4966054784U, + 4974438016U, 4982831488U, 4991221376U, 4999607168U, 5007998848U, + 5016386432U, 5024763776U, 5033164672U, 5041544576U, 5049941888U, + 5058329728U, 5066717056U, 5075107456U, 5083494272U, 5091883904U, + 5100273536U, 5108662144U, 5117048192U, 5125436032U, 5133827456U, + 5142215296U, 5150605184U, 5158993024U, 5167382144U, 5175769472U, + 5184157568U, 5192543872U, 5200936064U, 5209324928U, 5217711232U, + 5226102656U, 5234490496U, 5242877312U, 5251263872U, 5259654016U, + 5268040832U, 5276434304U, 5284819328U, 5293209728U, 5301598592U, + 5309986688U, 5318374784U, 5326764416U, 5335151488U, 5343542144U, + 5351929472U, 5360319872U, 5368706944U, 5377096576U, 5385484928U, + 5393871232U, 5402263424U, 5410650496U, 5419040384U, 5427426944U, + 5435816576U, 5444205952U, 5452594816U, 5460981376U, 5469367936U, + 5477760896U, 5486148736U, 5494536832U, 5502925952U, 5511315328U, + 5519703424U, 5528089984U, 5536481152U, 5544869504U, 5553256064U, + 5561645696U, 5570032768U, 5578423936U, 5586811264U, 5595193216U, + 5603585408U, 5611972736U, 5620366208U, 5628750464U, 5637143936U, + 5645528192U, 5653921408U, 5662310272U, 5670694784U, 5679082624U, + 5687474048U, 5695864448U, 5704251008U, 5712641408U, 5721030272U, + 5729416832U, 5737806208U, 5746194304U, 5754583936U, 5762969984U, + 5771358592U, 5779748224U, 5788137856U, 5796527488U, 5804911232U, + 5813300608U, 5821692544U, 5830082176U, 5838468992U, 5846855552U, + 5855247488U, 5863636096U, 5872024448U, 5880411008U, 5888799872U, + 5897186432U, 5905576832U, 5913966976U, 5922352768U, 5930744704U, + 5939132288U, 5947522432U, 5955911296U, 5964299392U, 5972688256U, + 5981074304U, 5989465472U, 5997851008U, 6006241408U, 6014627968U, + 6023015552U, 6031408256U, 6039796096U, 6048185216U, 6056574848U, + 6064963456U, 6073351808U, 6081736064U, 6090128768U, 6098517632U, + 6106906496U, 6115289216U, 6123680896U, 6132070016U, 6140459648U, + 6148849024U, 6157237376U, 6165624704U, 6174009728U, 6182403712U, + 6190792064U, 6199176064U, 6207569792U, 6215952256U, 6224345216U, + 6232732544U, 6241124224U, 6249510272U, 6257899136U, 6266287744U, + 6274676864U, 6283065728U, 6291454336U, 6299843456U, 6308232064U, + 6316620928U, 6325006208U, 6333395584U, 6341784704U, 6350174848U, + 6358562176U, 6366951296U, 6375337856U, 6383729536U, 6392119168U, + 6400504192U, 6408895616U, 6417283456U, 6425673344U, 6434059136U, + 6442444672U, 6450837376U, 6459223424U, 6467613056U, 6476004224U, + 6484393088U, 6492781952U, 6501170048U, 6509555072U, 6517947008U, + 6526336384U, 6534725504U, 6543112832U, 6551500672U, 6559888768U, + 6568278656U, 6576662912U, 6585055616U, 6593443456U, 6601834112U, + 6610219648U, 6618610304U, 6626999168U, 6635385472U, 6643777408U, + 6652164224U, 6660552832U, 6668941952U, 6677330048U, 6685719424U, + 6694107776U, 6702493568U, 6710882176U, 6719274112U, 6727662976U, + 6736052096U, 6744437632U, 6752825984U, 6761213824U, 6769604224U, + 6777993856U, 6786383488U, 6794770816U, 6803158144U, 6811549312U, + 6819937664U, 6828326528U, 6836706176U, 6845101696U, 6853491328U, + 6861880448U, 6870269312U, 6878655104U, 6887046272U, 6895433344U, + 6903822208U, 6912212864U, 6920596864U, 6928988288U, 6937377152U, + 6945764992U, 6954149248U, 6962544256U, 6970928768U, 6979317376U, + 6987709312U, 6996093824U, 7004487296U, 7012875392U, 7021258624U, + 7029652352U, 7038038912U, 7046427776U, 7054818944U, 7063207808U, + 7071595136U, 7079980928U, 7088372608U, 7096759424U, 7105149824U, + 7113536896U, 7121928064U, 7130315392U, 7138699648U, 7147092352U, + 7155479168U, 7163865728U, 7172249984U, 7180648064U, 7189036672U, + 7197424768U, 7205810816U, 7214196608U, 7222589824U, 7230975104U, + 7239367552U, 7247755904U, 7256145536U, 7264533376U, 7272921472U, + 7281308032U, 7289694848U, 7298088832U, 7306471808U, 7314864512U, + 7323253888U, 7331643008U, 7340029568U, 7348419712U, 7356808832U, + 7365196672U, 7373585792U, 7381973888U, 7390362752U, 7398750592U, + 7407138944U, 7415528576U, 7423915648U, 7432302208U, 7440690304U, + 7449080192U, 7457472128U, 7465860992U, 7474249088U, 7482635648U, + 7491023744U, 7499412608U, 7507803008U, 7516192384U, 7524579968U, + 7532967296U, 7541358464U, 7549745792U, 7558134656U, 7566524032U, + 7574912896U, 7583300992U, 7591690112U, 7600075136U, 7608466816U, + 7616854912U, 7625244544U, 7633629824U, 7642020992U, 7650410368U, + 7658794112U, 7667187328U, 7675574912U, 7683961984U, 7692349568U, + 7700739712U, 7709130368U, 7717519232U, 7725905536U, 7734295424U, + 7742683264U, 7751069056U, 7759457408U, 7767849088U, 7776238208U, + 7784626816U, 7793014912U, 7801405312U, 7809792128U, 7818179968U, + 7826571136U, 7834957184U, 7843347328U, 7851732352U, 7860124544U, + 7868512384U, 7876902016U, 7885287808U, 7893679744U, 7902067072U, + 7910455936U, 7918844288U, 7927230848U, 7935622784U, 7944009344U, + 7952400256U, 7960786048U, 7969176704U, 7977565312U, 7985953408U, + 7994339968U, 8002730368U, 8011119488U, 8019508096U, 8027896192U, + 8036285056U, 8044674688U, 8053062272U, 8061448832U, 8069838464U, + 8078227328U, 8086616704U, 8095006592U, 8103393664U, 8111783552U, + 8120171392U, 8128560256U, 8136949376U, 8145336704U, 8153726848U, + 8162114944U, 8170503296U, 8178891904U, 8187280768U, 8195669632U, + 8204058496U, 8212444544U, 8220834176U, 8229222272U, 8237612672U, + 8246000768U, 8254389376U, 8262775168U, 8271167104U, 8279553664U, + 8287944064U, 8296333184U, 8304715136U, 8313108352U, 8321497984U, + 8329885568U, 8338274432U, 8346663296U, 8355052928U, 8363441536U, + 8371828352U, 8380217984U, 8388606592U, 8396996224U, 8405384576U, + 8413772672U, 8422161536U, 8430549376U, 8438939008U, 8447326592U, + 8455715456U, 8464104832U, 8472492928U, 8480882048U, 8489270656U, + 8497659776U, 8506045312U, 8514434944U, 8522823808U, 8531208832U, + 8539602304U, 8547990656U, 8556378752U, 8564768384U, 8573154176U, + 8581542784U, 8589933952U, 8598322816U, 8606705024U, 8615099264U, + 8623487872U, 8631876992U, 8640264064U, 8648653952U, 8657040256U, + 8665430656U, 8673820544U, 8682209152U, 8690592128U, 8698977152U, + 8707374464U, 8715763328U, 8724151424U, 8732540032U, 8740928384U, + 8749315712U, 8757704576U, 8766089344U, 8774480768U, 8782871936U, + 8791260032U, 8799645824U, 8808034432U, 8816426368U, 8824812928U, + 8833199488U, 8841591424U, 8849976448U, 8858366336U, 8866757248U, + 8875147136U, 8883532928U, 8891923328U, 8900306816U, 8908700288U, + 8917088384U, 8925478784U, 8933867392U, 8942250368U, 8950644608U, + 8959032704U, 8967420544U, 8975809664U, 8984197504U, 8992584064U, + 9000976256U, 9009362048U, 9017752448U, 9026141312U, 9034530688U, + 9042917504U, 9051307904U, 9059694208U, 9068084864U, 9076471424U, + 9084861824U, 9093250688U, 9101638528U, 9110027648U, 9118416512U, + 9126803584U, 9135188096U, 9143581312U, 9151969664U, 9160356224U, + 9168747136U, 9177134464U, 9185525632U, 9193910144U, 9202302848U, + 9210690688U, 9219079552U, 9227465344U, 9235854464U, 9244244864U, + 9252633472U, 9261021824U, 9269411456U, 9277799296U, 9286188928U, + 9294574208U, 9302965888U, 9311351936U, 9319740032U, 9328131968U, + 9336516736U, 9344907392U, 9353296768U, 9361685888U, 9370074752U, + 9378463616U, 9386849408U, 9395239808U, 9403629184U, 9412016512U, + 9420405376U, 9428795008U, 9437181568U, 9445570688U, 9453960832U, + 9462346624U, 9470738048U, 9479121536U, 9487515008U, 9495903616U, + 9504289664U, 9512678528U, 9521067904U, 9529456256U, 9537843584U, + 9546233728U, 9554621312U, 9563011456U, 9571398784U, 9579788672U, + 9588178304U, 9596567168U, 9604954496U, 9613343104U, 9621732992U, + 9630121856U, 9638508416U, 9646898816U, 9655283584U, 9663675776U, + 9672061312U, 9680449664U, 9688840064U, 9697230464U, 9705617536U, + 9714003584U, 9722393984U, 9730772608U, 9739172224U, 9747561088U, + 9755945344U, 9764338816U, 9772726144U, 9781116544U, 9789503872U, + 9797892992U, 9806282624U, 9814670464U, 9823056512U, 9831439232U, + 9839833984U, 9848224384U, 9856613504U, 9865000576U, 9873391232U, + 9881772416U, 9890162816U, 9898556288U, 9906940544U, 9915333248U, + 9923721088U, 9932108672U, 9940496512U, 9948888448U, 9957276544U, + 9965666176U, 9974048384U, 9982441088U, 9990830464U, 9999219584U, + 10007602816U, 10015996544U, 10024385152U, 10032774016U, 10041163648U, + 10049548928U, 10057940096U, 10066329472U, 10074717824U, 10083105152U, + 10091495296U, 10099878784U, 10108272256U, 10116660608U, 10125049216U, + 10133437312U, 10141825664U, 10150213504U, 10158601088U, 10166991232U, + 10175378816U, 10183766144U, 10192157312U, 10200545408U, 10208935552U, + 10217322112U, 10225712768U, 10234099328U, 10242489472U, 10250876032U, + 10259264896U, 10267656064U, 10276042624U, 10284429184U, 10292820352U, + 10301209472U, 10309598848U, 10317987712U, 10326375296U, 10334763392U, + 10343153536U, 10351541632U, 10359930752U, 10368318592U, 10376707456U, + 10385096576U, 10393484672U, 10401867136U, 10410262144U, 10418647424U, + 10427039104U, 10435425664U, 10443810176U, 10452203648U, 10460589952U, + 10468982144U, 10477369472U, 10485759104U, 10494147712U, 10502533504U, + 10510923392U, 10519313536U, 10527702656U, 10536091264U, 10544478592U, + 10552867712U, 10561255808U, 10569642368U, 10578032768U, 10586423168U, + 10594805632U, 10603200128U, 10611588992U, 10619976064U, 10628361344U, + 10636754048U, 10645143424U, 10653531776U, 10661920384U, 10670307968U, + 10678696832U, 10687086464U, 10695475072U, 10703863168U, 10712246144U, + 10720639616U, 10729026688U, 10737414784U, 10745806208U, 10754190976U, + 10762581376U, 10770971264U, 10779356288U, 10787747456U, 10796135552U, + 10804525184U, 10812915584U, 10821301888U, 10829692288U, 10838078336U, + 10846469248U, 10854858368U, 10863247232U, 10871631488U, 10880023424U, + 10888412032U, 10896799616U, 10905188992U, 10913574016U, 10921964672U, + 10930352768U, 10938742912U, 10947132544U, 10955518592U, 10963909504U, + 10972298368U, 10980687488U, 10989074816U, 10997462912U, 11005851776U, + 11014241152U, 11022627712U, 11031017344U, 11039403904U, 11047793024U, + 11056184704U, 11064570752U, 11072960896U, 11081343872U, 11089737856U, + 11098128256U, 11106514816U, 11114904448U, 11123293568U, 11131680128U, + 11140065152U, 11148458368U, 11156845696U, 11165236864U, 11173624192U, + 11182013824U, 11190402688U, 11198790784U, 11207179136U, 11215568768U, + 11223957376U, 11232345728U, 11240734592U, 11249122688U, 11257511296U, + 11265899648U, 11274285952U, 11282675584U, 11291065472U, 11299452544U, + 11307842432U, 11316231296U, 11324616832U, 11333009024U, 11341395584U, + 11349782656U, 11358172288U, 11366560384U, 11374950016U, 11383339648U, + 11391721856U, 11400117376U, 11408504192U, 11416893568U, 11425283456U, + 11433671552U, 11442061184U, 11450444672U, 11458837888U, 11467226752U, + 11475611776U, 11484003968U, 11492392064U, 11500780672U, 11509169024U, + 11517550976U, 11525944448U, 11534335616U, 11542724224U, 11551111808U, + 11559500672U, 11567890304U, 11576277376U, 11584667008U, 11593056128U, + 11601443456U, 11609830016U, 11618221952U, 11626607488U, 11634995072U, + 11643387776U, 11651775104U, 11660161664U, 11668552576U, 11676940928U, + 11685330304U, 11693718656U, 11702106496U, 11710496128U, 11718882688U, + 11727273088U, 11735660416U, 11744050048U, 11752437376U, 11760824704U, + 11769216128U, 11777604736U, 11785991296U, 11794381952U, 11802770048U, + 11811157888U, 11819548544U, 11827932544U, 11836324736U, 11844713344U, + 11853100928U, 11861486464U, 11869879936U, 11878268032U, 11886656896U, + 11895044992U, 11903433088U, 11911822976U, 11920210816U, 11928600448U, + 11936987264U, 11945375872U, 11953761152U, 11962151296U, 11970543488U, + 11978928512U, 11987320448U, 11995708288U, 12004095104U, 12012486272U, + 12020875136U, 12029255552U, 12037652096U, 12046039168U, 12054429568U, + 12062813824U, 12071206528U, 12079594624U, 12087983744U, 12096371072U, + 12104759936U, 12113147264U, 12121534592U, 12129924992U, 12138314624U, + 12146703232U, 12155091584U, 12163481216U, 12171864704U, 12180255872U, + 12188643968U, 12197034112U, 12205424512U, 12213811328U, 12222199424U, + 12230590336U, 12238977664U, 12247365248U, 12255755392U, 12264143488U, + 12272531584U, 12280920448U, 12289309568U, 12297694592U, 12306086528U, + 12314475392U, 12322865024U, 12331253632U, 12339640448U, 12348029312U, + 12356418944U, 12364805248U, 12373196672U, 12381580928U, 12389969024U, + 12398357632U, 12406750592U, 12415138432U, 12423527552U, 12431916416U, + 12440304512U, 12448692352U, 12457081216U, 12465467776U, 12473859968U, + 12482245504U, 12490636672U, 12499025536U, 12507411584U, 12515801728U, + 12524190592U, 12532577152U, 12540966272U, 12549354368U, 12557743232U, + 12566129536U, 12574523264U, 12582911872U, 12591299456U, 12599688064U, + 12608074624U, 12616463488U, 12624845696U, 12633239936U, 12641631616U, + 12650019968U, 12658407296U, 12666795136U, 12675183232U, 12683574656U, + 12691960192U, 12700350592U, 12708740224U, 12717128576U, 12725515904U, + 12733906816U, 12742295168U, 12750680192U, 12759071872U, 12767460736U, + 12775848832U, 12784236928U, 12792626816U, 12801014656U, 12809404288U, + 12817789312U, 12826181504U, 12834568832U, 12842954624U, 12851345792U, + 12859732352U, 12868122496U, 12876512128U, 12884901248U, 12893289088U, + 12901672832U, 12910067584U, 12918455168U, 12926842496U, 12935232896U, + 12943620736U, 12952009856U, 12960396928U, 12968786816U, 12977176192U, + 12985563776U, 12993951104U, 13002341504U, 13010730368U, 13019115392U, + 13027506304U, 13035895168U, 13044272512U, 13052673152U, 13061062528U, + 13069446272U, 13077838976U, 13086227072U, 13094613632U, 13103000192U, + 13111393664U, 13119782528U, 13128157568U, 13136559232U, 13144945024U, + 13153329536U, 13161724288U, 13170111872U, 13178502784U, 13186884736U, + 13195279744U, 13203667072U, 13212057472U, 13220445824U, 13228832128U, + 13237221248U, 13245610624U, 13254000512U, 13262388352U, 13270777472U, + 13279166336U, 13287553408U, 13295943296U, 13304331904U, 13312719488U, + 13321108096U, 13329494656U, 13337885824U, 13346274944U, 13354663808U, + 13363051136U, 13371439232U, 13379825024U, 13388210816U, 13396605056U, + 13404995456U, 13413380224U, 13421771392U, 13430159744U, 13438546048U, + 13446937216U, 13455326848U, 13463708288U, 13472103808U, 13480492672U, + 13488875648U, 13497269888U, 13505657728U, 13514045312U, 13522435712U, + 13530824576U, 13539210112U, 13547599232U, 13555989376U, 13564379008U, + 13572766336U, 13581154432U, 13589544832U, 13597932928U, 13606320512U, + 13614710656U, 13623097472U, 13631477632U, 13639874944U, 13648264064U, + 13656652928U, 13665041792U, 13673430656U, 13681818496U, 13690207616U, + 13698595712U, 13706982272U, 13715373184U, 13723762048U, 13732150144U, + 13740536704U, 13748926592U, 13757316224U, 13765700992U, 13774090112U, + 13782477952U, 13790869376U, 13799259008U, 13807647872U, 13816036736U, + 13824425344U, 13832814208U, 13841202304U, 13849591424U, 13857978752U, + 13866368896U, 13874754688U, 13883145344U, 13891533184U, 13899919232U, + 13908311168U, 13916692096U, 13925085056U, 13933473152U, 13941866368U, + 13950253696U, 13958643584U, 13967032192U, 13975417216U, 13983807616U, + 13992197504U, 14000582272U, 14008973696U, 14017363072U, 14025752192U, + 14034137984U, 14042528384U, 14050918016U, 14059301504U, 14067691648U, + 14076083584U, 14084470144U, 14092852352U, 14101249664U, 14109635968U, + 14118024832U, 14126407552U, 14134804352U, 14143188608U, 14151577984U, + 14159968384U, 14168357248U, 14176741504U, 14185127296U, 14193521024U, + 14201911424U, 14210301824U, 14218685056U, 14227067264U, 14235467392U, + 14243855488U, 14252243072U, 14260630144U, 14269021568U, 14277409408U, + 14285799296U, 14294187904U, 14302571392U, 14310961792U, 14319353728U, + 14327738752U, 14336130944U, 14344518784U, 14352906368U, 14361296512U, + 14369685376U, 14378071424U, 14386462592U, 14394848128U, 14403230848U, + 14411627392U, 14420013952U, 14428402304U, 14436793472U, 14445181568U, + 14453569664U, 14461959808U, 14470347904U, 14478737024U, 14487122816U, + 14495511424U, 14503901824U, 14512291712U, 14520677504U, 14529064832U, + 14537456768U, 14545845632U, 14554234496U, 14562618496U, 14571011456U, + 14579398784U, 14587789184U, 14596172672U, 14604564608U, 14612953984U, + 14621341312U, 14629724288U, 14638120832U, 14646503296U, 14654897536U, + 14663284864U, 14671675264U, 14680061056U, 14688447616U, 14696835968U, + 14705228416U, 14713616768U, 14722003328U, 14730392192U, 14738784128U, + 14747172736U, 14755561088U, 14763947648U, 14772336512U, 14780725376U, + 14789110144U, 14797499776U, 14805892736U, 14814276992U, 14822670208U, + 14831056256U, 14839444352U, 14847836032U, 14856222848U, 14864612992U, + 14872997504U, 14881388672U, 14889775744U, 14898165376U, 14906553472U, + 14914944896U, 14923329664U, 14931721856U, 14940109696U, 14948497024U, + 14956887424U, 14965276544U, 14973663616U, 14982053248U, 14990439808U, + 14998830976U, 15007216768U, 15015605888U, 15023995264U, 15032385152U, + 15040768384U, 15049154944U, 15057549184U, 15065939072U, 15074328448U, + 15082715008U, 15091104128U, 15099493504U, 15107879296U, 15116269184U, + 15124659584U, 15133042304U, 15141431936U, 15149824384U, 15158214272U, + 15166602368U, 15174991232U, 15183378304U, 15191760512U, 15200154496U, + 15208542592U, 15216931712U, 15225323392U, 15233708416U, 15242098048U, + 15250489216U, 15258875264U, 15267265408U, 15275654528U, 15284043136U, + 15292431488U, 15300819584U, 15309208192U, 15317596544U, 15325986176U, + 15334374784U, 15342763648U, 15351151744U, 15359540608U, 15367929728U, + 15376318336U, 15384706432U, 15393092992U, 15401481856U, 15409869952U, + 15418258816U, 15426649984U, 15435037568U, 15443425664U, 15451815296U, + 15460203392U, 15468589184U, 15476979328U, 15485369216U, 15493755776U, + 15502146944U, 15510534272U, 15518924416U, 15527311232U, 15535699072U, + 15544089472U, 15552478336U, 15560866688U, 15569254528U, 15577642624U, + 15586031488U, 15594419072U, 15602809472U, 15611199104U, 15619586432U, + 15627975296U, 15636364928U, 15644753792U, 15653141888U, 15661529216U, + 15669918848U, 15678305152U, 15686696576U, 15695083136U, 15703474048U, + 15711861632U, 15720251264U, 15728636288U, 15737027456U, 15745417088U, + 15753804928U, 15762194048U, 15770582656U, 15778971008U, 15787358336U, + 15795747712U, 15804132224U, 15812523392U, 15820909696U, 15829300096U, + 15837691264U, 15846071936U, 15854466944U, 15862855808U, 15871244672U, + 15879634816U, 15888020608U, 15896409728U, 15904799104U, 15913185152U, + 15921577088U, 15929966464U, 15938354816U, 15946743424U, 15955129472U, + 15963519872U, 15971907968U, 15980296064U, 15988684928U, 15997073024U, + 16005460864U, 16013851264U, 16022241152U, 16030629248U, 16039012736U, + 16047406976U, 16055794816U, 16064181376U, 16072571264U, 16080957824U, + 16089346688U, 16097737856U, 16106125184U, 16114514816U, 16122904192U, + 16131292544U, 16139678848U, 16148066944U, 16156453504U, 16164839552U, + 16173236096U, 16181623424U, 16190012032U, 16198401152U, 16206790528U, + 16215177344U, 16223567744U, 16231956352U, 16240344704U, 16248731008U, + 16257117824U, 16265504384U, 16273898624U, 16282281856U, 16290668672U, + 16299064192U, 16307449216U, 16315842176U, 16324230016U, 16332613504U, + 16341006464U, 16349394304U, 16357783168U, 16366172288U, 16374561664U, + 16382951296U, 16391337856U, 16399726208U, 16408116352U, 16416505472U, + 16424892032U, 16433282176U, 16441668224U, 16450058624U, 16458448768U, + 16466836864U, 16475224448U, 16483613056U, 16492001408U, 16500391808U, + 16508779648U, 16517166976U, 16525555328U, 16533944192U, 16542330752U, + 16550719616U, 16559110528U, 16567497088U, 16575888512U, 16584274816U, + 16592665472U, 16601051008U, 16609442944U, 16617832064U, 16626218624U, + 16634607488U, 16642996096U, 16651385728U, 16659773824U, 16668163712U, + 16676552576U, 16684938112U, 16693328768U, 16701718144U, 16710095488U, + 16718492288U, 16726883968U, 16735272832U, 16743661184U, 16752049792U, + 16760436608U, 16768827008U, 16777214336U, 16785599104U, 16793992832U, + 16802381696U, 16810768768U, 16819151744U, 16827542656U, 16835934848U, + 16844323712U, 16852711552U, 16861101952U, 16869489536U, 16877876864U, + 16886265728U, 16894653056U, 16903044736U, 16911431296U, 16919821696U, + 16928207488U, 16936592768U, 16944987776U, 16953375616U, 16961763968U, + 16970152832U, 16978540928U, 16986929536U, 16995319168U, 17003704448U, + 17012096896U, 17020481152U, 17028870784U, 17037262208U, 17045649536U, + 17054039936U, 17062426496U, 17070814336U, 17079205504U, 17087592064U, + 17095978112U, 17104369024U, 17112759424U, 17121147776U, 17129536384U, + 17137926016U, 17146314368U, 17154700928U, 17163089792U, 17171480192U, + 17179864192U, 17188256896U, 17196644992U, 17205033856U, 17213423488U, + 17221811072U, 17230198912U, 17238588032U, 17246976896U, 17255360384U, + 17263754624U, 17272143232U, 17280530048U, 17288918912U, 17297309312U, + 17305696384U, 17314085504U, 17322475136U, 17330863744U, 17339252096U, + 17347640192U, 17356026496U, 17364413824U, 17372796544U, 17381190016U, + 17389583488U, 17397972608U, 17406360704U, 17414748544U, 17423135872U, + 17431527296U, 17439915904U, 17448303232U, 17456691584U, 17465081728U, + 17473468288U, 17481857408U, 17490247552U, 17498635904U, 17507022464U, + 17515409024U, 17523801728U, 17532189824U, 17540577664U, 17548966016U, + 17557353344U, 17565741184U, 17574131584U, 17582519168U, 17590907008U, + 17599296128U, 17607687808U, 17616076672U, 17624455808U, 17632852352U, + 17641238656U, 17649630848U, 17658018944U, 17666403968U, 17674794112U, + 17683178368U, 17691573376U, 17699962496U, 17708350592U, 17716739968U, + 17725126528U, 17733517184U, 17741898112U, 17750293888U, 17758673024U, + 17767070336U, 17775458432U, 17783848832U, 17792236928U, 17800625536U, + 17809012352U, 17817402752U, 17825785984U, 17834178944U, 17842563968U, + 17850955648U, 17859344512U, 17867732864U, 17876119424U, 17884511872U, + 17892900224U, 17901287296U, 17909677696U, 17918058112U, 17926451072U, + 17934843776U, 17943230848U, 17951609216U, 17960008576U, 17968397696U, + 17976784256U, 17985175424U, 17993564032U, 18001952128U, 18010339712U, + 18018728576U, 18027116672U, 18035503232U, 18043894144U, 18052283264U, + 18060672128U, 18069056384U, 18077449856U, 18085837184U, 18094225792U, + 18102613376U, 18111004544U, 18119388544U, 18127781248U, 18136170368U, + 18144558976U, 18152947328U, 18161336192U, 18169724288U, 18178108544U, + 18186498944U, 18194886784U, 18203275648U, 18211666048U, 18220048768U, + 18228444544U, 18236833408U, 18245220736U }; @@ -478,335 +478,335 @@ static const uint64_t dag_sizes[2048] = { // Sow[i*HashBytes]; j++]]]][[2]][[1]] const uint64_t cache_sizes[2048] = { - 16776896U, 16907456U, 17039296U, 17170112U, 17301056U, 17432512U, 17563072U, - 17693888U, 17824192U, 17955904U, 18087488U, 18218176U, 18349504U, 18481088U, - 18611392U, 18742336U, 18874304U, 19004224U, 19135936U, 19267264U, 19398208U, - 19529408U, 19660096U, 19791424U, 19922752U, 20053952U, 20184896U, 20315968U, - 20446912U, 20576576U, 20709184U, 20840384U, 20971072U, 21102272U, 21233216U, - 21364544U, 21494848U, 21626816U, 21757376U, 21887552U, 22019392U, 22151104U, - 22281536U, 22412224U, 22543936U, 22675264U, 22806464U, 22935872U, 23068096U, - 23198272U, 23330752U, 23459008U, 23592512U, 23723968U, 23854912U, 23986112U, - 24116672U, 24247616U, 24378688U, 24509504U, 24640832U, 24772544U, 24903488U, - 25034432U, 25165376U, 25296704U, 25427392U, 25558592U, 25690048U, 25820096U, - 25951936U, 26081728U, 26214208U, 26345024U, 26476096U, 26606656U, 26737472U, - 26869184U, 26998208U, 27131584U, 27262528U, 27393728U, 27523904U, 27655744U, - 27786688U, 27917888U, 28049344U, 28179904U, 28311488U, 28441792U, 28573504U, - 28700864U, 28835648U, 28966208U, 29096768U, 29228608U, 29359808U, 29490752U, - 29621824U, 29752256U, 29882816U, 30014912U, 30144448U, 30273728U, 30406976U, - 30538432U, 30670784U, 30799936U, 30932672U, 31063744U, 31195072U, 31325248U, - 31456192U, 31588288U, 31719232U, 31850432U, 31981504U, 32110784U, 32243392U, - 32372672U, 32505664U, 32636608U, 32767808U, 32897344U, 33029824U, 33160768U, - 33289664U, 33423296U, 33554368U, 33683648U, 33816512U, 33947456U, 34076992U, - 34208704U, 34340032U, 34471744U, 34600256U, 34734016U, 34864576U, 34993984U, - 35127104U, 35258176U, 35386688U, 35518528U, 35650624U, 35782336U, 35910976U, - 36044608U, 36175808U, 36305728U, 36436672U, 36568384U, 36699968U, 36830656U, - 36961984U, 37093312U, 37223488U, 37355072U, 37486528U, 37617472U, 37747904U, - 37879232U, 38009792U, 38141888U, 38272448U, 38403392U, 38535104U, 38660672U, - 38795584U, 38925632U, 39059264U, 39190336U, 39320768U, 39452096U, 39581632U, - 39713984U, 39844928U, 39974848U, 40107968U, 40238144U, 40367168U, 40500032U, - 40631744U, 40762816U, 40894144U, 41023552U, 41155904U, 41286208U, 41418304U, - 41547712U, 41680448U, 41811904U, 41942848U, 42073792U, 42204992U, 42334912U, - 42467008U, 42597824U, 42729152U, 42860096U, 42991552U, 43122368U, 43253696U, - 43382848U, 43515712U, 43646912U, 43777088U, 43907648U, 44039104U, 44170432U, - 44302144U, 44433344U, 44564288U, 44694976U, 44825152U, 44956864U, 45088448U, - 45219008U, 45350464U, 45481024U, 45612608U, 45744064U, 45874496U, 46006208U, - 46136768U, 46267712U, 46399424U, 46529344U, 46660672U, 46791488U, 46923328U, - 47053504U, 47185856U, 47316928U, 47447872U, 47579072U, 47710144U, 47839936U, - 47971648U, 48103232U, 48234176U, 48365248U, 48496192U, 48627136U, 48757312U, - 48889664U, 49020736U, 49149248U, 49283008U, 49413824U, 49545152U, 49675712U, - 49807168U, 49938368U, 50069056U, 50200256U, 50331584U, 50462656U, 50593472U, - 50724032U, 50853952U, 50986048U, 51117632U, 51248576U, 51379904U, 51510848U, - 51641792U, 51773248U, 51903296U, 52035136U, 52164032U, 52297664U, 52427968U, - 52557376U, 52690112U, 52821952U, 52952896U, 53081536U, 53213504U, 53344576U, - 53475776U, 53608384U, 53738816U, 53870528U, 54000832U, 54131776U, 54263744U, - 54394688U, 54525248U, 54655936U, 54787904U, 54918592U, 55049152U, 55181248U, - 55312064U, 55442752U, 55574336U, 55705024U, 55836224U, 55967168U, 56097856U, - 56228672U, 56358592U, 56490176U, 56621888U, 56753728U, 56884928U, 57015488U, - 57146816U, 57278272U, 57409216U, 57540416U, 57671104U, 57802432U, 57933632U, - 58064576U, 58195264U, 58326976U, 58457408U, 58588864U, 58720192U, 58849984U, - 58981696U, 59113024U, 59243456U, 59375552U, 59506624U, 59637568U, 59768512U, - 59897792U, 60030016U, 60161984U, 60293056U, 60423872U, 60554432U, 60683968U, - 60817216U, 60948032U, 61079488U, 61209664U, 61341376U, 61471936U, 61602752U, - 61733696U, 61865792U, 61996736U, 62127808U, 62259136U, 62389568U, 62520512U, - 62651584U, 62781632U, 62910784U, 63045056U, 63176128U, 63307072U, 63438656U, - 63569216U, 63700928U, 63831616U, 63960896U, 64093888U, 64225088U, 64355392U, - 64486976U, 64617664U, 64748608U, 64879424U, 65009216U, 65142464U, 65273792U, - 65402816U, 65535424U, 65666752U, 65797696U, 65927744U, 66060224U, 66191296U, - 66321344U, 66453056U, 66584384U, 66715328U, 66846656U, 66977728U, 67108672U, - 67239104U, 67370432U, 67501888U, 67631296U, 67763776U, 67895104U, 68026304U, - 68157248U, 68287936U, 68419264U, 68548288U, 68681408U, 68811968U, 68942912U, - 69074624U, 69205568U, 69337024U, 69467584U, 69599168U, 69729472U, 69861184U, - 69989824U, 70122944U, 70253888U, 70385344U, 70515904U, 70647232U, 70778816U, - 70907968U, 71040832U, 71171648U, 71303104U, 71432512U, 71564992U, 71695168U, - 71826368U, 71958464U, 72089536U, 72219712U, 72350144U, 72482624U, 72613568U, - 72744512U, 72875584U, 73006144U, 73138112U, 73268672U, 73400128U, 73530944U, - 73662272U, 73793344U, 73924544U, 74055104U, 74185792U, 74316992U, 74448832U, - 74579392U, 74710976U, 74841664U, 74972864U, 75102784U, 75233344U, 75364544U, - 75497024U, 75627584U, 75759296U, 75890624U, 76021696U, 76152256U, 76283072U, - 76414144U, 76545856U, 76676672U, 76806976U, 76937792U, 77070016U, 77200832U, - 77331392U, 77462464U, 77593664U, 77725376U, 77856448U, 77987776U, 78118336U, - 78249664U, 78380992U, 78511424U, 78642496U, 78773056U, 78905152U, 79033664U, - 79166656U, 79297472U, 79429568U, 79560512U, 79690816U, 79822784U, 79953472U, - 80084672U, 80214208U, 80346944U, 80477632U, 80608576U, 80740288U, 80870848U, - 81002048U, 81133504U, 81264448U, 81395648U, 81525952U, 81657536U, 81786304U, - 81919808U, 82050112U, 82181312U, 82311616U, 82443968U, 82573376U, 82705984U, - 82835776U, 82967744U, 83096768U, 83230528U, 83359552U, 83491264U, 83622464U, - 83753536U, 83886016U, 84015296U, 84147776U, 84277184U, 84409792U, 84540608U, - 84672064U, 84803008U, 84934336U, 85065152U, 85193792U, 85326784U, 85458496U, - 85589312U, 85721024U, 85851968U, 85982656U, 86112448U, 86244416U, 86370112U, - 86506688U, 86637632U, 86769344U, 86900672U, 87031744U, 87162304U, 87293632U, - 87424576U, 87555392U, 87687104U, 87816896U, 87947968U, 88079168U, 88211264U, - 88341824U, 88473152U, 88603712U, 88735424U, 88862912U, 88996672U, 89128384U, - 89259712U, 89390272U, 89521984U, 89652544U, 89783872U, 89914816U, 90045376U, - 90177088U, 90307904U, 90438848U, 90569152U, 90700096U, 90832832U, 90963776U, - 91093696U, 91223744U, 91356992U, 91486784U, 91618496U, 91749824U, 91880384U, - 92012224U, 92143552U, 92273344U, 92405696U, 92536768U, 92666432U, 92798912U, - 92926016U, 93060544U, 93192128U, 93322816U, 93453632U, 93583936U, 93715136U, - 93845056U, 93977792U, 94109504U, 94240448U, 94371776U, 94501184U, 94632896U, - 94764224U, 94895552U, 95023424U, 95158208U, 95287744U, 95420224U, 95550016U, - 95681216U, 95811904U, 95943872U, 96075328U, 96203584U, 96337856U, 96468544U, - 96599744U, 96731072U, 96860992U, 96992576U, 97124288U, 97254848U, 97385536U, - 97517248U, 97647808U, 97779392U, 97910464U, 98041408U, 98172608U, 98303168U, - 98434496U, 98565568U, 98696768U, 98827328U, 98958784U, 99089728U, 99220928U, - 99352384U, 99482816U, 99614272U, 99745472U, 99876416U, 100007104U, - 100138048U, 100267072U, 100401088U, 100529984U, 100662592U, 100791872U, - 100925248U, 101056064U, 101187392U, 101317952U, 101449408U, 101580608U, - 101711296U, 101841728U, 101973824U, 102104896U, 102235712U, 102366016U, - 102498112U, 102628672U, 102760384U, 102890432U, 103021888U, 103153472U, - 103284032U, 103415744U, 103545152U, 103677248U, 103808576U, 103939648U, - 104070976U, 104201792U, 104332736U, 104462528U, 104594752U, 104725952U, - 104854592U, 104988608U, 105118912U, 105247808U, 105381184U, 105511232U, - 105643072U, 105774784U, 105903296U, 106037056U, 106167872U, 106298944U, - 106429504U, 106561472U, 106691392U, 106822592U, 106954304U, 107085376U, - 107216576U, 107346368U, 107478464U, 107609792U, 107739712U, 107872192U, - 108003136U, 108131392U, 108265408U, 108396224U, 108527168U, 108657344U, - 108789568U, 108920384U, 109049792U, 109182272U, 109312576U, 109444928U, - 109572928U, 109706944U, 109837888U, 109969088U, 110099648U, 110230976U, - 110362432U, 110492992U, 110624704U, 110755264U, 110886208U, 111017408U, - 111148864U, 111279296U, 111410752U, 111541952U, 111673024U, 111803456U, - 111933632U, 112066496U, 112196416U, 112328512U, 112457792U, 112590784U, - 112715968U, 112852672U, 112983616U, 113114944U, 113244224U, 113376448U, - 113505472U, 113639104U, 113770304U, 113901376U, 114031552U, 114163264U, - 114294592U, 114425536U, 114556864U, 114687424U, 114818624U, 114948544U, - 115080512U, 115212224U, 115343296U, 115473472U, 115605184U, 115736128U, - 115867072U, 115997248U, 116128576U, 116260288U, 116391488U, 116522944U, - 116652992U, 116784704U, 116915648U, 117046208U, 117178304U, 117308608U, - 117440192U, 117569728U, 117701824U, 117833024U, 117964096U, 118094656U, - 118225984U, 118357312U, 118489024U, 118617536U, 118749632U, 118882112U, - 119012416U, 119144384U, 119275328U, 119406016U, 119537344U, 119668672U, - 119798464U, 119928896U, 120061376U, 120192832U, 120321728U, 120454336U, - 120584512U, 120716608U, 120848192U, 120979136U, 121109056U, 121241408U, - 121372352U, 121502912U, 121634752U, 121764416U, 121895744U, 122027072U, - 122157632U, 122289088U, 122421184U, 122550592U, 122682944U, 122813888U, - 122945344U, 123075776U, 123207488U, 123338048U, 123468736U, 123600704U, - 123731264U, 123861952U, 123993664U, 124124608U, 124256192U, 124386368U, - 124518208U, 124649024U, 124778048U, 124911296U, 125041088U, 125173696U, - 125303744U, 125432896U, 125566912U, 125696576U, 125829056U, 125958592U, - 126090304U, 126221248U, 126352832U, 126483776U, 126615232U, 126746432U, - 126876608U, 127008704U, 127139392U, 127270336U, 127401152U, 127532224U, - 127663552U, 127794752U, 127925696U, 128055232U, 128188096U, 128319424U, - 128449856U, 128581312U, 128712256U, 128843584U, 128973632U, 129103808U, - 129236288U, 129365696U, 129498944U, 129629888U, 129760832U, 129892288U, - 130023104U, 130154048U, 130283968U, 130416448U, 130547008U, 130678336U, - 130807616U, 130939456U, 131071552U, 131202112U, 131331776U, 131464384U, - 131594048U, 131727296U, 131858368U, 131987392U, 132120256U, 132250816U, - 132382528U, 132513728U, 132644672U, 132774976U, 132905792U, 133038016U, - 133168832U, 133299392U, 133429312U, 133562048U, 133692992U, 133823296U, - 133954624U, 134086336U, 134217152U, 134348608U, 134479808U, 134607296U, - 134741056U, 134872384U, 135002944U, 135134144U, 135265472U, 135396544U, - 135527872U, 135659072U, 135787712U, 135921472U, 136052416U, 136182848U, - 136313792U, 136444864U, 136576448U, 136707904U, 136837952U, 136970048U, - 137099584U, 137232064U, 137363392U, 137494208U, 137625536U, 137755712U, - 137887424U, 138018368U, 138149824U, 138280256U, 138411584U, 138539584U, - 138672832U, 138804928U, 138936128U, 139066688U, 139196864U, 139328704U, - 139460032U, 139590208U, 139721024U, 139852864U, 139984576U, 140115776U, - 140245696U, 140376512U, 140508352U, 140640064U, 140769856U, 140902336U, - 141032768U, 141162688U, 141294016U, 141426496U, 141556544U, 141687488U, - 141819584U, 141949888U, 142080448U, 142212544U, 142342336U, 142474432U, - 142606144U, 142736192U, 142868288U, 142997824U, 143129408U, 143258944U, - 143392448U, 143523136U, 143653696U, 143785024U, 143916992U, 144045632U, - 144177856U, 144309184U, 144440768U, 144570688U, 144701888U, 144832448U, - 144965056U, 145096384U, 145227584U, 145358656U, 145489856U, 145620928U, - 145751488U, 145883072U, 146011456U, 146144704U, 146275264U, 146407232U, - 146538176U, 146668736U, 146800448U, 146931392U, 147062336U, 147193664U, - 147324224U, 147455936U, 147586624U, 147717056U, 147848768U, 147979456U, - 148110784U, 148242368U, 148373312U, 148503232U, 148635584U, 148766144U, - 148897088U, 149028416U, 149159488U, 149290688U, 149420224U, 149551552U, - 149683136U, 149814976U, 149943616U, 150076352U, 150208064U, 150338624U, - 150470464U, 150600256U, 150732224U, 150862784U, 150993088U, 151125952U, - 151254976U, 151388096U, 151519168U, 151649728U, 151778752U, 151911104U, - 152042944U, 152174144U, 152304704U, 152435648U, 152567488U, 152698816U, - 152828992U, 152960576U, 153091648U, 153222976U, 153353792U, 153484096U, - 153616192U, 153747008U, 153878336U, 154008256U, 154139968U, 154270912U, - 154402624U, 154533824U, 154663616U, 154795712U, 154926272U, 155057984U, - 155188928U, 155319872U, 155450816U, 155580608U, 155712064U, 155843392U, - 155971136U, 156106688U, 156237376U, 156367424U, 156499264U, 156630976U, - 156761536U, 156892352U, 157024064U, 157155008U, 157284416U, 157415872U, - 157545536U, 157677248U, 157810496U, 157938112U, 158071744U, 158203328U, - 158334656U, 158464832U, 158596288U, 158727616U, 158858048U, 158988992U, - 159121216U, 159252416U, 159381568U, 159513152U, 159645632U, 159776192U, - 159906496U, 160038464U, 160169536U, 160300352U, 160430656U, 160563008U, - 160693952U, 160822208U, 160956352U, 161086784U, 161217344U, 161349184U, - 161480512U, 161611456U, 161742272U, 161873216U, 162002752U, 162135872U, - 162266432U, 162397888U, 162529216U, 162660032U, 162790976U, 162922048U, - 163052096U, 163184576U, 163314752U, 163446592U, 163577408U, 163707968U, - 163839296U, 163969984U, 164100928U, 164233024U, 164364224U, 164494912U, - 164625856U, 164756672U, 164887616U, 165019072U, 165150016U, 165280064U, - 165412672U, 165543104U, 165674944U, 165805888U, 165936832U, 166067648U, - 166198336U, 166330048U, 166461248U, 166591552U, 166722496U, 166854208U, - 166985408U, 167116736U, 167246656U, 167378368U, 167508416U, 167641024U, - 167771584U, 167903168U, 168034112U, 168164032U, 168295744U, 168427456U, - 168557632U, 168688448U, 168819136U, 168951616U, 169082176U, 169213504U, - 169344832U, 169475648U, 169605952U, 169738048U, 169866304U, 169999552U, - 170131264U, 170262464U, 170393536U, 170524352U, 170655424U, 170782016U, - 170917696U, 171048896U, 171179072U, 171310784U, 171439936U, 171573184U, - 171702976U, 171835072U, 171966272U, 172097216U, 172228288U, 172359232U, - 172489664U, 172621376U, 172747712U, 172883264U, 173014208U, 173144512U, - 173275072U, 173407424U, 173539136U, 173669696U, 173800768U, 173931712U, - 174063424U, 174193472U, 174325696U, 174455744U, 174586816U, 174718912U, - 174849728U, 174977728U, 175109696U, 175242688U, 175374272U, 175504832U, - 175636288U, 175765696U, 175898432U, 176028992U, 176159936U, 176291264U, - 176422592U, 176552512U, 176684864U, 176815424U, 176946496U, 177076544U, - 177209152U, 177340096U, 177470528U, 177600704U, 177731648U, 177864256U, - 177994816U, 178126528U, 178257472U, 178387648U, 178518464U, 178650176U, - 178781888U, 178912064U, 179044288U, 179174848U, 179305024U, 179436736U, - 179568448U, 179698496U, 179830208U, 179960512U, 180092608U, 180223808U, - 180354752U, 180485696U, 180617152U, 180748096U, 180877504U, 181009984U, - 181139264U, 181272512U, 181402688U, 181532608U, 181663168U, 181795136U, - 181926592U, 182057536U, 182190016U, 182320192U, 182451904U, 182582336U, - 182713792U, 182843072U, 182976064U, 183107264U, 183237056U, 183368384U, - 183494848U, 183631424U, 183762752U, 183893824U, 184024768U, 184154816U, - 184286656U, 184417984U, 184548928U, 184680128U, 184810816U, 184941248U, - 185072704U, 185203904U, 185335616U, 185465408U, 185596352U, 185727296U, - 185859904U, 185989696U, 186121664U, 186252992U, 186383552U, 186514112U, - 186645952U, 186777152U, 186907328U, 187037504U, 187170112U, 187301824U, - 187429184U, 187562048U, 187693504U, 187825472U, 187957184U, 188087104U, - 188218304U, 188349376U, 188481344U, 188609728U, 188743616U, 188874304U, - 189005248U, 189136448U, 189265088U, 189396544U, 189528128U, 189660992U, - 189791936U, 189923264U, 190054208U, 190182848U, 190315072U, 190447424U, - 190577984U, 190709312U, 190840768U, 190971328U, 191102656U, 191233472U, - 191364032U, 191495872U, 191626816U, 191758016U, 191888192U, 192020288U, - 192148928U, 192282176U, 192413504U, 192542528U, 192674752U, 192805952U, - 192937792U, 193068608U, 193198912U, 193330496U, 193462208U, 193592384U, - 193723456U, 193854272U, 193985984U, 194116672U, 194247232U, 194379712U, - 194508352U, 194641856U, 194772544U, 194900672U, 195035072U, 195166016U, - 195296704U, 195428032U, 195558592U, 195690304U, 195818176U, 195952576U, - 196083392U, 196214336U, 196345792U, 196476736U, 196607552U, 196739008U, - 196869952U, 197000768U, 197130688U, 197262784U, 197394368U, 197523904U, - 197656384U, 197787584U, 197916608U, 198049472U, 198180544U, 198310208U, - 198442432U, 198573632U, 198705088U, 198834368U, 198967232U, 199097792U, - 199228352U, 199360192U, 199491392U, 199621696U, 199751744U, 199883968U, - 200014016U, 200146624U, 200276672U, 200408128U, 200540096U, 200671168U, - 200801984U, 200933312U, 201062464U, 201194944U, 201326144U, 201457472U, - 201588544U, 201719744U, 201850816U, 201981632U, 202111552U, 202244032U, - 202374464U, 202505152U, 202636352U, 202767808U, 202898368U, 203030336U, - 203159872U, 203292608U, 203423296U, 203553472U, 203685824U, 203816896U, - 203947712U, 204078272U, 204208192U, 204341056U, 204472256U, 204603328U, - 204733888U, 204864448U, 204996544U, 205125568U, 205258304U, 205388864U, - 205517632U, 205650112U, 205782208U, 205913536U, 206044736U, 206176192U, - 206307008U, 206434496U, 206569024U, 206700224U, 206831168U, 206961856U, - 207093056U, 207223616U, 207355328U, 207486784U, 207616832U, 207749056U, - 207879104U, 208010048U, 208141888U, 208273216U, 208404032U, 208534336U, - 208666048U, 208796864U, 208927424U, 209059264U, 209189824U, 209321792U, - 209451584U, 209582656U, 209715136U, 209845568U, 209976896U, 210106432U, - 210239296U, 210370112U, 210501568U, 210630976U, 210763712U, 210894272U, - 211024832U, 211156672U, 211287616U, 211418176U, 211549376U, 211679296U, - 211812032U, 211942592U, 212074432U, 212204864U, 212334016U, 212467648U, - 212597824U, 212727616U, 212860352U, 212991424U, 213120832U, 213253952U, - 213385024U, 213515584U, 213645632U, 213777728U, 213909184U, 214040128U, - 214170688U, 214302656U, 214433728U, 214564544U, 214695232U, 214826048U, - 214956992U, 215089088U, 215219776U, 215350592U, 215482304U, 215613248U, - 215743552U, 215874752U, 216005312U, 216137024U, 216267328U, 216399296U, - 216530752U, 216661696U, 216790592U, 216923968U, 217054528U, 217183168U, - 217316672U, 217448128U, 217579072U, 217709504U, 217838912U, 217972672U, - 218102848U, 218233024U, 218364736U, 218496832U, 218627776U, 218759104U, - 218888896U, 219021248U, 219151936U, 219281728U, 219413056U, 219545024U, - 219675968U, 219807296U, 219938624U, 220069312U, 220200128U, 220331456U, - 220461632U, 220592704U, 220725184U, 220855744U, 220987072U, 221117888U, - 221249216U, 221378368U, 221510336U, 221642048U, 221772736U, 221904832U, - 222031808U, 222166976U, 222297536U, 222428992U, 222559936U, 222690368U, - 222820672U, 222953152U, 223083968U, 223213376U, 223345984U, 223476928U, - 223608512U, 223738688U, 223869376U, 224001472U, 224132672U, 224262848U, - 224394944U, 224524864U, 224657344U, 224788288U, 224919488U, 225050432U, - 225181504U, 225312704U, 225443776U, 225574592U, 225704768U, 225834176U, - 225966784U, 226097216U, 226229824U, 226360384U, 226491712U, 226623424U, - 226754368U, 226885312U, 227015104U, 227147456U, 227278528U, 227409472U, - 227539904U, 227669696U, 227802944U, 227932352U, 228065216U, 228196288U, - 228326464U, 228457792U, 228588736U, 228720064U, 228850112U, 228981056U, - 229113152U, 229243328U, 229375936U, 229505344U, 229636928U, 229769152U, - 229894976U, 230030272U, 230162368U, 230292416U, 230424512U, 230553152U, - 230684864U, 230816704U, 230948416U, 231079616U, 231210944U, 231342016U, - 231472448U, 231603776U, 231733952U, 231866176U, 231996736U, 232127296U, - 232259392U, 232388672U, 232521664U, 232652608U, 232782272U, 232914496U, - 233043904U, 233175616U, 233306816U, 233438528U, 233569984U, 233699776U, - 233830592U, 233962688U, 234092224U, 234221888U, 234353984U, 234485312U, - 234618304U, 234749888U, 234880832U, 235011776U, 235142464U, 235274048U, - 235403456U, 235535936U, 235667392U, 235797568U, 235928768U, 236057152U, - 236190272U, 236322752U, 236453312U, 236583616U, 236715712U, 236846528U, - 236976448U, 237108544U, 237239104U, 237371072U, 237501632U, 237630784U, - 237764416U, 237895232U, 238026688U, 238157632U, 238286912U, 238419392U, - 238548032U, 238681024U, 238812608U, 238941632U, 239075008U, 239206336U, - 239335232U, 239466944U, 239599168U, 239730496U, 239861312U, 239992384U, - 240122816U, 240254656U, 240385856U, 240516928U, 240647872U, 240779072U, - 240909632U, 241040704U, 241171904U, 241302848U, 241433408U, 241565248U, - 241696192U, 241825984U, 241958848U, 242088256U, 242220224U, 242352064U, - 242481856U, 242611648U, 242744896U, 242876224U, 243005632U, 243138496U, - 243268672U, 243400384U, 243531712U, 243662656U, 243793856U, 243924544U, - 244054592U, 244187072U, 244316608U, 244448704U, 244580032U, 244710976U, - 244841536U, 244972864U, 245104448U, 245233984U, 245365312U, 245497792U, - 245628736U, 245759936U, 245889856U, 246021056U, 246152512U, 246284224U, - 246415168U, 246545344U, 246675904U, 246808384U, 246939584U, 247070144U, - 247199552U, 247331648U, 247463872U, 247593536U, 247726016U, 247857088U, - 247987648U, 248116928U, 248249536U, 248380736U, 248512064U, 248643008U, - 248773312U, 248901056U, 249036608U, 249167552U, 249298624U, 249429184U, - 249560512U, 249692096U, 249822784U, 249954112U, 250085312U, 250215488U, - 250345792U, 250478528U, 250608704U, 250739264U, 250870976U, 251002816U, - 251133632U, 251263552U, 251395136U, 251523904U, 251657792U, 251789248U, - 251919424U, 252051392U, 252182464U, 252313408U, 252444224U, 252575552U, - 252706624U, 252836032U, 252968512U, 253099712U, 253227584U, 253361728U, - 253493056U, 253623488U, 253754432U, 253885504U, 254017216U, 254148032U, - 254279488U, 254410432U, 254541376U, 254672576U, 254803264U, 254933824U, - 255065792U, 255196736U, 255326528U, 255458752U, 255589952U, 255721408U, - 255851072U, 255983296U, 256114624U, 256244416U, 256374208U, 256507712U, - 256636096U, 256768832U, 256900544U, 257031616U, 257162176U, 257294272U, - 257424448U, 257555776U, 257686976U, 257818432U, 257949632U, 258079552U, - 258211136U, 258342464U, 258473408U, 258603712U, 258734656U, 258867008U, - 258996544U, 259127744U, 259260224U, 259391296U, 259522112U, 259651904U, - 259784384U, 259915328U, 260045888U, 260175424U, 260308544U, 260438336U, - 260570944U, 260700992U, 260832448U, 260963776U, 261092672U, 261226304U, - 261356864U, 261487936U, 261619648U, 261750592U, 261879872U, 262011968U, - 262143424U, 262274752U, 262404416U, 262537024U, 262667968U, 262799296U, - 262928704U, 263061184U, 263191744U, 263322944U, 263454656U, 263585216U, - 263716672U, 263847872U, 263978944U, 264108608U, 264241088U, 264371648U, - 264501184U, 264632768U, 264764096U, 264895936U, 265024576U, 265158464U, - 265287488U, 265418432U, 265550528U, 265681216U, 265813312U, 265943488U, - 266075968U, 266206144U, 266337728U, 266468032U, 266600384U, 266731072U, - 266862272U, 266993344U, 267124288U, 267255616U, 267386432U, 267516992U, - 267648704U, 267777728U, 267910592U, 268040512U, 268172096U, 268302784U, - 268435264U, 268566208U, 268696256U, 268828096U, 268959296U, 269090368U, - 269221312U, 269352256U, 269482688U, 269614784U, 269745856U, 269876416U, - 270007616U, 270139328U, 270270272U, 270401216U, 270531904U, 270663616U, - 270791744U, 270924736U, 271056832U, 271186112U, 271317184U, 271449536U, - 271580992U, 271711936U, 271843136U, 271973056U, 272105408U, 272236352U, - 272367296U, 272498368U, 272629568U, 272759488U, 272891456U, 273022784U, - 273153856U, 273284672U, 273415616U, 273547072U, 273677632U, 273808448U, - 273937088U, 274071488U, 274200896U, 274332992U, 274463296U, 274595392U, - 274726208U, 274857536U, 274988992U, 275118656U, 275250496U, 275382208U, - 275513024U, 275643968U, 275775296U, 275906368U, 276037184U, 276167872U, - 276297664U, 276429376U, 276560576U, 276692672U, 276822976U, 276955072U, - 277085632U, 277216832U, 277347008U, 277478848U, 277609664U, 277740992U, - 277868608U, 278002624U, 278134336U, 278265536U, 278395328U, 278526784U, - 278657728U, 278789824U, 278921152U, 279052096U, 279182912U, 279313088U, - 279443776U, 279576256U, 279706048U, 279838528U, 279969728U, 280099648U, - 280230976U, 280361408U, 280493632U, 280622528U, 280755392U, 280887104U, - 281018176U, 281147968U, 281278912U, 281411392U, 281542592U, 281673152U, - 281803712U, 281935552U, 282066496U, 282197312U, 282329024U, 282458816U, - 282590272U, 282720832U, 282853184U, 282983744U, 283115072U, 283246144U, - 283377344U, 283508416U, 283639744U, 283770304U, 283901504U, 284032576U, - 284163136U, 284294848U, 284426176U, 284556992U, 284687296U, 284819264U, - 284950208U, 285081536U + 16776896U, 16907456U, 17039296U, 17170112U, 17301056U, 17432512U, 17563072U, + 17693888U, 17824192U, 17955904U, 18087488U, 18218176U, 18349504U, 18481088U, + 18611392U, 18742336U, 18874304U, 19004224U, 19135936U, 19267264U, 19398208U, + 19529408U, 19660096U, 19791424U, 19922752U, 20053952U, 20184896U, 20315968U, + 20446912U, 20576576U, 20709184U, 20840384U, 20971072U, 21102272U, 21233216U, + 21364544U, 21494848U, 21626816U, 21757376U, 21887552U, 22019392U, 22151104U, + 22281536U, 22412224U, 22543936U, 22675264U, 22806464U, 22935872U, 23068096U, + 23198272U, 23330752U, 23459008U, 23592512U, 23723968U, 23854912U, 23986112U, + 24116672U, 24247616U, 24378688U, 24509504U, 24640832U, 24772544U, 24903488U, + 25034432U, 25165376U, 25296704U, 25427392U, 25558592U, 25690048U, 25820096U, + 25951936U, 26081728U, 26214208U, 26345024U, 26476096U, 26606656U, 26737472U, + 26869184U, 26998208U, 27131584U, 27262528U, 27393728U, 27523904U, 27655744U, + 27786688U, 27917888U, 28049344U, 28179904U, 28311488U, 28441792U, 28573504U, + 28700864U, 28835648U, 28966208U, 29096768U, 29228608U, 29359808U, 29490752U, + 29621824U, 29752256U, 29882816U, 30014912U, 30144448U, 30273728U, 30406976U, + 30538432U, 30670784U, 30799936U, 30932672U, 31063744U, 31195072U, 31325248U, + 31456192U, 31588288U, 31719232U, 31850432U, 31981504U, 32110784U, 32243392U, + 32372672U, 32505664U, 32636608U, 32767808U, 32897344U, 33029824U, 33160768U, + 33289664U, 33423296U, 33554368U, 33683648U, 33816512U, 33947456U, 34076992U, + 34208704U, 34340032U, 34471744U, 34600256U, 34734016U, 34864576U, 34993984U, + 35127104U, 35258176U, 35386688U, 35518528U, 35650624U, 35782336U, 35910976U, + 36044608U, 36175808U, 36305728U, 36436672U, 36568384U, 36699968U, 36830656U, + 36961984U, 37093312U, 37223488U, 37355072U, 37486528U, 37617472U, 37747904U, + 37879232U, 38009792U, 38141888U, 38272448U, 38403392U, 38535104U, 38660672U, + 38795584U, 38925632U, 39059264U, 39190336U, 39320768U, 39452096U, 39581632U, + 39713984U, 39844928U, 39974848U, 40107968U, 40238144U, 40367168U, 40500032U, + 40631744U, 40762816U, 40894144U, 41023552U, 41155904U, 41286208U, 41418304U, + 41547712U, 41680448U, 41811904U, 41942848U, 42073792U, 42204992U, 42334912U, + 42467008U, 42597824U, 42729152U, 42860096U, 42991552U, 43122368U, 43253696U, + 43382848U, 43515712U, 43646912U, 43777088U, 43907648U, 44039104U, 44170432U, + 44302144U, 44433344U, 44564288U, 44694976U, 44825152U, 44956864U, 45088448U, + 45219008U, 45350464U, 45481024U, 45612608U, 45744064U, 45874496U, 46006208U, + 46136768U, 46267712U, 46399424U, 46529344U, 46660672U, 46791488U, 46923328U, + 47053504U, 47185856U, 47316928U, 47447872U, 47579072U, 47710144U, 47839936U, + 47971648U, 48103232U, 48234176U, 48365248U, 48496192U, 48627136U, 48757312U, + 48889664U, 49020736U, 49149248U, 49283008U, 49413824U, 49545152U, 49675712U, + 49807168U, 49938368U, 50069056U, 50200256U, 50331584U, 50462656U, 50593472U, + 50724032U, 50853952U, 50986048U, 51117632U, 51248576U, 51379904U, 51510848U, + 51641792U, 51773248U, 51903296U, 52035136U, 52164032U, 52297664U, 52427968U, + 52557376U, 52690112U, 52821952U, 52952896U, 53081536U, 53213504U, 53344576U, + 53475776U, 53608384U, 53738816U, 53870528U, 54000832U, 54131776U, 54263744U, + 54394688U, 54525248U, 54655936U, 54787904U, 54918592U, 55049152U, 55181248U, + 55312064U, 55442752U, 55574336U, 55705024U, 55836224U, 55967168U, 56097856U, + 56228672U, 56358592U, 56490176U, 56621888U, 56753728U, 56884928U, 57015488U, + 57146816U, 57278272U, 57409216U, 57540416U, 57671104U, 57802432U, 57933632U, + 58064576U, 58195264U, 58326976U, 58457408U, 58588864U, 58720192U, 58849984U, + 58981696U, 59113024U, 59243456U, 59375552U, 59506624U, 59637568U, 59768512U, + 59897792U, 60030016U, 60161984U, 60293056U, 60423872U, 60554432U, 60683968U, + 60817216U, 60948032U, 61079488U, 61209664U, 61341376U, 61471936U, 61602752U, + 61733696U, 61865792U, 61996736U, 62127808U, 62259136U, 62389568U, 62520512U, + 62651584U, 62781632U, 62910784U, 63045056U, 63176128U, 63307072U, 63438656U, + 63569216U, 63700928U, 63831616U, 63960896U, 64093888U, 64225088U, 64355392U, + 64486976U, 64617664U, 64748608U, 64879424U, 65009216U, 65142464U, 65273792U, + 65402816U, 65535424U, 65666752U, 65797696U, 65927744U, 66060224U, 66191296U, + 66321344U, 66453056U, 66584384U, 66715328U, 66846656U, 66977728U, 67108672U, + 67239104U, 67370432U, 67501888U, 67631296U, 67763776U, 67895104U, 68026304U, + 68157248U, 68287936U, 68419264U, 68548288U, 68681408U, 68811968U, 68942912U, + 69074624U, 69205568U, 69337024U, 69467584U, 69599168U, 69729472U, 69861184U, + 69989824U, 70122944U, 70253888U, 70385344U, 70515904U, 70647232U, 70778816U, + 70907968U, 71040832U, 71171648U, 71303104U, 71432512U, 71564992U, 71695168U, + 71826368U, 71958464U, 72089536U, 72219712U, 72350144U, 72482624U, 72613568U, + 72744512U, 72875584U, 73006144U, 73138112U, 73268672U, 73400128U, 73530944U, + 73662272U, 73793344U, 73924544U, 74055104U, 74185792U, 74316992U, 74448832U, + 74579392U, 74710976U, 74841664U, 74972864U, 75102784U, 75233344U, 75364544U, + 75497024U, 75627584U, 75759296U, 75890624U, 76021696U, 76152256U, 76283072U, + 76414144U, 76545856U, 76676672U, 76806976U, 76937792U, 77070016U, 77200832U, + 77331392U, 77462464U, 77593664U, 77725376U, 77856448U, 77987776U, 78118336U, + 78249664U, 78380992U, 78511424U, 78642496U, 78773056U, 78905152U, 79033664U, + 79166656U, 79297472U, 79429568U, 79560512U, 79690816U, 79822784U, 79953472U, + 80084672U, 80214208U, 80346944U, 80477632U, 80608576U, 80740288U, 80870848U, + 81002048U, 81133504U, 81264448U, 81395648U, 81525952U, 81657536U, 81786304U, + 81919808U, 82050112U, 82181312U, 82311616U, 82443968U, 82573376U, 82705984U, + 82835776U, 82967744U, 83096768U, 83230528U, 83359552U, 83491264U, 83622464U, + 83753536U, 83886016U, 84015296U, 84147776U, 84277184U, 84409792U, 84540608U, + 84672064U, 84803008U, 84934336U, 85065152U, 85193792U, 85326784U, 85458496U, + 85589312U, 85721024U, 85851968U, 85982656U, 86112448U, 86244416U, 86370112U, + 86506688U, 86637632U, 86769344U, 86900672U, 87031744U, 87162304U, 87293632U, + 87424576U, 87555392U, 87687104U, 87816896U, 87947968U, 88079168U, 88211264U, + 88341824U, 88473152U, 88603712U, 88735424U, 88862912U, 88996672U, 89128384U, + 89259712U, 89390272U, 89521984U, 89652544U, 89783872U, 89914816U, 90045376U, + 90177088U, 90307904U, 90438848U, 90569152U, 90700096U, 90832832U, 90963776U, + 91093696U, 91223744U, 91356992U, 91486784U, 91618496U, 91749824U, 91880384U, + 92012224U, 92143552U, 92273344U, 92405696U, 92536768U, 92666432U, 92798912U, + 92926016U, 93060544U, 93192128U, 93322816U, 93453632U, 93583936U, 93715136U, + 93845056U, 93977792U, 94109504U, 94240448U, 94371776U, 94501184U, 94632896U, + 94764224U, 94895552U, 95023424U, 95158208U, 95287744U, 95420224U, 95550016U, + 95681216U, 95811904U, 95943872U, 96075328U, 96203584U, 96337856U, 96468544U, + 96599744U, 96731072U, 96860992U, 96992576U, 97124288U, 97254848U, 97385536U, + 97517248U, 97647808U, 97779392U, 97910464U, 98041408U, 98172608U, 98303168U, + 98434496U, 98565568U, 98696768U, 98827328U, 98958784U, 99089728U, 99220928U, + 99352384U, 99482816U, 99614272U, 99745472U, 99876416U, 100007104U, + 100138048U, 100267072U, 100401088U, 100529984U, 100662592U, 100791872U, + 100925248U, 101056064U, 101187392U, 101317952U, 101449408U, 101580608U, + 101711296U, 101841728U, 101973824U, 102104896U, 102235712U, 102366016U, + 102498112U, 102628672U, 102760384U, 102890432U, 103021888U, 103153472U, + 103284032U, 103415744U, 103545152U, 103677248U, 103808576U, 103939648U, + 104070976U, 104201792U, 104332736U, 104462528U, 104594752U, 104725952U, + 104854592U, 104988608U, 105118912U, 105247808U, 105381184U, 105511232U, + 105643072U, 105774784U, 105903296U, 106037056U, 106167872U, 106298944U, + 106429504U, 106561472U, 106691392U, 106822592U, 106954304U, 107085376U, + 107216576U, 107346368U, 107478464U, 107609792U, 107739712U, 107872192U, + 108003136U, 108131392U, 108265408U, 108396224U, 108527168U, 108657344U, + 108789568U, 108920384U, 109049792U, 109182272U, 109312576U, 109444928U, + 109572928U, 109706944U, 109837888U, 109969088U, 110099648U, 110230976U, + 110362432U, 110492992U, 110624704U, 110755264U, 110886208U, 111017408U, + 111148864U, 111279296U, 111410752U, 111541952U, 111673024U, 111803456U, + 111933632U, 112066496U, 112196416U, 112328512U, 112457792U, 112590784U, + 112715968U, 112852672U, 112983616U, 113114944U, 113244224U, 113376448U, + 113505472U, 113639104U, 113770304U, 113901376U, 114031552U, 114163264U, + 114294592U, 114425536U, 114556864U, 114687424U, 114818624U, 114948544U, + 115080512U, 115212224U, 115343296U, 115473472U, 115605184U, 115736128U, + 115867072U, 115997248U, 116128576U, 116260288U, 116391488U, 116522944U, + 116652992U, 116784704U, 116915648U, 117046208U, 117178304U, 117308608U, + 117440192U, 117569728U, 117701824U, 117833024U, 117964096U, 118094656U, + 118225984U, 118357312U, 118489024U, 118617536U, 118749632U, 118882112U, + 119012416U, 119144384U, 119275328U, 119406016U, 119537344U, 119668672U, + 119798464U, 119928896U, 120061376U, 120192832U, 120321728U, 120454336U, + 120584512U, 120716608U, 120848192U, 120979136U, 121109056U, 121241408U, + 121372352U, 121502912U, 121634752U, 121764416U, 121895744U, 122027072U, + 122157632U, 122289088U, 122421184U, 122550592U, 122682944U, 122813888U, + 122945344U, 123075776U, 123207488U, 123338048U, 123468736U, 123600704U, + 123731264U, 123861952U, 123993664U, 124124608U, 124256192U, 124386368U, + 124518208U, 124649024U, 124778048U, 124911296U, 125041088U, 125173696U, + 125303744U, 125432896U, 125566912U, 125696576U, 125829056U, 125958592U, + 126090304U, 126221248U, 126352832U, 126483776U, 126615232U, 126746432U, + 126876608U, 127008704U, 127139392U, 127270336U, 127401152U, 127532224U, + 127663552U, 127794752U, 127925696U, 128055232U, 128188096U, 128319424U, + 128449856U, 128581312U, 128712256U, 128843584U, 128973632U, 129103808U, + 129236288U, 129365696U, 129498944U, 129629888U, 129760832U, 129892288U, + 130023104U, 130154048U, 130283968U, 130416448U, 130547008U, 130678336U, + 130807616U, 130939456U, 131071552U, 131202112U, 131331776U, 131464384U, + 131594048U, 131727296U, 131858368U, 131987392U, 132120256U, 132250816U, + 132382528U, 132513728U, 132644672U, 132774976U, 132905792U, 133038016U, + 133168832U, 133299392U, 133429312U, 133562048U, 133692992U, 133823296U, + 133954624U, 134086336U, 134217152U, 134348608U, 134479808U, 134607296U, + 134741056U, 134872384U, 135002944U, 135134144U, 135265472U, 135396544U, + 135527872U, 135659072U, 135787712U, 135921472U, 136052416U, 136182848U, + 136313792U, 136444864U, 136576448U, 136707904U, 136837952U, 136970048U, + 137099584U, 137232064U, 137363392U, 137494208U, 137625536U, 137755712U, + 137887424U, 138018368U, 138149824U, 138280256U, 138411584U, 138539584U, + 138672832U, 138804928U, 138936128U, 139066688U, 139196864U, 139328704U, + 139460032U, 139590208U, 139721024U, 139852864U, 139984576U, 140115776U, + 140245696U, 140376512U, 140508352U, 140640064U, 140769856U, 140902336U, + 141032768U, 141162688U, 141294016U, 141426496U, 141556544U, 141687488U, + 141819584U, 141949888U, 142080448U, 142212544U, 142342336U, 142474432U, + 142606144U, 142736192U, 142868288U, 142997824U, 143129408U, 143258944U, + 143392448U, 143523136U, 143653696U, 143785024U, 143916992U, 144045632U, + 144177856U, 144309184U, 144440768U, 144570688U, 144701888U, 144832448U, + 144965056U, 145096384U, 145227584U, 145358656U, 145489856U, 145620928U, + 145751488U, 145883072U, 146011456U, 146144704U, 146275264U, 146407232U, + 146538176U, 146668736U, 146800448U, 146931392U, 147062336U, 147193664U, + 147324224U, 147455936U, 147586624U, 147717056U, 147848768U, 147979456U, + 148110784U, 148242368U, 148373312U, 148503232U, 148635584U, 148766144U, + 148897088U, 149028416U, 149159488U, 149290688U, 149420224U, 149551552U, + 149683136U, 149814976U, 149943616U, 150076352U, 150208064U, 150338624U, + 150470464U, 150600256U, 150732224U, 150862784U, 150993088U, 151125952U, + 151254976U, 151388096U, 151519168U, 151649728U, 151778752U, 151911104U, + 152042944U, 152174144U, 152304704U, 152435648U, 152567488U, 152698816U, + 152828992U, 152960576U, 153091648U, 153222976U, 153353792U, 153484096U, + 153616192U, 153747008U, 153878336U, 154008256U, 154139968U, 154270912U, + 154402624U, 154533824U, 154663616U, 154795712U, 154926272U, 155057984U, + 155188928U, 155319872U, 155450816U, 155580608U, 155712064U, 155843392U, + 155971136U, 156106688U, 156237376U, 156367424U, 156499264U, 156630976U, + 156761536U, 156892352U, 157024064U, 157155008U, 157284416U, 157415872U, + 157545536U, 157677248U, 157810496U, 157938112U, 158071744U, 158203328U, + 158334656U, 158464832U, 158596288U, 158727616U, 158858048U, 158988992U, + 159121216U, 159252416U, 159381568U, 159513152U, 159645632U, 159776192U, + 159906496U, 160038464U, 160169536U, 160300352U, 160430656U, 160563008U, + 160693952U, 160822208U, 160956352U, 161086784U, 161217344U, 161349184U, + 161480512U, 161611456U, 161742272U, 161873216U, 162002752U, 162135872U, + 162266432U, 162397888U, 162529216U, 162660032U, 162790976U, 162922048U, + 163052096U, 163184576U, 163314752U, 163446592U, 163577408U, 163707968U, + 163839296U, 163969984U, 164100928U, 164233024U, 164364224U, 164494912U, + 164625856U, 164756672U, 164887616U, 165019072U, 165150016U, 165280064U, + 165412672U, 165543104U, 165674944U, 165805888U, 165936832U, 166067648U, + 166198336U, 166330048U, 166461248U, 166591552U, 166722496U, 166854208U, + 166985408U, 167116736U, 167246656U, 167378368U, 167508416U, 167641024U, + 167771584U, 167903168U, 168034112U, 168164032U, 168295744U, 168427456U, + 168557632U, 168688448U, 168819136U, 168951616U, 169082176U, 169213504U, + 169344832U, 169475648U, 169605952U, 169738048U, 169866304U, 169999552U, + 170131264U, 170262464U, 170393536U, 170524352U, 170655424U, 170782016U, + 170917696U, 171048896U, 171179072U, 171310784U, 171439936U, 171573184U, + 171702976U, 171835072U, 171966272U, 172097216U, 172228288U, 172359232U, + 172489664U, 172621376U, 172747712U, 172883264U, 173014208U, 173144512U, + 173275072U, 173407424U, 173539136U, 173669696U, 173800768U, 173931712U, + 174063424U, 174193472U, 174325696U, 174455744U, 174586816U, 174718912U, + 174849728U, 174977728U, 175109696U, 175242688U, 175374272U, 175504832U, + 175636288U, 175765696U, 175898432U, 176028992U, 176159936U, 176291264U, + 176422592U, 176552512U, 176684864U, 176815424U, 176946496U, 177076544U, + 177209152U, 177340096U, 177470528U, 177600704U, 177731648U, 177864256U, + 177994816U, 178126528U, 178257472U, 178387648U, 178518464U, 178650176U, + 178781888U, 178912064U, 179044288U, 179174848U, 179305024U, 179436736U, + 179568448U, 179698496U, 179830208U, 179960512U, 180092608U, 180223808U, + 180354752U, 180485696U, 180617152U, 180748096U, 180877504U, 181009984U, + 181139264U, 181272512U, 181402688U, 181532608U, 181663168U, 181795136U, + 181926592U, 182057536U, 182190016U, 182320192U, 182451904U, 182582336U, + 182713792U, 182843072U, 182976064U, 183107264U, 183237056U, 183368384U, + 183494848U, 183631424U, 183762752U, 183893824U, 184024768U, 184154816U, + 184286656U, 184417984U, 184548928U, 184680128U, 184810816U, 184941248U, + 185072704U, 185203904U, 185335616U, 185465408U, 185596352U, 185727296U, + 185859904U, 185989696U, 186121664U, 186252992U, 186383552U, 186514112U, + 186645952U, 186777152U, 186907328U, 187037504U, 187170112U, 187301824U, + 187429184U, 187562048U, 187693504U, 187825472U, 187957184U, 188087104U, + 188218304U, 188349376U, 188481344U, 188609728U, 188743616U, 188874304U, + 189005248U, 189136448U, 189265088U, 189396544U, 189528128U, 189660992U, + 189791936U, 189923264U, 190054208U, 190182848U, 190315072U, 190447424U, + 190577984U, 190709312U, 190840768U, 190971328U, 191102656U, 191233472U, + 191364032U, 191495872U, 191626816U, 191758016U, 191888192U, 192020288U, + 192148928U, 192282176U, 192413504U, 192542528U, 192674752U, 192805952U, + 192937792U, 193068608U, 193198912U, 193330496U, 193462208U, 193592384U, + 193723456U, 193854272U, 193985984U, 194116672U, 194247232U, 194379712U, + 194508352U, 194641856U, 194772544U, 194900672U, 195035072U, 195166016U, + 195296704U, 195428032U, 195558592U, 195690304U, 195818176U, 195952576U, + 196083392U, 196214336U, 196345792U, 196476736U, 196607552U, 196739008U, + 196869952U, 197000768U, 197130688U, 197262784U, 197394368U, 197523904U, + 197656384U, 197787584U, 197916608U, 198049472U, 198180544U, 198310208U, + 198442432U, 198573632U, 198705088U, 198834368U, 198967232U, 199097792U, + 199228352U, 199360192U, 199491392U, 199621696U, 199751744U, 199883968U, + 200014016U, 200146624U, 200276672U, 200408128U, 200540096U, 200671168U, + 200801984U, 200933312U, 201062464U, 201194944U, 201326144U, 201457472U, + 201588544U, 201719744U, 201850816U, 201981632U, 202111552U, 202244032U, + 202374464U, 202505152U, 202636352U, 202767808U, 202898368U, 203030336U, + 203159872U, 203292608U, 203423296U, 203553472U, 203685824U, 203816896U, + 203947712U, 204078272U, 204208192U, 204341056U, 204472256U, 204603328U, + 204733888U, 204864448U, 204996544U, 205125568U, 205258304U, 205388864U, + 205517632U, 205650112U, 205782208U, 205913536U, 206044736U, 206176192U, + 206307008U, 206434496U, 206569024U, 206700224U, 206831168U, 206961856U, + 207093056U, 207223616U, 207355328U, 207486784U, 207616832U, 207749056U, + 207879104U, 208010048U, 208141888U, 208273216U, 208404032U, 208534336U, + 208666048U, 208796864U, 208927424U, 209059264U, 209189824U, 209321792U, + 209451584U, 209582656U, 209715136U, 209845568U, 209976896U, 210106432U, + 210239296U, 210370112U, 210501568U, 210630976U, 210763712U, 210894272U, + 211024832U, 211156672U, 211287616U, 211418176U, 211549376U, 211679296U, + 211812032U, 211942592U, 212074432U, 212204864U, 212334016U, 212467648U, + 212597824U, 212727616U, 212860352U, 212991424U, 213120832U, 213253952U, + 213385024U, 213515584U, 213645632U, 213777728U, 213909184U, 214040128U, + 214170688U, 214302656U, 214433728U, 214564544U, 214695232U, 214826048U, + 214956992U, 215089088U, 215219776U, 215350592U, 215482304U, 215613248U, + 215743552U, 215874752U, 216005312U, 216137024U, 216267328U, 216399296U, + 216530752U, 216661696U, 216790592U, 216923968U, 217054528U, 217183168U, + 217316672U, 217448128U, 217579072U, 217709504U, 217838912U, 217972672U, + 218102848U, 218233024U, 218364736U, 218496832U, 218627776U, 218759104U, + 218888896U, 219021248U, 219151936U, 219281728U, 219413056U, 219545024U, + 219675968U, 219807296U, 219938624U, 220069312U, 220200128U, 220331456U, + 220461632U, 220592704U, 220725184U, 220855744U, 220987072U, 221117888U, + 221249216U, 221378368U, 221510336U, 221642048U, 221772736U, 221904832U, + 222031808U, 222166976U, 222297536U, 222428992U, 222559936U, 222690368U, + 222820672U, 222953152U, 223083968U, 223213376U, 223345984U, 223476928U, + 223608512U, 223738688U, 223869376U, 224001472U, 224132672U, 224262848U, + 224394944U, 224524864U, 224657344U, 224788288U, 224919488U, 225050432U, + 225181504U, 225312704U, 225443776U, 225574592U, 225704768U, 225834176U, + 225966784U, 226097216U, 226229824U, 226360384U, 226491712U, 226623424U, + 226754368U, 226885312U, 227015104U, 227147456U, 227278528U, 227409472U, + 227539904U, 227669696U, 227802944U, 227932352U, 228065216U, 228196288U, + 228326464U, 228457792U, 228588736U, 228720064U, 228850112U, 228981056U, + 229113152U, 229243328U, 229375936U, 229505344U, 229636928U, 229769152U, + 229894976U, 230030272U, 230162368U, 230292416U, 230424512U, 230553152U, + 230684864U, 230816704U, 230948416U, 231079616U, 231210944U, 231342016U, + 231472448U, 231603776U, 231733952U, 231866176U, 231996736U, 232127296U, + 232259392U, 232388672U, 232521664U, 232652608U, 232782272U, 232914496U, + 233043904U, 233175616U, 233306816U, 233438528U, 233569984U, 233699776U, + 233830592U, 233962688U, 234092224U, 234221888U, 234353984U, 234485312U, + 234618304U, 234749888U, 234880832U, 235011776U, 235142464U, 235274048U, + 235403456U, 235535936U, 235667392U, 235797568U, 235928768U, 236057152U, + 236190272U, 236322752U, 236453312U, 236583616U, 236715712U, 236846528U, + 236976448U, 237108544U, 237239104U, 237371072U, 237501632U, 237630784U, + 237764416U, 237895232U, 238026688U, 238157632U, 238286912U, 238419392U, + 238548032U, 238681024U, 238812608U, 238941632U, 239075008U, 239206336U, + 239335232U, 239466944U, 239599168U, 239730496U, 239861312U, 239992384U, + 240122816U, 240254656U, 240385856U, 240516928U, 240647872U, 240779072U, + 240909632U, 241040704U, 241171904U, 241302848U, 241433408U, 241565248U, + 241696192U, 241825984U, 241958848U, 242088256U, 242220224U, 242352064U, + 242481856U, 242611648U, 242744896U, 242876224U, 243005632U, 243138496U, + 243268672U, 243400384U, 243531712U, 243662656U, 243793856U, 243924544U, + 244054592U, 244187072U, 244316608U, 244448704U, 244580032U, 244710976U, + 244841536U, 244972864U, 245104448U, 245233984U, 245365312U, 245497792U, + 245628736U, 245759936U, 245889856U, 246021056U, 246152512U, 246284224U, + 246415168U, 246545344U, 246675904U, 246808384U, 246939584U, 247070144U, + 247199552U, 247331648U, 247463872U, 247593536U, 247726016U, 247857088U, + 247987648U, 248116928U, 248249536U, 248380736U, 248512064U, 248643008U, + 248773312U, 248901056U, 249036608U, 249167552U, 249298624U, 249429184U, + 249560512U, 249692096U, 249822784U, 249954112U, 250085312U, 250215488U, + 250345792U, 250478528U, 250608704U, 250739264U, 250870976U, 251002816U, + 251133632U, 251263552U, 251395136U, 251523904U, 251657792U, 251789248U, + 251919424U, 252051392U, 252182464U, 252313408U, 252444224U, 252575552U, + 252706624U, 252836032U, 252968512U, 253099712U, 253227584U, 253361728U, + 253493056U, 253623488U, 253754432U, 253885504U, 254017216U, 254148032U, + 254279488U, 254410432U, 254541376U, 254672576U, 254803264U, 254933824U, + 255065792U, 255196736U, 255326528U, 255458752U, 255589952U, 255721408U, + 255851072U, 255983296U, 256114624U, 256244416U, 256374208U, 256507712U, + 256636096U, 256768832U, 256900544U, 257031616U, 257162176U, 257294272U, + 257424448U, 257555776U, 257686976U, 257818432U, 257949632U, 258079552U, + 258211136U, 258342464U, 258473408U, 258603712U, 258734656U, 258867008U, + 258996544U, 259127744U, 259260224U, 259391296U, 259522112U, 259651904U, + 259784384U, 259915328U, 260045888U, 260175424U, 260308544U, 260438336U, + 260570944U, 260700992U, 260832448U, 260963776U, 261092672U, 261226304U, + 261356864U, 261487936U, 261619648U, 261750592U, 261879872U, 262011968U, + 262143424U, 262274752U, 262404416U, 262537024U, 262667968U, 262799296U, + 262928704U, 263061184U, 263191744U, 263322944U, 263454656U, 263585216U, + 263716672U, 263847872U, 263978944U, 264108608U, 264241088U, 264371648U, + 264501184U, 264632768U, 264764096U, 264895936U, 265024576U, 265158464U, + 265287488U, 265418432U, 265550528U, 265681216U, 265813312U, 265943488U, + 266075968U, 266206144U, 266337728U, 266468032U, 266600384U, 266731072U, + 266862272U, 266993344U, 267124288U, 267255616U, 267386432U, 267516992U, + 267648704U, 267777728U, 267910592U, 268040512U, 268172096U, 268302784U, + 268435264U, 268566208U, 268696256U, 268828096U, 268959296U, 269090368U, + 269221312U, 269352256U, 269482688U, 269614784U, 269745856U, 269876416U, + 270007616U, 270139328U, 270270272U, 270401216U, 270531904U, 270663616U, + 270791744U, 270924736U, 271056832U, 271186112U, 271317184U, 271449536U, + 271580992U, 271711936U, 271843136U, 271973056U, 272105408U, 272236352U, + 272367296U, 272498368U, 272629568U, 272759488U, 272891456U, 273022784U, + 273153856U, 273284672U, 273415616U, 273547072U, 273677632U, 273808448U, + 273937088U, 274071488U, 274200896U, 274332992U, 274463296U, 274595392U, + 274726208U, 274857536U, 274988992U, 275118656U, 275250496U, 275382208U, + 275513024U, 275643968U, 275775296U, 275906368U, 276037184U, 276167872U, + 276297664U, 276429376U, 276560576U, 276692672U, 276822976U, 276955072U, + 277085632U, 277216832U, 277347008U, 277478848U, 277609664U, 277740992U, + 277868608U, 278002624U, 278134336U, 278265536U, 278395328U, 278526784U, + 278657728U, 278789824U, 278921152U, 279052096U, 279182912U, 279313088U, + 279443776U, 279576256U, 279706048U, 279838528U, 279969728U, 280099648U, + 280230976U, 280361408U, 280493632U, 280622528U, 280755392U, 280887104U, + 281018176U, 281147968U, 281278912U, 281411392U, 281542592U, 281673152U, + 281803712U, 281935552U, 282066496U, 282197312U, 282329024U, 282458816U, + 282590272U, 282720832U, 282853184U, 282983744U, 283115072U, 283246144U, + 283377344U, 283508416U, 283639744U, 283770304U, 283901504U, 284032576U, + 284163136U, 284294848U, 284426176U, 284556992U, 284687296U, 284819264U, + 284950208U, 285081536U }; #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/ethash.h b/ethash.h index bc1ac7647..4c38ea409 100644 --- a/ethash.h +++ b/ethash.h @@ -44,27 +44,27 @@ extern "C" { // LTODO: for consistency's sake maybe use ethash_params_t? typedef struct ethash_params { - /// Size of full data set (in bytes, multiple of mix size (128)). - uint64_t full_size; - /// Size of compute cache (in bytes, multiple of node size (64)). - uint64_t cache_size; + /// Size of full data set (in bytes, multiple of mix size (128)). + uint64_t full_size; + /// Size of compute cache (in bytes, multiple of node size (64)). + uint64_t cache_size; } ethash_params; /// Type of a seedhash/blockhash e.t.c. typedef struct ethash_h256 { uint8_t b[32]; } ethash_h256_t; static inline uint8_t ethash_h256_get(ethash_h256_t const* hash, unsigned int i) { - return hash->b[i]; + return hash->b[i]; } static inline void ethash_h256_set(ethash_h256_t *hash, unsigned int i, uint8_t v) { - hash->b[i] = v; + hash->b[i] = v; } static inline void ethash_h256_reset(ethash_h256_t *hash) { - memset(hash, 0, 32); + memset(hash, 0, 32); } struct ethash_light; @@ -75,8 +75,8 @@ typedef int(*ethash_callback_t)(unsigned); // LTODO: for consistency's sake maybe use ethash_return_value_t? typedef struct ethash_return_value { - ethash_h256_t result; - ethash_h256_t mix_hash; + ethash_h256_t result; + ethash_h256_t mix_hash; } ethash_return_value; uint64_t ethash_get_datasize(const uint32_t block_number); @@ -84,13 +84,13 @@ uint64_t ethash_get_cachesize(const uint32_t block_number); // initialize the parameters static inline void ethash_params_init(ethash_params *params, const uint32_t block_number) { - params->full_size = ethash_get_datasize(block_number); - params->cache_size = ethash_get_cachesize(block_number); + params->full_size = ethash_get_datasize(block_number); + params->cache_size = ethash_get_cachesize(block_number); } // LTODO: for consistency's sake maybe use ethash_cache_t? typedef struct ethash_cache { - void *mem; + void *mem; } ethash_cache; /** @@ -106,7 +106,7 @@ typedef struct ethash_cache { ethash_cache *ethash_cache_new(ethash_params const *params, ethash_h256_t const *seed); /** * Frees a previously allocated ethash_cache - * @param c The object to free + * @param c The object to free */ void ethash_cache_delete(ethash_cache *c); @@ -123,7 +123,7 @@ void ethash_cache_delete(ethash_cache *c); ethash_light_t ethash_light_new(ethash_params const *params, ethash_h256_t const *seed); /** * Frees a previously allocated ethash_light handler - * @param light The light handler to free + * @param light The light handler to free */ void ethash_light_delete(ethash_light_t light); /** @@ -138,10 +138,10 @@ void ethash_light_delete(ethash_light_t light); * parameters given. */ bool ethash_light_compute(ethash_return_value *ret, - ethash_light_t light, - ethash_params const *params, - const ethash_h256_t *header_hash, - const uint64_t nonce); + ethash_light_t light, + ethash_params const *params, + const ethash_h256_t *header_hash, + const uint64_t nonce); /** * Get a pointer to the cache object held by the light client * @@ -176,8 +176,8 @@ ethash_cache *ethash_light_acquire_cache(ethash_light_t light); * ERRNOMEM or invalid parameters used for @ref ethash_compute_full_data() */ ethash_full_t ethash_full_new(ethash_params const* params, - ethash_cache const* cache, - ethash_callback_t callback); + ethash_cache const* cache, + ethash_callback_t callback); /** * Frees a previously allocated ethash_full handler * @param full The light handler to free @@ -190,16 +190,16 @@ void ethash_full_delete(ethash_full_t full); * @param full The full client handler * @param params The parameters to use * @param header_hash The header hash to pack into the mix - * @param nonce The nonce to pack into the mix + * @param nonce The nonce to pack into the mix * @return true if all went well and false if there were invalid * parameters given or if there was a callback given and * at some point return a non-zero value */ bool ethash_full_compute(ethash_return_value *ret, - ethash_full_t full, - ethash_params const *params, - const ethash_h256_t *header_hash, - const uint64_t nonce); + ethash_full_t full, + ethash_params const *params, + const ethash_h256_t *header_hash, + const uint64_t nonce); /** * Get a pointer to the cache object held by the full client * @@ -221,27 +221,27 @@ void ethash_get_seedhash(ethash_h256_t *seedhash, const uint32_t block_number); // Returns if hash is less than or equal to difficulty static inline int ethash_check_difficulty(ethash_h256_t const *hash, - ethash_h256_t const *difficulty) + ethash_h256_t const *difficulty) { - // Difficulty is big endian - for (int i = 0; i < 32; i++) { - if (ethash_h256_get(hash, i) == ethash_h256_get(difficulty, i)) { - continue; - } - return ethash_h256_get(hash, i) < ethash_h256_get(difficulty, i); - } - return 1; + // Difficulty is big endian + for (int i = 0; i < 32; i++) { + if (ethash_h256_get(hash, i) == ethash_h256_get(difficulty, i)) { + continue; + } + return ethash_h256_get(hash, i) < ethash_h256_get(difficulty, i); + } + return 1; } int ethash_quick_check_difficulty(ethash_h256_t const *header_hash, - const uint64_t nonce, - ethash_h256_t const *mix_hash, - ethash_h256_t const *difficulty); + const uint64_t nonce, + ethash_h256_t const *mix_hash, + ethash_h256_t const *difficulty); /** * ========================= - * = DEPRECATED API = + * = DEPRECATED API = * ========================= * * Kept for backwards compatibility with whoever still uses it. Please consider @@ -249,22 +249,22 @@ int ethash_quick_check_difficulty(ethash_h256_t const *header_hash, */ void ethash_mkcache(ethash_cache *cache, ethash_params const *params, ethash_h256_t const *seed); void ethash_full(ethash_return_value *ret, - void const *full_mem, - ethash_params const *params, - ethash_h256_t const *header_hash, - const uint64_t nonce); + void const *full_mem, + ethash_params const *params, + ethash_h256_t const *header_hash, + const uint64_t nonce); void ethash_light(ethash_return_value *ret, - ethash_cache const *cache, - ethash_params const *params, - ethash_h256_t const *header_hash, - const uint64_t nonce); + ethash_cache const *cache, + ethash_params const *params, + ethash_h256_t const *header_hash, + const uint64_t nonce); /** * Compute the memory data for a full node's memory - * - * @param mem A pointer to an ethash full's memory - * @param params The parameters to compute the data with - * @param cache A cache object to use in the calculation - * @return true if all went fine and false for invalid parameters + * + * @param mem A pointer to an ethash full's memory + * @param params The parameters to compute the data with + * @param cache A cache object to use in the calculation + * @return true if all went fine and false for invalid parameters */ bool ethash_compute_full_data(void *mem, ethash_params const *params, ethash_cache const *cache); diff --git a/internal.c b/internal.c index 36acec94f..d5f0cb854 100644 --- a/internal.c +++ b/internal.c @@ -8,11 +8,11 @@ ethash is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with cpp-ethereum. If not, see . + along with cpp-ethereum. If not, see . */ /** @file internal.c * @author Tim Hughes @@ -38,411 +38,413 @@ #endif // WITH_CRYPTOPP uint64_t ethash_get_datasize(const uint32_t block_number) { - assert(block_number / EPOCH_LENGTH < 2048); - return dag_sizes[block_number / EPOCH_LENGTH]; + assert(block_number / EPOCH_LENGTH < 2048); + return dag_sizes[block_number / EPOCH_LENGTH]; } uint64_t ethash_get_cachesize(const uint32_t block_number) { - assert(block_number / EPOCH_LENGTH < 2048); - return cache_sizes[block_number / EPOCH_LENGTH]; + assert(block_number / EPOCH_LENGTH < 2048); + return cache_sizes[block_number / EPOCH_LENGTH]; } // Follows Sergio's "STRICT MEMORY HARD HASHING FUNCTIONS" (2014) // https://bitslog.files.wordpress.com/2013/12/memohash-v0-3.pdf // SeqMemoHash(s, R, N) bool static ethash_compute_cache_nodes(node *const nodes, - ethash_params const *params, - ethash_h256_t const* seed) + ethash_params const *params, + ethash_h256_t const* seed) { - if (params->cache_size % sizeof(node) != 0) { - return false; - } - uint32_t const num_nodes = (uint32_t) (params->cache_size / sizeof(node)); - - SHA3_512(nodes[0].bytes, (uint8_t*)seed, 32); - - for (unsigned i = 1; i != num_nodes; ++i) { - SHA3_512(nodes[i].bytes, nodes[i - 1].bytes, 64); - } - - for (unsigned j = 0; j != CACHE_ROUNDS; j++) { - for (unsigned i = 0; i != num_nodes; i++) { - uint32_t const idx = nodes[i].words[0] % num_nodes; - node data; - data = nodes[(num_nodes - 1 + i) % num_nodes]; - for (unsigned w = 0; w != NODE_WORDS; ++w) { - data.words[w] ^= nodes[idx].words[w]; - } - SHA3_512(nodes[i].bytes, data.bytes, sizeof(data)); - } - } - fix_endian_arr32(nodes->words, num_nodes * NODE_WORDS); - return true; + if (params->cache_size % sizeof(node) != 0) { + return false; + } + uint32_t const num_nodes = (uint32_t) (params->cache_size / sizeof(node)); + + SHA3_512(nodes[0].bytes, (uint8_t*)seed, 32); + + for (unsigned i = 1; i != num_nodes; ++i) { + SHA3_512(nodes[i].bytes, nodes[i - 1].bytes, 64); + } + + for (unsigned j = 0; j != CACHE_ROUNDS; j++) { + for (unsigned i = 0; i != num_nodes; i++) { + uint32_t const idx = nodes[i].words[0] % num_nodes; + node data; + data = nodes[(num_nodes - 1 + i) % num_nodes]; + for (unsigned w = 0; w != NODE_WORDS; ++w) { + data.words[w] ^= nodes[idx].words[w]; + } + SHA3_512(nodes[i].bytes, data.bytes, sizeof(data)); + } + } + + // now perform endian conversion + fix_endian_arr32(nodes->words, num_nodes * NODE_WORDS); + return true; } ethash_cache *ethash_cache_new(ethash_params const *params, ethash_h256_t const *seed) { - ethash_cache *ret; - ret = malloc(sizeof(*ret)); - if (!ret) { - return NULL; - } - ret->mem = malloc((size_t)params->cache_size); - if (!ret->mem) { - goto fail_free_cache; - } - - node *nodes = (node*)ret->mem; - if (!ethash_compute_cache_nodes(nodes, params, seed)) { - goto fail_free_cache_mem; - } - return ret; + ethash_cache *ret; + ret = malloc(sizeof(*ret)); + if (!ret) { + return NULL; + } + ret->mem = malloc((size_t)params->cache_size); + if (!ret->mem) { + goto fail_free_cache; + } + + node *nodes = (node*)ret->mem; + if (!ethash_compute_cache_nodes(nodes, params, seed)) { + goto fail_free_cache_mem; + } + return ret; fail_free_cache_mem: - free(ret->mem); + free(ret->mem); fail_free_cache: - free(ret); - return NULL; + free(ret); + return NULL; } void ethash_cache_delete(ethash_cache *c) { - free(c->mem); - free(c); + free(c->mem); + free(c); } void ethash_calculate_dag_item(node *const ret, - const unsigned node_index, - const struct ethash_params *params, - const struct ethash_cache *cache) + const unsigned node_index, + const struct ethash_params *params, + const struct ethash_cache *cache) { - uint32_t num_parent_nodes = (uint32_t) (params->cache_size / sizeof(node)); - node const *cache_nodes = (node const *) cache->mem; - node const *init = &cache_nodes[node_index % num_parent_nodes]; + uint32_t num_parent_nodes = (uint32_t) (params->cache_size / sizeof(node)); + node const *cache_nodes = (node const *) cache->mem; + node const *init = &cache_nodes[node_index % num_parent_nodes]; - memcpy(ret, init, sizeof(node)); - ret->words[0] ^= node_index; - SHA3_512(ret->bytes, ret->bytes, sizeof(node)); + memcpy(ret, init, sizeof(node)); + ret->words[0] ^= node_index; + SHA3_512(ret->bytes, ret->bytes, sizeof(node)); #if defined(_M_X64) && ENABLE_SSE - __m128i const fnv_prime = _mm_set1_epi32(FNV_PRIME); - __m128i xmm0 = ret->xmm[0]; - __m128i xmm1 = ret->xmm[1]; - __m128i xmm2 = ret->xmm[2]; - __m128i xmm3 = ret->xmm[3]; + __m128i const fnv_prime = _mm_set1_epi32(FNV_PRIME); + __m128i xmm0 = ret->xmm[0]; + __m128i xmm1 = ret->xmm[1]; + __m128i xmm2 = ret->xmm[2]; + __m128i xmm3 = ret->xmm[3]; #endif - for (unsigned i = 0; i != DATASET_PARENTS; ++i) { - uint32_t parent_index = ((node_index ^ i) * FNV_PRIME ^ ret->words[i % NODE_WORDS]) % num_parent_nodes; - node const *parent = &cache_nodes[parent_index]; + for (unsigned i = 0; i != DATASET_PARENTS; ++i) { + uint32_t parent_index = ((node_index ^ i) * FNV_PRIME ^ ret->words[i % NODE_WORDS]) % num_parent_nodes; + node const *parent = &cache_nodes[parent_index]; #if defined(_M_X64) && ENABLE_SSE - { - xmm0 = _mm_mullo_epi32(xmm0, fnv_prime); - xmm1 = _mm_mullo_epi32(xmm1, fnv_prime); - xmm2 = _mm_mullo_epi32(xmm2, fnv_prime); - xmm3 = _mm_mullo_epi32(xmm3, fnv_prime); - xmm0 = _mm_xor_si128(xmm0, parent->xmm[0]); - xmm1 = _mm_xor_si128(xmm1, parent->xmm[1]); - xmm2 = _mm_xor_si128(xmm2, parent->xmm[2]); - xmm3 = _mm_xor_si128(xmm3, parent->xmm[3]); - - // have to write to ret as values are used to compute index - ret->xmm[0] = xmm0; - ret->xmm[1] = xmm1; - ret->xmm[2] = xmm2; - ret->xmm[3] = xmm3; - } - #else - { - for (unsigned w = 0; w != NODE_WORDS; ++w) { - ret->words[w] = fnv_hash(ret->words[w], parent->words[w]); - } - } + { + xmm0 = _mm_mullo_epi32(xmm0, fnv_prime); + xmm1 = _mm_mullo_epi32(xmm1, fnv_prime); + xmm2 = _mm_mullo_epi32(xmm2, fnv_prime); + xmm3 = _mm_mullo_epi32(xmm3, fnv_prime); + xmm0 = _mm_xor_si128(xmm0, parent->xmm[0]); + xmm1 = _mm_xor_si128(xmm1, parent->xmm[1]); + xmm2 = _mm_xor_si128(xmm2, parent->xmm[2]); + xmm3 = _mm_xor_si128(xmm3, parent->xmm[3]); + + // have to write to ret as values are used to compute index + ret->xmm[0] = xmm0; + ret->xmm[1] = xmm1; + ret->xmm[2] = xmm2; + ret->xmm[3] = xmm3; + } + #else + { + for (unsigned w = 0; w != NODE_WORDS; ++w) { + ret->words[w] = fnv_hash(ret->words[w], parent->words[w]); + } + } #endif - } + } - SHA3_512(ret->bytes, ret->bytes, sizeof(node)); + SHA3_512(ret->bytes, ret->bytes, sizeof(node)); } bool ethash_compute_full_data(void *mem, - ethash_params const *params, - ethash_cache const *cache) + ethash_params const *params, + ethash_cache const *cache) { - if (params->full_size % (sizeof(uint32_t) * MIX_WORDS) != 0 || - (params->full_size % sizeof(node)) != 0) { - return false; - } - node *full_nodes = mem; - - // now compute full nodes - for (unsigned n = 0; n != (params->full_size / sizeof(node)); ++n) { - ethash_calculate_dag_item(&(full_nodes[n]), n, params, cache); - } - return true; + if (params->full_size % (sizeof(uint32_t) * MIX_WORDS) != 0 || + (params->full_size % sizeof(node)) != 0) { + return false; + } + node *full_nodes = mem; + + // now compute full nodes + for (unsigned n = 0; n != (params->full_size / sizeof(node)); ++n) { + ethash_calculate_dag_item(&(full_nodes[n]), n, params, cache); + } + return true; } static bool ethash_hash(ethash_return_value *ret, - node const *full_nodes, - ethash_cache const *cache, - ethash_params const *params, - ethash_h256_t const *header_hash, - const uint64_t nonce, - ethash_callback_t callback) + node const *full_nodes, + ethash_cache const *cache, + ethash_params const *params, + ethash_h256_t const *header_hash, + const uint64_t nonce, + ethash_callback_t callback) { - if (params->full_size % MIX_WORDS != 0) { - return false; - } - - // pack hash and nonce together into first 40 bytes of s_mix - assert(sizeof(node) * 8 == 512); - node s_mix[MIX_NODES + 1]; - memcpy(s_mix[0].bytes, header_hash, 32); - fix_endian64(s_mix[0].double_words[4], nonce); - - // compute sha3-512 hash and replicate across mix - SHA3_512(s_mix->bytes, s_mix->bytes, 40); - fix_endian_arr32(s_mix[0].words, 16); - - node *const mix = s_mix + 1; - for (unsigned w = 0; w != MIX_WORDS; ++w) { - mix->words[w] = s_mix[0].words[w % NODE_WORDS]; - } - - unsigned const - page_size = sizeof(uint32_t) * MIX_WORDS, - num_full_pages = (unsigned) (params->full_size / page_size); - - - for (unsigned i = 0; i != ACCESSES; ++i) { - uint32_t const index = ((s_mix->words[0] ^ i) * FNV_PRIME ^ mix->words[i % MIX_WORDS]) % num_full_pages; - - for (unsigned n = 0; n != MIX_NODES; ++n) { - const node *dag_node; - if (callback && - callback(((float)(i * n) / (float)(ACCESSES * MIX_NODES) * 100) != 0)) { - return false; - } - if (full_nodes) { - dag_node = &full_nodes[MIX_NODES * index + n]; - } else { - node tmp_node; - ethash_calculate_dag_item(&tmp_node, index * MIX_NODES + n, params, cache); - dag_node = &tmp_node; - } + if (params->full_size % MIX_WORDS != 0) { + return false; + } + + // pack hash and nonce together into first 40 bytes of s_mix + assert(sizeof(node) * 8 == 512); + node s_mix[MIX_NODES + 1]; + memcpy(s_mix[0].bytes, header_hash, 32); + fix_endian64(s_mix[0].double_words[4], nonce); + + // compute sha3-512 hash and replicate across mix + SHA3_512(s_mix->bytes, s_mix->bytes, 40); + fix_endian_arr32(s_mix[0].words, 16); + + node *const mix = s_mix + 1; + for (unsigned w = 0; w != MIX_WORDS; ++w) { + mix->words[w] = s_mix[0].words[w % NODE_WORDS]; + } + + unsigned const + page_size = sizeof(uint32_t) * MIX_WORDS, + num_full_pages = (unsigned) (params->full_size / page_size); + + + for (unsigned i = 0; i != ACCESSES; ++i) { + uint32_t const index = ((s_mix->words[0] ^ i) * FNV_PRIME ^ mix->words[i % MIX_WORDS]) % num_full_pages; + + for (unsigned n = 0; n != MIX_NODES; ++n) { + const node *dag_node; + if (callback && + callback(((float)(i * n) / (float)(ACCESSES * MIX_NODES) * 100) != 0)) { + return false; + } + if (full_nodes) { + dag_node = &full_nodes[MIX_NODES * index + n]; + } else { + node tmp_node; + ethash_calculate_dag_item(&tmp_node, index * MIX_NODES + n, params, cache); + dag_node = &tmp_node; + } #if defined(_M_X64) && ENABLE_SSE - { - __m128i fnv_prime = _mm_set1_epi32(FNV_PRIME); - __m128i xmm0 = _mm_mullo_epi32(fnv_prime, mix[n].xmm[0]); - __m128i xmm1 = _mm_mullo_epi32(fnv_prime, mix[n].xmm[1]); - __m128i xmm2 = _mm_mullo_epi32(fnv_prime, mix[n].xmm[2]); - __m128i xmm3 = _mm_mullo_epi32(fnv_prime, mix[n].xmm[3]); - mix[n].xmm[0] = _mm_xor_si128(xmm0, dag_node->xmm[0]); - mix[n].xmm[1] = _mm_xor_si128(xmm1, dag_node->xmm[1]); - mix[n].xmm[2] = _mm_xor_si128(xmm2, dag_node->xmm[2]); - mix[n].xmm[3] = _mm_xor_si128(xmm3, dag_node->xmm[3]); - } - #else - { - for (unsigned w = 0; w != NODE_WORDS; ++w) { - mix[n].words[w] = fnv_hash(mix[n].words[w], dag_node->words[w]); - } - } + { + __m128i fnv_prime = _mm_set1_epi32(FNV_PRIME); + __m128i xmm0 = _mm_mullo_epi32(fnv_prime, mix[n].xmm[0]); + __m128i xmm1 = _mm_mullo_epi32(fnv_prime, mix[n].xmm[1]); + __m128i xmm2 = _mm_mullo_epi32(fnv_prime, mix[n].xmm[2]); + __m128i xmm3 = _mm_mullo_epi32(fnv_prime, mix[n].xmm[3]); + mix[n].xmm[0] = _mm_xor_si128(xmm0, dag_node->xmm[0]); + mix[n].xmm[1] = _mm_xor_si128(xmm1, dag_node->xmm[1]); + mix[n].xmm[2] = _mm_xor_si128(xmm2, dag_node->xmm[2]); + mix[n].xmm[3] = _mm_xor_si128(xmm3, dag_node->xmm[3]); + } + #else + { + for (unsigned w = 0; w != NODE_WORDS; ++w) { + mix[n].words[w] = fnv_hash(mix[n].words[w], dag_node->words[w]); + } + } #endif - } - - } - - // compress mix - for (unsigned w = 0; w != MIX_WORDS; w += 4) { - uint32_t reduction = mix->words[w + 0]; - reduction = reduction * FNV_PRIME ^ mix->words[w + 1]; - reduction = reduction * FNV_PRIME ^ mix->words[w + 2]; - reduction = reduction * FNV_PRIME ^ mix->words[w + 3]; - mix->words[w / 4] = reduction; - } - - fix_endian_arr32(mix->words, MIX_WORDS / 4); - memcpy(&ret->mix_hash, mix->bytes, 32); - // final Keccak hash - SHA3_256(&ret->result, s_mix->bytes, 64 + 32); // Keccak-256(s + compressed_mix) - return true; + } + + } + + // compress mix + for (unsigned w = 0; w != MIX_WORDS; w += 4) { + uint32_t reduction = mix->words[w + 0]; + reduction = reduction * FNV_PRIME ^ mix->words[w + 1]; + reduction = reduction * FNV_PRIME ^ mix->words[w + 2]; + reduction = reduction * FNV_PRIME ^ mix->words[w + 3]; + mix->words[w / 4] = reduction; + } + + fix_endian_arr32(mix->words, MIX_WORDS / 4); + memcpy(&ret->mix_hash, mix->bytes, 32); + // final Keccak hash + SHA3_256(&ret->result, s_mix->bytes, 64 + 32); // Keccak-256(s + compressed_mix) + return true; } void ethash_quick_hash(ethash_h256_t *return_hash, - ethash_h256_t const *header_hash, - const uint64_t nonce, - ethash_h256_t const *mix_hash) + ethash_h256_t const *header_hash, + const uint64_t nonce, + ethash_h256_t const *mix_hash) { - uint8_t buf[64 + 32]; - memcpy(buf, header_hash, 32); - fix_endian64_same(nonce); - memcpy(&(buf[32]), &nonce, 8); - SHA3_512(buf, buf, 40); - memcpy(&(buf[64]), mix_hash, 32); - SHA3_256(return_hash, buf, 64 + 32); + uint8_t buf[64 + 32]; + memcpy(buf, header_hash, 32); + fix_endian64_same(nonce); + memcpy(&(buf[32]), &nonce, 8); + SHA3_512(buf, buf, 40); + memcpy(&(buf[64]), mix_hash, 32); + SHA3_256(return_hash, buf, 64 + 32); } void ethash_get_seedhash(ethash_h256_t *seedhash, const uint32_t block_number) { - ethash_h256_reset(seedhash); - const uint32_t epochs = block_number / EPOCH_LENGTH; - for (uint32_t i = 0; i < epochs; ++i) - SHA3_256(seedhash, (uint8_t*)seedhash, 32); + ethash_h256_reset(seedhash); + const uint32_t epochs = block_number / EPOCH_LENGTH; + for (uint32_t i = 0; i < epochs; ++i) + SHA3_256(seedhash, (uint8_t*)seedhash, 32); } int ethash_quick_check_difficulty(ethash_h256_t const *header_hash, - const uint64_t nonce, - ethash_h256_t const *mix_hash, - ethash_h256_t const *difficulty) + const uint64_t nonce, + ethash_h256_t const *mix_hash, + ethash_h256_t const *difficulty) { - ethash_h256_t return_hash; - ethash_quick_hash(&return_hash, header_hash, nonce, mix_hash); - return ethash_check_difficulty(&return_hash, difficulty); + ethash_h256_t return_hash; + ethash_quick_hash(&return_hash, header_hash, nonce, mix_hash); + return ethash_check_difficulty(&return_hash, difficulty); } ethash_light_t ethash_light_new(ethash_params const *params, ethash_h256_t const *seed) { - struct ethash_light *ret; - ret = calloc(sizeof(*ret), 1); - if (!ret) { - return NULL; - } - ret->cache = ethash_cache_new(params, seed); - if (!ret->cache) { - goto fail_free_light; - } - return ret; + struct ethash_light *ret; + ret = calloc(sizeof(*ret), 1); + if (!ret) { + return NULL; + } + ret->cache = ethash_cache_new(params, seed); + if (!ret->cache) { + goto fail_free_light; + } + return ret; fail_free_light: - free(ret); - return NULL; + free(ret); + return NULL; } void ethash_light_delete(ethash_light_t light) { - if (light->cache) { - ethash_cache_delete(light->cache); - } - free(light); + if (light->cache) { + ethash_cache_delete(light->cache); + } + free(light); } bool ethash_light_compute(ethash_return_value *ret, - ethash_light_t light, - ethash_params const *params, - const ethash_h256_t *header_hash, - const uint64_t nonce) + ethash_light_t light, + ethash_params const *params, + const ethash_h256_t *header_hash, + const uint64_t nonce) { - return ethash_hash(ret, NULL, light->cache, params, header_hash, nonce, NULL); + return ethash_hash(ret, NULL, light->cache, params, header_hash, nonce, NULL); } ethash_cache *ethash_light_get_cache(ethash_light_t light) { - return light->cache; + return light->cache; } ethash_cache *ethash_light_acquire_cache(ethash_light_t light) { - ethash_cache* ret = light->cache; - light->cache = 0; - return ret; + ethash_cache* ret = light->cache; + light->cache = 0; + return ret; } ethash_full_t ethash_full_new(ethash_params const* params, - ethash_cache const* cache, - ethash_callback_t callback) + ethash_cache const* cache, + ethash_callback_t callback) { - struct ethash_full *ret; - ret = calloc(sizeof(*ret), 1); - if (!ret) { - return NULL; - } - - ret->cache = (ethash_cache*)cache; - ret->data = malloc((size_t)params->full_size); - if (!ret->data) { - goto fail_free_full; - } - if (!ethash_compute_full_data(ret->data, params, cache)) { - goto fail_free_full_data; - } - ret->callback = callback; - return ret; + struct ethash_full *ret; + ret = calloc(sizeof(*ret), 1); + if (!ret) { + return NULL; + } + + ret->cache = (ethash_cache*)cache; + ret->data = malloc((size_t)params->full_size); + if (!ret->data) { + goto fail_free_full; + } + if (!ethash_compute_full_data(ret->data, params, cache)) { + goto fail_free_full_data; + } + ret->callback = callback; + return ret; fail_free_full_data: - free(ret->data); + free(ret->data); fail_free_full: - free(ret); - return NULL; + free(ret); + return NULL; } void ethash_full_delete(ethash_full_t full) { - if (full->cache) { - ethash_cache_delete(full->cache); - } - free(full->data); - free(full); + if (full->cache) { + ethash_cache_delete(full->cache); + } + free(full->data); + free(full); } bool ethash_full_compute(ethash_return_value *ret, - ethash_full_t full, - ethash_params const *params, - const ethash_h256_t *header_hash, - const uint64_t nonce) + ethash_full_t full, + ethash_params const *params, + const ethash_h256_t *header_hash, + const uint64_t nonce) { - return ethash_hash(ret, - (node const*)full->data, - NULL, - params, - header_hash, - nonce, - full->callback); + return ethash_hash(ret, + (node const*)full->data, + NULL, + params, + header_hash, + nonce, + full->callback); } ethash_cache *ethash_full_get_cache(ethash_full_t full) { - return full->cache; + return full->cache; } ethash_cache *ethash_full_acquire_cache(ethash_full_t full) { - ethash_cache* ret = full->cache; - full->cache = 0; - return ret; + ethash_cache* ret = full->cache; + full->cache = 0; + return ret; } /** * ========================= - * = DEPRECATED API = + * = DEPRECATED API = * ========================= * * Kept for backwards compatibility with whoever still uses it. Please consider * switching to the new API (look above) */ void ethash_mkcache(ethash_cache *cache, - ethash_params const *params, - ethash_h256_t const* seed) + ethash_params const *params, + ethash_h256_t const* seed) { - node *nodes = (node*) cache->mem; - ethash_compute_cache_nodes(nodes, params, seed); + node *nodes = (node*) cache->mem; + ethash_compute_cache_nodes(nodes, params, seed); } void ethash_full(ethash_return_value *ret, - void const *full_mem, - ethash_params const *params, - ethash_h256_t const *header_hash, - const uint64_t nonce) + void const *full_mem, + ethash_params const *params, + ethash_h256_t const *header_hash, + const uint64_t nonce) { - ethash_hash(ret, (node const *) full_mem, NULL, params, header_hash, nonce, NULL); + ethash_hash(ret, (node const *) full_mem, NULL, params, header_hash, nonce, NULL); } void ethash_light(ethash_return_value *ret, - ethash_cache const *cache, - ethash_params const *params, - ethash_h256_t const *header_hash, - const uint64_t nonce) + ethash_cache const *cache, + ethash_params const *params, + ethash_h256_t const *header_hash, + const uint64_t nonce) { - ethash_hash(ret, NULL, cache, params, header_hash, nonce, NULL); + ethash_hash(ret, NULL, cache, params, header_hash, nonce, NULL); } diff --git a/internal.h b/internal.h index 7c2c6293b..95e132d7c 100644 --- a/internal.h +++ b/internal.h @@ -20,9 +20,9 @@ extern "C" { #include typedef union node { - uint8_t bytes[NODE_WORDS * 4]; - uint32_t words[NODE_WORDS]; - uint64_t double_words[NODE_WORDS / 2]; + uint8_t bytes[NODE_WORDS * 4]; + uint32_t words[NODE_WORDS]; + uint64_t double_words[NODE_WORDS / 2]; #if defined(_M_X64) && ENABLE_SSE __m128i xmm[NODE_WORDS/4]; @@ -31,24 +31,24 @@ typedef union node { } node; struct ethash_light { - ethash_cache *cache; + ethash_cache *cache; }; struct ethash_full { - ethash_cache *cache; - node *data; - ethash_callback_t callback; + ethash_cache *cache; + node *data; + ethash_callback_t callback; }; void ethash_calculate_dag_item(node *const ret, - const unsigned node_index, - ethash_params const *params, - ethash_cache const *cache); + const unsigned node_index, + ethash_params const *params, + ethash_cache const *cache); void ethash_quick_hash(ethash_h256_t *return_hash, - ethash_h256_t const *header_hash, - const uint64_t nonce, - ethash_h256_t const *mix_hash); + ethash_h256_t const *header_hash, + const uint64_t nonce, + ethash_h256_t const *mix_hash); #ifdef __cplusplus } diff --git a/io.c b/io.c index dc72c63a6..f1a9d7012 100644 --- a/io.c +++ b/io.c @@ -26,64 +26,64 @@ #define PASS_ARR(c_) (c_), sizeof(c_) static bool ethash_io_write_file(char const *dirname, - char const* filename, - size_t filename_length, - void const* data, - size_t data_size) + char const* filename, + size_t filename_length, + void const* data, + size_t data_size) { - bool ret = false; - char *fullname = ethash_io_create_filename(dirname, filename, filename_length); - if (!fullname) { - return false; - } - FILE *f = ethash_fopen(fullname, "wb"); - if (!f) { - goto free_name; - } - if (data_size != fwrite(data, 1, data_size, f)) { - goto close; - } + bool ret = false; + char *fullname = ethash_io_create_filename(dirname, filename, filename_length); + if (!fullname) { + return false; + } + FILE *f = ethash_fopen(fullname, "wb"); + if (!f) { + goto free_name; + } + if (data_size != fwrite(data, 1, data_size, f)) { + goto close; + } - ret = true; + ret = true; close: - fclose(f); + fclose(f); free_name: - free(fullname); - return ret; + free(fullname); + return ret; } bool ethash_io_write(char const *dirname, - ethash_params const* params, - ethash_h256_t seedhash, - void const* cache, - uint8_t **data, - uint64_t *data_size) + ethash_params const* params, + ethash_h256_t seedhash, + void const* cache, + uint8_t **data, + uint64_t *data_size) { - char info_buffer[DAG_MEMO_BYTESIZE]; - // allocate the bytes - uint8_t *temp_data_ptr = malloc((size_t)params->full_size); - if (!temp_data_ptr) { - goto end; - } - ethash_compute_full_data(temp_data_ptr, params, cache); + char info_buffer[DAG_MEMO_BYTESIZE]; + // allocate the bytes + uint8_t *temp_data_ptr = malloc((size_t)params->full_size); + if (!temp_data_ptr) { + goto end; + } + ethash_compute_full_data(temp_data_ptr, params, cache); - if (!ethash_io_write_file(dirname, PASS_ARR(DAG_FILE_NAME), temp_data_ptr, (size_t)params->full_size)) { - goto fail_free; - } + if (!ethash_io_write_file(dirname, PASS_ARR(DAG_FILE_NAME), temp_data_ptr, (size_t)params->full_size)) { + goto fail_free; + } - ethash_io_serialize_info(REVISION, seedhash, info_buffer); - if (!ethash_io_write_file(dirname, PASS_ARR(DAG_MEMO_NAME), info_buffer, DAG_MEMO_BYTESIZE)) { - goto fail_free; - } + ethash_io_serialize_info(REVISION, seedhash, info_buffer); + if (!ethash_io_write_file(dirname, PASS_ARR(DAG_MEMO_NAME), info_buffer, DAG_MEMO_BYTESIZE)) { + goto fail_free; + } - *data = temp_data_ptr; - *data_size = params->full_size; - return true; + *data = temp_data_ptr; + *data_size = params->full_size; + return true; fail_free: - free(temp_data_ptr); + free(temp_data_ptr); end: - return false; + return false; } #undef PASS_ARR diff --git a/io.h b/io.h index 1697b6872..1884ed193 100644 --- a/io.h +++ b/io.h @@ -36,9 +36,9 @@ static const char DAG_MEMO_NAME[] = "full.info"; /// Possible return values of @see ethash_io_prepare enum ethash_io_rc { - ETHASH_IO_FAIL = 0, ///< There has been an IO failure - ETHASH_IO_MEMO_MISMATCH, ///< Memo file either did not exist or there was content mismatch - ETHASH_IO_MEMO_MATCH, ///< Memo file existed and contents matched. No need to do anything + ETHASH_IO_FAIL = 0, ///< There has been an IO failure + ETHASH_IO_MEMO_MISMATCH, ///< Memo file either did not exist or there was content mismatch + ETHASH_IO_MEMO_MATCH, ///< Memo file existed and contents matched. No need to do anything }; /** @@ -79,17 +79,17 @@ enum ethash_io_rc ethash_io_prepare(char const *dirname, ethash_h256_t seedhash) * @return True for success and false in case of failure. */ bool ethash_io_write(char const *dirname, - ethash_params const* params, - ethash_h256_t seedhash, - void const* cache, - uint8_t **data, - uint64_t *data_size); + ethash_params const* params, + ethash_h256_t seedhash, + void const* cache, + uint8_t **data, + uint64_t *data_size); /** * An fopen wrapper for no-warnings crossplatform fopen. * * Msvc compiler considers fopen to be insecure and suggests to use their - * alternative. This is a wrapper for this alternative. Another way is to + * alternative. This is a wrapper for this alternative. Another way is to * #define _CRT_SECURE_NO_WARNINGS, but disabling all security warnings does * not sound like a good idea. * @@ -102,7 +102,7 @@ FILE *ethash_fopen(const char *file_name, const char *mode); * An stncat wrapper for no-warnings crossplatform strncat. * * Msvc compiler considers strncat to be insecure and suggests to use their - * alternative. This is a wrapper for this alternative. Another way is to + * alternative. This is a wrapper for this alternative. Another way is to * #define _CRT_SECURE_NO_WARNINGS, but disabling all security warnings does * not sound like a good idea. * @@ -117,29 +117,29 @@ FILE *ethash_fopen(const char *file_name, const char *mode); char *ethash_strncat(char *dest, size_t dest_size, const char *src, size_t count); static inline void ethash_io_serialize_info(uint32_t revision, - ethash_h256_t seed_hash, - char *output) + ethash_h256_t seed_hash, + char *output) { - // if .info is only consumed locally we don't really care about endianess - memcpy(output, &revision, 4); - memcpy(output + 4, &seed_hash, 32); + // if .info is only consumed locally we don't really care about endianess + memcpy(output, &revision, 4); + memcpy(output + 4, &seed_hash, 32); } static inline char *ethash_io_create_filename(char const *dirname, - char const* filename, - size_t filename_length) + char const* filename, + size_t filename_length) { - size_t dirlen = strlen(dirname); - // in C the cast is not needed, but a C++ compiler will complain for invalid conversion - char *name = (char*)malloc(dirlen + filename_length + 1); - if (!name) { - return NULL; - } + size_t dirlen = strlen(dirname); + // in C the cast is not needed, but a C++ compiler will complain for invalid conversion + char *name = (char*)malloc(dirlen + filename_length + 1); + if (!name) { + return NULL; + } - name[0] = '\0'; - ethash_strncat(name, dirlen + filename_length + 1, dirname, dirlen); - ethash_strncat(name, dirlen + filename_length + 1, filename, filename_length); - return name; + name[0] = '\0'; + ethash_strncat(name, dirlen + filename_length + 1, dirname, dirlen); + ethash_strncat(name, dirlen + filename_length + 1, filename, filename_length); + return name; } diff --git a/io_posix.c b/io_posix.c index 7f3d2ec7f..c2feee2b4 100644 --- a/io_posix.c +++ b/io_posix.c @@ -29,58 +29,58 @@ FILE *ethash_fopen(const char *file_name, const char *mode) { - return fopen(file_name, mode); + return fopen(file_name, mode); } char *ethash_strncat(char *dest, size_t dest_size, const char *src, size_t count) -{ - return strlen(dest) + count + 1 <= dest_size ? strncat(dest, src, count) : NULL; +{ + return strlen(dest) + count + 1 <= dest_size ? strncat(dest, src, count) : NULL; } enum ethash_io_rc ethash_io_prepare(char const *dirname, ethash_h256_t seedhash) { - char read_buffer[DAG_MEMO_BYTESIZE]; - char expect_buffer[DAG_MEMO_BYTESIZE]; - enum ethash_io_rc ret = ETHASH_IO_FAIL; + char read_buffer[DAG_MEMO_BYTESIZE]; + char expect_buffer[DAG_MEMO_BYTESIZE]; + enum ethash_io_rc ret = ETHASH_IO_FAIL; - // assert directory exists, full owner permissions and read/search for others - int rc = mkdir(dirname, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH); - if (rc == -1 && errno != EEXIST) { - goto end; - } + // assert directory exists, full owner permissions and read/search for others + int rc = mkdir(dirname, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH); + if (rc == -1 && errno != EEXIST) { + goto end; + } - char *memofile = ethash_io_create_filename(dirname, DAG_MEMO_NAME, sizeof(DAG_MEMO_NAME)); - if (!memofile) { - goto end; - } + char *memofile = ethash_io_create_filename(dirname, DAG_MEMO_NAME, sizeof(DAG_MEMO_NAME)); + if (!memofile) { + goto end; + } - // try to open memo file - FILE *f = ethash_fopen(memofile, "rb"); - if (!f) { - // file does not exist, so no checking happens. All is fine. - ret = ETHASH_IO_MEMO_MISMATCH; - goto free_memo; - } + // try to open memo file + FILE *f = ethash_fopen(memofile, "rb"); + if (!f) { + // file does not exist, so no checking happens. All is fine. + ret = ETHASH_IO_MEMO_MISMATCH; + goto free_memo; + } - if (fread(read_buffer, 1, DAG_MEMO_BYTESIZE, f) != DAG_MEMO_BYTESIZE) { - goto close; - } + if (fread(read_buffer, 1, DAG_MEMO_BYTESIZE, f) != DAG_MEMO_BYTESIZE) { + goto close; + } - ethash_io_serialize_info(REVISION, seedhash, expect_buffer); - if (memcmp(read_buffer, expect_buffer, DAG_MEMO_BYTESIZE) != 0) { - // we have different memo contents so delete the memo file - if (unlink(memofile) != 0) { - goto close; - } - ret = ETHASH_IO_MEMO_MISMATCH; - } + ethash_io_serialize_info(REVISION, seedhash, expect_buffer); + if (memcmp(read_buffer, expect_buffer, DAG_MEMO_BYTESIZE) != 0) { + // we have different memo contents so delete the memo file + if (unlink(memofile) != 0) { + goto close; + } + ret = ETHASH_IO_MEMO_MISMATCH; + } - ret = ETHASH_IO_MEMO_MATCH; + ret = ETHASH_IO_MEMO_MATCH; close: - fclose(f); + fclose(f); free_memo: - free(memofile); + free(memofile); end: - return ret; + return ret; } diff --git a/io_win32.c b/io_win32.c index 97b81fea1..fb4231714 100644 --- a/io_win32.c +++ b/io_win32.c @@ -26,59 +26,59 @@ FILE *ethash_fopen(const char *file_name, const char *mode) { - FILE *f; - return fopen_s(&f, file_name, mode) == 0 ? f : NULL; + FILE *f; + return fopen_s(&f, file_name, mode) == 0 ? f : NULL; } char *ethash_strncat(char *dest, size_t dest_size, const char *src, size_t count) -{ - return strncat_s(dest, dest_size, src, count) == 0 ? dest : NULL; +{ + return strncat_s(dest, dest_size, src, count) == 0 ? dest : NULL; } enum ethash_io_rc ethash_io_prepare(char const *dirname, ethash_h256_t seedhash) { - char read_buffer[DAG_MEMO_BYTESIZE]; - char expect_buffer[DAG_MEMO_BYTESIZE]; - enum ethash_io_rc ret = ETHASH_IO_FAIL; + char read_buffer[DAG_MEMO_BYTESIZE]; + char expect_buffer[DAG_MEMO_BYTESIZE]; + enum ethash_io_rc ret = ETHASH_IO_FAIL; - // assert directory exists - int rc = _mkdir(dirname); - if (rc == -1 && errno != EEXIST) { - goto end; - } + // assert directory exists + int rc = _mkdir(dirname); + if (rc == -1 && errno != EEXIST) { + goto end; + } - char *memofile = ethash_io_create_filename(dirname, DAG_MEMO_NAME, sizeof(DAG_MEMO_NAME)); - if (!memofile) { - goto end; - } + char *memofile = ethash_io_create_filename(dirname, DAG_MEMO_NAME, sizeof(DAG_MEMO_NAME)); + if (!memofile) { + goto end; + } - // try to open memo file - FILE *f = ethash_fopen(memofile, "rb"); - if (!f) { - // file does not exist, so no checking happens. All is fine. - ret = ETHASH_IO_MEMO_MISMATCH; - goto free_memo; - } + // try to open memo file + FILE *f = ethash_fopen(memofile, "rb"); + if (!f) { + // file does not exist, so no checking happens. All is fine. + ret = ETHASH_IO_MEMO_MISMATCH; + goto free_memo; + } - if (fread(read_buffer, 1, DAG_MEMO_BYTESIZE, f) != DAG_MEMO_BYTESIZE) { - goto close; - } + if (fread(read_buffer, 1, DAG_MEMO_BYTESIZE, f) != DAG_MEMO_BYTESIZE) { + goto close; + } - ethash_io_serialize_info(REVISION, seedhash, expect_buffer); - if (memcmp(read_buffer, expect_buffer, DAG_MEMO_BYTESIZE) != 0) { - // we have different memo contents so delete the memo file - if (_unlink(memofile) != 0) { - goto close; - } - ret = ETHASH_IO_MEMO_MISMATCH; - } + ethash_io_serialize_info(REVISION, seedhash, expect_buffer); + if (memcmp(read_buffer, expect_buffer, DAG_MEMO_BYTESIZE) != 0) { + // we have different memo contents so delete the memo file + if (_unlink(memofile) != 0) { + goto close; + } + ret = ETHASH_IO_MEMO_MISMATCH; + } - ret = ETHASH_IO_MEMO_MATCH; + ret = ETHASH_IO_MEMO_MATCH; close: - fclose(f); + fclose(f); free_memo: - free(memofile); + free(memofile); end: - return ret; + return ret; } diff --git a/sha3.c b/sha3.c index 0c28230b8..e72fe1018 100644 --- a/sha3.c +++ b/sha3.c @@ -17,65 +17,65 @@ /*** Constants. ***/ static const uint8_t rho[24] = \ - { 1, 3, 6, 10, 15, 21, - 28, 36, 45, 55, 2, 14, - 27, 41, 56, 8, 25, 43, - 62, 18, 39, 61, 20, 44}; + { 1, 3, 6, 10, 15, 21, + 28, 36, 45, 55, 2, 14, + 27, 41, 56, 8, 25, 43, + 62, 18, 39, 61, 20, 44}; static const uint8_t pi[24] = \ - {10, 7, 11, 17, 18, 3, - 5, 16, 8, 21, 24, 4, - 15, 23, 19, 13, 12, 2, - 20, 14, 22, 9, 6, 1}; + {10, 7, 11, 17, 18, 3, + 5, 16, 8, 21, 24, 4, + 15, 23, 19, 13, 12, 2, + 20, 14, 22, 9, 6, 1}; static const uint64_t RC[24] = \ - {1ULL, 0x8082ULL, 0x800000000000808aULL, 0x8000000080008000ULL, - 0x808bULL, 0x80000001ULL, 0x8000000080008081ULL, 0x8000000000008009ULL, - 0x8aULL, 0x88ULL, 0x80008009ULL, 0x8000000aULL, - 0x8000808bULL, 0x800000000000008bULL, 0x8000000000008089ULL, 0x8000000000008003ULL, - 0x8000000000008002ULL, 0x8000000000000080ULL, 0x800aULL, 0x800000008000000aULL, - 0x8000000080008081ULL, 0x8000000000008080ULL, 0x80000001ULL, 0x8000000080008008ULL}; + {1ULL, 0x8082ULL, 0x800000000000808aULL, 0x8000000080008000ULL, + 0x808bULL, 0x80000001ULL, 0x8000000080008081ULL, 0x8000000000008009ULL, + 0x8aULL, 0x88ULL, 0x80008009ULL, 0x8000000aULL, + 0x8000808bULL, 0x800000000000008bULL, 0x8000000000008089ULL, 0x8000000000008003ULL, + 0x8000000000008002ULL, 0x8000000000000080ULL, 0x800aULL, 0x800000008000000aULL, + 0x8000000080008081ULL, 0x8000000000008080ULL, 0x80000001ULL, 0x8000000080008008ULL}; /*** Helper macros to unroll the permutation. ***/ #define rol(x, s) (((x) << s) | ((x) >> (64 - s))) #define REPEAT6(e) e e e e e e #define REPEAT24(e) REPEAT6(e e e e) #define REPEAT5(e) e e e e e -#define FOR5(v, s, e) \ - v = 0; \ - REPEAT5(e; v += s;) +#define FOR5(v, s, e) \ + v = 0; \ + REPEAT5(e; v += s;) /*** Keccak-f[1600] ***/ static inline void keccakf(void* state) { - uint64_t* a = (uint64_t*)state; - uint64_t b[5] = {0}; - uint64_t t = 0; - uint8_t x, y; + uint64_t* a = (uint64_t*)state; + uint64_t b[5] = {0}; + uint64_t t = 0; + uint8_t x, y; - for (int i = 0; i < 24; i++) { - // Theta - FOR5(x, 1, - b[x] = 0; - FOR5(y, 5, - b[x] ^= a[x + y]; )) - FOR5(x, 1, - FOR5(y, 5, - a[y + x] ^= b[(x + 4) % 5] ^ rol(b[(x + 1) % 5], 1); )) - // Rho and pi - t = a[1]; - x = 0; - REPEAT24(b[0] = a[pi[x]]; - a[pi[x]] = rol(t, rho[x]); - t = b[0]; - x++; ) - // Chi - FOR5(y, - 5, - FOR5(x, 1, - b[x] = a[y + x];) - FOR5(x, 1, - a[y + x] = b[x] ^ ((~b[(x + 1) % 5]) & b[(x + 2) % 5]); )) - // Iota - a[0] ^= RC[i]; - } + for (int i = 0; i < 24; i++) { + // Theta + FOR5(x, 1, + b[x] = 0; + FOR5(y, 5, + b[x] ^= a[x + y]; )) + FOR5(x, 1, + FOR5(y, 5, + a[y + x] ^= b[(x + 4) % 5] ^ rol(b[(x + 1) % 5], 1); )) + // Rho and pi + t = a[1]; + x = 0; + REPEAT24(b[0] = a[pi[x]]; + a[pi[x]] = rol(t, rho[x]); + t = b[0]; + x++; ) + // Chi + FOR5(y, + 5, + FOR5(x, 1, + b[x] = a[y + x];) + FOR5(x, 1, + a[y + x] = b[x] ^ ((~b[(x + 1) % 5]) & b[(x + 2) % 5]); )) + // Iota + a[0] ^= RC[i]; + } } /******** The FIPS202-defined functions. ********/ @@ -83,20 +83,20 @@ static inline void keccakf(void* state) { /*** Some helper macros. ***/ #define _(S) do { S } while (0) -#define FOR(i, ST, L, S) \ - _(for (size_t i = 0; i < L; i += ST) { S; }) -#define mkapply_ds(NAME, S) \ - static inline void NAME(uint8_t* dst, \ - const uint8_t* src, \ - size_t len) { \ - FOR(i, 1, len, S); \ - } -#define mkapply_sd(NAME, S) \ - static inline void NAME(const uint8_t* src, \ - uint8_t* dst, \ - size_t len) { \ - FOR(i, 1, len, S); \ - } +#define FOR(i, ST, L, S) \ + _(for (size_t i = 0; i < L; i += ST) { S; }) +#define mkapply_ds(NAME, S) \ + static inline void NAME(uint8_t* dst, \ + const uint8_t* src, \ + size_t len) { \ + FOR(i, 1, len, S); \ + } +#define mkapply_sd(NAME, S) \ + static inline void NAME(const uint8_t* src, \ + uint8_t* dst, \ + size_t len) { \ + FOR(i, 1, len, S); \ + } mkapply_ds(xorin, dst[i] ^= src[i]) // xorin mkapply_sd(setout, dst[i] = src[i]) // setout @@ -105,47 +105,47 @@ mkapply_sd(setout, dst[i] = src[i]) // setout #define Plen 200 // Fold P*F over the full blocks of an input. -#define foldP(I, L, F) \ - while (L >= rate) { \ - F(a, I, rate); \ - P(a); \ - I += rate; \ - L -= rate; \ - } +#define foldP(I, L, F) \ + while (L >= rate) { \ + F(a, I, rate); \ + P(a); \ + I += rate; \ + L -= rate; \ + } /** The sponge-based hash construction. **/ static inline int hash(uint8_t* out, size_t outlen, - const uint8_t* in, size_t inlen, - size_t rate, uint8_t delim) { - if ((out == NULL) || ((in == NULL) && inlen != 0) || (rate >= Plen)) { - return -1; - } - uint8_t a[Plen] = {0}; - // Absorb input. - foldP(in, inlen, xorin); - // Xor in the DS and pad frame. - a[inlen] ^= delim; - a[rate - 1] ^= 0x80; - // Xor in the last block. - xorin(a, in, inlen); - // Apply P - P(a); - // Squeeze output. - foldP(out, outlen, setout); - setout(a, out, outlen); - memset(a, 0, 200); - return 0; + const uint8_t* in, size_t inlen, + size_t rate, uint8_t delim) { + if ((out == NULL) || ((in == NULL) && inlen != 0) || (rate >= Plen)) { + return -1; + } + uint8_t a[Plen] = {0}; + // Absorb input. + foldP(in, inlen, xorin); + // Xor in the DS and pad frame. + a[inlen] ^= delim; + a[rate - 1] ^= 0x80; + // Xor in the last block. + xorin(a, in, inlen); + // Apply P + P(a); + // Squeeze output. + foldP(out, outlen, setout); + setout(a, out, outlen); + memset(a, 0, 200); + return 0; } -#define defsha3(bits) \ - int sha3_##bits(uint8_t* out, size_t outlen, \ - const uint8_t* in, size_t inlen) { \ - if (outlen > (bits/8)) { \ - return -1; \ - } \ - return hash(out, outlen, in, inlen, 200 - (bits / 4), 0x01); \ - } +#define defsha3(bits) \ + int sha3_##bits(uint8_t* out, size_t outlen, \ + const uint8_t* in, size_t inlen) { \ + if (outlen > (bits/8)) { \ + return -1; \ + } \ + return hash(out, outlen, in, inlen, 200 - (bits / 4), 0x01); \ + } /*** FIPS202 SHA3 FOFs ***/ defsha3(256) -defsha3(512) \ No newline at end of file +defsha3(512) diff --git a/sha3.h b/sha3.h index 8b127247f..bf9d1c481 100644 --- a/sha3.h +++ b/sha3.h @@ -11,19 +11,19 @@ extern "C" { struct ethash_h256; #define decsha3(bits) \ - int sha3_##bits(uint8_t*, size_t, const uint8_t*, size_t); + int sha3_##bits(uint8_t*, size_t, const uint8_t*, size_t); decsha3(256) decsha3(512) static inline void SHA3_256(struct ethash_h256 const* ret, uint8_t const *data, const size_t size) { - sha3_256((uint8_t*)ret, 32, data, size); + sha3_256((uint8_t*)ret, 32, data, size); } static inline void SHA3_512(uint8_t *ret, uint8_t const *data, const size_t size) { - sha3_512(ret, 64, data, size); + sha3_512(ret, 64, data, size); } #ifdef __cplusplus diff --git a/sha3_cryptopp.cpp b/sha3_cryptopp.cpp index 144e4719a..13d090b15 100644 --- a/sha3_cryptopp.cpp +++ b/sha3_cryptopp.cpp @@ -25,11 +25,13 @@ extern "C" { struct ethash_h256; typedef struct ethash_h256 ethash_h256_t; -void SHA3_256(ethash_h256_t const* ret, const uint8_t *data, size_t size) { - CryptoPP::SHA3_256().CalculateDigest((uint8_t*)ret, data, size); +void SHA3_256(ethash_h256_t const* ret, const uint8_t *data, size_t size) +{ + CryptoPP::SHA3_256().CalculateDigest((uint8_t*)ret, data, size); } -void SHA3_512(uint8_t *const ret, const uint8_t *data, size_t size) { - CryptoPP::SHA3_512().CalculateDigest(ret, data, size); +void SHA3_512(uint8_t *const ret, const uint8_t *data, size_t size) +{ + CryptoPP::SHA3_512().CalculateDigest(ret, data, size); } } diff --git a/util.c b/util.c index fbf268b7d..d635477f1 100644 --- a/util.c +++ b/util.c @@ -30,7 +30,7 @@ __declspec(dllimport) void __stdcall OutputDebugStringA(const char* lpOutputStri void debugf(const char *str, ...) { va_list args; - va_start(args, str); + va_start(args, str); char buf[1<<16]; _vsnprintf_s(buf, sizeof(buf), sizeof(buf), str, args); From fbf7fc5b660dc91d4557de63958076fbd98f969a Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Mon, 13 Apr 2015 15:41:29 +0200 Subject: [PATCH 039/461] Memoization is done with the DAG filename --- ethash.h | 8 ++++++ internal.h | 2 ++ io.c | 39 --------------------------- io.h | 78 +++++++++++++++++++----------------------------------- io_posix.c | 36 +++++++++---------------- 5 files changed, 49 insertions(+), 114 deletions(-) diff --git a/ethash.h b/ethash.h index 4c38ea409..a92dd5b08 100644 --- a/ethash.h +++ b/ethash.h @@ -67,6 +67,14 @@ static inline void ethash_h256_reset(ethash_h256_t *hash) memset(hash, 0, 32); } +// convenience macro to statically initialize an h256_t +// usage: +// ethash_h256_t a = ethash_h256_static_init(1, 2, 3, ... ) +// have to provide all 32 values. If you don't provide all the rest +// will simply be unitialized (not guranteed to be 0) +#define ethash_h256_static_init(...) \ + {.b = {__VA_ARGS__} } + struct ethash_light; typedef struct ethash_light* ethash_light_t; struct ethash_full; diff --git a/internal.h b/internal.h index 95e132d7c..fadcf3fe7 100644 --- a/internal.h +++ b/internal.h @@ -2,6 +2,7 @@ #include "compiler.h" #include "endian.h" #include "ethash.h" +#include #define ENABLE_SSE 0 @@ -35,6 +36,7 @@ struct ethash_light { }; struct ethash_full { + FILE *file; ethash_cache *cache; node *data; ethash_callback_t callback; diff --git a/io.c b/io.c index f1a9d7012..0a1b8731a 100644 --- a/io.c +++ b/io.c @@ -22,9 +22,6 @@ #include #include -// silly macro to save some typing -#define PASS_ARR(c_) (c_), sizeof(c_) - static bool ethash_io_write_file(char const *dirname, char const* filename, size_t filename_length, @@ -51,39 +48,3 @@ free_name: free(fullname); return ret; } - -bool ethash_io_write(char const *dirname, - ethash_params const* params, - ethash_h256_t seedhash, - void const* cache, - uint8_t **data, - uint64_t *data_size) -{ - char info_buffer[DAG_MEMO_BYTESIZE]; - // allocate the bytes - uint8_t *temp_data_ptr = malloc((size_t)params->full_size); - if (!temp_data_ptr) { - goto end; - } - ethash_compute_full_data(temp_data_ptr, params, cache); - - if (!ethash_io_write_file(dirname, PASS_ARR(DAG_FILE_NAME), temp_data_ptr, (size_t)params->full_size)) { - goto fail_free; - } - - ethash_io_serialize_info(REVISION, seedhash, info_buffer); - if (!ethash_io_write_file(dirname, PASS_ARR(DAG_MEMO_NAME), info_buffer, DAG_MEMO_BYTESIZE)) { - goto fail_free; - } - - *data = temp_data_ptr; - *data_size = params->full_size; - return true; - -fail_free: - free(temp_data_ptr); -end: - return false; -} - -#undef PASS_ARR diff --git a/io.h b/io.h index 1884ed193..29c8eea1b 100644 --- a/io.h +++ b/io.h @@ -23,67 +23,41 @@ #include #include #include +#include "endian.h" #include "ethash.h" #ifdef __cplusplus extern "C" { #endif - -static const char DAG_FILE_NAME[] = "full"; -static const char DAG_MEMO_NAME[] = "full.info"; -// MSVC thinks that "static const unsigned int" is not a compile time variable. Sorry for the #define :( -#define DAG_MEMO_BYTESIZE 36 - +// Maximum size for mutable part of DAG file name +// 10 is for maximum number of digits of a uint32_t (for REVISION) +// 1 is for _ and 16 is for the first 16 hex digits for first 8 bytes of +// the seedhash and last 1 is for the null terminating character +// Reference: https://github.com/ethereum/wiki/wiki/Ethash-DAG +#define DAG_MUTABLE_NAME_MAX_SIZE (10 + 1 + 16 + 1) /// Possible return values of @see ethash_io_prepare enum ethash_io_rc { ETHASH_IO_FAIL = 0, ///< There has been an IO failure - ETHASH_IO_MEMO_MISMATCH, ///< Memo file either did not exist or there was content mismatch - ETHASH_IO_MEMO_MATCH, ///< Memo file existed and contents matched. No need to do anything + ETHASH_IO_MEMO_MISMATCH, ///< The DAG file did not exist or there was revision/hash mismatch + ETHASH_IO_MEMO_MATCH, ///< DAG file existed and revision/hash matched. No need to do anything }; /** * Prepares io for ethash * - * Create the DAG directory if it does not exist, and check if the memo file matches. - * If it does not match then it's deleted to pave the way for @ref ethash_io_write() + * Create the DAG directory and the DAG file if they don't exist. * - * @param dirname A null terminated c-string of the path of the ethash + * @param[in] dirname A null terminated c-string of the path of the ethash * data directory. If it does not exist it's created. - * @param seedhash The seedhash of the current block number + * @param[in] seedhash The seedhash of the current block number, used in the + * naming of the file as can be seen from the spec at: + * https://github.com/ethereum/wiki/wiki/Ethash-DAG + * @param[out] f If the hash/revision combo matched then this will point + * to an opened file handler for that file. User will then + * have to close it. * @return For possible return values @see enum ethash_io_rc */ -enum ethash_io_rc ethash_io_prepare(char const *dirname, ethash_h256_t seedhash); - -/** - * Fully computes data and writes it to the file on disk. - * - * This function should be called after @see ethash_io_prepare() and only if - * its return value is @c ETHASH_IO_MEMO_MISMATCH. Will write both the full data - * and the memo file. - * - * @param[in] dirname A null terminated c-string of the path of the ethash - * data directory. Has to exist. - * @param[in] params An ethash_params object containing the full size - * and the cache size - * @param[in] seedhash The seedhash of the current block number - * @param[in] cache The cache data. Would have usually been calulated by - * @see ethash_prep_light(). - * @param[out] data Pass a pointer to uint8_t by reference here. If the - * function is succesfull then this point to the allocated - * data calculated by @see ethash_prep_full(). Memory - * ownership is transfered to the callee. Remember that - * you eventually need to free this with a call to free(). - * @param[out] data_size Pass a uint64_t by value. If the function is succesfull - * then this will contain the number of bytes allocated - * for @a data. - * @return True for success and false in case of failure. - */ -bool ethash_io_write(char const *dirname, - ethash_params const* params, - ethash_h256_t seedhash, - void const* cache, - uint8_t **data, - uint64_t *data_size); +enum ethash_io_rc ethash_io_prepare(char const *dirname, ethash_h256_t seedhash, FILE **f); /** * An fopen wrapper for no-warnings crossplatform fopen. @@ -99,7 +73,7 @@ bool ethash_io_write(char const *dirname, */ FILE *ethash_fopen(const char *file_name, const char *mode); /** - * An stncat wrapper for no-warnings crossplatform strncat. + * An strncat wrapper for no-warnings crossplatform strncat. * * Msvc compiler considers strncat to be insecure and suggests to use their * alternative. This is a wrapper for this alternative. Another way is to @@ -116,13 +90,15 @@ FILE *ethash_fopen(const char *file_name, const char *mode); */ char *ethash_strncat(char *dest, size_t dest_size, const char *src, size_t count); -static inline void ethash_io_serialize_info(uint32_t revision, - ethash_h256_t seed_hash, - char *output) +static inline bool ethash_io_mutable_name(uint32_t revision, + ethash_h256_t *seed_hash, + char *output) { - // if .info is only consumed locally we don't really care about endianess - memcpy(output, &revision, 4); - memcpy(output + 4, &seed_hash, 32); + uint64_t hash = *((uint64_t*)seed_hash); +#if LITTLE_ENDIAN == BYTE_ORDER + hash = ethash_swap_u64(hash); +#endif + return snprintf(output, DAG_MUTABLE_NAME_MAX_SIZE, "%u_%016lx", revision, hash) >= 0; } static inline char *ethash_io_create_filename(char const *dirname, diff --git a/io_posix.c b/io_posix.c index c2feee2b4..8fff0bb0d 100644 --- a/io_posix.c +++ b/io_posix.c @@ -37,10 +37,11 @@ char *ethash_strncat(char *dest, size_t dest_size, const char *src, size_t count return strlen(dest) + count + 1 <= dest_size ? strncat(dest, src, count) : NULL; } -enum ethash_io_rc ethash_io_prepare(char const *dirname, ethash_h256_t seedhash) +enum ethash_io_rc ethash_io_prepare(char const *dirname, + ethash_h256_t seedhash, + FILE **output_file) { - char read_buffer[DAG_MEMO_BYTESIZE]; - char expect_buffer[DAG_MEMO_BYTESIZE]; + char mutable_name[DAG_MUTABLE_NAME_MAX_SIZE]; enum ethash_io_rc ret = ETHASH_IO_FAIL; // assert directory exists, full owner permissions and read/search for others @@ -49,38 +50,25 @@ enum ethash_io_rc ethash_io_prepare(char const *dirname, ethash_h256_t seedhash) goto end; } - char *memofile = ethash_io_create_filename(dirname, DAG_MEMO_NAME, sizeof(DAG_MEMO_NAME)); - if (!memofile) { + ethash_io_mutable_name(REVISION, &seedhash, mutable_name); + char *tmpfile = ethash_io_create_filename(dirname, mutable_name, strlen(mutable_name)); + if (!tmpfile) { goto end; } - // try to open memo file - FILE *f = ethash_fopen(memofile, "rb"); + // try to open the file + FILE *f = fopen(tmpfile, "rb"); if (!f) { - // file does not exist, so no checking happens. All is fine. + // file does not exist, will need to be created ret = ETHASH_IO_MEMO_MISMATCH; goto free_memo; } - if (fread(read_buffer, 1, DAG_MEMO_BYTESIZE, f) != DAG_MEMO_BYTESIZE) { - goto close; - } - - ethash_io_serialize_info(REVISION, seedhash, expect_buffer); - if (memcmp(read_buffer, expect_buffer, DAG_MEMO_BYTESIZE) != 0) { - // we have different memo contents so delete the memo file - if (unlink(memofile) != 0) { - goto close; - } - ret = ETHASH_IO_MEMO_MISMATCH; - } - ret = ETHASH_IO_MEMO_MATCH; -close: - fclose(f); + *output_file = f; free_memo: - free(memofile); + free(tmpfile); end: return ret; } From 1a0e498afc75aa8c62872e634fc89cef2a9ac4fd Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Mon, 13 Apr 2015 15:54:14 +0200 Subject: [PATCH 040/461] ethash_io changes for windows --- io_posix.c | 3 +-- io_win32.c | 33 +++++++++------------------------ 2 files changed, 10 insertions(+), 26 deletions(-) diff --git a/io_posix.c b/io_posix.c index 8fff0bb0d..13827878b 100644 --- a/io_posix.c +++ b/io_posix.c @@ -57,7 +57,7 @@ enum ethash_io_rc ethash_io_prepare(char const *dirname, } // try to open the file - FILE *f = fopen(tmpfile, "rb"); + FILE *f = ethash_fopen(tmpfile, "rb"); if (!f) { // file does not exist, will need to be created ret = ETHASH_IO_MEMO_MISMATCH; @@ -65,7 +65,6 @@ enum ethash_io_rc ethash_io_prepare(char const *dirname, } ret = ETHASH_IO_MEMO_MATCH; - *output_file = f; free_memo: free(tmpfile); diff --git a/io_win32.c b/io_win32.c index fb4231714..cf8d0669a 100644 --- a/io_win32.c +++ b/io_win32.c @@ -37,8 +37,7 @@ char *ethash_strncat(char *dest, size_t dest_size, const char *src, size_t count enum ethash_io_rc ethash_io_prepare(char const *dirname, ethash_h256_t seedhash) { - char read_buffer[DAG_MEMO_BYTESIZE]; - char expect_buffer[DAG_MEMO_BYTESIZE]; + char mutable_name[DAG_MUTABLE_NAME_MAX_SIZE]; enum ethash_io_rc ret = ETHASH_IO_FAIL; // assert directory exists @@ -47,38 +46,24 @@ enum ethash_io_rc ethash_io_prepare(char const *dirname, ethash_h256_t seedhash) goto end; } - char *memofile = ethash_io_create_filename(dirname, DAG_MEMO_NAME, sizeof(DAG_MEMO_NAME)); - if (!memofile) { + ethash_io_mutable_name(REVISION, &seedhash, mutable_name); + char *tmpfile = ethash_io_create_filename(dirname, mutable_name, strlen(mutable_name)); + if (!tmpfile) { goto end; } - // try to open memo file - FILE *f = ethash_fopen(memofile, "rb"); + // try to open the file + FILE *f = ethash_fopen(tmpfile, "rb"); if (!f) { - // file does not exist, so no checking happens. All is fine. + // file does not exist, will need to be created ret = ETHASH_IO_MEMO_MISMATCH; goto free_memo; } - if (fread(read_buffer, 1, DAG_MEMO_BYTESIZE, f) != DAG_MEMO_BYTESIZE) { - goto close; - } - - ethash_io_serialize_info(REVISION, seedhash, expect_buffer); - if (memcmp(read_buffer, expect_buffer, DAG_MEMO_BYTESIZE) != 0) { - // we have different memo contents so delete the memo file - if (_unlink(memofile) != 0) { - goto close; - } - ret = ETHASH_IO_MEMO_MISMATCH; - } - ret = ETHASH_IO_MEMO_MATCH; - -close: - fclose(f); + *output_file = f; free_memo: - free(memofile); + free(tmpfile); end: return ret; } From 0c4e19be7d67d037e95e8871a7d2bf6fbbb9f42a Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Tue, 14 Apr 2015 15:25:00 +0200 Subject: [PATCH 041/461] Adding memory mapped I/O to ethash_full_new --- CMakeLists.txt | 2 +- ethash.h | 12 ++++-- internal.c | 57 ++++++++++++++++++++++------ internal.h | 1 + io.h | 20 ++++++---- io_posix.c | 25 +++++++++--- io_win32.c | 21 ++++++++-- mmap.h | 28 ++++++++++++++ mmap_win32.c | 101 +++++++++++++++++++++++++++++++++++++++++++++++++ 9 files changed, 236 insertions(+), 31 deletions(-) create mode 100644 mmap.h create mode 100644 mmap_win32.c diff --git a/CMakeLists.txt b/CMakeLists.txt index c92240086..4ac285f69 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,7 +21,7 @@ set(FILES util.c data_sizes.h) if (MSVC) - list(APPEND FILES io_win32.c) + list(APPEND FILES io_win32.c mmap_win32.c) else() list(APPEND FILES io_posix.c) endif() diff --git a/ethash.h b/ethash.h index a92dd5b08..1872d8168 100644 --- a/ethash.h +++ b/ethash.h @@ -170,6 +170,8 @@ ethash_cache *ethash_light_acquire_cache(ethash_light_t light); /** * Allocate and initialize a new ethash_full handler * + * @param dirname The directory in which to put the DAG file. + * @param seedhash The seed hash of the block. Used in the DAG file naming. * @param params The parameters to initialize it with. We are interested in * the full_size from here * @param cache A cache object to use that was allocated with @ref ethash_cache_new(). @@ -183,9 +185,11 @@ ethash_cache *ethash_light_acquire_cache(ethash_light_t light); * @return Newly allocated ethash_full handler or NULL in case of * ERRNOMEM or invalid parameters used for @ref ethash_compute_full_data() */ -ethash_full_t ethash_full_new(ethash_params const* params, - ethash_cache const* cache, - ethash_callback_t callback); +ethash_full_t ethash_full_new(char const *dirname, + const ethash_h256_t *seed_hash, + ethash_params const* params, + ethash_cache const* cache, + ethash_callback_t callback); /** * Frees a previously allocated ethash_full handler * @param full The light handler to free @@ -198,7 +202,7 @@ void ethash_full_delete(ethash_full_t full); * @param full The full client handler * @param params The parameters to use * @param header_hash The header hash to pack into the mix - * @param nonce The nonce to pack into the mix + * @param nonce The nonce to pack into the mix * @return true if all went well and false if there were invalid * parameters given or if there was a callback given and * at some point return a non-zero value diff --git a/internal.c b/internal.c index d5f0cb854..93fc3bbe9 100644 --- a/internal.c +++ b/internal.c @@ -23,11 +23,14 @@ #include #include #include +#include +#include "mmap.h" #include "ethash.h" #include "fnv.h" #include "endian.h" #include "internal.h" #include "data_sizes.h" +#include "io.h" #ifdef WITH_CRYPTOPP @@ -121,11 +124,9 @@ void ethash_calculate_dag_item(node *const ret, uint32_t num_parent_nodes = (uint32_t) (params->cache_size / sizeof(node)); node const *cache_nodes = (node const *) cache->mem; node const *init = &cache_nodes[node_index % num_parent_nodes]; - memcpy(ret, init, sizeof(node)); ret->words[0] ^= node_index; SHA3_512(ret->bytes, ret->bytes, sizeof(node)); - #if defined(_M_X64) && ENABLE_SSE __m128i const fnv_prime = _mm_set1_epi32(FNV_PRIME); __m128i xmm0 = ret->xmm[0]; @@ -176,7 +177,6 @@ bool ethash_compute_full_data(void *mem, return false; } node *full_nodes = mem; - // now compute full nodes for (unsigned n = 0; n != (params->full_size / sizeof(node)); ++n) { ethash_calculate_dag_item(&(full_nodes[n]), n, params, cache); @@ -277,7 +277,6 @@ void ethash_quick_hash(ethash_h256_t *return_hash, const uint64_t nonce, ethash_h256_t const *mix_hash) { - uint8_t buf[64 + 32]; memcpy(buf, header_hash, 32); fix_endian64_same(nonce); @@ -353,21 +352,50 @@ ethash_cache *ethash_light_acquire_cache(ethash_light_t light) return ret; } -ethash_full_t ethash_full_new(ethash_params const* params, - ethash_cache const* cache, - ethash_callback_t callback) +ethash_full_t ethash_full_new(char const *dirname, + const ethash_h256_t *seed_hash, + ethash_params const* params, + ethash_cache const* cache, + ethash_callback_t callback) { struct ethash_full *ret; + int fd; + FILE *f = NULL; + bool match = false; ret = calloc(sizeof(*ret), 1); if (!ret) { return NULL; } ret->cache = (ethash_cache*)cache; - ret->data = malloc((size_t)params->full_size); - if (!ret->data) { + ret->file_size = (size_t)params->full_size; + switch (ethash_io_prepare(dirname, *seed_hash, &f, (size_t)params->full_size)) { + case ETHASH_IO_FAIL: goto fail_free_full; + case ETHASH_IO_MEMO_MATCH: + match = true; + case ETHASH_IO_MEMO_MISMATCH: + ret->file = f; + if ((fd = fileno(ret->file)) == -1) { + goto fail_free_full; + } + ret->data = mmap( + NULL, + (size_t)params->full_size, + PROT_READ | PROT_WRITE, + MAP_SHARED, + fd, + 0 + ); + if (ret->data == MAP_FAILED) { + goto fail_close_file; + } + if (match) { + return ret; + } + break; } + if (!ethash_compute_full_data(ret->data, params, cache)) { goto fail_free_full_data; } @@ -375,7 +403,10 @@ ethash_full_t ethash_full_new(ethash_params const* params, return ret; fail_free_full_data: - free(ret->data); + // could check that munmap(..) == 0 but even if it did not can't really do anything here + munmap(ret->data, (size_t)params->full_size); +fail_close_file: + fclose(ret->file); fail_free_full: free(ret); return NULL; @@ -386,7 +417,11 @@ void ethash_full_delete(ethash_full_t full) if (full->cache) { ethash_cache_delete(full->cache); } - free(full->data); + // could check that munmap(..) == 0 but even if it did not can't really do anything here + munmap(full->data, full->file_size); + if (full->file) { + fclose(full->file); + } free(full); } diff --git a/internal.h b/internal.h index fadcf3fe7..3d340512d 100644 --- a/internal.h +++ b/internal.h @@ -37,6 +37,7 @@ struct ethash_light { struct ethash_full { FILE *file; + size_t file_size; ethash_cache *cache; node *data; ethash_callback_t callback; diff --git a/io.h b/io.h index 29c8eea1b..736309971 100644 --- a/io.h +++ b/io.h @@ -52,12 +52,18 @@ enum ethash_io_rc { * @param[in] seedhash The seedhash of the current block number, used in the * naming of the file as can be seen from the spec at: * https://github.com/ethereum/wiki/wiki/Ethash-DAG - * @param[out] f If the hash/revision combo matched then this will point - * to an opened file handler for that file. User will then - * have to close it. + * @param[out] f If there was no failure then this will point to an open + * file descriptor. User is responsible for closing it. + * In the case of memo match then the file is open on read + * mode, while on the case of mismatch a new file is created + * on write mode + * @param[in] file_size The size that the DAG file should have on disk * @return For possible return values @see enum ethash_io_rc */ -enum ethash_io_rc ethash_io_prepare(char const *dirname, ethash_h256_t seedhash, FILE **f); +enum ethash_io_rc ethash_io_prepare(char const *dirname, + ethash_h256_t const seedhash, + FILE **f, + size_t file_size); /** * An fopen wrapper for no-warnings crossplatform fopen. @@ -91,8 +97,8 @@ FILE *ethash_fopen(const char *file_name, const char *mode); char *ethash_strncat(char *dest, size_t dest_size, const char *src, size_t count); static inline bool ethash_io_mutable_name(uint32_t revision, - ethash_h256_t *seed_hash, - char *output) + ethash_h256_t const* seed_hash, + char* output) { uint64_t hash = *((uint64_t*)seed_hash); #if LITTLE_ENDIAN == BYTE_ORDER @@ -101,7 +107,7 @@ static inline bool ethash_io_mutable_name(uint32_t revision, return snprintf(output, DAG_MUTABLE_NAME_MAX_SIZE, "%u_%016lx", revision, hash) >= 0; } -static inline char *ethash_io_create_filename(char const *dirname, +static inline char *ethash_io_create_filename(char const* dirname, char const* filename, size_t filename_length) { diff --git a/io_posix.c b/io_posix.c index 13827878b..3aa28d3ad 100644 --- a/io_posix.c +++ b/io_posix.c @@ -38,8 +38,9 @@ char *ethash_strncat(char *dest, size_t dest_size, const char *src, size_t count } enum ethash_io_rc ethash_io_prepare(char const *dirname, - ethash_h256_t seedhash, - FILE **output_file) + ethash_h256_t const seedhash, + FILE **output_file, + size_t file_size) { char mutable_name[DAG_MUTABLE_NAME_MAX_SIZE]; enum ethash_io_rc ret = ETHASH_IO_FAIL; @@ -57,14 +58,28 @@ enum ethash_io_rc ethash_io_prepare(char const *dirname, } // try to open the file - FILE *f = ethash_fopen(tmpfile, "rb"); - if (!f) { + FILE *f = ethash_fopen(tmpfile, "rb+"); + if (f) { + // TODO: check for file size + } else { // file does not exist, will need to be created + f = ethash_fopen(tmpfile, "wb+"); + if (!f) { + goto free_memo; + } + // make sure it's of the proper size + if (fseek(f, file_size - 1, SEEK_SET) != 0) { + fclose(f); + goto free_memo; + } + fputc('\n', f); + fflush(f); ret = ETHASH_IO_MEMO_MISMATCH; - goto free_memo; + goto set_file; } ret = ETHASH_IO_MEMO_MATCH; +set_file: *output_file = f; free_memo: free(tmpfile); diff --git a/io_win32.c b/io_win32.c index cf8d0669a..17d0983b9 100644 --- a/io_win32.c +++ b/io_win32.c @@ -35,7 +35,10 @@ char *ethash_strncat(char *dest, size_t dest_size, const char *src, size_t count return strncat_s(dest, dest_size, src, count) == 0 ? dest : NULL; } -enum ethash_io_rc ethash_io_prepare(char const *dirname, ethash_h256_t seedhash) +enum ethash_io_rc ethash_io_prepare(char const *dirname, + ethash_h256_t const seedhash, + FILE **output_file, + size_t file_size) { char mutable_name[DAG_MUTABLE_NAME_MAX_SIZE]; enum ethash_io_rc ret = ETHASH_IO_FAIL; @@ -53,14 +56,26 @@ enum ethash_io_rc ethash_io_prepare(char const *dirname, ethash_h256_t seedhash) } // try to open the file - FILE *f = ethash_fopen(tmpfile, "rb"); + FILE *f = ethash_fopen(tmpfile, "rb+"); if (!f) { // file does not exist, will need to be created + f = ethash_fopen(tmpfile, "wb+"); + if (!f) { + goto free_memo; + } + // make sure it's of the proper size + if (fseek(f, file_size - 1, SEEK_SET) != 0) { + fclose(f); + goto free_memo; + } + fputc('\n', f); + fflush(f); ret = ETHASH_IO_MEMO_MISMATCH; - goto free_memo; + goto set_file; } ret = ETHASH_IO_MEMO_MATCH; +set_file: *output_file = f; free_memo: free(tmpfile); diff --git a/mmap.h b/mmap.h new file mode 100644 index 000000000..17f145888 --- /dev/null +++ b/mmap.h @@ -0,0 +1,28 @@ +/* + This file is part of ethash. + + ethash is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ethash is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with ethash. If not, see . +*/ +/** @file mmap.h + * @author Lefteris Karapetsas + * @date 2015 + */ +#pragma once +#if defined(__MINGW32__) || defined(_WIN32) +void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset); +#else +#include +#endif + + diff --git a/mmap_win32.c b/mmap_win32.c new file mode 100644 index 000000000..9a37b6c79 --- /dev/null +++ b/mmap_win32.c @@ -0,0 +1,101 @@ +/* mmap() replacement for Windows + * + * Author: Mike Frysinger + * Placed into the public domain + */ + +/* References: + * CreateFileMapping: http://msdn.microsoft.com/en-us/library/aa366537(VS.85).aspx + * CloseHandle: http://msdn.microsoft.com/en-us/library/ms724211(VS.85).aspx + * MapViewOfFile: http://msdn.microsoft.com/en-us/library/aa366761(VS.85).aspx + * UnmapViewOfFile: http://msdn.microsoft.com/en-us/library/aa366882(VS.85).aspx + */ + +#include +#include +#include +#include "mmap.h" + +#define PROT_READ 0x1 +#define PROT_WRITE 0x2 +/* This flag is only available in WinXP+ */ +#ifdef FILE_MAP_EXECUTE +#define PROT_EXEC 0x4 +#else +#define PROT_EXEC 0x0 +#define FILE_MAP_EXECUTE 0 +#endif + +#define MAP_SHARED 0x01 +#define MAP_PRIVATE 0x02 +#define MAP_ANONYMOUS 0x20 +#define MAP_ANON MAP_ANONYMOUS +#define MAP_FAILED ((void *) -1) + +#ifdef __USE_FILE_OFFSET64 +# define DWORD_HI(x) (x >> 32) +# define DWORD_LO(x) ((x) & 0xffffffff) +#else +# define DWORD_HI(x) (0) +# define DWORD_LO(x) (x) +#endif + +void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset) +{ + if (prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC)) + return MAP_FAILED; + if (fd == -1) { + if (!(flags & MAP_ANON) || offset) + return MAP_FAILED; + } else if (flags & MAP_ANON) + return MAP_FAILED; + + DWORD flProtect; + if (prot & PROT_WRITE) { + if (prot & PROT_EXEC) + flProtect = PAGE_EXECUTE_READWRITE; + else + flProtect = PAGE_READWRITE; + } else if (prot & PROT_EXEC) { + if (prot & PROT_READ) + flProtect = PAGE_EXECUTE_READ; + else if (prot & PROT_EXEC) + flProtect = PAGE_EXECUTE; + } else + flProtect = PAGE_READONLY; + + off_t end = length + offset; + HANDLE mmap_fd, h; + if (fd == -1) + mmap_fd = INVALID_HANDLE_VALUE; + else + mmap_fd = (HANDLE)_get_osfhandle(fd); + h = CreateFileMapping(mmap_fd, NULL, flProtect, DWORD_HI(end), DWORD_LO(end), NULL); + if (h == NULL) + return MAP_FAILED; + + DWORD dwDesiredAccess; + if (prot & PROT_WRITE) + dwDesiredAccess = FILE_MAP_WRITE; + else + dwDesiredAccess = FILE_MAP_READ; + if (prot & PROT_EXEC) + dwDesiredAccess |= FILE_MAP_EXECUTE; + if (flags & MAP_PRIVATE) + dwDesiredAccess |= FILE_MAP_COPY; + void *ret = MapViewOfFile(h, dwDesiredAccess, DWORD_HI(offset), DWORD_LO(offset), length); + if (ret == NULL) { + CloseHandle(h); + ret = MAP_FAILED; + } + return ret; +} + +static void munmap(void *addr, size_t length) +{ + UnmapViewOfFile(addr); + /* ruh-ro, we leaked handle from CreateFileMapping() ... */ +} + +#undef DWORD_HI +#undef DWORD_LO From f6d4634c75a78526057f9aaa4e5e04a8332263e9 Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Tue, 14 Apr 2015 16:48:06 +0200 Subject: [PATCH 042/461] Move ethash_io_prepare to io.c - Platform specific io.c files now contain only the minimum amount of code they can. --- internal.c | 3 ++- io.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ io.h | 34 +++++++++++++++++++++++++++++--- io_posix.c | 58 ++++++++++++++---------------------------------------- io_win32.c | 56 ++++++++++++++-------------------------------------- 5 files changed, 121 insertions(+), 88 deletions(-) diff --git a/internal.c b/internal.c index 93fc3bbe9..fac5b7ae2 100644 --- a/internal.c +++ b/internal.c @@ -371,12 +371,13 @@ ethash_full_t ethash_full_new(char const *dirname, ret->file_size = (size_t)params->full_size; switch (ethash_io_prepare(dirname, *seed_hash, &f, (size_t)params->full_size)) { case ETHASH_IO_FAIL: + case ETHASH_IO_MEMO_SIZE_MISMATCH: goto fail_free_full; case ETHASH_IO_MEMO_MATCH: match = true; case ETHASH_IO_MEMO_MISMATCH: ret->file = f; - if ((fd = fileno(ret->file)) == -1) { + if ((fd = ethash_fileno(ret->file)) == -1) { goto fail_free_full; } ret->data = mmap( diff --git a/io.c b/io.c index 0a1b8731a..d444fc983 100644 --- a/io.c +++ b/io.c @@ -48,3 +48,61 @@ free_name: free(fullname); return ret; } + +enum ethash_io_rc ethash_io_prepare(char const *dirname, + ethash_h256_t const seedhash, + FILE **output_file, + size_t file_size) +{ + char mutable_name[DAG_MUTABLE_NAME_MAX_SIZE]; + enum ethash_io_rc ret = ETHASH_IO_FAIL; + + // assert directory exists + if (!ethash_mkdir(dirname)) { + goto end; + } + + ethash_io_mutable_name(REVISION, &seedhash, mutable_name); + char *tmpfile = ethash_io_create_filename(dirname, mutable_name, strlen(mutable_name)); + if (!tmpfile) { + goto end; + } + + // try to open the file + FILE *f = ethash_fopen(tmpfile, "rb+"); + if (f) { + size_t found_size; + if (!ethash_file_size(f, &found_size)) { + fclose(f); + goto free_memo; + } + if (file_size != found_size) { + fclose(f); + ret = ETHASH_IO_MEMO_SIZE_MISMATCH; + goto free_memo; + } + } else { + // file does not exist, will need to be created + f = ethash_fopen(tmpfile, "wb+"); + if (!f) { + goto free_memo; + } + // make sure it's of the proper size + if (fseek(f, file_size - 1, SEEK_SET) != 0) { + fclose(f); + goto free_memo; + } + fputc('\n', f); + fflush(f); + ret = ETHASH_IO_MEMO_MISMATCH; + goto set_file; + } + + ret = ETHASH_IO_MEMO_MATCH; +set_file: + *output_file = f; +free_memo: + free(tmpfile); +end: + return ret; +} diff --git a/io.h b/io.h index 736309971..c27344b7f 100644 --- a/io.h +++ b/io.h @@ -37,9 +37,10 @@ extern "C" { #define DAG_MUTABLE_NAME_MAX_SIZE (10 + 1 + 16 + 1) /// Possible return values of @see ethash_io_prepare enum ethash_io_rc { - ETHASH_IO_FAIL = 0, ///< There has been an IO failure - ETHASH_IO_MEMO_MISMATCH, ///< The DAG file did not exist or there was revision/hash mismatch - ETHASH_IO_MEMO_MATCH, ///< DAG file existed and revision/hash matched. No need to do anything + ETHASH_IO_FAIL = 0, ///< There has been an IO failure + ETHASH_IO_MEMO_SIZE_MISMATCH, ///< DAG with revision/hash match, but file size was wrong. + ETHASH_IO_MEMO_MISMATCH, ///< The DAG file did not exist or there was revision/hash mismatch + ETHASH_IO_MEMO_MATCH, ///< DAG file existed and revision/hash matched. No need to do anything }; /** @@ -78,6 +79,7 @@ enum ethash_io_rc ethash_io_prepare(char const *dirname, * @return The FILE* or NULL in failure */ FILE *ethash_fopen(const char *file_name, const char *mode); + /** * An strncat wrapper for no-warnings crossplatform strncat. * @@ -96,6 +98,32 @@ FILE *ethash_fopen(const char *file_name, const char *mode); */ char *ethash_strncat(char *dest, size_t dest_size, const char *src, size_t count); +/** + * A cross-platform mkdir wrapper to create a directory or assert it's there + * + * @param dirname The full path of the directory to create + * @return true if the directory was created or if it already + * existed + */ +bool ethash_mkdir(char const *dirname); + +/** + * Get a file's size + * + * @param[in] f The open file stream whose size to get + * @param[out] size Pass a size_t by reference to contain the file size + * @return true in success and false if there was a failure + */ +bool ethash_file_size(FILE *f, size_t *ret_size); + +/** + * Get a file descriptor number from a FILE stream + * + * @param f The file stream whose fd to get + * @return Platform specific fd handler + */ +int ethash_fileno(FILE *f); + static inline bool ethash_io_mutable_name(uint32_t revision, ethash_h256_t const* seed_hash, char* output) diff --git a/io_posix.c b/io_posix.c index 3aa28d3ad..fd4bdafbd 100644 --- a/io_posix.c +++ b/io_posix.c @@ -37,52 +37,24 @@ char *ethash_strncat(char *dest, size_t dest_size, const char *src, size_t count return strlen(dest) + count + 1 <= dest_size ? strncat(dest, src, count) : NULL; } -enum ethash_io_rc ethash_io_prepare(char const *dirname, - ethash_h256_t const seedhash, - FILE **output_file, - size_t file_size) +bool ethash_mkdir(char const *dirname) { - char mutable_name[DAG_MUTABLE_NAME_MAX_SIZE]; - enum ethash_io_rc ret = ETHASH_IO_FAIL; - - // assert directory exists, full owner permissions and read/search for others int rc = mkdir(dirname, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH); - if (rc == -1 && errno != EEXIST) { - goto end; - } + return rc != -1 || errno == EEXIST; +} - ethash_io_mutable_name(REVISION, &seedhash, mutable_name); - char *tmpfile = ethash_io_create_filename(dirname, mutable_name, strlen(mutable_name)); - if (!tmpfile) { - goto end; - } +int ethash_fileno(FILE *f) +{ + return fileno(f); +} - // try to open the file - FILE *f = ethash_fopen(tmpfile, "rb+"); - if (f) { - // TODO: check for file size - } else { - // file does not exist, will need to be created - f = ethash_fopen(tmpfile, "wb+"); - if (!f) { - goto free_memo; - } - // make sure it's of the proper size - if (fseek(f, file_size - 1, SEEK_SET) != 0) { - fclose(f); - goto free_memo; - } - fputc('\n', f); - fflush(f); - ret = ETHASH_IO_MEMO_MISMATCH; - goto set_file; +bool ethash_file_size(FILE *f, size_t *ret_size) +{ + struct stat st; + int fd; + if ((fd = fileno(f)) == -1 || fstat(fd, &st) != 0) { + return false; } - - ret = ETHASH_IO_MEMO_MATCH; -set_file: - *output_file = f; -free_memo: - free(tmpfile); -end: - return ret; + *ret_size = st.st_size; + return true; } diff --git a/io_win32.c b/io_win32.c index 17d0983b9..9906c359e 100644 --- a/io_win32.c +++ b/io_win32.c @@ -35,50 +35,24 @@ char *ethash_strncat(char *dest, size_t dest_size, const char *src, size_t count return strncat_s(dest, dest_size, src, count) == 0 ? dest : NULL; } -enum ethash_io_rc ethash_io_prepare(char const *dirname, - ethash_h256_t const seedhash, - FILE **output_file, - size_t file_size) +bool ethash_mkdir(char const *dirname) { - char mutable_name[DAG_MUTABLE_NAME_MAX_SIZE]; - enum ethash_io_rc ret = ETHASH_IO_FAIL; - - // assert directory exists int rc = _mkdir(dirname); - if (rc == -1 && errno != EEXIST) { - goto end; - } + return rc != -1 || errno == EEXIST; +} - ethash_io_mutable_name(REVISION, &seedhash, mutable_name); - char *tmpfile = ethash_io_create_filename(dirname, mutable_name, strlen(mutable_name)); - if (!tmpfile) { - goto end; - } +int ethash_fileno(FILE *f) +{ + return _fileno(f); +} - // try to open the file - FILE *f = ethash_fopen(tmpfile, "rb+"); - if (!f) { - // file does not exist, will need to be created - f = ethash_fopen(tmpfile, "wb+"); - if (!f) { - goto free_memo; - } - // make sure it's of the proper size - if (fseek(f, file_size - 1, SEEK_SET) != 0) { - fclose(f); - goto free_memo; - } - fputc('\n', f); - fflush(f); - ret = ETHASH_IO_MEMO_MISMATCH; - goto set_file; +bool ethash_file_size(FILE *f, size_t *ret_size) +{ + struct _stat st; + int fd; + if ((fd = _fileno(f)) == -1 || _fstat(fd, &st) != 0) { + return false; } - - ret = ETHASH_IO_MEMO_MATCH; -set_file: - *output_file = f; -free_memo: - free(tmpfile); -end: - return ret; + *ret_size = st.st_size; + return true; } From 473bff75fe2ba056f825da77ade8a1f330237328 Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Tue, 14 Apr 2015 17:28:44 +0200 Subject: [PATCH 043/461] Windows fixes - Moving required memmap stuff to the header - proper header inclusion for fstat/stat - #define snprintf --- io.h | 6 ++++++ io_win32.c | 2 ++ mmap.h | 20 +++++++++++++++++++- mmap_win32.c | 17 ----------------- 4 files changed, 27 insertions(+), 18 deletions(-) diff --git a/io.h b/io.h index c27344b7f..dc69eb2e3 100644 --- a/io.h +++ b/io.h @@ -43,6 +43,12 @@ enum ethash_io_rc { ETHASH_IO_MEMO_MATCH, ///< DAG file existed and revision/hash matched. No need to do anything }; +// small hack for windows. I don't feel I should use va_args and forward just +// to have this one function properly cross-platform abstracted +#if defined(_WIN32) +#define snprintf(...) sprintf_s(__VA_ARGS__) +#endif + /** * Prepares io for ethash * diff --git a/io_win32.c b/io_win32.c index 9906c359e..6fdfec28b 100644 --- a/io_win32.c +++ b/io_win32.c @@ -23,6 +23,8 @@ #include #include #include +#include +#include FILE *ethash_fopen(const char *file_name, const char *mode) { diff --git a/mmap.h b/mmap.h index 17f145888..1eed116a9 100644 --- a/mmap.h +++ b/mmap.h @@ -20,8 +20,26 @@ */ #pragma once #if defined(__MINGW32__) || defined(_WIN32) -void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset); +#include + +#define PROT_READ 0x1 +#define PROT_WRITE 0x2 +/* This flag is only available in WinXP+ */ +#ifdef FILE_MAP_EXECUTE +#define PROT_EXEC 0x4 #else +#define PROT_EXEC 0x0 +#define FILE_MAP_EXECUTE 0 +#endif + +#define MAP_SHARED 0x01 +#define MAP_PRIVATE 0x02 +#define MAP_ANONYMOUS 0x20 +#define MAP_ANON MAP_ANONYMOUS +#define MAP_FAILED ((void *) -1) + +void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset); +#else // posix, yay! ^_^ #include #endif diff --git a/mmap_win32.c b/mmap_win32.c index 9a37b6c79..3d2a04133 100644 --- a/mmap_win32.c +++ b/mmap_win32.c @@ -13,25 +13,8 @@ #include #include -#include #include "mmap.h" -#define PROT_READ 0x1 -#define PROT_WRITE 0x2 -/* This flag is only available in WinXP+ */ -#ifdef FILE_MAP_EXECUTE -#define PROT_EXEC 0x4 -#else -#define PROT_EXEC 0x0 -#define FILE_MAP_EXECUTE 0 -#endif - -#define MAP_SHARED 0x01 -#define MAP_PRIVATE 0x02 -#define MAP_ANONYMOUS 0x20 -#define MAP_ANON MAP_ANONYMOUS -#define MAP_FAILED ((void *) -1) - #ifdef __USE_FILE_OFFSET64 # define DWORD_HI(x) (x >> 32) # define DWORD_LO(x) ((x) & 0xffffffff) From cdd749e3c6e92662d9be729b0c43c3d3d04d8b5f Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Tue, 14 Apr 2015 18:02:22 +0200 Subject: [PATCH 044/461] More windows fixes - Designated initializer don't work in C++ code for MSVC - munmap signature moved to the header --- ethash.h | 2 +- mmap.h | 1 + mmap_win32.c | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ethash.h b/ethash.h index 1872d8168..44d2512c7 100644 --- a/ethash.h +++ b/ethash.h @@ -73,7 +73,7 @@ static inline void ethash_h256_reset(ethash_h256_t *hash) // have to provide all 32 values. If you don't provide all the rest // will simply be unitialized (not guranteed to be 0) #define ethash_h256_static_init(...) \ - {.b = {__VA_ARGS__} } + { {__VA_ARGS__} } struct ethash_light; typedef struct ethash_light* ethash_light_t; diff --git a/mmap.h b/mmap.h index 1eed116a9..789fd448d 100644 --- a/mmap.h +++ b/mmap.h @@ -39,6 +39,7 @@ #define MAP_FAILED ((void *) -1) void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset); +void munmap(void *addr, size_t length); #else // posix, yay! ^_^ #include #endif diff --git a/mmap_win32.c b/mmap_win32.c index 3d2a04133..fdf71e050 100644 --- a/mmap_win32.c +++ b/mmap_win32.c @@ -74,7 +74,7 @@ void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset return ret; } -static void munmap(void *addr, size_t length) +void munmap(void *addr, size_t length) { UnmapViewOfFile(addr); /* ruh-ro, we leaked handle from CreateFileMapping() ... */ From 4cb2146fd522bfdd13e519bb1a826ffe123f9ee4 Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Wed, 15 Apr 2015 11:42:17 +0200 Subject: [PATCH 045/461] byteswap.h may not exist in some MacOSX versions --- endian.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/endian.h b/endian.h index 06f448b91..5a05b444b 100644 --- a/endian.h +++ b/endian.h @@ -28,7 +28,11 @@ #include #define ethash_swap_u32(input_) _byteswap_ulong(input_) #define ethash_swap_u64(input_) _byteswap_uint64(input_) -#else +#elif defined(__APPLE__) +#include +#define ethash_swap_u32(input_) OSSwapInt32(input_) +#define ethash_swap_u64(input_) OSSwapInt64(input_) +#else // posix #include #define ethash_swap_u32(input_) __bswap_32(input_) #define ethash_swap_u64(input_) __bswap_64(input_) From e77d3f855512000523301793931003872073963d Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Thu, 16 Apr 2015 12:27:48 +0200 Subject: [PATCH 046/461] Use crossplatform uint64_t hex printf specifier --- io.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/io.h b/io.h index dc69eb2e3..bbe060180 100644 --- a/io.h +++ b/io.h @@ -23,6 +23,7 @@ #include #include #include +#include #include "endian.h" #include "ethash.h" @@ -138,7 +139,7 @@ static inline bool ethash_io_mutable_name(uint32_t revision, #if LITTLE_ENDIAN == BYTE_ORDER hash = ethash_swap_u64(hash); #endif - return snprintf(output, DAG_MUTABLE_NAME_MAX_SIZE, "%u_%016lx", revision, hash) >= 0; + return snprintf(output, DAG_MUTABLE_NAME_MAX_SIZE, "%u_%016" PRIx64, revision, hash) >= 0; } static inline char *ethash_io_create_filename(char const* dirname, From eb7b33db2b165b3f90418f581acdffd4241732dd Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Thu, 16 Apr 2015 12:33:53 +0200 Subject: [PATCH 047/461] Try to appease gcc in travis regarding printf format specifiers --- io.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/io.h b/io.h index bbe060180..83a64a65c 100644 --- a/io.h +++ b/io.h @@ -23,6 +23,9 @@ #include #include #include +#ifdef __cplusplus +#define __STDC_FORMAT_MACROS 1 +#endif #include #include "endian.h" #include "ethash.h" From d2f5c863a013d0f3aec068beed15fc7dc60cbb0a Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Thu, 16 Apr 2015 12:58:19 +0200 Subject: [PATCH 048/461] Properly close HANDLE in mmap for Windows --- mmap_win32.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mmap_win32.c b/mmap_win32.c index fdf71e050..881249d14 100644 --- a/mmap_win32.c +++ b/mmap_win32.c @@ -68,16 +68,16 @@ void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset dwDesiredAccess |= FILE_MAP_COPY; void *ret = MapViewOfFile(h, dwDesiredAccess, DWORD_HI(offset), DWORD_LO(offset), length); if (ret == NULL) { - CloseHandle(h); ret = MAP_FAILED; } + // since we are handling the file ourselves with fd, close the Windows Handle here + CloseHandle(h); return ret; } void munmap(void *addr, size_t length) { UnmapViewOfFile(addr); - /* ruh-ro, we leaked handle from CreateFileMapping() ... */ } #undef DWORD_HI From 0c08bd7f926258991ce4caba5fab3a9997f4e25f Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Thu, 16 Apr 2015 15:24:42 +0200 Subject: [PATCH 049/461] Add tests for ethash callback used in full_compute --- internal.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/internal.c b/internal.c index fac5b7ae2..26ee40cd9 100644 --- a/internal.c +++ b/internal.c @@ -24,6 +24,7 @@ #include #include #include +#include #include "mmap.h" #include "ethash.h" #include "fnv.h" @@ -215,16 +216,18 @@ static bool ethash_hash(ethash_return_value *ret, page_size = sizeof(uint32_t) * MIX_WORDS, num_full_pages = (unsigned) (params->full_size / page_size); - + const double progress_change = 1.0f / ACCESSES / MIX_NODES; + double progress = 0.0f; for (unsigned i = 0; i != ACCESSES; ++i) { uint32_t const index = ((s_mix->words[0] ^ i) * FNV_PRIME ^ mix->words[i % MIX_WORDS]) % num_full_pages; for (unsigned n = 0; n != MIX_NODES; ++n) { const node *dag_node; if (callback && - callback(((float)(i * n) / (float)(ACCESSES * MIX_NODES) * 100) != 0)) { + callback((unsigned int)(ceil(progress * 100.0f))) != 0) { return false; } + progress += progress_change; if (full_nodes) { dag_node = &full_nodes[MIX_NODES * index + n]; } else { From 0275e7ad112ef7e657a8f3b11e7a8b29d7f4495f Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Fri, 17 Apr 2015 12:58:51 +0200 Subject: [PATCH 050/461] Style fixes in internal.c/ethash.h --- ethash.h | 72 +++++++++++++++++++-------------------- internal.c | 98 +++++++++++++++++++++++++++--------------------------- 2 files changed, 85 insertions(+), 85 deletions(-) diff --git a/ethash.h b/ethash.h index 44d2512c7..7fe6e29a3 100644 --- a/ethash.h +++ b/ethash.h @@ -57,12 +57,12 @@ static inline uint8_t ethash_h256_get(ethash_h256_t const* hash, unsigned int i) return hash->b[i]; } -static inline void ethash_h256_set(ethash_h256_t *hash, unsigned int i, uint8_t v) +static inline void ethash_h256_set(ethash_h256_t* hash, unsigned int i, uint8_t v) { hash->b[i] = v; } -static inline void ethash_h256_reset(ethash_h256_t *hash) +static inline void ethash_h256_reset(ethash_h256_t* hash) { memset(hash, 0, 32); } @@ -91,7 +91,7 @@ uint64_t ethash_get_datasize(const uint32_t block_number); uint64_t ethash_get_cachesize(const uint32_t block_number); // initialize the parameters -static inline void ethash_params_init(ethash_params *params, const uint32_t block_number) { +static inline void ethash_params_init(ethash_params* params, const uint32_t block_number) { params->full_size = ethash_get_datasize(block_number); params->cache_size = ethash_get_cachesize(block_number); } @@ -111,12 +111,12 @@ typedef struct ethash_cache { * @return Newly allocated ethash_cache on success or NULL in case of * ERRNOMEM or invalid parameters used for @ref ethash_compute_cache_nodes() */ -ethash_cache *ethash_cache_new(ethash_params const *params, ethash_h256_t const *seed); +ethash_cache *ethash_cache_new(ethash_params const* params, ethash_h256_t const* seed); /** * Frees a previously allocated ethash_cache * @param c The object to free */ -void ethash_cache_delete(ethash_cache *c); +void ethash_cache_delete(ethash_cache* c); /** * Allocate and initialize a new ethash_light handler @@ -128,7 +128,7 @@ void ethash_cache_delete(ethash_cache *c); * @return Newly allocated ethash_light handler or NULL in case of * ERRNOMEM or invalid parameters used for @ref ethash_compute_cache_nodes() */ -ethash_light_t ethash_light_new(ethash_params const *params, ethash_h256_t const *seed); +ethash_light_t ethash_light_new(ethash_params const* params, ethash_h256_t const* seed); /** * Frees a previously allocated ethash_light handler * @param light The light handler to free @@ -145,11 +145,11 @@ void ethash_light_delete(ethash_light_t light); * @return true if all went well and false if there were invalid * parameters given. */ -bool ethash_light_compute(ethash_return_value *ret, - ethash_light_t light, - ethash_params const *params, - const ethash_h256_t *header_hash, - const uint64_t nonce); +bool ethash_light_compute(ethash_return_value* ret, + ethash_light_t light, + ethash_params const* params, + const ethash_h256_t* header_hash, + const uint64_t nonce); /** * Get a pointer to the cache object held by the light client * @@ -185,8 +185,8 @@ ethash_cache *ethash_light_acquire_cache(ethash_light_t light); * @return Newly allocated ethash_full handler or NULL in case of * ERRNOMEM or invalid parameters used for @ref ethash_compute_full_data() */ -ethash_full_t ethash_full_new(char const *dirname, - const ethash_h256_t *seed_hash, +ethash_full_t ethash_full_new(char const* dirname, + ethash_h256_t const* seed_hash, ethash_params const* params, ethash_cache const* cache, ethash_callback_t callback); @@ -207,11 +207,11 @@ void ethash_full_delete(ethash_full_t full); * parameters given or if there was a callback given and * at some point return a non-zero value */ -bool ethash_full_compute(ethash_return_value *ret, - ethash_full_t full, - ethash_params const *params, - const ethash_h256_t *header_hash, - const uint64_t nonce); +bool ethash_full_compute(ethash_return_value* ret, + ethash_full_t full, + ethash_params const* params, + const ethash_h256_t* header_hash, + const uint64_t nonce); /** * Get a pointer to the cache object held by the full client * @@ -232,8 +232,8 @@ ethash_cache *ethash_full_acquire_cache(ethash_full_t full); void ethash_get_seedhash(ethash_h256_t *seedhash, const uint32_t block_number); // Returns if hash is less than or equal to difficulty -static inline int ethash_check_difficulty(ethash_h256_t const *hash, - ethash_h256_t const *difficulty) +static inline int ethash_check_difficulty(ethash_h256_t const* hash, + ethash_h256_t const* difficulty) { // Difficulty is big endian for (int i = 0; i < 32; i++) { @@ -245,10 +245,10 @@ static inline int ethash_check_difficulty(ethash_h256_t const *hash, return 1; } -int ethash_quick_check_difficulty(ethash_h256_t const *header_hash, - const uint64_t nonce, - ethash_h256_t const *mix_hash, - ethash_h256_t const *difficulty); +int ethash_quick_check_difficulty(ethash_h256_t const* header_hash, + const uint64_t nonce, + ethash_h256_t const* mix_hash, + ethash_h256_t const* difficulty); /** @@ -259,17 +259,17 @@ int ethash_quick_check_difficulty(ethash_h256_t const *header_hash, * Kept for backwards compatibility with whoever still uses it. Please consider * switching to the new API (look above) */ -void ethash_mkcache(ethash_cache *cache, ethash_params const *params, ethash_h256_t const *seed); -void ethash_full(ethash_return_value *ret, - void const *full_mem, - ethash_params const *params, - ethash_h256_t const *header_hash, - const uint64_t nonce); -void ethash_light(ethash_return_value *ret, - ethash_cache const *cache, - ethash_params const *params, - ethash_h256_t const *header_hash, - const uint64_t nonce); +void ethash_mkcache(ethash_cache* cache, ethash_params const* params, ethash_h256_t const* seed); +void ethash_full(ethash_return_value* ret, + void const* full_mem, + ethash_params const* params, + ethash_h256_t const* header_hash, + const uint64_t nonce); +void ethash_light(ethash_return_value* ret, + ethash_cache const* cache, + ethash_params const* params, + ethash_h256_t const* header_hash, + const uint64_t nonce); /** * Compute the memory data for a full node's memory * @@ -278,7 +278,7 @@ void ethash_light(ethash_return_value *ret, * @param cache A cache object to use in the calculation * @return true if all went fine and false for invalid parameters */ -bool ethash_compute_full_data(void *mem, ethash_params const *params, ethash_cache const *cache); +bool ethash_compute_full_data(void* mem, ethash_params const* params, ethash_cache const* cache); #ifdef __cplusplus } diff --git a/internal.c b/internal.c index 26ee40cd9..2f0db150d 100644 --- a/internal.c +++ b/internal.c @@ -54,9 +54,9 @@ uint64_t ethash_get_cachesize(const uint32_t block_number) { // Follows Sergio's "STRICT MEMORY HARD HASHING FUNCTIONS" (2014) // https://bitslog.files.wordpress.com/2013/12/memohash-v0-3.pdf // SeqMemoHash(s, R, N) -bool static ethash_compute_cache_nodes(node *const nodes, - ethash_params const *params, - ethash_h256_t const* seed) +bool static ethash_compute_cache_nodes(node* const nodes, + ethash_params const* params, + ethash_h256_t const* seed) { if (params->cache_size % sizeof(node) != 0) { return false; @@ -86,7 +86,7 @@ bool static ethash_compute_cache_nodes(node *const nodes, return true; } -ethash_cache *ethash_cache_new(ethash_params const *params, ethash_h256_t const *seed) +ethash_cache *ethash_cache_new(ethash_params const* params, ethash_h256_t const* seed) { ethash_cache *ret; ret = malloc(sizeof(*ret)); @@ -111,16 +111,16 @@ fail_free_cache: return NULL; } -void ethash_cache_delete(ethash_cache *c) +void ethash_cache_delete(ethash_cache* c) { free(c->mem); free(c); } -void ethash_calculate_dag_item(node *const ret, - const unsigned node_index, - const struct ethash_params *params, - const struct ethash_cache *cache) +void ethash_calculate_dag_item(node* const ret, + const unsigned node_index, + const struct ethash_params *params, + const struct ethash_cache *cache) { uint32_t num_parent_nodes = (uint32_t) (params->cache_size / sizeof(node)); node const *cache_nodes = (node const *) cache->mem; @@ -169,9 +169,9 @@ void ethash_calculate_dag_item(node *const ret, SHA3_512(ret->bytes, ret->bytes, sizeof(node)); } -bool ethash_compute_full_data(void *mem, - ethash_params const *params, - ethash_cache const *cache) +bool ethash_compute_full_data(void* mem, + ethash_params const* params, + ethash_cache const* cache) { if (params->full_size % (sizeof(uint32_t) * MIX_WORDS) != 0 || (params->full_size % sizeof(node)) != 0) { @@ -185,13 +185,13 @@ bool ethash_compute_full_data(void *mem, return true; } -static bool ethash_hash(ethash_return_value *ret, - node const *full_nodes, - ethash_cache const *cache, - ethash_params const *params, - ethash_h256_t const *header_hash, - const uint64_t nonce, - ethash_callback_t callback) +static bool ethash_hash(ethash_return_value* ret, + node const* full_nodes, + ethash_cache const* cache, + ethash_params const* params, + ethash_h256_t const* header_hash, + const uint64_t nonce, + ethash_callback_t callback) { if (params->full_size % MIX_WORDS != 0) { return false; @@ -275,10 +275,10 @@ static bool ethash_hash(ethash_return_value *ret, return true; } -void ethash_quick_hash(ethash_h256_t *return_hash, - ethash_h256_t const *header_hash, - const uint64_t nonce, - ethash_h256_t const *mix_hash) +void ethash_quick_hash(ethash_h256_t* return_hash, + ethash_h256_t const* header_hash, + const uint64_t nonce, + ethash_h256_t const* mix_hash) { uint8_t buf[64 + 32]; memcpy(buf, header_hash, 32); @@ -289,7 +289,7 @@ void ethash_quick_hash(ethash_h256_t *return_hash, SHA3_256(return_hash, buf, 64 + 32); } -void ethash_get_seedhash(ethash_h256_t *seedhash, const uint32_t block_number) +void ethash_get_seedhash(ethash_h256_t* seedhash, const uint32_t block_number) { ethash_h256_reset(seedhash); const uint32_t epochs = block_number / EPOCH_LENGTH; @@ -297,10 +297,10 @@ void ethash_get_seedhash(ethash_h256_t *seedhash, const uint32_t block_number) SHA3_256(seedhash, (uint8_t*)seedhash, 32); } -int ethash_quick_check_difficulty(ethash_h256_t const *header_hash, - const uint64_t nonce, - ethash_h256_t const *mix_hash, - ethash_h256_t const *difficulty) +int ethash_quick_check_difficulty(ethash_h256_t const* header_hash, + const uint64_t nonce, + ethash_h256_t const* mix_hash, + ethash_h256_t const* difficulty) { ethash_h256_t return_hash; @@ -308,7 +308,7 @@ int ethash_quick_check_difficulty(ethash_h256_t const *header_hash, return ethash_check_difficulty(&return_hash, difficulty); } -ethash_light_t ethash_light_new(ethash_params const *params, ethash_h256_t const *seed) +ethash_light_t ethash_light_new(ethash_params const* params, ethash_h256_t const* seed) { struct ethash_light *ret; ret = calloc(sizeof(*ret), 1); @@ -335,10 +335,10 @@ void ethash_light_delete(ethash_light_t light) } bool ethash_light_compute(ethash_return_value *ret, - ethash_light_t light, - ethash_params const *params, - const ethash_h256_t *header_hash, - const uint64_t nonce) + ethash_light_t light, + ethash_params const* params, + const ethash_h256_t* header_hash, + const uint64_t nonce) { return ethash_hash(ret, NULL, light->cache, params, header_hash, nonce, NULL); } @@ -355,8 +355,8 @@ ethash_cache *ethash_light_acquire_cache(ethash_light_t light) return ret; } -ethash_full_t ethash_full_new(char const *dirname, - const ethash_h256_t *seed_hash, +ethash_full_t ethash_full_new(char const* dirname, + ethash_h256_t const* seed_hash, ethash_params const* params, ethash_cache const* cache, ethash_callback_t callback) @@ -429,11 +429,11 @@ void ethash_full_delete(ethash_full_t full) free(full); } -bool ethash_full_compute(ethash_return_value *ret, - ethash_full_t full, - ethash_params const *params, - const ethash_h256_t *header_hash, - const uint64_t nonce) +bool ethash_full_compute(ethash_return_value* ret, + ethash_full_t full, + ethash_params const* params, + const ethash_h256_t* header_hash, + const uint64_t nonce) { return ethash_hash(ret, (node const*)full->data, @@ -464,25 +464,25 @@ ethash_cache *ethash_full_acquire_cache(ethash_full_t full) * Kept for backwards compatibility with whoever still uses it. Please consider * switching to the new API (look above) */ -void ethash_mkcache(ethash_cache *cache, - ethash_params const *params, +void ethash_mkcache(ethash_cache* cache, + ethash_params const* params, ethash_h256_t const* seed) { node *nodes = (node*) cache->mem; ethash_compute_cache_nodes(nodes, params, seed); } -void ethash_full(ethash_return_value *ret, - void const *full_mem, - ethash_params const *params, - ethash_h256_t const *header_hash, +void ethash_full(ethash_return_value* ret, + void const* full_mem, + ethash_params const* params, + ethash_h256_t const* header_hash, const uint64_t nonce) { ethash_hash(ret, (node const *) full_mem, NULL, params, header_hash, nonce, NULL); } void ethash_light(ethash_return_value *ret, - ethash_cache const *cache, - ethash_params const *params, - ethash_h256_t const *header_hash, + ethash_cache const* cache, + ethash_params const* params, + ethash_h256_t const* header_hash, const uint64_t nonce) { ethash_hash(ret, NULL, cache, params, header_hash, nonce, NULL); From bd571d3b2c4e4b0634a01db93011b5e387f1b79e Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Fri, 17 Apr 2015 14:41:07 +0200 Subject: [PATCH 051/461] Styling fixes in io, ethash and internal --- ethash.h | 55 +++++++++++++++--------- internal.c | 124 ++++++++++++++++++++++++++++++++--------------------- io.c | 28 ++++++------ io.h | 58 ++++++++++++++----------- io_posix.c | 8 ++-- io_win32.c | 12 +++--- 6 files changed, 167 insertions(+), 118 deletions(-) diff --git a/ethash.h b/ethash.h index 7fe6e29a3..22fe85e89 100644 --- a/ethash.h +++ b/ethash.h @@ -91,7 +91,8 @@ uint64_t ethash_get_datasize(const uint32_t block_number); uint64_t ethash_get_cachesize(const uint32_t block_number); // initialize the parameters -static inline void ethash_params_init(ethash_params* params, const uint32_t block_number) { +static inline void ethash_params_init(ethash_params* params, const uint32_t block_number) +{ params->full_size = ethash_get_datasize(block_number); params->cache_size = ethash_get_cachesize(block_number); } @@ -111,7 +112,7 @@ typedef struct ethash_cache { * @return Newly allocated ethash_cache on success or NULL in case of * ERRNOMEM or invalid parameters used for @ref ethash_compute_cache_nodes() */ -ethash_cache *ethash_cache_new(ethash_params const* params, ethash_h256_t const* seed); +ethash_cache* ethash_cache_new(ethash_params const* params, ethash_h256_t const* seed); /** * Frees a previously allocated ethash_cache * @param c The object to free @@ -145,11 +146,13 @@ void ethash_light_delete(ethash_light_t light); * @return true if all went well and false if there were invalid * parameters given. */ -bool ethash_light_compute(ethash_return_value* ret, +bool ethash_light_compute( + ethash_return_value* ret, ethash_light_t light, ethash_params const* params, const ethash_h256_t* header_hash, - const uint64_t nonce); + const uint64_t nonce +); /** * Get a pointer to the cache object held by the light client * @@ -157,7 +160,7 @@ bool ethash_light_compute(ethash_return_value* ret, * @return A pointer to the cache held by the light client or NULL if * there was no cache in the first place */ -ethash_cache *ethash_light_get_cache(ethash_light_t light); +ethash_cache* ethash_light_get_cache(ethash_light_t light); /** * Move the memory ownership of the cache somewhere else * @@ -165,7 +168,7 @@ ethash_cache *ethash_light_get_cache(ethash_light_t light); * After this function concludes it will no longer have a cache. * @return A pointer to the moved cache or NULL if there was no cache in the first place */ -ethash_cache *ethash_light_acquire_cache(ethash_light_t light); +ethash_cache* ethash_light_acquire_cache(ethash_light_t light); /** * Allocate and initialize a new ethash_full handler @@ -185,11 +188,13 @@ ethash_cache *ethash_light_acquire_cache(ethash_light_t light); * @return Newly allocated ethash_full handler or NULL in case of * ERRNOMEM or invalid parameters used for @ref ethash_compute_full_data() */ -ethash_full_t ethash_full_new(char const* dirname, +ethash_full_t ethash_full_new( + char const* dirname, ethash_h256_t const* seed_hash, ethash_params const* params, ethash_cache const* cache, - ethash_callback_t callback); + ethash_callback_t callback +); /** * Frees a previously allocated ethash_full handler * @param full The light handler to free @@ -207,11 +212,13 @@ void ethash_full_delete(ethash_full_t full); * parameters given or if there was a callback given and * at some point return a non-zero value */ -bool ethash_full_compute(ethash_return_value* ret, +bool ethash_full_compute( + ethash_return_value* ret, ethash_full_t full, ethash_params const* params, const ethash_h256_t* header_hash, - const uint64_t nonce); + const uint64_t nonce +); /** * Get a pointer to the cache object held by the full client * @@ -219,7 +226,7 @@ bool ethash_full_compute(ethash_return_value* ret, * @return A pointer to the cache held by the full client or NULL * if there was no cache in the first place */ -ethash_cache *ethash_full_get_cache(ethash_full_t full); +ethash_cache* ethash_full_get_cache(ethash_full_t full); /** * Move the memory ownership of the cache somewhere else * @@ -227,13 +234,15 @@ ethash_cache *ethash_full_get_cache(ethash_full_t full); * After this function concludes it will no longer have a cache. * @return A pointer to the moved cache or NULL if there was no cache in the first place */ -ethash_cache *ethash_full_acquire_cache(ethash_full_t full); +ethash_cache* ethash_full_acquire_cache(ethash_full_t full); void ethash_get_seedhash(ethash_h256_t *seedhash, const uint32_t block_number); // Returns if hash is less than or equal to difficulty -static inline int ethash_check_difficulty(ethash_h256_t const* hash, - ethash_h256_t const* difficulty) +static inline int ethash_check_difficulty( + ethash_h256_t const* hash, + ethash_h256_t const* difficulty +) { // Difficulty is big endian for (int i = 0; i < 32; i++) { @@ -245,10 +254,12 @@ static inline int ethash_check_difficulty(ethash_h256_t const* hash, return 1; } -int ethash_quick_check_difficulty(ethash_h256_t const* header_hash, +int ethash_quick_check_difficulty( + ethash_h256_t const* header_hash, const uint64_t nonce, ethash_h256_t const* mix_hash, - ethash_h256_t const* difficulty); + ethash_h256_t const* difficulty +); /** @@ -260,16 +271,20 @@ int ethash_quick_check_difficulty(ethash_h256_t const* header_hash, * switching to the new API (look above) */ void ethash_mkcache(ethash_cache* cache, ethash_params const* params, ethash_h256_t const* seed); -void ethash_full(ethash_return_value* ret, +void ethash_full( + ethash_return_value* ret, void const* full_mem, ethash_params const* params, ethash_h256_t const* header_hash, - const uint64_t nonce); -void ethash_light(ethash_return_value* ret, + const uint64_t nonce +); +void ethash_light( + ethash_return_value* ret, ethash_cache const* cache, ethash_params const* params, ethash_h256_t const* header_hash, - const uint64_t nonce); + const uint64_t nonce +); /** * Compute the memory data for a full node's memory * diff --git a/internal.c b/internal.c index 2f0db150d..3c110ec66 100644 --- a/internal.c +++ b/internal.c @@ -41,12 +41,14 @@ #include "sha3.h" #endif // WITH_CRYPTOPP -uint64_t ethash_get_datasize(const uint32_t block_number) { +uint64_t ethash_get_datasize(const uint32_t block_number) +{ assert(block_number / EPOCH_LENGTH < 2048); return dag_sizes[block_number / EPOCH_LENGTH]; } -uint64_t ethash_get_cachesize(const uint32_t block_number) { +uint64_t ethash_get_cachesize(const uint32_t block_number) +{ assert(block_number / EPOCH_LENGTH < 2048); return cache_sizes[block_number / EPOCH_LENGTH]; } @@ -54,9 +56,11 @@ uint64_t ethash_get_cachesize(const uint32_t block_number) { // Follows Sergio's "STRICT MEMORY HARD HASHING FUNCTIONS" (2014) // https://bitslog.files.wordpress.com/2013/12/memohash-v0-3.pdf // SeqMemoHash(s, R, N) -bool static ethash_compute_cache_nodes(node* const nodes, +bool static ethash_compute_cache_nodes( + node* const nodes, ethash_params const* params, - ethash_h256_t const* seed) + ethash_h256_t const* seed +) { if (params->cache_size % sizeof(node) != 0) { return false; @@ -86,9 +90,9 @@ bool static ethash_compute_cache_nodes(node* const nodes, return true; } -ethash_cache *ethash_cache_new(ethash_params const* params, ethash_h256_t const* seed) +ethash_cache* ethash_cache_new(ethash_params const* params, ethash_h256_t const* seed) { - ethash_cache *ret; + ethash_cache* ret; ret = malloc(sizeof(*ret)); if (!ret) { return NULL; @@ -98,7 +102,7 @@ ethash_cache *ethash_cache_new(ethash_params const* params, ethash_h256_t const* goto fail_free_cache; } - node *nodes = (node*)ret->mem; + node* nodes = (node*)ret->mem; if (!ethash_compute_cache_nodes(nodes, params, seed)) { goto fail_free_cache_mem; } @@ -117,14 +121,16 @@ void ethash_cache_delete(ethash_cache* c) free(c); } -void ethash_calculate_dag_item(node* const ret, +void ethash_calculate_dag_item( + node* const ret, const unsigned node_index, const struct ethash_params *params, - const struct ethash_cache *cache) + const struct ethash_cache *cache +) { uint32_t num_parent_nodes = (uint32_t) (params->cache_size / sizeof(node)); - node const *cache_nodes = (node const *) cache->mem; - node const *init = &cache_nodes[node_index % num_parent_nodes]; + node const* cache_nodes = (node const *) cache->mem; + node const* init = &cache_nodes[node_index % num_parent_nodes]; memcpy(ret, init, sizeof(node)); ret->words[0] ^= node_index; SHA3_512(ret->bytes, ret->bytes, sizeof(node)); @@ -165,19 +171,20 @@ void ethash_calculate_dag_item(node* const ret, } #endif } - SHA3_512(ret->bytes, ret->bytes, sizeof(node)); } -bool ethash_compute_full_data(void* mem, +bool ethash_compute_full_data( + void* mem, ethash_params const* params, - ethash_cache const* cache) + ethash_cache const* cache +) { if (params->full_size % (sizeof(uint32_t) * MIX_WORDS) != 0 || (params->full_size % sizeof(node)) != 0) { return false; } - node *full_nodes = mem; + node* full_nodes = mem; // now compute full nodes for (unsigned n = 0; n != (params->full_size / sizeof(node)); ++n) { ethash_calculate_dag_item(&(full_nodes[n]), n, params, cache); @@ -185,13 +192,15 @@ bool ethash_compute_full_data(void* mem, return true; } -static bool ethash_hash(ethash_return_value* ret, +static bool ethash_hash( + ethash_return_value* ret, node const* full_nodes, ethash_cache const* cache, ethash_params const* params, ethash_h256_t const* header_hash, const uint64_t nonce, - ethash_callback_t callback) + ethash_callback_t callback +) { if (params->full_size % MIX_WORDS != 0) { return false; @@ -207,22 +216,21 @@ static bool ethash_hash(ethash_return_value* ret, SHA3_512(s_mix->bytes, s_mix->bytes, 40); fix_endian_arr32(s_mix[0].words, 16); - node *const mix = s_mix + 1; + node* const mix = s_mix + 1; for (unsigned w = 0; w != MIX_WORDS; ++w) { mix->words[w] = s_mix[0].words[w % NODE_WORDS]; } - unsigned const - page_size = sizeof(uint32_t) * MIX_WORDS, - num_full_pages = (unsigned) (params->full_size / page_size); + unsigned const page_size = sizeof(uint32_t) * MIX_WORDS; + unsigned const num_full_pages = (unsigned) (params->full_size / page_size); - const double progress_change = 1.0f / ACCESSES / MIX_NODES; + double const progress_change = 1.0f / ACCESSES / MIX_NODES; double progress = 0.0f; for (unsigned i = 0; i != ACCESSES; ++i) { uint32_t const index = ((s_mix->words[0] ^ i) * FNV_PRIME ^ mix->words[i % MIX_WORDS]) % num_full_pages; for (unsigned n = 0; n != MIX_NODES; ++n) { - const node *dag_node; + node const* dag_node; if (callback && callback((unsigned int)(ceil(progress * 100.0f))) != 0) { return false; @@ -275,10 +283,12 @@ static bool ethash_hash(ethash_return_value* ret, return true; } -void ethash_quick_hash(ethash_h256_t* return_hash, +void ethash_quick_hash( + ethash_h256_t* return_hash, ethash_h256_t const* header_hash, const uint64_t nonce, - ethash_h256_t const* mix_hash) + ethash_h256_t const* mix_hash +) { uint8_t buf[64 + 32]; memcpy(buf, header_hash, 32); @@ -297,10 +307,12 @@ void ethash_get_seedhash(ethash_h256_t* seedhash, const uint32_t block_number) SHA3_256(seedhash, (uint8_t*)seedhash, 32); } -int ethash_quick_check_difficulty(ethash_h256_t const* header_hash, +int ethash_quick_check_difficulty( + ethash_h256_t const* header_hash, const uint64_t nonce, ethash_h256_t const* mix_hash, - ethash_h256_t const* difficulty) + ethash_h256_t const* difficulty +) { ethash_h256_t return_hash; @@ -334,11 +346,13 @@ void ethash_light_delete(ethash_light_t light) free(light); } -bool ethash_light_compute(ethash_return_value *ret, +bool ethash_light_compute( + ethash_return_value* ret, ethash_light_t light, ethash_params const* params, const ethash_h256_t* header_hash, - const uint64_t nonce) + const uint64_t nonce +) { return ethash_hash(ret, NULL, light->cache, params, header_hash, nonce, NULL); } @@ -355,13 +369,15 @@ ethash_cache *ethash_light_acquire_cache(ethash_light_t light) return ret; } -ethash_full_t ethash_full_new(char const* dirname, +ethash_full_t ethash_full_new( + char const* dirname, ethash_h256_t const* seed_hash, ethash_params const* params, ethash_cache const* cache, - ethash_callback_t callback) + ethash_callback_t callback +) { - struct ethash_full *ret; + struct ethash_full* ret; int fd; FILE *f = NULL; bool match = false; @@ -429,11 +445,13 @@ void ethash_full_delete(ethash_full_t full) free(full); } -bool ethash_full_compute(ethash_return_value* ret, +bool ethash_full_compute( + ethash_return_value* ret, ethash_full_t full, ethash_params const* params, const ethash_h256_t* header_hash, - const uint64_t nonce) + const uint64_t nonce +) { return ethash_hash(ret, (node const*)full->data, @@ -444,12 +462,12 @@ bool ethash_full_compute(ethash_return_value* ret, full->callback); } -ethash_cache *ethash_full_get_cache(ethash_full_t full) +ethash_cache* ethash_full_get_cache(ethash_full_t full) { return full->cache; } -ethash_cache *ethash_full_acquire_cache(ethash_full_t full) +ethash_cache* ethash_full_acquire_cache(ethash_full_t full) { ethash_cache* ret = full->cache; full->cache = 0; @@ -464,26 +482,32 @@ ethash_cache *ethash_full_acquire_cache(ethash_full_t full) * Kept for backwards compatibility with whoever still uses it. Please consider * switching to the new API (look above) */ -void ethash_mkcache(ethash_cache* cache, - ethash_params const* params, - ethash_h256_t const* seed) +void ethash_mkcache( + ethash_cache* cache, + ethash_params const* params, + ethash_h256_t const* seed +) { - node *nodes = (node*) cache->mem; + node* nodes = (node*) cache->mem; ethash_compute_cache_nodes(nodes, params, seed); } -void ethash_full(ethash_return_value* ret, - void const* full_mem, - ethash_params const* params, - ethash_h256_t const* header_hash, - const uint64_t nonce) +void ethash_full( + ethash_return_value* ret, + void const* full_mem, + ethash_params const* params, + ethash_h256_t const* header_hash, + const uint64_t nonce +) { ethash_hash(ret, (node const *) full_mem, NULL, params, header_hash, nonce, NULL); } -void ethash_light(ethash_return_value *ret, - ethash_cache const* cache, - ethash_params const* params, - ethash_h256_t const* header_hash, - const uint64_t nonce) +void ethash_light( + ethash_return_value* ret, + ethash_cache const* cache, + ethash_params const* params, + ethash_h256_t const* header_hash, + const uint64_t nonce +) { ethash_hash(ret, NULL, cache, params, header_hash, nonce, NULL); } diff --git a/io.c b/io.c index d444fc983..fc29640b9 100644 --- a/io.c +++ b/io.c @@ -22,18 +22,20 @@ #include #include -static bool ethash_io_write_file(char const *dirname, - char const* filename, - size_t filename_length, - void const* data, - size_t data_size) +static bool ethash_io_write_file( + char const* dirname, + char const* filename, + size_t filename_length, + void const* data, + size_t data_size +) { bool ret = false; - char *fullname = ethash_io_create_filename(dirname, filename, filename_length); + char* fullname = ethash_io_create_filename(dirname, filename, filename_length); if (!fullname) { return false; } - FILE *f = ethash_fopen(fullname, "wb"); + FILE* f = ethash_fopen(fullname, "wb"); if (!f) { goto free_name; } @@ -49,10 +51,12 @@ free_name: return ret; } -enum ethash_io_rc ethash_io_prepare(char const *dirname, +enum ethash_io_rc ethash_io_prepare( + char const* dirname, ethash_h256_t const seedhash, - FILE **output_file, - size_t file_size) + FILE** output_file, + size_t file_size +) { char mutable_name[DAG_MUTABLE_NAME_MAX_SIZE]; enum ethash_io_rc ret = ETHASH_IO_FAIL; @@ -63,13 +67,13 @@ enum ethash_io_rc ethash_io_prepare(char const *dirname, } ethash_io_mutable_name(REVISION, &seedhash, mutable_name); - char *tmpfile = ethash_io_create_filename(dirname, mutable_name, strlen(mutable_name)); + char* tmpfile = ethash_io_create_filename(dirname, mutable_name, strlen(mutable_name)); if (!tmpfile) { goto end; } // try to open the file - FILE *f = ethash_fopen(tmpfile, "rb+"); + FILE* f = ethash_fopen(tmpfile, "rb+"); if (f) { size_t found_size; if (!ethash_file_size(f, &found_size)) { diff --git a/io.h b/io.h index 83a64a65c..5c42d18b8 100644 --- a/io.h +++ b/io.h @@ -58,23 +58,25 @@ enum ethash_io_rc { * * Create the DAG directory and the DAG file if they don't exist. * - * @param[in] dirname A null terminated c-string of the path of the ethash - * data directory. If it does not exist it's created. - * @param[in] seedhash The seedhash of the current block number, used in the - * naming of the file as can be seen from the spec at: - * https://github.com/ethereum/wiki/wiki/Ethash-DAG - * @param[out] f If there was no failure then this will point to an open - * file descriptor. User is responsible for closing it. - * In the case of memo match then the file is open on read - * mode, while on the case of mismatch a new file is created - * on write mode - * @param[in] file_size The size that the DAG file should have on disk - * @return For possible return values @see enum ethash_io_rc + * @param[in] dirname A null terminated c-string of the path of the ethash + * data directory. If it does not exist it's created. + * @param[in] seedhash The seedhash of the current block number, used in the + * naming of the file as can be seen from the spec at: + * https://github.com/ethereum/wiki/wiki/Ethash-DAG + * @param[out] output_file If there was no failure then this will point to an open + * file descriptor. User is responsible for closing it. + * In the case of memo match then the file is open on read + * mode, while on the case of mismatch a new file is created + * on write mode + * @param[in] file_size The size that the DAG file should have on disk + * @return For possible return values @see enum ethash_io_rc */ -enum ethash_io_rc ethash_io_prepare(char const *dirname, +enum ethash_io_rc ethash_io_prepare( + char const* dirname, ethash_h256_t const seedhash, - FILE **f, - size_t file_size); + FILE** output_file, + size_t file_size +); /** * An fopen wrapper for no-warnings crossplatform fopen. @@ -88,7 +90,7 @@ enum ethash_io_rc ethash_io_prepare(char const *dirname, * @param mode Opening mode. Check fopen() * @return The FILE* or NULL in failure */ -FILE *ethash_fopen(const char *file_name, const char *mode); +FILE* ethash_fopen(const char* file_name, const char* mode); /** * An strncat wrapper for no-warnings crossplatform strncat. @@ -106,7 +108,7 @@ FILE *ethash_fopen(const char *file_name, const char *mode); * @return If all is well returns the dest buffer. If there is an * error returns NULL */ -char *ethash_strncat(char *dest, size_t dest_size, const char *src, size_t count); +char* ethash_strncat(char* dest, size_t dest_size, const char* src, size_t count); /** * A cross-platform mkdir wrapper to create a directory or assert it's there @@ -115,7 +117,7 @@ char *ethash_strncat(char *dest, size_t dest_size, const char *src, size_t count * @return true if the directory was created or if it already * existed */ -bool ethash_mkdir(char const *dirname); +bool ethash_mkdir(char const* dirname); /** * Get a file's size @@ -124,7 +126,7 @@ bool ethash_mkdir(char const *dirname); * @param[out] size Pass a size_t by reference to contain the file size * @return true in success and false if there was a failure */ -bool ethash_file_size(FILE *f, size_t *ret_size); +bool ethash_file_size(FILE* f, size_t* ret_size); /** * Get a file descriptor number from a FILE stream @@ -132,11 +134,13 @@ bool ethash_file_size(FILE *f, size_t *ret_size); * @param f The file stream whose fd to get * @return Platform specific fd handler */ -int ethash_fileno(FILE *f); +int ethash_fileno(FILE* f); -static inline bool ethash_io_mutable_name(uint32_t revision, +static inline bool ethash_io_mutable_name( + uint32_t revision, ethash_h256_t const* seed_hash, - char* output) + char* output +) { uint64_t hash = *((uint64_t*)seed_hash); #if LITTLE_ENDIAN == BYTE_ORDER @@ -145,13 +149,15 @@ static inline bool ethash_io_mutable_name(uint32_t revision, return snprintf(output, DAG_MUTABLE_NAME_MAX_SIZE, "%u_%016" PRIx64, revision, hash) >= 0; } -static inline char *ethash_io_create_filename(char const* dirname, - char const* filename, - size_t filename_length) +static inline char* ethash_io_create_filename( + char const* dirname, + char const* filename, + size_t filename_length +) { size_t dirlen = strlen(dirname); // in C the cast is not needed, but a C++ compiler will complain for invalid conversion - char *name = (char*)malloc(dirlen + filename_length + 1); + char* name = (char*)malloc(dirlen + filename_length + 1); if (!name) { return NULL; } diff --git a/io_posix.c b/io_posix.c index fd4bdafbd..10a5c3f59 100644 --- a/io_posix.c +++ b/io_posix.c @@ -27,17 +27,17 @@ #include #include -FILE *ethash_fopen(const char *file_name, const char *mode) +FILE* ethash_fopen(const char* file_name, const char* mode) { return fopen(file_name, mode); } -char *ethash_strncat(char *dest, size_t dest_size, const char *src, size_t count) +char* ethash_strncat(char* dest, size_t dest_size, const char* src, size_t count) { return strlen(dest) + count + 1 <= dest_size ? strncat(dest, src, count) : NULL; } -bool ethash_mkdir(char const *dirname) +bool ethash_mkdir(char const* dirname) { int rc = mkdir(dirname, S_IRWXU | S_IRWXG | S_IROTH | S_IXOTH); return rc != -1 || errno == EEXIST; @@ -48,7 +48,7 @@ int ethash_fileno(FILE *f) return fileno(f); } -bool ethash_file_size(FILE *f, size_t *ret_size) +bool ethash_file_size(FILE* f, size_t* ret_size) { struct stat st; int fd; diff --git a/io_win32.c b/io_win32.c index 6fdfec28b..6181538aa 100644 --- a/io_win32.c +++ b/io_win32.c @@ -26,29 +26,29 @@ #include #include -FILE *ethash_fopen(const char *file_name, const char *mode) +FILE* ethash_fopen(const char* file_name, const char* mode) { - FILE *f; + FILE* f; return fopen_s(&f, file_name, mode) == 0 ? f : NULL; } -char *ethash_strncat(char *dest, size_t dest_size, const char *src, size_t count) +char* ethash_strncat(char* dest, size_t dest_size, const char* src, size_t count) { return strncat_s(dest, dest_size, src, count) == 0 ? dest : NULL; } -bool ethash_mkdir(char const *dirname) +bool ethash_mkdir(char const* dirname) { int rc = _mkdir(dirname); return rc != -1 || errno == EEXIST; } -int ethash_fileno(FILE *f) +int ethash_fileno(FILE* f) { return _fileno(f); } -bool ethash_file_size(FILE *f, size_t *ret_size) +bool ethash_file_size(FILE* f, size_t* ret_size) { struct _stat st; int fd; From 0f000e36ce50516eae6bd9b4ff83217e8bd64c1f Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Fri, 17 Apr 2015 14:41:56 +0200 Subject: [PATCH 052/461] Remove unused function --- io.c | 29 ----------------------------- 1 file changed, 29 deletions(-) diff --git a/io.c b/io.c index fc29640b9..2a411efb6 100644 --- a/io.c +++ b/io.c @@ -22,35 +22,6 @@ #include #include -static bool ethash_io_write_file( - char const* dirname, - char const* filename, - size_t filename_length, - void const* data, - size_t data_size -) -{ - bool ret = false; - char* fullname = ethash_io_create_filename(dirname, filename, filename_length); - if (!fullname) { - return false; - } - FILE* f = ethash_fopen(fullname, "wb"); - if (!f) { - goto free_name; - } - if (data_size != fwrite(data, 1, data_size, f)) { - goto close; - } - - ret = true; -close: - fclose(f); -free_name: - free(fullname); - return ret; -} - enum ethash_io_rc ethash_io_prepare( char const* dirname, ethash_h256_t const seedhash, From 81fd29ce8ca69a25da8aadf1dd172ede5974de40 Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Fri, 17 Apr 2015 14:45:12 +0200 Subject: [PATCH 053/461] Style fixes in mmap --- mmap.h | 4 ++-- mmap_win32.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mmap.h b/mmap.h index 789fd448d..1e226e83f 100644 --- a/mmap.h +++ b/mmap.h @@ -38,8 +38,8 @@ #define MAP_ANON MAP_ANONYMOUS #define MAP_FAILED ((void *) -1) -void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset); -void munmap(void *addr, size_t length); +void* mmap(void* start, size_t length, int prot, int flags, int fd, off_t offset); +void munmap(void* addr, size_t length); #else // posix, yay! ^_^ #include #endif diff --git a/mmap_win32.c b/mmap_win32.c index 881249d14..42968b98a 100644 --- a/mmap_win32.c +++ b/mmap_win32.c @@ -23,7 +23,7 @@ # define DWORD_LO(x) (x) #endif -void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset) +void* mmap(void* start, size_t length, int prot, int flags, int fd, off_t offset) { if (prot & ~(PROT_READ | PROT_WRITE | PROT_EXEC)) return MAP_FAILED; @@ -75,7 +75,7 @@ void *mmap(void *start, size_t length, int prot, int flags, int fd, off_t offset return ret; } -void munmap(void *addr, size_t length) +void munmap(void* addr, size_t length) { UnmapViewOfFile(addr); } From 492537b7c456c09bd1c65881258d32cfbacb7c1b Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Fri, 17 Apr 2015 14:57:04 +0200 Subject: [PATCH 054/461] Miscellaneous style fixes --- endian.h | 30 +++++++++++++++--------------- fnv.h | 7 ++++--- internal.h | 30 +++++++++++++++++------------- sha3.h | 6 +++--- sha3_cryptopp.cpp | 4 ++-- sha3_cryptopp.h | 4 ++-- util.c | 4 ++-- util.h | 2 +- 8 files changed, 46 insertions(+), 41 deletions(-) diff --git a/endian.h b/endian.h index 5a05b444b..0ee402d9a 100644 --- a/endian.h +++ b/endian.h @@ -42,11 +42,11 @@ #if LITTLE_ENDIAN == BYTE_ORDER #define fix_endian32(dst_ ,src_) dst_ = src_ -#define fix_endian32_same(val_) +#define fix_endian32_same(val_) #define fix_endian64(dst_, src_) dst_ = src_ -#define fix_endian64_same(val_) +#define fix_endian64_same(val_) #define fix_endian_arr32(arr_, size_) -#define fix_endian_arr64(arr_, size_) +#define fix_endian_arr64(arr_, size_) #elif BIG_ENDIAN == BYTE_ORDER @@ -54,18 +54,18 @@ #define fix_endian32_same(val_) val_ = ethash_swap_u32(val_) #define fix_endian64(dst_, src_) dst_ = ethash_swap_u64(src_ #define fix_endian64_same(val_) val_ = ethash_swap_u64(val_) -#define fix_endian_arr32(arr_, size_) \ - do { \ - for (unsigned i_ = 0; i_ < (size_), ++i_) { \ - arr_[i_] = ethash_swap_u32(arr_[i_]); \ - } \ - while (0) -#define fix_endian_arr64(arr_, size_) \ - do { \ - for (unsigned i_ = 0; i_ < (size_), ++i_) { \ - arr_[i_] = ethash_swap_u64(arr_[i_]); \ - } \ - while (0) \ +#define fix_endian_arr32(arr_, size_) \ + do { \ + for (unsigned i_ = 0; i_ < (size_), ++i_) { \ + arr_[i_] = ethash_swap_u32(arr_[i_]); \ + } \ + while (0) +#define fix_endian_arr64(arr_, size_) \ + do { \ + for (unsigned i_ = 0; i_ < (size_), ++i_) { \ + arr_[i_] = ethash_swap_u64(arr_[i_]); \ + } \ + while (0) \ #else # error "endian not supported" diff --git a/fnv.h b/fnv.h index edabeaae2..d23c4e247 100644 --- a/fnv.h +++ b/fnv.h @@ -29,10 +29,11 @@ extern "C" { #define FNV_PRIME 0x01000193 -static inline uint32_t fnv_hash(const uint32_t x, const uint32_t y) { - return x*FNV_PRIME ^ y; +static inline uint32_t fnv_hash(uint32_t const x, uint32_t const y) +{ + return x * FNV_PRIME ^ y; } #ifdef __cplusplus } -#endif \ No newline at end of file +#endif diff --git a/internal.h b/internal.h index 3d340512d..e5a34f350 100644 --- a/internal.h +++ b/internal.h @@ -32,26 +32,30 @@ typedef union node { } node; struct ethash_light { - ethash_cache *cache; + ethash_cache* cache; }; struct ethash_full { - FILE *file; + FILE* file; size_t file_size; - ethash_cache *cache; - node *data; + ethash_cache* cache; + node* data; ethash_callback_t callback; }; -void ethash_calculate_dag_item(node *const ret, - const unsigned node_index, - ethash_params const *params, - ethash_cache const *cache); - -void ethash_quick_hash(ethash_h256_t *return_hash, - ethash_h256_t const *header_hash, - const uint64_t nonce, - ethash_h256_t const *mix_hash); +void ethash_calculate_dag_item( + node* const ret, + const unsigned node_index, + ethash_params const* params, + ethash_cache const* cache +); + +void ethash_quick_hash( + ethash_h256_t* return_hash, + ethash_h256_t const* header_hash, + const uint64_t nonce, + ethash_h256_t const* mix_hash +); #ifdef __cplusplus } diff --git a/sha3.h b/sha3.h index bf9d1c481..a38006292 100644 --- a/sha3.h +++ b/sha3.h @@ -11,17 +11,17 @@ extern "C" { struct ethash_h256; #define decsha3(bits) \ - int sha3_##bits(uint8_t*, size_t, const uint8_t*, size_t); + int sha3_##bits(uint8_t*, size_t, uint8_t const*, size_t); decsha3(256) decsha3(512) -static inline void SHA3_256(struct ethash_h256 const* ret, uint8_t const *data, const size_t size) +static inline void SHA3_256(struct ethash_h256 const* ret, uint8_t const* data, size_t const size) { sha3_256((uint8_t*)ret, 32, data, size); } -static inline void SHA3_512(uint8_t *ret, uint8_t const *data, const size_t size) +static inline void SHA3_512(uint8_t* ret, uint8_t const* data, size_t const size) { sha3_512(ret, 64, data, size); } diff --git a/sha3_cryptopp.cpp b/sha3_cryptopp.cpp index 13d090b15..2a7c02664 100644 --- a/sha3_cryptopp.cpp +++ b/sha3_cryptopp.cpp @@ -25,12 +25,12 @@ extern "C" { struct ethash_h256; typedef struct ethash_h256 ethash_h256_t; -void SHA3_256(ethash_h256_t const* ret, const uint8_t *data, size_t size) +void SHA3_256(ethash_h256_t const* ret, uint8_t const* data, size_t size) { CryptoPP::SHA3_256().CalculateDigest((uint8_t*)ret, data, size); } -void SHA3_512(uint8_t *const ret, const uint8_t *data, size_t size) +void SHA3_512(uint8_t* const ret, uint8_t const* data, size_t size) { CryptoPP::SHA3_512().CalculateDigest(ret, data, size); } diff --git a/sha3_cryptopp.h b/sha3_cryptopp.h index 47da9427b..cc81f2855 100644 --- a/sha3_cryptopp.h +++ b/sha3_cryptopp.h @@ -11,8 +11,8 @@ extern "C" { struct ethash_h256; typedef struct ethash_h256 ethash_h256_t; -void SHA3_256(ethash_h256_t *const ret, const uint8_t *data, size_t size); -void SHA3_512(uint8_t *const ret, const uint8_t *data, size_t size); +void SHA3_256(ethash_h256_t const* ret, uint8_t const* data, size_t size); +void SHA3_512(uint8_t* const ret, uint8_t const* data, size_t size); #ifdef __cplusplus } diff --git a/util.c b/util.c index d635477f1..615ca3243 100644 --- a/util.c +++ b/util.c @@ -25,9 +25,9 @@ #ifdef _MSC_VER // foward declare without all of Windows.h -__declspec(dllimport) void __stdcall OutputDebugStringA(const char* lpOutputString); +__declspec(dllimport) void __stdcall OutputDebugStringA(char const* lpOutputString); -void debugf(const char *str, ...) +void debugf(char const* str, ...) { va_list args; va_start(args, str); diff --git a/util.h b/util.h index ba8957815..c5fc6e55b 100644 --- a/util.h +++ b/util.h @@ -27,7 +27,7 @@ extern "C" { #endif #ifdef _MSC_VER -void debugf(const char *str, ...); +void debugf(char const* str, ...); #else #define debugf printf #endif From c70f3e569265df57e7c3fda3f47682ca86bcdc12 Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Fri, 17 Apr 2015 15:10:49 +0200 Subject: [PATCH 055/461] More const related style fixes --- ethash.h | 20 ++++++++++---------- internal.c | 20 ++++++++++---------- io.h | 4 ++-- io_posix.c | 4 ++-- io_win32.c | 4 ++-- 5 files changed, 26 insertions(+), 26 deletions(-) diff --git a/ethash.h b/ethash.h index 22fe85e89..99a83fc3a 100644 --- a/ethash.h +++ b/ethash.h @@ -87,11 +87,11 @@ typedef struct ethash_return_value { ethash_h256_t mix_hash; } ethash_return_value; -uint64_t ethash_get_datasize(const uint32_t block_number); -uint64_t ethash_get_cachesize(const uint32_t block_number); +uint64_t ethash_get_datasize(uint32_t const block_number); +uint64_t ethash_get_cachesize(uint32_t const block_number); // initialize the parameters -static inline void ethash_params_init(ethash_params* params, const uint32_t block_number) +static inline void ethash_params_init(ethash_params* params, uint32_t const block_number) { params->full_size = ethash_get_datasize(block_number); params->cache_size = ethash_get_cachesize(block_number); @@ -99,7 +99,7 @@ static inline void ethash_params_init(ethash_params* params, const uint32_t bloc // LTODO: for consistency's sake maybe use ethash_cache_t? typedef struct ethash_cache { - void *mem; + void* mem; } ethash_cache; /** @@ -151,7 +151,7 @@ bool ethash_light_compute( ethash_light_t light, ethash_params const* params, const ethash_h256_t* header_hash, - const uint64_t nonce + uint64_t const nonce ); /** * Get a pointer to the cache object held by the light client @@ -216,8 +216,8 @@ bool ethash_full_compute( ethash_return_value* ret, ethash_full_t full, ethash_params const* params, - const ethash_h256_t* header_hash, - const uint64_t nonce + ethash_h256_t const* header_hash, + uint64_t const nonce ); /** * Get a pointer to the cache object held by the full client @@ -256,7 +256,7 @@ static inline int ethash_check_difficulty( int ethash_quick_check_difficulty( ethash_h256_t const* header_hash, - const uint64_t nonce, + uint64_t const nonce, ethash_h256_t const* mix_hash, ethash_h256_t const* difficulty ); @@ -276,14 +276,14 @@ void ethash_full( void const* full_mem, ethash_params const* params, ethash_h256_t const* header_hash, - const uint64_t nonce + uint64_t const nonce ); void ethash_light( ethash_return_value* ret, ethash_cache const* cache, ethash_params const* params, ethash_h256_t const* header_hash, - const uint64_t nonce + uint64_t const nonce ); /** * Compute the memory data for a full node's memory diff --git a/internal.c b/internal.c index 3c110ec66..4e4f2c6d2 100644 --- a/internal.c +++ b/internal.c @@ -41,13 +41,13 @@ #include "sha3.h" #endif // WITH_CRYPTOPP -uint64_t ethash_get_datasize(const uint32_t block_number) +uint64_t ethash_get_datasize(uint32_t const block_number) { assert(block_number / EPOCH_LENGTH < 2048); return dag_sizes[block_number / EPOCH_LENGTH]; } -uint64_t ethash_get_cachesize(const uint32_t block_number) +uint64_t ethash_get_cachesize(uint32_t const block_number) { assert(block_number / EPOCH_LENGTH < 2048); return cache_sizes[block_number / EPOCH_LENGTH]; @@ -198,7 +198,7 @@ static bool ethash_hash( ethash_cache const* cache, ethash_params const* params, ethash_h256_t const* header_hash, - const uint64_t nonce, + uint64_t const nonce, ethash_callback_t callback ) { @@ -286,7 +286,7 @@ static bool ethash_hash( void ethash_quick_hash( ethash_h256_t* return_hash, ethash_h256_t const* header_hash, - const uint64_t nonce, + uint64_t const nonce, ethash_h256_t const* mix_hash ) { @@ -309,7 +309,7 @@ void ethash_get_seedhash(ethash_h256_t* seedhash, const uint32_t block_number) int ethash_quick_check_difficulty( ethash_h256_t const* header_hash, - const uint64_t nonce, + uint64_t const nonce, ethash_h256_t const* mix_hash, ethash_h256_t const* difficulty ) @@ -351,7 +351,7 @@ bool ethash_light_compute( ethash_light_t light, ethash_params const* params, const ethash_h256_t* header_hash, - const uint64_t nonce + uint64_t const nonce ) { return ethash_hash(ret, NULL, light->cache, params, header_hash, nonce, NULL); @@ -449,8 +449,8 @@ bool ethash_full_compute( ethash_return_value* ret, ethash_full_t full, ethash_params const* params, - const ethash_h256_t* header_hash, - const uint64_t nonce + ethash_h256_t const* header_hash, + uint64_t const nonce ) { return ethash_hash(ret, @@ -496,7 +496,7 @@ void ethash_full( void const* full_mem, ethash_params const* params, ethash_h256_t const* header_hash, - const uint64_t nonce + uint64_t const nonce ) { ethash_hash(ret, (node const *) full_mem, NULL, params, header_hash, nonce, NULL); @@ -506,7 +506,7 @@ void ethash_light( ethash_cache const* cache, ethash_params const* params, ethash_h256_t const* header_hash, - const uint64_t nonce + uint64_t const nonce ) { ethash_hash(ret, NULL, cache, params, header_hash, nonce, NULL); diff --git a/io.h b/io.h index 5c42d18b8..609c2769e 100644 --- a/io.h +++ b/io.h @@ -90,7 +90,7 @@ enum ethash_io_rc ethash_io_prepare( * @param mode Opening mode. Check fopen() * @return The FILE* or NULL in failure */ -FILE* ethash_fopen(const char* file_name, const char* mode); +FILE* ethash_fopen(char const* file_name, char const* mode); /** * An strncat wrapper for no-warnings crossplatform strncat. @@ -108,7 +108,7 @@ FILE* ethash_fopen(const char* file_name, const char* mode); * @return If all is well returns the dest buffer. If there is an * error returns NULL */ -char* ethash_strncat(char* dest, size_t dest_size, const char* src, size_t count); +char* ethash_strncat(char* dest, size_t dest_size, char const* src, size_t count); /** * A cross-platform mkdir wrapper to create a directory or assert it's there diff --git a/io_posix.c b/io_posix.c index 10a5c3f59..5783ec272 100644 --- a/io_posix.c +++ b/io_posix.c @@ -27,12 +27,12 @@ #include #include -FILE* ethash_fopen(const char* file_name, const char* mode) +FILE* ethash_fopen(char const* file_name, char const* mode) { return fopen(file_name, mode); } -char* ethash_strncat(char* dest, size_t dest_size, const char* src, size_t count) +char* ethash_strncat(char* dest, size_t dest_size, char const* src, size_t count) { return strlen(dest) + count + 1 <= dest_size ? strncat(dest, src, count) : NULL; } diff --git a/io_win32.c b/io_win32.c index 6181538aa..505f11e2b 100644 --- a/io_win32.c +++ b/io_win32.c @@ -26,13 +26,13 @@ #include #include -FILE* ethash_fopen(const char* file_name, const char* mode) +FILE* ethash_fopen(char const* file_name, char const* mode) { FILE* f; return fopen_s(&f, file_name, mode) == 0 ? f : NULL; } -char* ethash_strncat(char* dest, size_t dest_size, const char* src, size_t count) +char* ethash_strncat(char* dest, size_t dest_size, char const* src, size_t count) { return strncat_s(dest, dest_size, src, count) == 0 ? dest : NULL; } From df1d8c024f24ffda797038284ed4c41ee8eca45c Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Fri, 24 Apr 2015 14:29:02 +0200 Subject: [PATCH 056/461] Adding ETHASH namespace to some defines --- ethash.h | 22 +++++++++++----------- internal.c | 18 +++++++++--------- internal.h | 2 +- io.c | 2 +- 4 files changed, 22 insertions(+), 22 deletions(-) diff --git a/ethash.h b/ethash.h index 99a83fc3a..2acda0e31 100644 --- a/ethash.h +++ b/ethash.h @@ -26,17 +26,17 @@ #include #include "compiler.h" -#define REVISION 23 -#define DATASET_BYTES_INIT 1073741824U // 2**30 -#define DATASET_BYTES_GROWTH 8388608U // 2**23 -#define CACHE_BYTES_INIT 1073741824U // 2**24 -#define CACHE_BYTES_GROWTH 131072U // 2**17 -#define EPOCH_LENGTH 30000U -#define MIX_BYTES 128 -#define HASH_BYTES 64 -#define DATASET_PARENTS 256 -#define CACHE_ROUNDS 3 -#define ACCESSES 64 +#define ETHASH_REVISION 23 +#define ETHASH_DATASET_BYTES_INIT 1073741824U // 2**30 +#define ETHASH_DATASET_BYTES_GROWTH 8388608U // 2**23 +#define ETHASH_CACHE_BYTES_INIT 1073741824U // 2**24 +#define ETHASH_CACHE_BYTES_GROWTH 131072U // 2**17 +#define ETHASH_EPOCH_LENGTH 30000U +#define ETHASH_MIX_BYTES 128 +#define ETHASH_HASH_BYTES 64 +#define ETHASH_DATASET_PARENTS 256 +#define ETHASH_CACHE_ROUNDS 3 +#define ETHASH_ACCESSES 64 #ifdef __cplusplus extern "C" { diff --git a/internal.c b/internal.c index 4e4f2c6d2..02967913c 100644 --- a/internal.c +++ b/internal.c @@ -43,14 +43,14 @@ uint64_t ethash_get_datasize(uint32_t const block_number) { - assert(block_number / EPOCH_LENGTH < 2048); - return dag_sizes[block_number / EPOCH_LENGTH]; + assert(block_number / ETHASH_EPOCH_LENGTH < 2048); + return dag_sizes[block_number / ETHASH_EPOCH_LENGTH]; } uint64_t ethash_get_cachesize(uint32_t const block_number) { - assert(block_number / EPOCH_LENGTH < 2048); - return cache_sizes[block_number / EPOCH_LENGTH]; + assert(block_number / ETHASH_EPOCH_LENGTH < 2048); + return cache_sizes[block_number / ETHASH_EPOCH_LENGTH]; } // Follows Sergio's "STRICT MEMORY HARD HASHING FUNCTIONS" (2014) @@ -73,7 +73,7 @@ bool static ethash_compute_cache_nodes( SHA3_512(nodes[i].bytes, nodes[i - 1].bytes, 64); } - for (unsigned j = 0; j != CACHE_ROUNDS; j++) { + for (unsigned j = 0; j != ETHASH_CACHE_ROUNDS; j++) { for (unsigned i = 0; i != num_nodes; i++) { uint32_t const idx = nodes[i].words[0] % num_nodes; node data; @@ -142,7 +142,7 @@ void ethash_calculate_dag_item( __m128i xmm3 = ret->xmm[3]; #endif - for (unsigned i = 0; i != DATASET_PARENTS; ++i) { + for (unsigned i = 0; i != ETHASH_DATASET_PARENTS; ++i) { uint32_t parent_index = ((node_index ^ i) * FNV_PRIME ^ ret->words[i % NODE_WORDS]) % num_parent_nodes; node const *parent = &cache_nodes[parent_index]; @@ -224,9 +224,9 @@ static bool ethash_hash( unsigned const page_size = sizeof(uint32_t) * MIX_WORDS; unsigned const num_full_pages = (unsigned) (params->full_size / page_size); - double const progress_change = 1.0f / ACCESSES / MIX_NODES; + double const progress_change = 1.0f / ETHASH_ACCESSES / MIX_NODES; double progress = 0.0f; - for (unsigned i = 0; i != ACCESSES; ++i) { + for (unsigned i = 0; i != ETHASH_ACCESSES; ++i) { uint32_t const index = ((s_mix->words[0] ^ i) * FNV_PRIME ^ mix->words[i % MIX_WORDS]) % num_full_pages; for (unsigned n = 0; n != MIX_NODES; ++n) { @@ -302,7 +302,7 @@ void ethash_quick_hash( void ethash_get_seedhash(ethash_h256_t* seedhash, const uint32_t block_number) { ethash_h256_reset(seedhash); - const uint32_t epochs = block_number / EPOCH_LENGTH; + const uint32_t epochs = block_number / ETHASH_EPOCH_LENGTH; for (uint32_t i = 0; i < epochs; ++i) SHA3_256(seedhash, (uint8_t*)seedhash, 32); } diff --git a/internal.h b/internal.h index e5a34f350..b492ae983 100644 --- a/internal.h +++ b/internal.h @@ -16,7 +16,7 @@ extern "C" { // compile time settings #define NODE_WORDS (64/4) -#define MIX_WORDS (MIX_BYTES/4) +#define MIX_WORDS (ETHASH_MIX_BYTES/4) #define MIX_NODES (MIX_WORDS / NODE_WORDS) #include diff --git a/io.c b/io.c index 2a411efb6..c39494826 100644 --- a/io.c +++ b/io.c @@ -37,7 +37,7 @@ enum ethash_io_rc ethash_io_prepare( goto end; } - ethash_io_mutable_name(REVISION, &seedhash, mutable_name); + ethash_io_mutable_name(ETHASH_REVISION, &seedhash, mutable_name); char* tmpfile = ethash_io_create_filename(dirname, mutable_name, strlen(mutable_name)); if (!tmpfile) { goto end; From 7cf3fa0398d769e0e5fecc70a3edc105ca2045fa Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Fri, 24 Apr 2015 15:00:32 +0200 Subject: [PATCH 057/461] Attempting to fix no symbols for static lib on MacOSX --- CMakeLists.txt | 5 ++--- util.c | 3 --- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4ac285f69..4875dcf77 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -10,8 +10,7 @@ if (NOT MSVC) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99") endif() -set(FILES util.c - util.h +set(FILES util.h io.c internal.c ethash.h @@ -21,7 +20,7 @@ set(FILES util.c data_sizes.h) if (MSVC) - list(APPEND FILES io_win32.c mmap_win32.c) + list(APPEND FILES util.c io_win32.c mmap_win32.c) else() list(APPEND FILES io_posix.c) endif() diff --git a/util.c b/util.c index 615ca3243..268e6db05 100644 --- a/util.c +++ b/util.c @@ -22,7 +22,6 @@ #include #include "util.h" -#ifdef _MSC_VER // foward declare without all of Windows.h __declspec(dllimport) void __stdcall OutputDebugStringA(char const* lpOutputString); @@ -37,5 +36,3 @@ void debugf(char const* str, ...) buf[sizeof(buf)-1] = '\0'; OutputDebugStringA(buf); } - -#endif From 95f0419ec875444f9644ac0b6c3b6239d8c3bbaf Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Mon, 20 Apr 2015 12:54:16 +0200 Subject: [PATCH 058/461] Some minor changes to the C API towards finalization --- ethash.h | 128 ++++++++++++++++++++++++++--------------------------- internal.c | 118 +++++++++++++++++++++++++----------------------- internal.h | 9 ++-- 3 files changed, 128 insertions(+), 127 deletions(-) diff --git a/ethash.h b/ethash.h index 2acda0e31..9f6189c88 100644 --- a/ethash.h +++ b/ethash.h @@ -42,14 +42,6 @@ extern "C" { #endif -// LTODO: for consistency's sake maybe use ethash_params_t? -typedef struct ethash_params { - /// Size of full data set (in bytes, multiple of mix size (128)). - uint64_t full_size; - /// Size of compute cache (in bytes, multiple of node size (64)). - uint64_t cache_size; -} ethash_params; - /// Type of a seedhash/blockhash e.t.c. typedef struct ethash_h256 { uint8_t b[32]; } ethash_h256_t; static inline uint8_t ethash_h256_get(ethash_h256_t const* hash, unsigned int i) @@ -90,46 +82,38 @@ typedef struct ethash_return_value { uint64_t ethash_get_datasize(uint32_t const block_number); uint64_t ethash_get_cachesize(uint32_t const block_number); -// initialize the parameters -static inline void ethash_params_init(ethash_params* params, uint32_t const block_number) -{ - params->full_size = ethash_get_datasize(block_number); - params->cache_size = ethash_get_cachesize(block_number); -} - // LTODO: for consistency's sake maybe use ethash_cache_t? typedef struct ethash_cache { void* mem; -} ethash_cache; + uint64_t cache_size; +} ethash_cache_t; /** * Allocate and initialize a new ethash_cache object * - * @param params The parameters to initialize it with. We are interested in - * the cache_size from here - * @param seed Block seedhash to be used during the computation of the - * cache nodes - * @return Newly allocated ethash_cache on success or NULL in case of - * ERRNOMEM or invalid parameters used for @ref ethash_compute_cache_nodes() + * @param cache_size The size of the cache in bytes + * @param seed Block seedhash to be used during the computation of the + * cache nodes + * @return Newly allocated ethash_cache on success or NULL in case of + * ERRNOMEM or invalid parameters used for @ref ethash_compute_cache_nodes() */ -ethash_cache* ethash_cache_new(ethash_params const* params, ethash_h256_t const* seed); +ethash_cache_t* ethash_cache_new(uint64_t cache_size, ethash_h256_t const* seed); /** * Frees a previously allocated ethash_cache * @param c The object to free */ -void ethash_cache_delete(ethash_cache* c); +void ethash_cache_delete(ethash_cache_t* c); /** * Allocate and initialize a new ethash_light handler * - * @param params The parameters to initialize it with. We are interested in - * the cache_size from here - * @param seed Block seedhash to be used during the computation of the - * cache nodes - * @return Newly allocated ethash_light handler or NULL in case of - * ERRNOMEM or invalid parameters used for @ref ethash_compute_cache_nodes() + * @param cache_size The size of the cache in bytes + * @param seed Block seedhash to be used during the computation of the + * cache nodes + * @return Newly allocated ethash_light handler or NULL in case of + * ERRNOMEM or invalid parameters used for @ref ethash_compute_cache_nodes() */ -ethash_light_t ethash_light_new(ethash_params const* params, ethash_h256_t const* seed); +ethash_light_t ethash_light_new(uint64_t cache_size, ethash_h256_t const* seed); /** * Frees a previously allocated ethash_light handler * @param light The light handler to free @@ -140,7 +124,7 @@ void ethash_light_delete(ethash_light_t light); * * @param ret An object of ethash_return_value to hold the return value * @param light The light client handler - * @param params The parameters to use + * @param full_size The size of the full data in bytes. * @param header_hash The header hash to pack into the mix * @param nonce The nonce to pack into the mix * @return true if all went well and false if there were invalid @@ -149,7 +133,7 @@ void ethash_light_delete(ethash_light_t light); bool ethash_light_compute( ethash_return_value* ret, ethash_light_t light, - ethash_params const* params, + uint64_t full_size, const ethash_h256_t* header_hash, uint64_t const nonce ); @@ -160,7 +144,7 @@ bool ethash_light_compute( * @return A pointer to the cache held by the light client or NULL if * there was no cache in the first place */ -ethash_cache* ethash_light_get_cache(ethash_light_t light); +ethash_cache_t* ethash_light_get_cache(ethash_light_t light); /** * Move the memory ownership of the cache somewhere else * @@ -168,31 +152,30 @@ ethash_cache* ethash_light_get_cache(ethash_light_t light); * After this function concludes it will no longer have a cache. * @return A pointer to the moved cache or NULL if there was no cache in the first place */ -ethash_cache* ethash_light_acquire_cache(ethash_light_t light); +ethash_cache_t* ethash_light_acquire_cache(ethash_light_t light); /** * Allocate and initialize a new ethash_full handler * - * @param dirname The directory in which to put the DAG file. - * @param seedhash The seed hash of the block. Used in the DAG file naming. - * @param params The parameters to initialize it with. We are interested in - * the full_size from here - * @param cache A cache object to use that was allocated with @ref ethash_cache_new(). - * Iff this function succeeds the ethash_full_t will take memory - * ownership of the cache and free it at deletion. If not then the user - * still has to handle freeing of the cache himself. - * @param callback A callback function with signature of @ref ethash_callback_t - * It accepts an unsigned with which a progress of DAG calculation - * can be displayed. If all goes well the callback should return 0. - * If a non-zero value is returned then DAG generation will stop. - * @return Newly allocated ethash_full handler or NULL in case of - * ERRNOMEM or invalid parameters used for @ref ethash_compute_full_data() + * @param dirname The directory in which to put the DAG file. + * @param seedhash The seed hash of the block. Used in the DAG file naming. + * @param full_size The size of the full data in bytes. + * @param cache A cache object to use that was allocated with @ref ethash_cache_new(). + * Iff this function succeeds the ethash_full_t will take memory + * memory ownership of the cache and free it at deletion. If + * not then the user still has to handle freeing of the cache himself. + * @param callback A callback function with signature of @ref ethash_callback_t + * It accepts an unsigned with which a progress of DAG calculation + * can be displayed. If all goes well the callback should return 0. + * If a non-zero value is returned then DAG generation will stop. + * @return Newly allocated ethash_full handler or NULL in case of + * ERRNOMEM or invalid parameters used for @ref ethash_compute_full_data() */ ethash_full_t ethash_full_new( char const* dirname, ethash_h256_t const* seed_hash, - ethash_params const* params, - ethash_cache const* cache, + uint64_t full_size, + ethash_cache_t const* cache, ethash_callback_t callback ); /** @@ -205,7 +188,6 @@ void ethash_full_delete(ethash_full_t full); * * @param ret An object of ethash_return_value to hold the return value * @param full The full client handler - * @param params The parameters to use * @param header_hash The header hash to pack into the mix * @param nonce The nonce to pack into the mix * @return true if all went well and false if there were invalid @@ -215,7 +197,6 @@ void ethash_full_delete(ethash_full_t full); bool ethash_full_compute( ethash_return_value* ret, ethash_full_t full, - ethash_params const* params, ethash_h256_t const* header_hash, uint64_t const nonce ); @@ -226,7 +207,7 @@ bool ethash_full_compute( * @return A pointer to the cache held by the full client or NULL * if there was no cache in the first place */ -ethash_cache* ethash_full_get_cache(ethash_full_t full); +ethash_cache_t* ethash_full_get_cache(ethash_full_t full); /** * Move the memory ownership of the cache somewhere else * @@ -234,7 +215,7 @@ ethash_cache* ethash_full_get_cache(ethash_full_t full); * After this function concludes it will no longer have a cache. * @return A pointer to the moved cache or NULL if there was no cache in the first place */ -ethash_cache* ethash_full_acquire_cache(ethash_full_t full); +ethash_cache_t* ethash_full_acquire_cache(ethash_full_t full); void ethash_get_seedhash(ethash_h256_t *seedhash, const uint32_t block_number); @@ -261,6 +242,16 @@ int ethash_quick_check_difficulty( ethash_h256_t const* difficulty ); +/** + * Compute the memory data for a full node's memory + * + * @param mem A pointer to an ethash full's memory + * @param full_size The size of the full data in bytes + * @param cache A cache object to use in the calculation + * @return true if all went fine and false for invalid parameters + */ +bool ethash_compute_full_data(void* mem, uint64_t full_size, ethash_cache_t const* cache); + /** * ========================= @@ -270,7 +261,21 @@ int ethash_quick_check_difficulty( * Kept for backwards compatibility with whoever still uses it. Please consider * switching to the new API (look above) */ -void ethash_mkcache(ethash_cache* cache, ethash_params const* params, ethash_h256_t const* seed); +typedef struct ethash_params { + /// Size of full data set (in bytes, multiple of mix size (128)). + uint64_t full_size; + /// Size of compute cache (in bytes, multiple of node size (64)). + uint64_t cache_size; +} ethash_params; + +// initialize the parameters +static inline void ethash_params_init(ethash_params* params, uint32_t const block_number) +{ + params->full_size = ethash_get_datasize(block_number); + params->cache_size = ethash_get_cachesize(block_number); +} + +void ethash_mkcache(ethash_cache_t* cache, ethash_params const* params, ethash_h256_t const* seed); void ethash_full( ethash_return_value* ret, void const* full_mem, @@ -280,20 +285,11 @@ void ethash_full( ); void ethash_light( ethash_return_value* ret, - ethash_cache const* cache, + ethash_cache_t const* cache, ethash_params const* params, ethash_h256_t const* header_hash, uint64_t const nonce ); -/** - * Compute the memory data for a full node's memory - * - * @param mem A pointer to an ethash full's memory - * @param params The parameters to compute the data with - * @param cache A cache object to use in the calculation - * @return true if all went fine and false for invalid parameters - */ -bool ethash_compute_full_data(void* mem, ethash_params const* params, ethash_cache const* cache); #ifdef __cplusplus } diff --git a/internal.c b/internal.c index 02967913c..a17396b47 100644 --- a/internal.c +++ b/internal.c @@ -58,14 +58,14 @@ uint64_t ethash_get_cachesize(uint32_t const block_number) // SeqMemoHash(s, R, N) bool static ethash_compute_cache_nodes( node* const nodes, - ethash_params const* params, + uint64_t cache_size, ethash_h256_t const* seed ) { - if (params->cache_size % sizeof(node) != 0) { + if (cache_size % sizeof(node) != 0) { return false; } - uint32_t const num_nodes = (uint32_t) (params->cache_size / sizeof(node)); + uint32_t const num_nodes = (uint32_t) (cache_size / sizeof(node)); SHA3_512(nodes[0].bytes, (uint8_t*)seed, 32); @@ -90,22 +90,23 @@ bool static ethash_compute_cache_nodes( return true; } -ethash_cache* ethash_cache_new(ethash_params const* params, ethash_h256_t const* seed) +ethash_cache_t* ethash_cache_new(uint64_t cache_size, ethash_h256_t const* seed) { - ethash_cache* ret; + ethash_cache_t* ret; ret = malloc(sizeof(*ret)); if (!ret) { return NULL; } - ret->mem = malloc((size_t)params->cache_size); + ret->mem = malloc((size_t)cache_size); if (!ret->mem) { goto fail_free_cache; } node* nodes = (node*)ret->mem; - if (!ethash_compute_cache_nodes(nodes, params, seed)) { + if (!ethash_compute_cache_nodes(nodes, cache_size, seed)) { goto fail_free_cache_mem; } + ret->cache_size = cache_size; return ret; fail_free_cache_mem: @@ -115,7 +116,7 @@ fail_free_cache: return NULL; } -void ethash_cache_delete(ethash_cache* c) +void ethash_cache_delete(ethash_cache_t* c) { free(c->mem); free(c); @@ -124,11 +125,10 @@ void ethash_cache_delete(ethash_cache* c) void ethash_calculate_dag_item( node* const ret, const unsigned node_index, - const struct ethash_params *params, - const struct ethash_cache *cache + ethash_cache_t const* cache ) { - uint32_t num_parent_nodes = (uint32_t) (params->cache_size / sizeof(node)); + uint32_t num_parent_nodes = (uint32_t) (cache->cache_size / sizeof(node)); node const* cache_nodes = (node const *) cache->mem; node const* init = &cache_nodes[node_index % num_parent_nodes]; memcpy(ret, init, sizeof(node)); @@ -174,20 +174,16 @@ void ethash_calculate_dag_item( SHA3_512(ret->bytes, ret->bytes, sizeof(node)); } -bool ethash_compute_full_data( - void* mem, - ethash_params const* params, - ethash_cache const* cache -) +bool ethash_compute_full_data(void* mem, uint64_t full_size, ethash_cache_t const* cache) { - if (params->full_size % (sizeof(uint32_t) * MIX_WORDS) != 0 || - (params->full_size % sizeof(node)) != 0) { + if (full_size % (sizeof(uint32_t) * MIX_WORDS) != 0 || + (full_size % sizeof(node)) != 0) { return false; } node* full_nodes = mem; // now compute full nodes - for (unsigned n = 0; n != (params->full_size / sizeof(node)); ++n) { - ethash_calculate_dag_item(&(full_nodes[n]), n, params, cache); + for (unsigned n = 0; n != (full_size / sizeof(node)); ++n) { + ethash_calculate_dag_item(&(full_nodes[n]), n, cache); } return true; } @@ -195,14 +191,14 @@ bool ethash_compute_full_data( static bool ethash_hash( ethash_return_value* ret, node const* full_nodes, - ethash_cache const* cache, - ethash_params const* params, + ethash_cache_t const* cache, + uint64_t full_size, ethash_h256_t const* header_hash, uint64_t const nonce, ethash_callback_t callback ) { - if (params->full_size % MIX_WORDS != 0) { + if (full_size % MIX_WORDS != 0) { return false; } @@ -222,7 +218,7 @@ static bool ethash_hash( } unsigned const page_size = sizeof(uint32_t) * MIX_WORDS; - unsigned const num_full_pages = (unsigned) (params->full_size / page_size); + unsigned const num_full_pages = (unsigned) (full_size / page_size); double const progress_change = 1.0f / ETHASH_ACCESSES / MIX_NODES; double progress = 0.0f; @@ -240,7 +236,7 @@ static bool ethash_hash( dag_node = &full_nodes[MIX_NODES * index + n]; } else { node tmp_node; - ethash_calculate_dag_item(&tmp_node, index * MIX_NODES + n, params, cache); + ethash_calculate_dag_item(&tmp_node, index * MIX_NODES + n, cache); dag_node = &tmp_node; } @@ -320,14 +316,14 @@ int ethash_quick_check_difficulty( return ethash_check_difficulty(&return_hash, difficulty); } -ethash_light_t ethash_light_new(ethash_params const* params, ethash_h256_t const* seed) +ethash_light_t ethash_light_new(uint64_t cache_size, ethash_h256_t const* seed) { struct ethash_light *ret; ret = calloc(sizeof(*ret), 1); if (!ret) { return NULL; } - ret->cache = ethash_cache_new(params, seed); + ret->cache = ethash_cache_new(cache_size, seed); if (!ret->cache) { goto fail_free_light; } @@ -349,22 +345,30 @@ void ethash_light_delete(ethash_light_t light) bool ethash_light_compute( ethash_return_value* ret, ethash_light_t light, - ethash_params const* params, + uint64_t full_size, const ethash_h256_t* header_hash, uint64_t const nonce ) { - return ethash_hash(ret, NULL, light->cache, params, header_hash, nonce, NULL); + return ethash_hash( + ret, + NULL, + light->cache, + full_size, + header_hash, + nonce, + NULL + ); } -ethash_cache *ethash_light_get_cache(ethash_light_t light) +ethash_cache_t *ethash_light_get_cache(ethash_light_t light) { return light->cache; } -ethash_cache *ethash_light_acquire_cache(ethash_light_t light) +ethash_cache_t *ethash_light_acquire_cache(ethash_light_t light) { - ethash_cache* ret = light->cache; + ethash_cache_t* ret = light->cache; light->cache = 0; return ret; } @@ -372,8 +376,8 @@ ethash_cache *ethash_light_acquire_cache(ethash_light_t light) ethash_full_t ethash_full_new( char const* dirname, ethash_h256_t const* seed_hash, - ethash_params const* params, - ethash_cache const* cache, + uint64_t full_size, + ethash_cache_t const* cache, ethash_callback_t callback ) { @@ -386,9 +390,9 @@ ethash_full_t ethash_full_new( return NULL; } - ret->cache = (ethash_cache*)cache; - ret->file_size = (size_t)params->full_size; - switch (ethash_io_prepare(dirname, *seed_hash, &f, (size_t)params->full_size)) { + ret->cache = (ethash_cache_t*)cache; + ret->file_size = (size_t)full_size; + switch (ethash_io_prepare(dirname, *seed_hash, &f, (size_t)full_size)) { case ETHASH_IO_FAIL: case ETHASH_IO_MEMO_SIZE_MISMATCH: goto fail_free_full; @@ -401,7 +405,7 @@ ethash_full_t ethash_full_new( } ret->data = mmap( NULL, - (size_t)params->full_size, + (size_t)full_size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, @@ -416,7 +420,7 @@ ethash_full_t ethash_full_new( break; } - if (!ethash_compute_full_data(ret->data, params, cache)) { + if (!ethash_compute_full_data(ret->data, full_size, cache)) { goto fail_free_full_data; } ret->callback = callback; @@ -424,7 +428,7 @@ ethash_full_t ethash_full_new( fail_free_full_data: // could check that munmap(..) == 0 but even if it did not can't really do anything here - munmap(ret->data, (size_t)params->full_size); + munmap(ret->data, (size_t)full_size); fail_close_file: fclose(ret->file); fail_free_full: @@ -448,28 +452,29 @@ void ethash_full_delete(ethash_full_t full) bool ethash_full_compute( ethash_return_value* ret, ethash_full_t full, - ethash_params const* params, ethash_h256_t const* header_hash, uint64_t const nonce ) { - return ethash_hash(ret, - (node const*)full->data, - NULL, - params, - header_hash, - nonce, - full->callback); + return ethash_hash( + ret, + (node const*)full->data, + NULL, + full->file_size, + header_hash, + nonce, + full->callback + ); } -ethash_cache* ethash_full_get_cache(ethash_full_t full) +ethash_cache_t* ethash_full_get_cache(ethash_full_t full) { return full->cache; } -ethash_cache* ethash_full_acquire_cache(ethash_full_t full) +ethash_cache_t* ethash_full_acquire_cache(ethash_full_t full) { - ethash_cache* ret = full->cache; + ethash_cache_t* ret = full->cache; full->cache = 0; return ret; } @@ -483,14 +488,15 @@ ethash_cache* ethash_full_acquire_cache(ethash_full_t full) * switching to the new API (look above) */ void ethash_mkcache( - ethash_cache* cache, + ethash_cache_t* cache, ethash_params const* params, ethash_h256_t const* seed ) { node* nodes = (node*) cache->mem; - ethash_compute_cache_nodes(nodes, params, seed); + ethash_compute_cache_nodes(nodes, params->cache_size, seed); } + void ethash_full( ethash_return_value* ret, void const* full_mem, @@ -499,15 +505,15 @@ void ethash_full( uint64_t const nonce ) { - ethash_hash(ret, (node const *) full_mem, NULL, params, header_hash, nonce, NULL); + ethash_hash(ret, (node const *) full_mem, NULL, params->full_size, header_hash, nonce, NULL); } void ethash_light( ethash_return_value* ret, - ethash_cache const* cache, + ethash_cache_t const* cache, ethash_params const* params, ethash_h256_t const* header_hash, uint64_t const nonce ) { - ethash_hash(ret, NULL, cache, params, header_hash, nonce, NULL); + ethash_hash(ret, NULL, cache, params->full_size, header_hash, nonce, NULL); } diff --git a/internal.h b/internal.h index b492ae983..fdfa2f961 100644 --- a/internal.h +++ b/internal.h @@ -32,13 +32,13 @@ typedef union node { } node; struct ethash_light { - ethash_cache* cache; + ethash_cache_t* cache; }; struct ethash_full { FILE* file; - size_t file_size; - ethash_cache* cache; + uint64_t file_size; + ethash_cache_t* cache; node* data; ethash_callback_t callback; }; @@ -46,8 +46,7 @@ struct ethash_full { void ethash_calculate_dag_item( node* const ret, const unsigned node_index, - ethash_params const* params, - ethash_cache const* cache + ethash_cache_t const* cache ); void ethash_quick_hash( From 12e408ee8caa5ffe82271dab338070814ac99d3d Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Mon, 20 Apr 2015 17:28:02 +0200 Subject: [PATCH 059/461] Adding ethash_full_data() --- ethash.h | 4 ++++ internal.c | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/ethash.h b/ethash.h index 9f6189c88..098828e83 100644 --- a/ethash.h +++ b/ethash.h @@ -200,6 +200,10 @@ bool ethash_full_compute( ethash_h256_t const* header_hash, uint64_t const nonce ); +/** + * Get a pointer to the full DAG data + */ +void *ethash_full_data(ethash_full_t full); /** * Get a pointer to the cache object held by the full client * diff --git a/internal.c b/internal.c index a17396b47..6f9afec3c 100644 --- a/internal.c +++ b/internal.c @@ -467,6 +467,11 @@ bool ethash_full_compute( ); } +void *ethash_full_data(ethash_full_t full) +{ + return full->data; +} + ethash_cache_t* ethash_full_get_cache(ethash_full_t full) { return full->cache; From 2f77c792a89a9a2078ca7c88f8c8c63f50a05d8e Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Tue, 21 Apr 2015 14:46:08 +0200 Subject: [PATCH 060/461] ethash_full should not keep cache_size - plus block number is a uint64_t not uint32_t --- ethash.h | 20 ++------------------ internal.c | 21 ++------------------- internal.h | 1 - 3 files changed, 4 insertions(+), 38 deletions(-) diff --git a/ethash.h b/ethash.h index 098828e83..61bb72fdb 100644 --- a/ethash.h +++ b/ethash.h @@ -79,8 +79,8 @@ typedef struct ethash_return_value { ethash_h256_t mix_hash; } ethash_return_value; -uint64_t ethash_get_datasize(uint32_t const block_number); -uint64_t ethash_get_cachesize(uint32_t const block_number); +uint64_t ethash_get_datasize(uint64_t const block_number); +uint64_t ethash_get_cachesize(uint64_t const block_number); // LTODO: for consistency's sake maybe use ethash_cache_t? typedef struct ethash_cache { @@ -204,22 +204,6 @@ bool ethash_full_compute( * Get a pointer to the full DAG data */ void *ethash_full_data(ethash_full_t full); -/** - * Get a pointer to the cache object held by the full client - * - * @param full The full client whose cache to request - * @return A pointer to the cache held by the full client or NULL - * if there was no cache in the first place - */ -ethash_cache_t* ethash_full_get_cache(ethash_full_t full); -/** - * Move the memory ownership of the cache somewhere else - * - * @param full The full client whose cache's memory ownership to acquire. - * After this function concludes it will no longer have a cache. - * @return A pointer to the moved cache or NULL if there was no cache in the first place - */ -ethash_cache_t* ethash_full_acquire_cache(ethash_full_t full); void ethash_get_seedhash(ethash_h256_t *seedhash, const uint32_t block_number); diff --git a/internal.c b/internal.c index 6f9afec3c..9a75a12fd 100644 --- a/internal.c +++ b/internal.c @@ -41,13 +41,13 @@ #include "sha3.h" #endif // WITH_CRYPTOPP -uint64_t ethash_get_datasize(uint32_t const block_number) +uint64_t ethash_get_datasize(uint64_t const block_number) { assert(block_number / ETHASH_EPOCH_LENGTH < 2048); return dag_sizes[block_number / ETHASH_EPOCH_LENGTH]; } -uint64_t ethash_get_cachesize(uint32_t const block_number) +uint64_t ethash_get_cachesize(uint64_t const block_number) { assert(block_number / ETHASH_EPOCH_LENGTH < 2048); return cache_sizes[block_number / ETHASH_EPOCH_LENGTH]; @@ -389,8 +389,6 @@ ethash_full_t ethash_full_new( if (!ret) { return NULL; } - - ret->cache = (ethash_cache_t*)cache; ret->file_size = (size_t)full_size; switch (ethash_io_prepare(dirname, *seed_hash, &f, (size_t)full_size)) { case ETHASH_IO_FAIL: @@ -438,9 +436,6 @@ fail_free_full: void ethash_full_delete(ethash_full_t full) { - if (full->cache) { - ethash_cache_delete(full->cache); - } // could check that munmap(..) == 0 but even if it did not can't really do anything here munmap(full->data, full->file_size); if (full->file) { @@ -472,18 +467,6 @@ void *ethash_full_data(ethash_full_t full) return full->data; } -ethash_cache_t* ethash_full_get_cache(ethash_full_t full) -{ - return full->cache; -} - -ethash_cache_t* ethash_full_acquire_cache(ethash_full_t full) -{ - ethash_cache_t* ret = full->cache; - full->cache = 0; - return ret; -} - /** * ========================= * = DEPRECATED API = diff --git a/internal.h b/internal.h index fdfa2f961..b5fcf71fe 100644 --- a/internal.h +++ b/internal.h @@ -38,7 +38,6 @@ struct ethash_light { struct ethash_full { FILE* file; uint64_t file_size; - ethash_cache_t* cache; node* data; ethash_callback_t callback; }; From d7b3e00407c23bd3cc39826f0912f8a268d6f016 Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Wed, 22 Apr 2015 10:17:39 +0200 Subject: [PATCH 061/461] ethash_return_value get a _t for consistency --- ethash.h | 12 +++++------- internal.c | 10 +++++----- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/ethash.h b/ethash.h index 61bb72fdb..a0860097e 100644 --- a/ethash.h +++ b/ethash.h @@ -73,16 +73,14 @@ struct ethash_full; typedef struct ethash_full* ethash_full_t; typedef int(*ethash_callback_t)(unsigned); -// LTODO: for consistency's sake maybe use ethash_return_value_t? typedef struct ethash_return_value { ethash_h256_t result; ethash_h256_t mix_hash; -} ethash_return_value; +} ethash_return_value_t; uint64_t ethash_get_datasize(uint64_t const block_number); uint64_t ethash_get_cachesize(uint64_t const block_number); -// LTODO: for consistency's sake maybe use ethash_cache_t? typedef struct ethash_cache { void* mem; uint64_t cache_size; @@ -131,7 +129,7 @@ void ethash_light_delete(ethash_light_t light); * parameters given. */ bool ethash_light_compute( - ethash_return_value* ret, + ethash_return_value_t* ret, ethash_light_t light, uint64_t full_size, const ethash_h256_t* header_hash, @@ -195,7 +193,7 @@ void ethash_full_delete(ethash_full_t full); * at some point return a non-zero value */ bool ethash_full_compute( - ethash_return_value* ret, + ethash_return_value_t* ret, ethash_full_t full, ethash_h256_t const* header_hash, uint64_t const nonce @@ -265,14 +263,14 @@ static inline void ethash_params_init(ethash_params* params, uint32_t const bloc void ethash_mkcache(ethash_cache_t* cache, ethash_params const* params, ethash_h256_t const* seed); void ethash_full( - ethash_return_value* ret, + ethash_return_value_t* ret, void const* full_mem, ethash_params const* params, ethash_h256_t const* header_hash, uint64_t const nonce ); void ethash_light( - ethash_return_value* ret, + ethash_return_value_t* ret, ethash_cache_t const* cache, ethash_params const* params, ethash_h256_t const* header_hash, diff --git a/internal.c b/internal.c index 9a75a12fd..512a0ed9d 100644 --- a/internal.c +++ b/internal.c @@ -189,7 +189,7 @@ bool ethash_compute_full_data(void* mem, uint64_t full_size, ethash_cache_t cons } static bool ethash_hash( - ethash_return_value* ret, + ethash_return_value_t* ret, node const* full_nodes, ethash_cache_t const* cache, uint64_t full_size, @@ -343,7 +343,7 @@ void ethash_light_delete(ethash_light_t light) } bool ethash_light_compute( - ethash_return_value* ret, + ethash_return_value_t* ret, ethash_light_t light, uint64_t full_size, const ethash_h256_t* header_hash, @@ -445,7 +445,7 @@ void ethash_full_delete(ethash_full_t full) } bool ethash_full_compute( - ethash_return_value* ret, + ethash_return_value_t* ret, ethash_full_t full, ethash_h256_t const* header_hash, uint64_t const nonce @@ -486,7 +486,7 @@ void ethash_mkcache( } void ethash_full( - ethash_return_value* ret, + ethash_return_value_t* ret, void const* full_mem, ethash_params const* params, ethash_h256_t const* header_hash, @@ -496,7 +496,7 @@ void ethash_full( ethash_hash(ret, (node const *) full_mem, NULL, params->full_size, header_hash, nonce, NULL); } void ethash_light( - ethash_return_value* ret, + ethash_return_value_t* ret, ethash_cache_t const* cache, ethash_params const* params, ethash_h256_t const* header_hash, From 25c62e1ae4517ec671397c3e62e2dec6c8216e32 Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Mon, 27 Apr 2015 12:15:45 +0200 Subject: [PATCH 062/461] If given dir does not contain DIRSEP add it --- io.h | 35 +++++++++++++++-------------------- io_posix.c | 25 +++++++++++++++++++++++++ io_win32.c | 25 +++++++++++++++++++++++++ 3 files changed, 65 insertions(+), 20 deletions(-) diff --git a/io.h b/io.h index 609c2769e..0559377b1 100644 --- a/io.h +++ b/io.h @@ -136,6 +136,21 @@ bool ethash_file_size(FILE* f, size_t* ret_size); */ int ethash_fileno(FILE* f); +/** + * Create the filename for the DAG. + * + * @param dirname The directory name in which the DAG file should reside + * If it does not end with a directory separator it is appended. + * @param filename The actual name of the file + * @param filename_length The length of the filename in bytes + * @return A char* containing the full name. User must deallocate. + */ +char* ethash_io_create_filename( + char const* dirname, + char const* filename, + size_t filename_length +); + static inline bool ethash_io_mutable_name( uint32_t revision, ethash_h256_t const* seed_hash, @@ -149,26 +164,6 @@ static inline bool ethash_io_mutable_name( return snprintf(output, DAG_MUTABLE_NAME_MAX_SIZE, "%u_%016" PRIx64, revision, hash) >= 0; } -static inline char* ethash_io_create_filename( - char const* dirname, - char const* filename, - size_t filename_length -) -{ - size_t dirlen = strlen(dirname); - // in C the cast is not needed, but a C++ compiler will complain for invalid conversion - char* name = (char*)malloc(dirlen + filename_length + 1); - if (!name) { - return NULL; - } - - name[0] = '\0'; - ethash_strncat(name, dirlen + filename_length + 1, dirname, dirlen); - ethash_strncat(name, dirlen + filename_length + 1, filename, filename_length); - return name; -} - - #ifdef __cplusplus } #endif diff --git a/io_posix.c b/io_posix.c index 5783ec272..c16521d5a 100644 --- a/io_posix.c +++ b/io_posix.c @@ -48,6 +48,31 @@ int ethash_fileno(FILE *f) return fileno(f); } +char* ethash_io_create_filename( + char const* dirname, + char const* filename, + size_t filename_length +) +{ + size_t dirlen = strlen(dirname); + size_t dest_size = dirlen + filename_length + 1; + if (dirname[dirlen] != '/') { + dest_size += 1; + } + char* name = malloc(dest_size); + if (!name) { + return NULL; + } + + name[0] = '\0'; + ethash_strncat(name, dest_size, dirname, dirlen); + if (dirname[dirlen] != '/') { + ethash_strncat(name, dest_size, "/", 1); + } + ethash_strncat(name, dest_size, filename, filename_length); + return name; +} + bool ethash_file_size(FILE* f, size_t* ret_size) { struct stat st; diff --git a/io_win32.c b/io_win32.c index 505f11e2b..d64362914 100644 --- a/io_win32.c +++ b/io_win32.c @@ -48,6 +48,31 @@ int ethash_fileno(FILE* f) return _fileno(f); } +char* ethash_io_create_filename( + char const* dirname, + char const* filename, + size_t filename_length +) +{ + size_t dirlen = strlen(dirname); + size_t dest_size = dirlen + filename_length + 1; + if (dirname[dirlen] != '\\' || dirname[dirlen] != '/') { + dest_size += 1; + } + char* name = malloc(dest_size); + if (!name) { + return NULL; + } + + name[0] = '\0'; + ethash_strncat(name, dest_size, dirname, dirlen); + if (dirname[dirlen] != '\\' || dirname[dirlen] != '/') { + ethash_strncat(name, dest_size, "\\", 1); + } + ethash_strncat(name, dest_size, filename, filename_length); + return name; +} + bool ethash_file_size(FILE* f, size_t* ret_size) { struct _stat st; From 94eee46b2a0e4fea528c30320db56bcd03f3dac6 Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Mon, 27 Apr 2015 16:33:20 +0200 Subject: [PATCH 063/461] Force DAG file creation if file already existed but with wrong size --- internal.c | 49 ++++++++++++++++++++++++------------------ io.c | 62 ++++++++++++++++++++++++++++++------------------------ io.h | 5 ++++- 3 files changed, 67 insertions(+), 49 deletions(-) diff --git a/internal.c b/internal.c index 512a0ed9d..d5d7bfda2 100644 --- a/internal.c +++ b/internal.c @@ -373,6 +373,24 @@ ethash_cache_t *ethash_light_acquire_cache(ethash_light_t light) return ret; } +static bool ethash_mmap(struct ethash_full* ret, FILE* f) +{ + int fd; + ret->file = f; + if ((fd = ethash_fileno(ret->file)) == -1) { + return false; + } + ret->data = mmap( + NULL, + (size_t)ret->file_size, + PROT_READ | PROT_WRITE, + MAP_SHARED, + fd, + 0 + ); + return ret->data != MAP_FAILED; +} + ethash_full_t ethash_full_new( char const* dirname, ethash_h256_t const* seed_hash, @@ -382,39 +400,30 @@ ethash_full_t ethash_full_new( ) { struct ethash_full* ret; - int fd; FILE *f = NULL; - bool match = false; ret = calloc(sizeof(*ret), 1); if (!ret) { return NULL; } ret->file_size = (size_t)full_size; - switch (ethash_io_prepare(dirname, *seed_hash, &f, (size_t)full_size)) { + switch (ethash_io_prepare(dirname, *seed_hash, &f, (size_t)full_size, false)) { case ETHASH_IO_FAIL: - case ETHASH_IO_MEMO_SIZE_MISMATCH: goto fail_free_full; case ETHASH_IO_MEMO_MATCH: - match = true; - case ETHASH_IO_MEMO_MISMATCH: - ret->file = f; - if ((fd = ethash_fileno(ret->file)) == -1) { + if (!ethash_mmap(ret, f)) { + goto fail_close_file; + } + return ret; + case ETHASH_IO_MEMO_SIZE_MISMATCH: + // if a DAG of same filename but unexpected size is found, silently force new file creation + if (ethash_io_prepare(dirname, *seed_hash, &f, (size_t)full_size, true) != ETHASH_IO_MEMO_MISMATCH) { goto fail_free_full; } - ret->data = mmap( - NULL, - (size_t)full_size, - PROT_READ | PROT_WRITE, - MAP_SHARED, - fd, - 0 - ); - if (ret->data == MAP_FAILED) { + // fallthrough to the mismatch case here, DO NOT go through match + case ETHASH_IO_MEMO_MISMATCH: + if (!ethash_mmap(ret, f)) { goto fail_close_file; } - if (match) { - return ret; - } break; } diff --git a/io.c b/io.c index c39494826..6694e17a3 100644 --- a/io.c +++ b/io.c @@ -26,7 +26,8 @@ enum ethash_io_rc ethash_io_prepare( char const* dirname, ethash_h256_t const seedhash, FILE** output_file, - size_t file_size + size_t file_size, + bool force_create ) { char mutable_name[DAG_MUTABLE_NAME_MAX_SIZE]; @@ -43,35 +44,40 @@ enum ethash_io_rc ethash_io_prepare( goto end; } - // try to open the file - FILE* f = ethash_fopen(tmpfile, "rb+"); - if (f) { - size_t found_size; - if (!ethash_file_size(f, &found_size)) { - fclose(f); - goto free_memo; + FILE *f; + if (!force_create) { + // try to open the file + f = ethash_fopen(tmpfile, "rb+"); + if (f) { + size_t found_size; + if (!ethash_file_size(f, &found_size)) { + fclose(f); + goto free_memo; + } + if (file_size != found_size) { + fclose(f); + ret = ETHASH_IO_MEMO_SIZE_MISMATCH; + goto free_memo; + } + ret = ETHASH_IO_MEMO_MATCH; + goto set_file; } - if (file_size != found_size) { - fclose(f); - ret = ETHASH_IO_MEMO_SIZE_MISMATCH; - goto free_memo; - } - } else { - // file does not exist, will need to be created - f = ethash_fopen(tmpfile, "wb+"); - if (!f) { - goto free_memo; - } - // make sure it's of the proper size - if (fseek(f, file_size - 1, SEEK_SET) != 0) { - fclose(f); - goto free_memo; - } - fputc('\n', f); - fflush(f); - ret = ETHASH_IO_MEMO_MISMATCH; - goto set_file; } + + // file does not exist, will need to be created + f = ethash_fopen(tmpfile, "wb+"); + if (!f) { + goto free_memo; + } + // make sure it's of the proper size + if (fseek(f, file_size - 1, SEEK_SET) != 0) { + fclose(f); + goto free_memo; + } + fputc('\n', f); + fflush(f); + ret = ETHASH_IO_MEMO_MISMATCH; + goto set_file; ret = ETHASH_IO_MEMO_MATCH; set_file: diff --git a/io.h b/io.h index 0559377b1..d47dd83bb 100644 --- a/io.h +++ b/io.h @@ -69,13 +69,16 @@ enum ethash_io_rc { * mode, while on the case of mismatch a new file is created * on write mode * @param[in] file_size The size that the DAG file should have on disk + * @param[out] force_create If true then there is no check to see if the file + * already exists * @return For possible return values @see enum ethash_io_rc */ enum ethash_io_rc ethash_io_prepare( char const* dirname, ethash_h256_t const seedhash, FILE** output_file, - size_t file_size + size_t file_size, + bool force_create ); /** From d82b609449a2b3aa261c806bb3b564a1bd149f9f Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Tue, 28 Apr 2015 15:13:22 +0200 Subject: [PATCH 064/461] API changes requested by Gavin. - Following this spec: https://github.com/ethereum/wiki/wiki/Ethash-C-API - This breaks all but the cpp tests. OpenCL miner and go ethereum will be fixed in subsequent commits. --- ethash.h | 174 +++++---------------------------------------------- internal.c | 179 ++++++++++++++++++++++------------------------------- internal.h | 112 ++++++++++++++++++++++++++++++++- io.h | 16 ++++- io_posix.c | 30 ++++++--- io_win32.c | 30 ++++++--- 6 files changed, 262 insertions(+), 279 deletions(-) diff --git a/ethash.h b/ethash.h index a0860097e..83d4d569a 100644 --- a/ethash.h +++ b/ethash.h @@ -44,20 +44,6 @@ extern "C" { /// Type of a seedhash/blockhash e.t.c. typedef struct ethash_h256 { uint8_t b[32]; } ethash_h256_t; -static inline uint8_t ethash_h256_get(ethash_h256_t const* hash, unsigned int i) -{ - return hash->b[i]; -} - -static inline void ethash_h256_set(ethash_h256_t* hash, unsigned int i, uint8_t v) -{ - hash->b[i] = v; -} - -static inline void ethash_h256_reset(ethash_h256_t* hash) -{ - memset(hash, 0, 32); -} // convenience macro to statically initialize an h256_t // usage: @@ -76,42 +62,17 @@ typedef int(*ethash_callback_t)(unsigned); typedef struct ethash_return_value { ethash_h256_t result; ethash_h256_t mix_hash; + bool success; } ethash_return_value_t; -uint64_t ethash_get_datasize(uint64_t const block_number); -uint64_t ethash_get_cachesize(uint64_t const block_number); - -typedef struct ethash_cache { - void* mem; - uint64_t cache_size; -} ethash_cache_t; - -/** - * Allocate and initialize a new ethash_cache object - * - * @param cache_size The size of the cache in bytes - * @param seed Block seedhash to be used during the computation of the - * cache nodes - * @return Newly allocated ethash_cache on success or NULL in case of - * ERRNOMEM or invalid parameters used for @ref ethash_compute_cache_nodes() - */ -ethash_cache_t* ethash_cache_new(uint64_t cache_size, ethash_h256_t const* seed); -/** - * Frees a previously allocated ethash_cache - * @param c The object to free - */ -void ethash_cache_delete(ethash_cache_t* c); - /** * Allocate and initialize a new ethash_light handler * - * @param cache_size The size of the cache in bytes - * @param seed Block seedhash to be used during the computation of the - * cache nodes + * @param block_number The block number for which to create the handler * @return Newly allocated ethash_light handler or NULL in case of * ERRNOMEM or invalid parameters used for @ref ethash_compute_cache_nodes() */ -ethash_light_t ethash_light_new(uint64_t cache_size, ethash_h256_t const* seed); +ethash_light_t ethash_light_new(uint64_t const block_number); /** * Frees a previously allocated ethash_light handler * @param light The light handler to free @@ -120,48 +81,21 @@ void ethash_light_delete(ethash_light_t light); /** * Calculate the light client data * - * @param ret An object of ethash_return_value to hold the return value * @param light The light client handler - * @param full_size The size of the full data in bytes. * @param header_hash The header hash to pack into the mix * @param nonce The nonce to pack into the mix - * @return true if all went well and false if there were invalid - * parameters given. + * @return an object of ethash_return_value_t holding the return values */ -bool ethash_light_compute( - ethash_return_value_t* ret, +ethash_return_value_t ethash_light_compute( ethash_light_t light, - uint64_t full_size, - const ethash_h256_t* header_hash, + const ethash_h256_t header_hash, uint64_t const nonce ); -/** - * Get a pointer to the cache object held by the light client - * - * @param light The light client whose cache to request - * @return A pointer to the cache held by the light client or NULL if - * there was no cache in the first place - */ -ethash_cache_t* ethash_light_get_cache(ethash_light_t light); -/** - * Move the memory ownership of the cache somewhere else - * - * @param light The light client whose cache's memory ownership to acquire. - * After this function concludes it will no longer have a cache. - * @return A pointer to the moved cache or NULL if there was no cache in the first place - */ -ethash_cache_t* ethash_light_acquire_cache(ethash_light_t light); /** * Allocate and initialize a new ethash_full handler * - * @param dirname The directory in which to put the DAG file. - * @param seedhash The seed hash of the block. Used in the DAG file naming. - * @param full_size The size of the full data in bytes. - * @param cache A cache object to use that was allocated with @ref ethash_cache_new(). - * Iff this function succeeds the ethash_full_t will take memory - * memory ownership of the cache and free it at deletion. If - * not then the user still has to handle freeing of the cache himself. + * @param dirname The light handler containing the cache. * @param callback A callback function with signature of @ref ethash_callback_t * It accepts an unsigned with which a progress of DAG calculation * can be displayed. If all goes well the callback should return 0. @@ -169,13 +103,8 @@ ethash_cache_t* ethash_light_acquire_cache(ethash_light_t light); * @return Newly allocated ethash_full handler or NULL in case of * ERRNOMEM or invalid parameters used for @ref ethash_compute_full_data() */ -ethash_full_t ethash_full_new( - char const* dirname, - ethash_h256_t const* seed_hash, - uint64_t full_size, - ethash_cache_t const* cache, - ethash_callback_t callback -); +ethash_full_t ethash_full_new(ethash_light_t light, ethash_callback_t callback); + /** * Frees a previously allocated ethash_full handler * @param full The light handler to free @@ -184,98 +113,29 @@ void ethash_full_delete(ethash_full_t full); /** * Calculate the full client data * - * @param ret An object of ethash_return_value to hold the return value * @param full The full client handler * @param header_hash The header hash to pack into the mix * @param nonce The nonce to pack into the mix - * @return true if all went well and false if there were invalid - * parameters given or if there was a callback given and - * at some point return a non-zero value + * @return An object of ethash_return_value to hold the return value */ -bool ethash_full_compute( - ethash_return_value_t* ret, +ethash_return_value_t ethash_full_compute( ethash_full_t full, - ethash_h256_t const* header_hash, + ethash_h256_t const header_hash, uint64_t const nonce ); /** * Get a pointer to the full DAG data */ -void *ethash_full_data(ethash_full_t full); - -void ethash_get_seedhash(ethash_h256_t *seedhash, const uint32_t block_number); - -// Returns if hash is less than or equal to difficulty -static inline int ethash_check_difficulty( - ethash_h256_t const* hash, - ethash_h256_t const* difficulty -) -{ - // Difficulty is big endian - for (int i = 0; i < 32; i++) { - if (ethash_h256_get(hash, i) == ethash_h256_get(difficulty, i)) { - continue; - } - return ethash_h256_get(hash, i) < ethash_h256_get(difficulty, i); - } - return 1; -} - -int ethash_quick_check_difficulty( - ethash_h256_t const* header_hash, - uint64_t const nonce, - ethash_h256_t const* mix_hash, - ethash_h256_t const* difficulty -); - +void const* ethash_full_dag(ethash_full_t full); /** - * Compute the memory data for a full node's memory - * - * @param mem A pointer to an ethash full's memory - * @param full_size The size of the full data in bytes - * @param cache A cache object to use in the calculation - * @return true if all went fine and false for invalid parameters + * Get the size of the DAG data */ -bool ethash_compute_full_data(void* mem, uint64_t full_size, ethash_cache_t const* cache); - +uint64_t ethash_full_dag_size(ethash_full_t full); /** - * ========================= - * = DEPRECATED API = - * ========================= - * - * Kept for backwards compatibility with whoever still uses it. Please consider - * switching to the new API (look above) + * Calculate the seedhash for a given block number */ -typedef struct ethash_params { - /// Size of full data set (in bytes, multiple of mix size (128)). - uint64_t full_size; - /// Size of compute cache (in bytes, multiple of node size (64)). - uint64_t cache_size; -} ethash_params; - -// initialize the parameters -static inline void ethash_params_init(ethash_params* params, uint32_t const block_number) -{ - params->full_size = ethash_get_datasize(block_number); - params->cache_size = ethash_get_cachesize(block_number); -} - -void ethash_mkcache(ethash_cache_t* cache, ethash_params const* params, ethash_h256_t const* seed); -void ethash_full( - ethash_return_value_t* ret, - void const* full_mem, - ethash_params const* params, - ethash_h256_t const* header_hash, - uint64_t const nonce -); -void ethash_light( - ethash_return_value_t* ret, - ethash_cache_t const* cache, - ethash_params const* params, - ethash_h256_t const* header_hash, - uint64_t const nonce -); +void ethash_get_seedhash(ethash_h256_t *seedhash, uint64_t const block_number); #ifdef __cplusplus } diff --git a/internal.c b/internal.c index d5d7bfda2..c52ca773c 100644 --- a/internal.c +++ b/internal.c @@ -90,46 +90,14 @@ bool static ethash_compute_cache_nodes( return true; } -ethash_cache_t* ethash_cache_new(uint64_t cache_size, ethash_h256_t const* seed) -{ - ethash_cache_t* ret; - ret = malloc(sizeof(*ret)); - if (!ret) { - return NULL; - } - ret->mem = malloc((size_t)cache_size); - if (!ret->mem) { - goto fail_free_cache; - } - - node* nodes = (node*)ret->mem; - if (!ethash_compute_cache_nodes(nodes, cache_size, seed)) { - goto fail_free_cache_mem; - } - ret->cache_size = cache_size; - return ret; - -fail_free_cache_mem: - free(ret->mem); -fail_free_cache: - free(ret); - return NULL; -} - -void ethash_cache_delete(ethash_cache_t* c) -{ - free(c->mem); - free(c); -} - void ethash_calculate_dag_item( node* const ret, const unsigned node_index, - ethash_cache_t const* cache + ethash_light_t const light ) { - uint32_t num_parent_nodes = (uint32_t) (cache->cache_size / sizeof(node)); - node const* cache_nodes = (node const *) cache->mem; + uint32_t num_parent_nodes = (uint32_t) (light->cache_size / sizeof(node)); + node const* cache_nodes = (node const *) light->cache; node const* init = &cache_nodes[node_index % num_parent_nodes]; memcpy(ret, init, sizeof(node)); ret->words[0] ^= node_index; @@ -174,7 +142,7 @@ void ethash_calculate_dag_item( SHA3_512(ret->bytes, ret->bytes, sizeof(node)); } -bool ethash_compute_full_data(void* mem, uint64_t full_size, ethash_cache_t const* cache) +bool ethash_compute_full_data(void* mem, uint64_t full_size, ethash_light_t const light) { if (full_size % (sizeof(uint32_t) * MIX_WORDS) != 0 || (full_size % sizeof(node)) != 0) { @@ -183,7 +151,7 @@ bool ethash_compute_full_data(void* mem, uint64_t full_size, ethash_cache_t cons node* full_nodes = mem; // now compute full nodes for (unsigned n = 0; n != (full_size / sizeof(node)); ++n) { - ethash_calculate_dag_item(&(full_nodes[n]), n, cache); + ethash_calculate_dag_item(&(full_nodes[n]), n, light); } return true; } @@ -191,9 +159,9 @@ bool ethash_compute_full_data(void* mem, uint64_t full_size, ethash_cache_t cons static bool ethash_hash( ethash_return_value_t* ret, node const* full_nodes, - ethash_cache_t const* cache, + ethash_light_t const light, uint64_t full_size, - ethash_h256_t const* header_hash, + ethash_h256_t const header_hash, uint64_t const nonce, ethash_callback_t callback ) @@ -205,7 +173,7 @@ static bool ethash_hash( // pack hash and nonce together into first 40 bytes of s_mix assert(sizeof(node) * 8 == 512); node s_mix[MIX_NODES + 1]; - memcpy(s_mix[0].bytes, header_hash, 32); + memcpy(s_mix[0].bytes, &header_hash, 32); fix_endian64(s_mix[0].double_words[4], nonce); // compute sha3-512 hash and replicate across mix @@ -236,7 +204,7 @@ static bool ethash_hash( dag_node = &full_nodes[MIX_NODES * index + n]; } else { node tmp_node; - ethash_calculate_dag_item(&tmp_node, index * MIX_NODES + n, cache); + ethash_calculate_dag_item(&tmp_node, index * MIX_NODES + n, light); dag_node = &tmp_node; } @@ -295,7 +263,7 @@ void ethash_quick_hash( SHA3_256(return_hash, buf, 64 + 32); } -void ethash_get_seedhash(ethash_h256_t* seedhash, const uint32_t block_number) +void ethash_get_seedhash(ethash_h256_t* seedhash, uint64_t const block_number) { ethash_h256_reset(seedhash); const uint32_t epochs = block_number / ETHASH_EPOCH_LENGTH; @@ -316,44 +284,61 @@ int ethash_quick_check_difficulty( return ethash_check_difficulty(&return_hash, difficulty); } -ethash_light_t ethash_light_new(uint64_t cache_size, ethash_h256_t const* seed) +ethash_light_t ethash_light_new_internal(uint64_t cache_size, ethash_h256_t const* seed) { struct ethash_light *ret; ret = calloc(sizeof(*ret), 1); if (!ret) { return NULL; } - ret->cache = ethash_cache_new(cache_size, seed); + ret->cache = malloc((size_t)cache_size); if (!ret->cache) { goto fail_free_light; } + node* nodes = (node*)ret->cache; + if (!ethash_compute_cache_nodes(nodes, cache_size, seed)) { + goto fail_free_cache_mem; + } + ret->cache_size = cache_size; return ret; +fail_free_cache_mem: + free(ret->cache); fail_free_light: free(ret); return NULL; } +ethash_light_t ethash_light_new(uint64_t const block_number) +{ + ethash_h256_t seedhash; + ethash_light_t ret; + ethash_get_seedhash(&seedhash, block_number); + ret = ethash_light_new_internal(ethash_get_cachesize(block_number), &seedhash); + ret->block_number = block_number; + return ret; +} + void ethash_light_delete(ethash_light_t light) { if (light->cache) { - ethash_cache_delete(light->cache); + free(light->cache); } free(light); } -bool ethash_light_compute( +bool ethash_light_compute_internal( ethash_return_value_t* ret, ethash_light_t light, uint64_t full_size, - const ethash_h256_t* header_hash, + const ethash_h256_t header_hash, uint64_t const nonce ) { return ethash_hash( ret, NULL, - light->cache, + light, full_size, header_hash, nonce, @@ -361,18 +346,23 @@ bool ethash_light_compute( ); } -ethash_cache_t *ethash_light_get_cache(ethash_light_t light) -{ - return light->cache; -} - -ethash_cache_t *ethash_light_acquire_cache(ethash_light_t light) +ethash_return_value_t ethash_light_compute( + ethash_light_t light, + const ethash_h256_t header_hash, + uint64_t const nonce +) { - ethash_cache_t* ret = light->cache; - light->cache = 0; + ethash_return_value_t ret; + ret.success = true; + uint64_t full_size = ethash_get_datasize(light->block_number); + if (!ethash_light_compute_internal(&ret, light, full_size, header_hash, nonce)) { + ret.success = false; + } return ret; } + + static bool ethash_mmap(struct ethash_full* ret, FILE* f) { int fd; @@ -391,11 +381,11 @@ static bool ethash_mmap(struct ethash_full* ret, FILE* f) return ret->data != MAP_FAILED; } -ethash_full_t ethash_full_new( +ethash_full_t ethash_full_new_internal( char const* dirname, ethash_h256_t const* seed_hash, uint64_t full_size, - ethash_cache_t const* cache, + ethash_light_t const light, ethash_callback_t callback ) { @@ -427,7 +417,7 @@ ethash_full_t ethash_full_new( break; } - if (!ethash_compute_full_data(ret->data, full_size, cache)) { + if (!ethash_compute_full_data(ret->data, full_size, light)) { goto fail_free_full_data; } ret->callback = callback; @@ -443,6 +433,18 @@ fail_free_full: return NULL; } +ethash_full_t ethash_full_new(ethash_light_t light, ethash_callback_t callback) +{ + char strbuf[256]; + if (!ethash_get_default_dirname(strbuf, 256)) { + return NULL; + } + uint64_t full_size = ethash_get_datasize(light->block_number); + ethash_h256_t seedhash; + ethash_get_seedhash(&seedhash, light->block_number); + return ethash_full_new_internal(strbuf, &seedhash, full_size, light, callback); +} + void ethash_full_delete(ethash_full_t full) { // could check that munmap(..) == 0 but even if it did not can't really do anything here @@ -453,64 +455,33 @@ void ethash_full_delete(ethash_full_t full) free(full); } -bool ethash_full_compute( - ethash_return_value_t* ret, +ethash_return_value_t ethash_full_compute( ethash_full_t full, - ethash_h256_t const* header_hash, + ethash_h256_t const header_hash, uint64_t const nonce ) { - return ethash_hash( - ret, + ethash_return_value_t ret; + ret.success = true; + if (!ethash_hash( + &ret, (node const*)full->data, NULL, full->file_size, header_hash, nonce, - full->callback - ); -} - -void *ethash_full_data(ethash_full_t full) -{ - return full->data; + full->callback)) { + ret.success = false; + } + return ret; } -/** - * ========================= - * = DEPRECATED API = - * ========================= - * - * Kept for backwards compatibility with whoever still uses it. Please consider - * switching to the new API (look above) - */ -void ethash_mkcache( - ethash_cache_t* cache, - ethash_params const* params, - ethash_h256_t const* seed -) +void const* ethash_full_dag(ethash_full_t full) { - node* nodes = (node*) cache->mem; - ethash_compute_cache_nodes(nodes, params->cache_size, seed); + return full->data; } -void ethash_full( - ethash_return_value_t* ret, - void const* full_mem, - ethash_params const* params, - ethash_h256_t const* header_hash, - uint64_t const nonce -) -{ - ethash_hash(ret, (node const *) full_mem, NULL, params->full_size, header_hash, nonce, NULL); -} -void ethash_light( - ethash_return_value_t* ret, - ethash_cache_t const* cache, - ethash_params const* params, - ethash_h256_t const* header_hash, - uint64_t const nonce -) +uint64_t ethash_full_dag_size(ethash_full_t full) { - ethash_hash(ret, NULL, cache, params->full_size, header_hash, nonce, NULL); + return full->file_size; } diff --git a/internal.h b/internal.h index b5fcf71fe..bb622177d 100644 --- a/internal.h +++ b/internal.h @@ -31,10 +31,80 @@ typedef union node { } node; +static inline uint8_t ethash_h256_get(ethash_h256_t const* hash, unsigned int i) +{ + return hash->b[i]; +} + +static inline void ethash_h256_set(ethash_h256_t* hash, unsigned int i, uint8_t v) +{ + hash->b[i] = v; +} + +static inline void ethash_h256_reset(ethash_h256_t* hash) +{ + memset(hash, 0, 32); +} + +// Returns if hash is less than or equal to difficulty +static inline int ethash_check_difficulty( + ethash_h256_t const* hash, + ethash_h256_t const* difficulty +) +{ + // Difficulty is big endian + for (int i = 0; i < 32; i++) { + if (ethash_h256_get(hash, i) == ethash_h256_get(difficulty, i)) { + continue; + } + return ethash_h256_get(hash, i) < ethash_h256_get(difficulty, i); + } + return 1; +} + +int ethash_quick_check_difficulty( + ethash_h256_t const* header_hash, + uint64_t const nonce, + ethash_h256_t const* mix_hash, + ethash_h256_t const* difficulty +); + struct ethash_light { - ethash_cache_t* cache; + void* cache; + uint64_t cache_size; + uint64_t block_number; }; +/** + * Allocate and initialize a new ethash_light handler. Internal version + * + * @param cache_size The size of the cache in bytes + * @param seed Block seedhash to be used during the computation of the + * cache nodes + * @return Newly allocated ethash_light handler or NULL in case of + * ERRNOMEM or invalid parameters used for @ref ethash_compute_cache_nodes() + */ +ethash_light_t ethash_light_new_internal(uint64_t cache_size, ethash_h256_t const* seed); + +/** + * Calculate the light client data. Internal version. + * + * @param ret An object of ethash_return_value to hold the return value + * @param light The light client handler + * @param full_size The size of the full data in bytes. + * @param header_hash The header hash to pack into the mix + * @param nonce The nonce to pack into the mix + * @return true if all went well and false if there were invalid + * parameters given. + */ +bool ethash_light_compute_internal( + ethash_return_value_t* ret, + ethash_light_t light, + uint64_t full_size, + const ethash_h256_t header_hash, + uint64_t const nonce +); + struct ethash_full { FILE* file; uint64_t file_size; @@ -42,10 +112,35 @@ struct ethash_full { ethash_callback_t callback; }; +/** + * Allocate and initialize a new ethash_full handler. Internal version. + * + * @param dirname The directory in which to put the DAG file. + * @param seedhash The seed hash of the block. Used in the DAG file naming. + * @param full_size The size of the full data in bytes. + * @param cache A cache object to use that was allocated with @ref ethash_cache_new(). + * Iff this function succeeds the ethash_full_t will take memory + * memory ownership of the cache and free it at deletion. If + * not then the user still has to handle freeing of the cache himself. + * @param callback A callback function with signature of @ref ethash_callback_t + * It accepts an unsigned with which a progress of DAG calculation + * can be displayed. If all goes well the callback should return 0. + * If a non-zero value is returned then DAG generation will stop. + * @return Newly allocated ethash_full handler or NULL in case of + * ERRNOMEM or invalid parameters used for @ref ethash_compute_full_data() + */ +ethash_full_t ethash_full_new_internal( + char const* dirname, + ethash_h256_t const* seed_hash, + uint64_t full_size, + ethash_light_t const light, + ethash_callback_t callback +); + void ethash_calculate_dag_item( node* const ret, const unsigned node_index, - ethash_cache_t const* cache + ethash_light_t const cache ); void ethash_quick_hash( @@ -55,6 +150,19 @@ void ethash_quick_hash( ethash_h256_t const* mix_hash ); +uint64_t ethash_get_datasize(uint64_t const block_number); +uint64_t ethash_get_cachesize(uint64_t const block_number); + +/** + * Compute the memory data for a full node's memory + * + * @param mem A pointer to an ethash full's memory + * @param full_size The size of the full data in bytes + * @param cache A cache object to use in the calculation + * @return true if all went fine and false for invalid parameters + */ +bool ethash_compute_full_data(void* mem, uint64_t full_size, ethash_light_t const cache); + #ifdef __cplusplus } #endif diff --git a/io.h b/io.h index d47dd83bb..c4cebcda1 100644 --- a/io.h +++ b/io.h @@ -115,7 +115,7 @@ char* ethash_strncat(char* dest, size_t dest_size, char const* src, size_t count /** * A cross-platform mkdir wrapper to create a directory or assert it's there - * + * * @param dirname The full path of the directory to create * @return true if the directory was created or if it already * existed @@ -133,7 +133,7 @@ bool ethash_file_size(FILE* f, size_t* ret_size); /** * Get a file descriptor number from a FILE stream - * + * * @param f The file stream whose fd to get * @return Platform specific fd handler */ @@ -154,6 +154,18 @@ char* ethash_io_create_filename( size_t filename_length ); +/** + * Gets the default directory name for the DAG depending on the system + * + * The spec defining this directory is here: https://github.com/ethereum/wiki/wiki/Ethash-DAG + * + * @param[out] strbuf A string buffer of sufficient size to keep the + * null termninated string of the directory name + * @param[in] buffsize Size of @a strbuf in bytes + * @return true for success and false otherwise + */ +bool ethash_get_default_dirname(char* strbuf, size_t buffsize); + static inline bool ethash_io_mutable_name( uint32_t revision, ethash_h256_t const* seed_hash, diff --git a/io_posix.c b/io_posix.c index c16521d5a..0f5d2b082 100644 --- a/io_posix.c +++ b/io_posix.c @@ -55,10 +55,10 @@ char* ethash_io_create_filename( ) { size_t dirlen = strlen(dirname); - size_t dest_size = dirlen + filename_length + 1; - if (dirname[dirlen] != '/') { - dest_size += 1; - } + size_t dest_size = dirlen + filename_length + 1; + if (dirname[dirlen] != '/') { + dest_size += 1; + } char* name = malloc(dest_size); if (!name) { return NULL; @@ -66,9 +66,9 @@ char* ethash_io_create_filename( name[0] = '\0'; ethash_strncat(name, dest_size, dirname, dirlen); - if (dirname[dirlen] != '/') { - ethash_strncat(name, dest_size, "/", 1); - } + if (dirname[dirlen] != '/') { + ethash_strncat(name, dest_size, "/", 1); + } ethash_strncat(name, dest_size, filename, filename_length); return name; } @@ -83,3 +83,19 @@ bool ethash_file_size(FILE* f, size_t* ret_size) *ret_size = st.st_size; return true; } + +bool ethash_get_default_dirname(char* strbuf, size_t buffsize) +{ + strbuf[0] = '\n'; + char* home_dir = getenv("HOME"); + size_t len = strlen(home_dir); + if (!ethash_strncat(strbuf, buffsize, home_dir, len)) { + return false; + } + if (home_dir[len] != '/') { + if (!ethash_strncat(strbuf, buffsize, "/", 1)) { + return false; + } + } + return ethash_strncat(strbuf, buffsize, ".ethash/", 8); +} diff --git a/io_win32.c b/io_win32.c index d64362914..84a249883 100644 --- a/io_win32.c +++ b/io_win32.c @@ -55,10 +55,10 @@ char* ethash_io_create_filename( ) { size_t dirlen = strlen(dirname); - size_t dest_size = dirlen + filename_length + 1; - if (dirname[dirlen] != '\\' || dirname[dirlen] != '/') { - dest_size += 1; - } + size_t dest_size = dirlen + filename_length + 1; + if (dirname[dirlen] != '\\' || dirname[dirlen] != '/') { + dest_size += 1; + } char* name = malloc(dest_size); if (!name) { return NULL; @@ -66,9 +66,9 @@ char* ethash_io_create_filename( name[0] = '\0'; ethash_strncat(name, dest_size, dirname, dirlen); - if (dirname[dirlen] != '\\' || dirname[dirlen] != '/') { - ethash_strncat(name, dest_size, "\\", 1); - } + if (dirname[dirlen] != '\\' || dirname[dirlen] != '/') { + ethash_strncat(name, dest_size, "\\", 1); + } ethash_strncat(name, dest_size, filename, filename_length); return name; } @@ -83,3 +83,19 @@ bool ethash_file_size(FILE* f, size_t* ret_size) *ret_size = st.st_size; return true; } + +bool ethash_get_default_dirname(char* strbuf, size_t buffsize) +{ + strbuf[0] = '\n'; + if (!SUCCEEDED(SHGetFolderPathW(NULL, CSIDL_PROFILE, NULL, 0, (WCHAR*)strbuf))) { + return false; + } + if (!ethash_strncat(strbuf, buffsize, home_dir, len)) { + return false; + } + if (!ethash_strncat(strbuf, buffsize, "\\", 1)) { + return false; + } + + return ethash_strncat(strbuf, buffsize, "Appdata\\Ethash\\", 14); +} From 6e5598412b6f61889c97db4b4f5278ed6e797313 Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Tue, 28 Apr 2015 15:53:49 +0200 Subject: [PATCH 065/461] Fixes for $HOME in Windows --- io_win32.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/io_win32.c b/io_win32.c index 84a249883..15da9fa58 100644 --- a/io_win32.c +++ b/io_win32.c @@ -25,6 +25,7 @@ #include #include #include +#include FILE* ethash_fopen(char const* file_name, char const* mode) { @@ -90,9 +91,6 @@ bool ethash_get_default_dirname(char* strbuf, size_t buffsize) if (!SUCCEEDED(SHGetFolderPathW(NULL, CSIDL_PROFILE, NULL, 0, (WCHAR*)strbuf))) { return false; } - if (!ethash_strncat(strbuf, buffsize, home_dir, len)) { - return false; - } if (!ethash_strncat(strbuf, buffsize, "\\", 1)) { return false; } From 17ec0c7559824b667d0848188e8223e7b7ee90de Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Tue, 28 Apr 2015 18:07:10 +0200 Subject: [PATCH 066/461] ethash_get_seedhash() now returns the seedhash value - plus removing const from PoD. --- ethash.h | 28 ++++++++++++++-------------- internal.c | 20 ++++++++++---------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/ethash.h b/ethash.h index 83d4d569a..ea94fd762 100644 --- a/ethash.h +++ b/ethash.h @@ -68,11 +68,11 @@ typedef struct ethash_return_value { /** * Allocate and initialize a new ethash_light handler * - * @param block_number The block number for which to create the handler - * @return Newly allocated ethash_light handler or NULL in case of - * ERRNOMEM or invalid parameters used for @ref ethash_compute_cache_nodes() + * @param block_number The block number for which to create the handler + * @return Newly allocated ethash_light handler or NULL in case of + * ERRNOMEM or invalid parameters used for @ref ethash_compute_cache_nodes() */ -ethash_light_t ethash_light_new(uint64_t const block_number); +ethash_light_t ethash_light_new(uint64_t block_number); /** * Frees a previously allocated ethash_light handler * @param light The light handler to free @@ -89,19 +89,19 @@ void ethash_light_delete(ethash_light_t light); ethash_return_value_t ethash_light_compute( ethash_light_t light, const ethash_h256_t header_hash, - uint64_t const nonce + uint64_t nonce ); /** * Allocate and initialize a new ethash_full handler * - * @param dirname The light handler containing the cache. - * @param callback A callback function with signature of @ref ethash_callback_t - * It accepts an unsigned with which a progress of DAG calculation - * can be displayed. If all goes well the callback should return 0. - * If a non-zero value is returned then DAG generation will stop. - * @return Newly allocated ethash_full handler or NULL in case of - * ERRNOMEM or invalid parameters used for @ref ethash_compute_full_data() + * @param light The light handler containing the cache. + * @param callback A callback function with signature of @ref ethash_callback_t + * It accepts an unsigned with which a progress of DAG calculation + * can be displayed. If all goes well the callback should return 0. + * If a non-zero value is returned then DAG generation will stop. + * @return Newly allocated ethash_full handler or NULL in case of + * ERRNOMEM or invalid parameters used for @ref ethash_compute_full_data() */ ethash_full_t ethash_full_new(ethash_light_t light, ethash_callback_t callback); @@ -121,7 +121,7 @@ void ethash_full_delete(ethash_full_t full); ethash_return_value_t ethash_full_compute( ethash_full_t full, ethash_h256_t const header_hash, - uint64_t const nonce + uint64_t nonce ); /** * Get a pointer to the full DAG data @@ -135,7 +135,7 @@ uint64_t ethash_full_dag_size(ethash_full_t full); /** * Calculate the seedhash for a given block number */ -void ethash_get_seedhash(ethash_h256_t *seedhash, uint64_t const block_number); +ethash_h256_t ethash_get_seedhash(uint64_t block_number); #ifdef __cplusplus } diff --git a/internal.c b/internal.c index c52ca773c..9e6d3a9eb 100644 --- a/internal.c +++ b/internal.c @@ -263,12 +263,14 @@ void ethash_quick_hash( SHA3_256(return_hash, buf, 64 + 32); } -void ethash_get_seedhash(ethash_h256_t* seedhash, uint64_t const block_number) +ethash_h256_t ethash_get_seedhash(uint64_t block_number) { - ethash_h256_reset(seedhash); + ethash_h256_t ret; + ethash_h256_reset(&ret); const uint32_t epochs = block_number / ETHASH_EPOCH_LENGTH; for (uint32_t i = 0; i < epochs; ++i) - SHA3_256(seedhash, (uint8_t*)seedhash, 32); + SHA3_256(&ret, (uint8_t*)&ret, 32); + return ret; } int ethash_quick_check_difficulty( @@ -309,11 +311,10 @@ fail_free_light: return NULL; } -ethash_light_t ethash_light_new(uint64_t const block_number) +ethash_light_t ethash_light_new(uint64_t block_number) { - ethash_h256_t seedhash; + ethash_h256_t seedhash = ethash_get_seedhash(block_number); ethash_light_t ret; - ethash_get_seedhash(&seedhash, block_number); ret = ethash_light_new_internal(ethash_get_cachesize(block_number), &seedhash); ret->block_number = block_number; return ret; @@ -332,7 +333,7 @@ bool ethash_light_compute_internal( ethash_light_t light, uint64_t full_size, const ethash_h256_t header_hash, - uint64_t const nonce + uint64_t nonce ) { return ethash_hash( @@ -440,8 +441,7 @@ ethash_full_t ethash_full_new(ethash_light_t light, ethash_callback_t callback) return NULL; } uint64_t full_size = ethash_get_datasize(light->block_number); - ethash_h256_t seedhash; - ethash_get_seedhash(&seedhash, light->block_number); + ethash_h256_t seedhash = ethash_get_seedhash(light->block_number); return ethash_full_new_internal(strbuf, &seedhash, full_size, light, callback); } @@ -458,7 +458,7 @@ void ethash_full_delete(ethash_full_t full) ethash_return_value_t ethash_full_compute( ethash_full_t full, ethash_h256_t const header_hash, - uint64_t const nonce + uint64_t nonce ) { ethash_return_value_t ret; From 274720c7cf6660207b5c0eb2ad93606401306a59 Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Wed, 29 Apr 2015 12:33:01 +0200 Subject: [PATCH 067/461] Clearly specify the platform where utils.c is used --- CMakeLists.txt | 2 +- util.c => util_win32.c | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename util.c => util_win32.c (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4875dcf77..a65621c3e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,7 @@ set(FILES util.h data_sizes.h) if (MSVC) - list(APPEND FILES util.c io_win32.c mmap_win32.c) + list(APPEND FILES util_win32.c io_win32.c mmap_win32.c) else() list(APPEND FILES io_posix.c) endif() diff --git a/util.c b/util_win32.c similarity index 100% rename from util.c rename to util_win32.c From f786d231fc3bc73b5bdeb4aecb8ce8e6c8106dc8 Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Wed, 29 Apr 2015 12:56:11 +0200 Subject: [PATCH 068/461] Use internal API in GO bridge - Also proper place of const in some C function signatures --- ethash.h | 2 +- internal.c | 4 ++-- internal.h | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ethash.h b/ethash.h index ea94fd762..b8ad2255a 100644 --- a/ethash.h +++ b/ethash.h @@ -88,7 +88,7 @@ void ethash_light_delete(ethash_light_t light); */ ethash_return_value_t ethash_light_compute( ethash_light_t light, - const ethash_h256_t header_hash, + ethash_h256_t const header_hash, uint64_t nonce ); diff --git a/internal.c b/internal.c index 9e6d3a9eb..3d598a26c 100644 --- a/internal.c +++ b/internal.c @@ -332,7 +332,7 @@ bool ethash_light_compute_internal( ethash_return_value_t* ret, ethash_light_t light, uint64_t full_size, - const ethash_h256_t header_hash, + ethash_h256_t const header_hash, uint64_t nonce ) { @@ -349,7 +349,7 @@ bool ethash_light_compute_internal( ethash_return_value_t ethash_light_compute( ethash_light_t light, - const ethash_h256_t header_hash, + ethash_h256_t const header_hash, uint64_t const nonce ) { diff --git a/internal.h b/internal.h index bb622177d..a73b5ad30 100644 --- a/internal.h +++ b/internal.h @@ -101,7 +101,7 @@ bool ethash_light_compute_internal( ethash_return_value_t* ret, ethash_light_t light, uint64_t full_size, - const ethash_h256_t header_hash, + ethash_h256_t const header_hash, uint64_t const nonce ); From 0d14f005a5089b0449810dc0e265a8b1baa5f111 Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Thu, 30 Apr 2015 13:30:43 +0200 Subject: [PATCH 069/461] Fix DAG size in GObridge and callback location in C --- internal.c | 33 +++++++++++++++++---------------- internal.h | 9 +++++++-- 2 files changed, 24 insertions(+), 18 deletions(-) diff --git a/internal.c b/internal.c index 3d598a26c..adc842fce 100644 --- a/internal.c +++ b/internal.c @@ -142,15 +142,27 @@ void ethash_calculate_dag_item( SHA3_512(ret->bytes, ret->bytes, sizeof(node)); } -bool ethash_compute_full_data(void* mem, uint64_t full_size, ethash_light_t const light) +bool ethash_compute_full_data( + void* mem, + uint64_t full_size, + ethash_light_t const light, + ethash_callback_t callback +) { if (full_size % (sizeof(uint32_t) * MIX_WORDS) != 0 || (full_size % sizeof(node)) != 0) { return false; } node* full_nodes = mem; + double const progress_change = 1.0f / (full_size / sizeof(node)); + double progress = 0.0f; // now compute full nodes for (unsigned n = 0; n != (full_size / sizeof(node)); ++n) { + if (callback && + callback((unsigned int)(ceil(progress * 100.0f))) != 0) { + return false; + } + progress += progress_change; ethash_calculate_dag_item(&(full_nodes[n]), n, light); } return true; @@ -162,8 +174,7 @@ static bool ethash_hash( ethash_light_t const light, uint64_t full_size, ethash_h256_t const header_hash, - uint64_t const nonce, - ethash_callback_t callback + uint64_t const nonce ) { if (full_size % MIX_WORDS != 0) { @@ -188,18 +199,11 @@ static bool ethash_hash( unsigned const page_size = sizeof(uint32_t) * MIX_WORDS; unsigned const num_full_pages = (unsigned) (full_size / page_size); - double const progress_change = 1.0f / ETHASH_ACCESSES / MIX_NODES; - double progress = 0.0f; for (unsigned i = 0; i != ETHASH_ACCESSES; ++i) { uint32_t const index = ((s_mix->words[0] ^ i) * FNV_PRIME ^ mix->words[i % MIX_WORDS]) % num_full_pages; for (unsigned n = 0; n != MIX_NODES; ++n) { node const* dag_node; - if (callback && - callback((unsigned int)(ceil(progress * 100.0f))) != 0) { - return false; - } - progress += progress_change; if (full_nodes) { dag_node = &full_nodes[MIX_NODES * index + n]; } else { @@ -342,8 +346,7 @@ bool ethash_light_compute_internal( light, full_size, header_hash, - nonce, - NULL + nonce ); } @@ -418,10 +421,9 @@ ethash_full_t ethash_full_new_internal( break; } - if (!ethash_compute_full_data(ret->data, full_size, light)) { + if (!ethash_compute_full_data(ret->data, full_size, light, callback)) { goto fail_free_full_data; } - ret->callback = callback; return ret; fail_free_full_data: @@ -469,8 +471,7 @@ ethash_return_value_t ethash_full_compute( NULL, full->file_size, header_hash, - nonce, - full->callback)) { + nonce)) { ret.success = false; } return ret; diff --git a/internal.h b/internal.h index a73b5ad30..779b6d2d5 100644 --- a/internal.h +++ b/internal.h @@ -109,7 +109,6 @@ struct ethash_full { FILE* file; uint64_t file_size; node* data; - ethash_callback_t callback; }; /** @@ -159,9 +158,15 @@ uint64_t ethash_get_cachesize(uint64_t const block_number); * @param mem A pointer to an ethash full's memory * @param full_size The size of the full data in bytes * @param cache A cache object to use in the calculation + * @param callback The callback function. Check @ref ethash_full_new() for details. * @return true if all went fine and false for invalid parameters */ -bool ethash_compute_full_data(void* mem, uint64_t full_size, ethash_light_t const cache); +bool ethash_compute_full_data( + void* mem, + uint64_t full_size, + ethash_light_t const light, + ethash_callback_t callback +); #ifdef __cplusplus } From 47bf6d7b523283e3d8e556ddd98be4ef580ebc5f Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Thu, 30 Apr 2015 18:37:39 +0200 Subject: [PATCH 070/461] Add Magic number to DAG file after completion for verification - There could be a situation where there can be an incomplete file left on disk. We need to protect ourselves from this. So we add a special magic number at the beginnign of the DAG after completion. --- ethash.h | 2 ++ internal.c | 21 ++++++++++++++++++--- io.c | 17 +++++++++++++++-- 3 files changed, 35 insertions(+), 5 deletions(-) diff --git a/ethash.h b/ethash.h index b8ad2255a..50f4aaaca 100644 --- a/ethash.h +++ b/ethash.h @@ -37,6 +37,8 @@ #define ETHASH_DATASET_PARENTS 256 #define ETHASH_CACHE_ROUNDS 3 #define ETHASH_ACCESSES 64 +#define ETHASH_DAG_MAGIC_NUM_SIZE 8 +#define ETHASH_DAG_MAGIC_NUM 0xFEE1DEADBADDCAFE #ifdef __cplusplus extern "C" { diff --git a/internal.c b/internal.c index adc842fce..b0991b9ea 100644 --- a/internal.c +++ b/internal.c @@ -370,19 +370,24 @@ ethash_return_value_t ethash_light_compute( static bool ethash_mmap(struct ethash_full* ret, FILE* f) { int fd; + void* mmapped_data; ret->file = f; if ((fd = ethash_fileno(ret->file)) == -1) { return false; } - ret->data = mmap( + mmapped_data= mmap( NULL, - (size_t)ret->file_size, + (size_t)ret->file_size + ETHASH_DAG_MAGIC_NUM_SIZE, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0 ); - return ret->data != MAP_FAILED; + if (mmapped_data == MAP_FAILED) { + return false; + } + ret->data = mmapped_data + ETHASH_DAG_MAGIC_NUM_SIZE; + return true; } ethash_full_t ethash_full_new_internal( @@ -424,6 +429,16 @@ ethash_full_t ethash_full_new_internal( if (!ethash_compute_full_data(ret->data, full_size, light, callback)) { goto fail_free_full_data; } + + // after the DAG has been filled then we finalize it by writting the magic number at the beginning + if (fseek(f, 0, SEEK_SET) != 0) { + goto fail_free_full_data; + } + uint64_t const magic_num = ETHASH_DAG_MAGIC_NUM; + if (fwrite(&magic_num, ETHASH_DAG_MAGIC_NUM_SIZE, 1, f) != 1) { + goto fail_free_full_data; + } + fflush(f); // make sure the magic number IS there return ret; fail_free_full_data: diff --git a/io.c b/io.c index 6694e17a3..8568754ef 100644 --- a/io.c +++ b/io.c @@ -54,7 +54,20 @@ enum ethash_io_rc ethash_io_prepare( fclose(f); goto free_memo; } - if (file_size != found_size) { + if (file_size != found_size - ETHASH_DAG_MAGIC_NUM_SIZE) { + fclose(f); + ret = ETHASH_IO_MEMO_SIZE_MISMATCH; + goto free_memo; + } + // compare the magic number, no need to care about endianess since it's local + uint64_t magic_num; + if (fread(&magic_num, ETHASH_DAG_MAGIC_NUM_SIZE, 1, f) != 1) { + // I/O error + fclose(f); + ret = ETHASH_IO_MEMO_SIZE_MISMATCH; + goto free_memo; + } + if (magic_num != ETHASH_DAG_MAGIC_NUM) { fclose(f); ret = ETHASH_IO_MEMO_SIZE_MISMATCH; goto free_memo; @@ -70,7 +83,7 @@ enum ethash_io_rc ethash_io_prepare( goto free_memo; } // make sure it's of the proper size - if (fseek(f, file_size - 1, SEEK_SET) != 0) { + if (fseek(f, file_size + ETHASH_DAG_MAGIC_NUM_SIZE - 1, SEEK_SET) != 0) { fclose(f); goto free_memo; } From 377fe9cbd81337374af7228e0b5c5bc787d08f35 Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Fri, 1 May 2015 00:14:39 +0200 Subject: [PATCH 071/461] Callback will now be called only 100 times pes DAG creation --- ethash.h | 3 +++ internal.c | 11 +++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ethash.h b/ethash.h index 50f4aaaca..9bb48fcf6 100644 --- a/ethash.h +++ b/ethash.h @@ -102,6 +102,9 @@ ethash_return_value_t ethash_light_compute( * It accepts an unsigned with which a progress of DAG calculation * can be displayed. If all goes well the callback should return 0. * If a non-zero value is returned then DAG generation will stop. + * Be advised. A progress value of 100 means that DAG creation is + * almost complete and that this function will soon return succesfully. + * It does not mean that the function has already had a succesfull return. * @return Newly allocated ethash_full handler or NULL in case of * ERRNOMEM or invalid parameters used for @ref ethash_compute_full_data() */ diff --git a/internal.c b/internal.c index b0991b9ea..eb075c9db 100644 --- a/internal.c +++ b/internal.c @@ -153,14 +153,17 @@ bool ethash_compute_full_data( (full_size % sizeof(node)) != 0) { return false; } + unsigned int const max_n = full_size / sizeof(node); node* full_nodes = mem; - double const progress_change = 1.0f / (full_size / sizeof(node)); + double const progress_change = 1.0f / max_n; double progress = 0.0f; // now compute full nodes - for (unsigned n = 0; n != (full_size / sizeof(node)); ++n) { + for (unsigned n = 0; n != max_n; ++n) { if (callback && - callback((unsigned int)(ceil(progress * 100.0f))) != 0) { - return false; + n % (max_n / 100) == 0 && + callback((unsigned int)(ceil(progress * 100.0f))) != 0) { + + return false; } progress += progress_change; ethash_calculate_dag_item(&(full_nodes[n]), n, light); From a6a882c57a7bb093ae428a75d604167a98ba1816 Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Fri, 1 May 2015 00:15:25 +0200 Subject: [PATCH 072/461] Test of ethash_get_default_dirname() and bug fix --- io_posix.c | 2 +- io_win32.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/io_posix.c b/io_posix.c index 0f5d2b082..f31d738e4 100644 --- a/io_posix.c +++ b/io_posix.c @@ -86,7 +86,7 @@ bool ethash_file_size(FILE* f, size_t* ret_size) bool ethash_get_default_dirname(char* strbuf, size_t buffsize) { - strbuf[0] = '\n'; + strbuf[0] = '\0'; char* home_dir = getenv("HOME"); size_t len = strlen(home_dir); if (!ethash_strncat(strbuf, buffsize, home_dir, len)) { diff --git a/io_win32.c b/io_win32.c index 15da9fa58..021aff9c9 100644 --- a/io_win32.c +++ b/io_win32.c @@ -87,7 +87,7 @@ bool ethash_file_size(FILE* f, size_t* ret_size) bool ethash_get_default_dirname(char* strbuf, size_t buffsize) { - strbuf[0] = '\n'; + strbuf[0] = '\0'; if (!SUCCEEDED(SHGetFolderPathW(NULL, CSIDL_PROFILE, NULL, 0, (WCHAR*)strbuf))) { return false; } From df2687e51708a952d097d9a70777169c5e7e49df Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Fri, 1 May 2015 00:36:44 +0200 Subject: [PATCH 073/461] Addressing MSVC compile error and warnings --- ethash.h | 2 +- internal.c | 18 +++++++++--------- internal.h | 4 ++-- io.c | 2 +- io.h | 2 +- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/ethash.h b/ethash.h index 9bb48fcf6..0c6a1f9e9 100644 --- a/ethash.h +++ b/ethash.h @@ -91,7 +91,7 @@ void ethash_light_delete(ethash_light_t light); ethash_return_value_t ethash_light_compute( ethash_light_t light, ethash_h256_t const header_hash, - uint64_t nonce + uint64_t nonce ); /** diff --git a/internal.c b/internal.c index eb075c9db..9b8fa8f9e 100644 --- a/internal.c +++ b/internal.c @@ -92,7 +92,7 @@ bool static ethash_compute_cache_nodes( void ethash_calculate_dag_item( node* const ret, - const unsigned node_index, + uint64_t node_index, ethash_light_t const light ) { @@ -153,12 +153,12 @@ bool ethash_compute_full_data( (full_size % sizeof(node)) != 0) { return false; } - unsigned int const max_n = full_size / sizeof(node); + uint64_t const max_n = full_size / sizeof(node); node* full_nodes = mem; double const progress_change = 1.0f / max_n; double progress = 0.0f; // now compute full nodes - for (unsigned n = 0; n != max_n; ++n) { + for (uint64_t n = 0; n != max_n; ++n) { if (callback && n % (max_n / 100) == 0 && callback((unsigned int)(ceil(progress * 100.0f))) != 0) { @@ -203,7 +203,7 @@ static bool ethash_hash( unsigned const num_full_pages = (unsigned) (full_size / page_size); for (unsigned i = 0; i != ETHASH_ACCESSES; ++i) { - uint32_t const index = ((s_mix->words[0] ^ i) * FNV_PRIME ^ mix->words[i % MIX_WORDS]) % num_full_pages; + uint64_t const index = ((s_mix->words[0] ^ i) * FNV_PRIME ^ mix->words[i % MIX_WORDS]) % num_full_pages; for (unsigned n = 0; n != MIX_NODES; ++n) { node const* dag_node; @@ -274,7 +274,7 @@ ethash_h256_t ethash_get_seedhash(uint64_t block_number) { ethash_h256_t ret; ethash_h256_reset(&ret); - const uint32_t epochs = block_number / ETHASH_EPOCH_LENGTH; + uint64_t const epochs = block_number / ETHASH_EPOCH_LENGTH; for (uint32_t i = 0; i < epochs; ++i) SHA3_256(&ret, (uint8_t*)&ret, 32); return ret; @@ -356,7 +356,7 @@ bool ethash_light_compute_internal( ethash_return_value_t ethash_light_compute( ethash_light_t light, ethash_h256_t const header_hash, - uint64_t const nonce + uint64_t nonce ) { ethash_return_value_t ret; @@ -373,7 +373,7 @@ ethash_return_value_t ethash_light_compute( static bool ethash_mmap(struct ethash_full* ret, FILE* f) { int fd; - void* mmapped_data; + char* mmapped_data; ret->file = f; if ((fd = ethash_fileno(ret->file)) == -1) { return false; @@ -389,7 +389,7 @@ static bool ethash_mmap(struct ethash_full* ret, FILE* f) if (mmapped_data == MAP_FAILED) { return false; } - ret->data = mmapped_data + ETHASH_DAG_MAGIC_NUM_SIZE; + ret->data = (node*)(mmapped_data + ETHASH_DAG_MAGIC_NUM_SIZE); return true; } @@ -468,7 +468,7 @@ ethash_full_t ethash_full_new(ethash_light_t light, ethash_callback_t callback) void ethash_full_delete(ethash_full_t full) { // could check that munmap(..) == 0 but even if it did not can't really do anything here - munmap(full->data, full->file_size); + munmap(full->data, (size_t)full->file_size); if (full->file) { fclose(full->file); } diff --git a/internal.h b/internal.h index 779b6d2d5..2209589b8 100644 --- a/internal.h +++ b/internal.h @@ -102,7 +102,7 @@ bool ethash_light_compute_internal( ethash_light_t light, uint64_t full_size, ethash_h256_t const header_hash, - uint64_t const nonce + uint64_t nonce ); struct ethash_full { @@ -138,7 +138,7 @@ ethash_full_t ethash_full_new_internal( void ethash_calculate_dag_item( node* const ret, - const unsigned node_index, + uint64_t node_index, ethash_light_t const cache ); diff --git a/io.c b/io.c index 8568754ef..be2fbde84 100644 --- a/io.c +++ b/io.c @@ -26,7 +26,7 @@ enum ethash_io_rc ethash_io_prepare( char const* dirname, ethash_h256_t const seedhash, FILE** output_file, - size_t file_size, + uint64_t file_size, bool force_create ) { diff --git a/io.h b/io.h index c4cebcda1..26c82f111 100644 --- a/io.h +++ b/io.h @@ -77,7 +77,7 @@ enum ethash_io_rc ethash_io_prepare( char const* dirname, ethash_h256_t const seedhash, FILE** output_file, - size_t file_size, + uint64_t file_size, bool force_create ); From e9c11a143ede5d5419c2977dfe62a6dc4d9f7dc0 Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Mon, 4 May 2015 13:21:01 +0200 Subject: [PATCH 074/461] Switching node indices to uint32_t to get the old behaviour back --- internal.c | 12 ++++++------ internal.h | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/internal.c b/internal.c index 9b8fa8f9e..a0dd8b46b 100644 --- a/internal.c +++ b/internal.c @@ -69,16 +69,16 @@ bool static ethash_compute_cache_nodes( SHA3_512(nodes[0].bytes, (uint8_t*)seed, 32); - for (unsigned i = 1; i != num_nodes; ++i) { + for (uint32_t i = 1; i != num_nodes; ++i) { SHA3_512(nodes[i].bytes, nodes[i - 1].bytes, 64); } - for (unsigned j = 0; j != ETHASH_CACHE_ROUNDS; j++) { - for (unsigned i = 0; i != num_nodes; i++) { + for (uint32_t j = 0; j != ETHASH_CACHE_ROUNDS; j++) { + for (uint32_t i = 0; i != num_nodes; i++) { uint32_t const idx = nodes[i].words[0] % num_nodes; node data; data = nodes[(num_nodes - 1 + i) % num_nodes]; - for (unsigned w = 0; w != NODE_WORDS; ++w) { + for (uint32_t w = 0; w != NODE_WORDS; ++w) { data.words[w] ^= nodes[idx].words[w]; } SHA3_512(nodes[i].bytes, data.bytes, sizeof(data)); @@ -92,7 +92,7 @@ bool static ethash_compute_cache_nodes( void ethash_calculate_dag_item( node* const ret, - uint64_t node_index, + uint32_t node_index, ethash_light_t const light ) { @@ -110,7 +110,7 @@ void ethash_calculate_dag_item( __m128i xmm3 = ret->xmm[3]; #endif - for (unsigned i = 0; i != ETHASH_DATASET_PARENTS; ++i) { + for (uint32_t i = 0; i != ETHASH_DATASET_PARENTS; ++i) { uint32_t parent_index = ((node_index ^ i) * FNV_PRIME ^ ret->words[i % NODE_WORDS]) % num_parent_nodes; node const *parent = &cache_nodes[parent_index]; diff --git a/internal.h b/internal.h index 2209589b8..a2fa60e9f 100644 --- a/internal.h +++ b/internal.h @@ -138,7 +138,7 @@ ethash_full_t ethash_full_new_internal( void ethash_calculate_dag_item( node* const ret, - uint64_t node_index, + uint32_t node_index, ethash_light_t const cache ); From d3396ec513c34e0bf69a6281af7f19d446b56990 Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Mon, 4 May 2015 14:13:07 +0200 Subject: [PATCH 075/461] ethash.go, libethash: pass hashes and return values on the stack Passing Go pointers into C is not safe. See https://golang.org/issue/8310 for more background. This commit removes uses like the ones below and passes hashes and return values on the stack instead. var h common.Hash C.function(&h[0], ...) var ret C.struct_ethash_return_value C.function(&ret) This requires changes in the internal C API. --- internal.c | 34 ++++++++++++---------------------- internal.h | 9 +++------ 2 files changed, 15 insertions(+), 28 deletions(-) diff --git a/internal.c b/internal.c index a0dd8b46b..afa04971f 100644 --- a/internal.c +++ b/internal.c @@ -335,22 +335,19 @@ void ethash_light_delete(ethash_light_t light) free(light); } -bool ethash_light_compute_internal( - ethash_return_value_t* ret, +ethash_return_value_t ethash_light_compute_internal( ethash_light_t light, uint64_t full_size, ethash_h256_t const header_hash, uint64_t nonce ) { - return ethash_hash( - ret, - NULL, - light, - full_size, - header_hash, - nonce - ); + ethash_return_value_t ret; + ret.success = true; + if (!ethash_hash(&ret, NULL, light, full_size, header_hash, nonce)) { + ret.success = false; + } + return ret; } ethash_return_value_t ethash_light_compute( @@ -359,17 +356,10 @@ ethash_return_value_t ethash_light_compute( uint64_t nonce ) { - ethash_return_value_t ret; - ret.success = true; uint64_t full_size = ethash_get_datasize(light->block_number); - if (!ethash_light_compute_internal(&ret, light, full_size, header_hash, nonce)) { - ret.success = false; - } - return ret; + return ethash_light_compute_internal(light, full_size, header_hash, nonce); } - - static bool ethash_mmap(struct ethash_full* ret, FILE* f) { int fd; @@ -395,7 +385,7 @@ static bool ethash_mmap(struct ethash_full* ret, FILE* f) ethash_full_t ethash_full_new_internal( char const* dirname, - ethash_h256_t const* seed_hash, + ethash_h256_t const seed_hash, uint64_t full_size, ethash_light_t const light, ethash_callback_t callback @@ -408,7 +398,7 @@ ethash_full_t ethash_full_new_internal( return NULL; } ret->file_size = (size_t)full_size; - switch (ethash_io_prepare(dirname, *seed_hash, &f, (size_t)full_size, false)) { + switch (ethash_io_prepare(dirname, seed_hash, &f, (size_t)full_size, false)) { case ETHASH_IO_FAIL: goto fail_free_full; case ETHASH_IO_MEMO_MATCH: @@ -418,7 +408,7 @@ ethash_full_t ethash_full_new_internal( return ret; case ETHASH_IO_MEMO_SIZE_MISMATCH: // if a DAG of same filename but unexpected size is found, silently force new file creation - if (ethash_io_prepare(dirname, *seed_hash, &f, (size_t)full_size, true) != ETHASH_IO_MEMO_MISMATCH) { + if (ethash_io_prepare(dirname, seed_hash, &f, (size_t)full_size, true) != ETHASH_IO_MEMO_MISMATCH) { goto fail_free_full; } // fallthrough to the mismatch case here, DO NOT go through match @@ -462,7 +452,7 @@ ethash_full_t ethash_full_new(ethash_light_t light, ethash_callback_t callback) } uint64_t full_size = ethash_get_datasize(light->block_number); ethash_h256_t seedhash = ethash_get_seedhash(light->block_number); - return ethash_full_new_internal(strbuf, &seedhash, full_size, light, callback); + return ethash_full_new_internal(strbuf, seedhash, full_size, light, callback); } void ethash_full_delete(ethash_full_t full) diff --git a/internal.h b/internal.h index a2fa60e9f..221ff290a 100644 --- a/internal.h +++ b/internal.h @@ -89,16 +89,13 @@ ethash_light_t ethash_light_new_internal(uint64_t cache_size, ethash_h256_t cons /** * Calculate the light client data. Internal version. * - * @param ret An object of ethash_return_value to hold the return value * @param light The light client handler * @param full_size The size of the full data in bytes. * @param header_hash The header hash to pack into the mix * @param nonce The nonce to pack into the mix - * @return true if all went well and false if there were invalid - * parameters given. + * @return The resulting hash. */ -bool ethash_light_compute_internal( - ethash_return_value_t* ret, +ethash_return_value_t ethash_light_compute_internal( ethash_light_t light, uint64_t full_size, ethash_h256_t const header_hash, @@ -130,7 +127,7 @@ struct ethash_full { */ ethash_full_t ethash_full_new_internal( char const* dirname, - ethash_h256_t const* seed_hash, + ethash_h256_t const seed_hash, uint64_t full_size, ethash_light_t const light, ethash_callback_t callback From 54dce65fa12e3d1a216f5b964c775dc3806d6ee5 Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Mon, 4 May 2015 15:03:58 +0200 Subject: [PATCH 076/461] Use FNV hash function in ethash_calculate_dag_item() --- internal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal.c b/internal.c index a0dd8b46b..552772741 100644 --- a/internal.c +++ b/internal.c @@ -111,7 +111,7 @@ void ethash_calculate_dag_item( #endif for (uint32_t i = 0; i != ETHASH_DATASET_PARENTS; ++i) { - uint32_t parent_index = ((node_index ^ i) * FNV_PRIME ^ ret->words[i % NODE_WORDS]) % num_parent_nodes; + uint32_t parent_index = fnv_hash(node_index ^ i, ret->words[i % NODE_WORDS]) % num_parent_nodes; node const *parent = &cache_nodes[parent_index]; #if defined(_M_X64) && ENABLE_SSE From bcf9ed658907aa4c40e14862b433eb6f56c7bb2e Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Mon, 4 May 2015 15:13:08 +0200 Subject: [PATCH 077/461] Trying to address more MSVC warnings --- internal.c | 10 +++++----- io.c | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/internal.c b/internal.c index 552772741..6aba8fe4d 100644 --- a/internal.c +++ b/internal.c @@ -153,12 +153,12 @@ bool ethash_compute_full_data( (full_size % sizeof(node)) != 0) { return false; } - uint64_t const max_n = full_size / sizeof(node); + uint32_t const max_n = (uint32_t)(full_size / sizeof(node)); node* full_nodes = mem; double const progress_change = 1.0f / max_n; double progress = 0.0f; // now compute full nodes - for (uint64_t n = 0; n != max_n; ++n) { + for (uint32_t n = 0; n != max_n; ++n) { if (callback && n % (max_n / 100) == 0 && callback((unsigned int)(ceil(progress * 100.0f))) != 0) { @@ -195,7 +195,7 @@ static bool ethash_hash( fix_endian_arr32(s_mix[0].words, 16); node* const mix = s_mix + 1; - for (unsigned w = 0; w != MIX_WORDS; ++w) { + for (uint32_t w = 0; w != MIX_WORDS; ++w) { mix->words[w] = s_mix[0].words[w % NODE_WORDS]; } @@ -203,7 +203,7 @@ static bool ethash_hash( unsigned const num_full_pages = (unsigned) (full_size / page_size); for (unsigned i = 0; i != ETHASH_ACCESSES; ++i) { - uint64_t const index = ((s_mix->words[0] ^ i) * FNV_PRIME ^ mix->words[i % MIX_WORDS]) % num_full_pages; + uint32_t const index = fnv_hash(s_mix->words[0] ^ i, mix->words[i % MIX_WORDS]) % num_full_pages; for (unsigned n = 0; n != MIX_NODES; ++n) { node const* dag_node; @@ -239,7 +239,7 @@ static bool ethash_hash( } // compress mix - for (unsigned w = 0; w != MIX_WORDS; w += 4) { + for (uint32_t w = 0; w != MIX_WORDS; w += 4) { uint32_t reduction = mix->words[w + 0]; reduction = reduction * FNV_PRIME ^ mix->words[w + 1]; reduction = reduction * FNV_PRIME ^ mix->words[w + 2]; diff --git a/io.c b/io.c index be2fbde84..5b4e7da2b 100644 --- a/io.c +++ b/io.c @@ -83,7 +83,7 @@ enum ethash_io_rc ethash_io_prepare( goto free_memo; } // make sure it's of the proper size - if (fseek(f, file_size + ETHASH_DAG_MAGIC_NUM_SIZE - 1, SEEK_SET) != 0) { + if (fseek(f, (long int)(file_size + ETHASH_DAG_MAGIC_NUM_SIZE - 1), SEEK_SET) != 0) { fclose(f); goto free_memo; } From b90dd99d09a795b032849dda74075a56ae8d9920 Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Tue, 5 May 2015 11:41:32 +0200 Subject: [PATCH 078/461] Fixing Windows tests --- io_posix.c | 3 ++- io_win32.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/io_posix.c b/io_posix.c index f31d738e4..7f03d5482 100644 --- a/io_posix.c +++ b/io_posix.c @@ -86,6 +86,7 @@ bool ethash_file_size(FILE* f, size_t* ret_size) bool ethash_get_default_dirname(char* strbuf, size_t buffsize) { + static const char dir_suffix[] = ".ethash/"; strbuf[0] = '\0'; char* home_dir = getenv("HOME"); size_t len = strlen(home_dir); @@ -97,5 +98,5 @@ bool ethash_get_default_dirname(char* strbuf, size_t buffsize) return false; } } - return ethash_strncat(strbuf, buffsize, ".ethash/", 8); + return ethash_strncat(strbuf, buffsize, dir_suffix, sizeof(dir_suffix)); } diff --git a/io_win32.c b/io_win32.c index 021aff9c9..d9c54d141 100644 --- a/io_win32.c +++ b/io_win32.c @@ -87,6 +87,7 @@ bool ethash_file_size(FILE* f, size_t* ret_size) bool ethash_get_default_dirname(char* strbuf, size_t buffsize) { + static const char dir_suffix[] = "Appdata\\Ethash\\"; strbuf[0] = '\0'; if (!SUCCEEDED(SHGetFolderPathW(NULL, CSIDL_PROFILE, NULL, 0, (WCHAR*)strbuf))) { return false; @@ -95,5 +96,5 @@ bool ethash_get_default_dirname(char* strbuf, size_t buffsize) return false; } - return ethash_strncat(strbuf, buffsize, "Appdata\\Ethash\\", 14); + return ethash_strncat(strbuf, buffsize, dir_suffix, sizeof(dir_suffix)); } From bed7c62bca4c4e420337865fa3f32d7633ad0ade Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Tue, 5 May 2015 14:54:24 +0200 Subject: [PATCH 079/461] Fixes for building on Mac --- sha3_cryptopp.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sha3_cryptopp.h b/sha3_cryptopp.h index cc81f2855..9edc407d5 100644 --- a/sha3_cryptopp.h +++ b/sha3_cryptopp.h @@ -9,9 +9,8 @@ extern "C" { #endif struct ethash_h256; -typedef struct ethash_h256 ethash_h256_t; -void SHA3_256(ethash_h256_t const* ret, uint8_t const* data, size_t size); +void SHA3_256(struct ethash_h256 const* ret, uint8_t const* data, size_t size); void SHA3_512(uint8_t* const ret, uint8_t const* data, size_t size); #ifdef __cplusplus From 898682d04d21cd32a47d1373dc8d9f9078b17893 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Tue, 5 May 2015 17:52:27 +0200 Subject: [PATCH 080/461] JIT class: the EVM JIT facade. The JIT class added, future public EVM JIT library interface. Currently it supports queries about EVM code status. --- evmjit/CMakeLists.txt | 2 + evmjit/include/evmjit/DataTypes.h | 56 ++++++++++++++++++++++++++++ evmjit/include/evmjit/JIT.h | 36 ++++++++++++++++++ evmjit/libevmjit-cpp/CMakeLists.txt | 1 + evmjit/libevmjit-cpp/Env.cpp | 3 +- evmjit/libevmjit-cpp/Utils.h | 14 +++++-- evmjit/libevmjit/CMakeLists.txt | 3 ++ evmjit/libevmjit/Common.h | 12 +----- evmjit/libevmjit/ExecutionEngine.cpp | 24 +++++------- evmjit/libevmjit/JIT.cpp | 46 +++++++++++++++++++++++ evmjit/libevmjit/RuntimeData.h | 7 +++- libevm/CMakeLists.txt | 3 ++ 12 files changed, 175 insertions(+), 32 deletions(-) create mode 100644 evmjit/include/evmjit/DataTypes.h create mode 100644 evmjit/include/evmjit/JIT.h create mode 100644 evmjit/libevmjit/JIT.cpp diff --git a/evmjit/CMakeLists.txt b/evmjit/CMakeLists.txt index 5ab394a80..a0e9c1f46 100644 --- a/evmjit/CMakeLists.txt +++ b/evmjit/CMakeLists.txt @@ -33,6 +33,8 @@ else() link_directories(/usr/lib/llvm-3.5/lib) endif() +get_filename_component(EVMJIT_INCLUDE_DIR include ABSOLUTE) + add_subdirectory(libevmjit) if(EVMJIT_CPP) diff --git a/evmjit/include/evmjit/DataTypes.h b/evmjit/include/evmjit/DataTypes.h new file mode 100644 index 000000000..179d9a372 --- /dev/null +++ b/evmjit/include/evmjit/DataTypes.h @@ -0,0 +1,56 @@ +#pragma once + +#include +#include + +namespace dev +{ +namespace evmjit +{ + +struct h256 +{ + uint64_t words[4]; +}; + +inline bool operator==(h256 _h1, h256 _h2) +{ + return _h1.words[0] == _h2.words[0] && + _h1.words[1] == _h2.words[1] && + _h1.words[2] == _h2.words[2] && + _h1.words[3] == _h2.words[3]; +} + +/// Representation of 256-bit value binary compatible with LLVM i256 +struct i256 +{ + uint64_t a = 0; + uint64_t b = 0; + uint64_t c = 0; + uint64_t d = 0; + + i256() = default; + i256(h256 _h) + { + a = _h.words[0]; + b = _h.words[1]; + c = _h.words[2]; + d = _h.words[3]; + } +}; + +} +} + +namespace std +{ +template<> struct hash +{ + size_t operator()(dev::evmjit::h256 const& _h) const + { + /// This implementation expects the argument to be a full 256-bit Keccak hash. + /// It does nothing more than returning a slice of the input hash. + return static_cast(_h.words[0]); + }; +}; +} diff --git a/evmjit/include/evmjit/JIT.h b/evmjit/include/evmjit/JIT.h new file mode 100644 index 000000000..446dd9e56 --- /dev/null +++ b/evmjit/include/evmjit/JIT.h @@ -0,0 +1,36 @@ +#pragma once + +#include "evmjit/DataTypes.h" + +namespace dev +{ +namespace eth +{ +namespace jit +{ + class ExecutionEngine; +} +} + +namespace evmjit +{ + +class JIT +{ +public: + + /// Ask JIT if the EVM code is ready for execution. + /// Returns `true` if the EVM code has been compiled and loaded into memory. + /// In this case the code can be executed without overhead. + /// \param _codeHash The Keccak hash of the EVM code. + static bool isCodeReady(h256 _codeHash); + +private: + friend class dev::eth::jit::ExecutionEngine; + + static void* getCode(h256 _codeHash); + static void mapCode(h256 _codeHash, void* _funcAddr); +}; + +} +} diff --git a/evmjit/libevmjit-cpp/CMakeLists.txt b/evmjit/libevmjit-cpp/CMakeLists.txt index 5b4dbb9c8..5b2a35b00 100644 --- a/evmjit/libevmjit-cpp/CMakeLists.txt +++ b/evmjit/libevmjit-cpp/CMakeLists.txt @@ -19,6 +19,7 @@ add_library(${TARGET_NAME} STATIC ${SOURCES}) set_property(TARGET ${TARGET_NAME} PROPERTY FOLDER "libs") include_directories(../..) +include_directories(${EVMJIT_INCLUDE_DIR}) include_directories(${LLVM_INCLUDE_DIRS}) include_directories(${Boost_INCLUDE_DIRS}) diff --git a/evmjit/libevmjit-cpp/Env.cpp b/evmjit/libevmjit-cpp/Env.cpp index 2c37412fc..a5a60f48c 100644 --- a/evmjit/libevmjit-cpp/Env.cpp +++ b/evmjit/libevmjit-cpp/Env.cpp @@ -3,6 +3,7 @@ #include #include #include +#include #include "Utils.h" @@ -16,7 +17,7 @@ extern "C" using namespace dev; using namespace dev::eth; - using jit::i256; + using evmjit::i256; EXPORT void env_sload(ExtVMFace* _env, i256* _index, i256* o_value) { diff --git a/evmjit/libevmjit-cpp/Utils.h b/evmjit/libevmjit-cpp/Utils.h index ac796920b..f9b9b2ef4 100644 --- a/evmjit/libevmjit-cpp/Utils.h +++ b/evmjit/libevmjit-cpp/Utils.h @@ -1,13 +1,13 @@ #pragma once -#include +#include namespace dev { namespace eth { -inline u256 llvm2eth(jit::i256 _i) +inline u256 llvm2eth(evmjit::i256 _i) { u256 u = 0; u |= _i.d; @@ -20,9 +20,9 @@ inline u256 llvm2eth(jit::i256 _i) return u; } -inline jit::i256 eth2llvm(u256 _u) +inline evmjit::i256 eth2llvm(u256 _u) { - jit::i256 i; + evmjit::i256 i; u256 mask = 0xFFFFFFFFFFFFFFFF; i.a = static_cast(_u & mask); _u >>= 64; @@ -34,5 +34,11 @@ inline jit::i256 eth2llvm(u256 _u) return i; } +inline evmjit::h256 eth2llvm(h256 _u) +{ + /// Just directly copies memory + return *(evmjit::h256*)&_u; +} + } } diff --git a/evmjit/libevmjit/CMakeLists.txt b/evmjit/libevmjit/CMakeLists.txt index 7f4e763d7..4b15d52ac 100644 --- a/evmjit/libevmjit/CMakeLists.txt +++ b/evmjit/libevmjit/CMakeLists.txt @@ -8,6 +8,7 @@ set(SOURCES Common.h Compiler.cpp Compiler.h CompilerHelper.cpp CompilerHelper.h + ${EVMJIT_INCLUDE_DIR}/evmjit/DataTypes.h Endianness.cpp Endianness.h ExecStats.cpp ExecStats.h ExecutionEngine.cpp ExecutionEngine.h @@ -15,6 +16,7 @@ set(SOURCES GasMeter.cpp GasMeter.h Instruction.cpp Instruction.h interface.cpp interface.h + JIT.cpp ${EVMJIT_INCLUDE_DIR}/evmjit/JIT.h Memory.cpp Memory.h Optimizer.cpp Optimizer.h Runtime.cpp Runtime.h @@ -79,6 +81,7 @@ set_target_properties(${TARGET_NAME} PROPERTIES VERSION ${EVMJIT_VERSION} SOVERSION ${EVMJIT_SOVERSION} FOLDER "libs") +include_directories(${EVMJIT_INCLUDE_DIR}) include_directories(${LLVM_INCLUDE_DIRS}) include_directories(${CMAKE_CURRENT_BINARY_DIR}/gen) diff --git a/evmjit/libevmjit/Common.h b/evmjit/libevmjit/Common.h index 028f0b3c5..b519614fe 100644 --- a/evmjit/libevmjit/Common.h +++ b/evmjit/libevmjit/Common.h @@ -31,7 +31,7 @@ enum class ReturnCode // Standard error codes OutOfGas = -1, - StackUnderflow = -2, + StackUnderflow = -2, BadJumpDestination = -3, BadInstruction = -4, Rejected = -5, ///< Input data (code, gas, block info, etc.) does not meet JIT requirement and execution request has been rejected @@ -46,16 +46,6 @@ enum class ReturnCode LinkerWorkaround = -299, }; -/// Representation of 256-bit value binary compatible with LLVM i256 -struct i256 -{ - uint64_t a = 0; - uint64_t b = 0; - uint64_t c = 0; - uint64_t d = 0; -}; -static_assert(sizeof(i256) == 32, "Wrong i265 size"); - #define UNTESTED assert(false) } diff --git a/evmjit/libevmjit/ExecutionEngine.cpp b/evmjit/libevmjit/ExecutionEngine.cpp index e15dad969..08ca403b5 100644 --- a/evmjit/libevmjit/ExecutionEngine.cpp +++ b/evmjit/libevmjit/ExecutionEngine.cpp @@ -19,6 +19,7 @@ #include #include "preprocessor/llvm_includes_end.h" +#include "evmjit/JIT.h" #include "Runtime.h" #include "Compiler.h" #include "Optimizer.h" @@ -33,6 +34,7 @@ namespace eth { namespace jit { +using evmjit::JIT; namespace { @@ -119,8 +121,6 @@ ReturnCode ExecutionEngine::run(RuntimeData* _data, Env* _env) // TODO: Do not pseudo-init the cache every time auto objectCache = (g_cache != CacheMode::off && g_cache != CacheMode::clear) ? Cache::getObjectCache(g_cache, listener.get()) : nullptr; - static std::unordered_map funcCache; - static std::unique_ptr ee; if (!ee) { @@ -147,8 +147,9 @@ ReturnCode ExecutionEngine::run(RuntimeData* _data, Env* _env) module.release(); // Successfully created llvm::ExecutionEngine takes ownership of the module ee->setObjectCache(objectCache); - if (preloadCache) - Cache::preload(*ee, funcCache); + // FIXME: Disabled during API changes + //if (preloadCache) + // Cache::preload(*ee, funcCache); } static StatsCollector statsCollector; @@ -156,11 +157,8 @@ ReturnCode ExecutionEngine::run(RuntimeData* _data, Env* _env) auto mainFuncName = codeHash(_data->codeHash); m_runtime.init(_data, _env); - EntryFuncPtr entryFuncPtr = nullptr; - auto it = funcCache.find(mainFuncName); - if (it != funcCache.end()) - entryFuncPtr = (EntryFuncPtr) it->second; - + // TODO: Remove cast + auto entryFuncPtr = (EntryFuncPtr) JIT::getCode(_data->codeHash); if (!entryFuncPtr) { auto module = objectCache ? Cache::getObject(mainFuncName) : nullptr; @@ -183,12 +181,10 @@ ReturnCode ExecutionEngine::run(RuntimeData* _data, Env* _env) module.release(); listener->stateChanged(ExecState::CodeGen); entryFuncPtr = (EntryFuncPtr)ee->getFunctionAddress(mainFuncName); + if (!CHECK(entryFuncPtr)) + return ReturnCode::LLVMLinkError; + JIT::mapCode(_data->codeHash, (void*)entryFuncPtr); // FIXME: Remove cast } - if (!CHECK(entryFuncPtr)) - return ReturnCode::LLVMLinkError; - - if (it == funcCache.end()) - funcCache[mainFuncName] = (uint64_t) entryFuncPtr; listener->stateChanged(ExecState::Execution); auto returnCode = entryFuncPtr(&m_runtime); diff --git a/evmjit/libevmjit/JIT.cpp b/evmjit/libevmjit/JIT.cpp new file mode 100644 index 000000000..9774c7396 --- /dev/null +++ b/evmjit/libevmjit/JIT.cpp @@ -0,0 +1,46 @@ +#include "evmjit/JIT.h" + +#include + +namespace dev +{ +namespace evmjit +{ +namespace +{ + +class JITImpl: JIT +{ +public: + std::unordered_map codeMap; + + static JITImpl& instance() + { + static JITImpl s_instance; + return s_instance; + } +}; + +} // anonymous namespace + +bool JIT::isCodeReady(h256 _codeHash) +{ + return JITImpl::instance().codeMap.count(_codeHash) != 0; +} + +void* JIT::getCode(h256 _codeHash) +{ + auto& codeMap = JITImpl::instance().codeMap; + auto it = codeMap.find(_codeHash); + if (it != codeMap.end()) + return it->second; + return nullptr; +} + +void JIT::mapCode(h256 _codeHash, void* _funcAddr) +{ + JITImpl::instance().codeMap.insert(std::make_pair(_codeHash, _funcAddr)); +} + +} +} diff --git a/evmjit/libevmjit/RuntimeData.h b/evmjit/libevmjit/RuntimeData.h index cc081cc58..6a5cd0d14 100644 --- a/evmjit/libevmjit/RuntimeData.h +++ b/evmjit/libevmjit/RuntimeData.h @@ -1,5 +1,6 @@ #pragma once +#include "evmjit/DataTypes.h" #include "Common.h" namespace dev @@ -8,7 +9,9 @@ namespace eth { namespace jit { - +using evmjit::i256; +using evmjit::h256; + struct RuntimeData { enum Index @@ -49,7 +52,7 @@ struct RuntimeData int64_t timestamp = 0; byte const* code = nullptr; uint64_t codeSize = 0; - i256 codeHash; + h256 codeHash; }; /// VM Environment (ExtVM) opaque type diff --git a/libevm/CMakeLists.txt b/libevm/CMakeLists.txt index f6f0c01e4..26bb46e2e 100644 --- a/libevm/CMakeLists.txt +++ b/libevm/CMakeLists.txt @@ -15,6 +15,9 @@ aux_source_directory(. SRC_LIST) # and windows is failing to build without that include_directories(BEFORE ..) include_directories(${Boost_INCLUDE_DIRS}) +if (EVMJIT) + include_directories(../evmjit/include) +endif() set(EXECUTABLE evm) From 1e6659d1a9fd6d38dec28193260c9d89b3a08abf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Wed, 6 May 2015 10:29:36 +0200 Subject: [PATCH 081/461] Allow selecting VM kind manually --- evmjit/libevmjit-cpp/JitVM.cpp | 4 +--- libevm/VMFactory.cpp | 11 ++++++++--- libevm/VMFactory.h | 8 +++++++- 3 files changed, 16 insertions(+), 7 deletions(-) diff --git a/evmjit/libevmjit-cpp/JitVM.cpp b/evmjit/libevmjit-cpp/JitVM.cpp index 84cc41dd1..7acbec5c1 100644 --- a/evmjit/libevmjit-cpp/JitVM.cpp +++ b/evmjit/libevmjit-cpp/JitVM.cpp @@ -32,9 +32,7 @@ bytesConstRef JitVM::go(ExtVMFace& _ext, OnOpFunc const& _onOp, uint64_t _step) if (rejected) { cwarn << "Execution rejected by EVM JIT (gas limit: " << m_gas << "), executing with interpreter"; - VMFactory::setKind(VMKind::Interpreter); - m_fallbackVM = VMFactory::create(m_gas); - VMFactory::setKind(VMKind::JIT); + m_fallbackVM = VMFactory::create(VMKind::Interpreter, m_gas); auto&& output = m_fallbackVM->go(_ext, _onOp, _step); m_gas = m_fallbackVM->gas(); // copy remaining gas, Executive expects it return output; diff --git a/libevm/VMFactory.cpp b/libevm/VMFactory.cpp index 1092906e4..f7d6267c7 100644 --- a/libevm/VMFactory.cpp +++ b/libevm/VMFactory.cpp @@ -29,7 +29,7 @@ namespace eth { namespace { - VMKind g_kind = VMKind::Interpreter; + auto g_kind = VMKind::Interpreter; } void VMFactory::setKind(VMKind _kind) @@ -38,11 +38,16 @@ void VMFactory::setKind(VMKind _kind) } std::unique_ptr VMFactory::create(u256 _gas) +{ + return create(g_kind, _gas); +} + +std::unique_ptr VMFactory::create(VMKind _kind, u256 _gas) { #if ETH_EVMJIT - return std::unique_ptr(g_kind == VMKind::JIT ? static_cast(new JitVM(_gas)) : static_cast(new VM(_gas))); + return std::unique_ptr(_kind == VMKind::JIT ? static_cast(new JitVM(_gas)) : static_cast(new VM(_gas))); #else - asserts(g_kind == VMKind::Interpreter && "JIT disabled in build configuration"); + asserts(_kind == VMKind::Interpreter && "JIT disabled in build configuration"); return std::unique_ptr(new VM(_gas)); #endif } diff --git a/libevm/VMFactory.h b/libevm/VMFactory.h index d0d02e0c4..ba78b85e9 100644 --- a/libevm/VMFactory.h +++ b/libevm/VMFactory.h @@ -26,7 +26,7 @@ namespace eth enum class VMKind: bool { Interpreter, - JIT + JIT, }; class VMFactory @@ -34,7 +34,13 @@ class VMFactory public: VMFactory() = delete; + /// Creates a VM instance of global kind (controlled by setKind() function). static std::unique_ptr create(u256 _gas); + + /// Creates a VM instance of kind provided. + static std::unique_ptr create(VMKind _kind, u256 _gas); + + /// Set global VM kind static void setKind(VMKind _kind); }; From d622fdfd76619a399c7e7add24188e56a64b1b52 Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Wed, 6 May 2015 12:37:05 +0200 Subject: [PATCH 082/461] Adding Block verification tests - The data for the block verification come from the POC-9 testnet. - Also using boolean instead of int in check_difficulty for the verification --- internal.c | 2 +- internal.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal.c b/internal.c index 607e44138..e881e0c7b 100644 --- a/internal.c +++ b/internal.c @@ -280,7 +280,7 @@ ethash_h256_t ethash_get_seedhash(uint64_t block_number) return ret; } -int ethash_quick_check_difficulty( +bool ethash_quick_check_difficulty( ethash_h256_t const* header_hash, uint64_t const nonce, ethash_h256_t const* mix_hash, diff --git a/internal.h b/internal.h index 221ff290a..4e2b695ac 100644 --- a/internal.h +++ b/internal.h @@ -47,7 +47,7 @@ static inline void ethash_h256_reset(ethash_h256_t* hash) } // Returns if hash is less than or equal to difficulty -static inline int ethash_check_difficulty( +static inline bool ethash_check_difficulty( ethash_h256_t const* hash, ethash_h256_t const* difficulty ) @@ -59,10 +59,10 @@ static inline int ethash_check_difficulty( } return ethash_h256_get(hash, i) < ethash_h256_get(difficulty, i); } - return 1; + return true; } -int ethash_quick_check_difficulty( +bool ethash_quick_check_difficulty( ethash_h256_t const* header_hash, uint64_t const nonce, ethash_h256_t const* mix_hash, From 346770def9d57318d7cad957c64528ff6709b267 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Wed, 6 May 2015 13:18:52 +0200 Subject: [PATCH 083/461] SmartVM: initial implementation --- libevm/SmartVM.cpp | 79 ++++++++++++++++++++++++++++++++++++++++++++ libevm/SmartVM.h | 43 ++++++++++++++++++++++++ libevm/VMFactory.cpp | 12 ++++++- libevm/VMFactory.h | 3 +- test/TestHelper.cpp | 7 ++-- test/TestHelper.h | 1 - 6 files changed, 138 insertions(+), 7 deletions(-) create mode 100644 libevm/SmartVM.cpp create mode 100644 libevm/SmartVM.h diff --git a/libevm/SmartVM.cpp b/libevm/SmartVM.cpp new file mode 100644 index 000000000..4f759a745 --- /dev/null +++ b/libevm/SmartVM.cpp @@ -0,0 +1,79 @@ +/* + This file is part of cpp-ethereum. + + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ + +// SmartVM is only available if EVM JIT is enabled +#if ETH_EVMJIT + +#include "SmartVM.h" +#include +#include +#include +#include +#include +#include "VMFactory.h" + +namespace dev +{ +namespace eth +{ +namespace +{ + using HitMap = std::unordered_map; + + HitMap& getHitMap() + { + static HitMap s_hitMap; + return s_hitMap; + } +} + +bytesConstRef SmartVM::go(ExtVMFace& _ext, OnOpFunc const& _onOp, uint64_t _steps) +{ + auto codeHash = sha3(_ext.code); + auto vmKind = VMKind::Interpreter; // default VM + + // Jitted EVM code already in memory? + if (evmjit::JIT::isCodeReady(eth2llvm(codeHash))) + { + cnote << "Jitted"; + vmKind = VMKind::JIT; + } + else + { + // Check EVM code hit count + static const uint64_t c_hitTreshold = 1; + auto& hits = getHitMap()[codeHash]; + ++hits; + if (hits > c_hitTreshold) + { + cnote << "JIT selected"; + vmKind = VMKind::JIT; + } + } + + // TODO: Selected VM must be kept only because it returns reference to its internal memory. + // VM implementations should be stateless, without gas counter and escaping memory reference. + m_selectedVM = VMFactory::create(vmKind, gas()); + auto out = m_selectedVM->go(_ext, _onOp, _steps); + m_gas = m_selectedVM->gas(); + return out; +} + +} +} + +#endif diff --git a/libevm/SmartVM.h b/libevm/SmartVM.h new file mode 100644 index 000000000..29f464ecd --- /dev/null +++ b/libevm/SmartVM.h @@ -0,0 +1,43 @@ +/* + This file is part of cpp-ethereum. + + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +#pragma once + +#include "VMFace.h" + +namespace dev +{ +namespace eth +{ + +/// Smart VM proxy. +/// +/// This class is a strategy pattern implementation for VM. For every EVM code +/// execution request it tries to select the best VM implementation (Interpreter or JIT) +/// by analyzing available information like: code size, hit count, JIT status, etc. +class SmartVM: public VMFace +{ +public: + SmartVM(u256 _gas): VMFace(_gas) {} + + virtual bytesConstRef go(ExtVMFace& _ext, OnOpFunc const& _onOp = {}, uint64_t _steps = (uint64_t)-1) override final; + +private: + std::unique_ptr m_selectedVM; +}; + +} +} diff --git a/libevm/VMFactory.cpp b/libevm/VMFactory.cpp index f7d6267c7..db619fa85 100644 --- a/libevm/VMFactory.cpp +++ b/libevm/VMFactory.cpp @@ -18,6 +18,7 @@ #include "VMFactory.h" #include #include "VM.h" +#include "SmartVM.h" #if ETH_EVMJIT #include @@ -45,7 +46,16 @@ std::unique_ptr VMFactory::create(u256 _gas) std::unique_ptr VMFactory::create(VMKind _kind, u256 _gas) { #if ETH_EVMJIT - return std::unique_ptr(_kind == VMKind::JIT ? static_cast(new JitVM(_gas)) : static_cast(new VM(_gas))); + switch (_kind) + { + default: + case VMKind::Interpreter: + return std::unique_ptr(new VM(_gas)); + case VMKind::JIT: + return std::unique_ptr(new JitVM(_gas)); + case VMKind::Smart: + return std::unique_ptr(new SmartVM(_gas)); + } #else asserts(_kind == VMKind::Interpreter && "JIT disabled in build configuration"); return std::unique_ptr(new VM(_gas)); diff --git a/libevm/VMFactory.h b/libevm/VMFactory.h index ba78b85e9..777bb8cd1 100644 --- a/libevm/VMFactory.h +++ b/libevm/VMFactory.h @@ -23,10 +23,11 @@ namespace dev namespace eth { -enum class VMKind: bool +enum class VMKind { Interpreter, JIT, + Smart, }; class VMFactory diff --git a/test/TestHelper.cpp b/test/TestHelper.cpp index eecf6f80d..b14c3571c 100644 --- a/test/TestHelper.cpp +++ b/test/TestHelper.cpp @@ -288,7 +288,7 @@ void ImportTest::checkExpectedState(State const& _stateExpect, State const& _sta { addressOptions = _expectedStateOptions.at(a.first); } - catch(std::out_of_range) + catch(std::out_of_range const&) { BOOST_ERROR("expectedStateOptions map does not match expectedState in checkExpectedState!"); break; @@ -707,10 +707,9 @@ Options::Options() { auto arg = std::string{argv[i]}; if (arg == "--jit") - { - jit = true; eth::VMFactory::setKind(eth::VMKind::JIT); - } + else if (arg == "--vm=smart") + eth::VMFactory::setKind(eth::VMKind::Smart); else if (arg == "--vmtrace") vmtrace = true; else if (arg == "--filltests") diff --git a/test/TestHelper.h b/test/TestHelper.h index 10e76aa96..834dc0562 100644 --- a/test/TestHelper.h +++ b/test/TestHelper.h @@ -179,7 +179,6 @@ void checkAddresses(mapType& _expectedAddrs, mapType& _resultAddrs) class Options { public: - bool jit = false; ///< Use JIT bool vmtrace = false; ///< Create EVM execution tracer // TODO: Link with log verbosity? bool fillTests = false; ///< Create JSON test files from execution results bool stats = false; ///< Execution time stats From 79dca367dc10e9598973895f6e22350b2d2f32b4 Mon Sep 17 00:00:00 2001 From: Gustav Simonsson Date: Wed, 6 May 2015 15:48:28 +0200 Subject: [PATCH 084/461] Comment out conflicting debug macro --- util.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/util.h b/util.h index c5fc6e55b..0d2307f3d 100644 --- a/util.h +++ b/util.h @@ -26,11 +26,11 @@ extern "C" { #endif -#ifdef _MSC_VER +//#ifdef _MSC_VER void debugf(char const* str, ...); -#else -#define debugf printf -#endif +//#else +//#define debugf printf +//#endif static inline uint32_t min_u32(uint32_t a, uint32_t b) { From 383c14b1789626c0b9c7f85731e8c501a95efc09 Mon Sep 17 00:00:00 2001 From: Gustav Simonsson Date: Wed, 6 May 2015 16:06:33 +0200 Subject: [PATCH 085/461] Add -mno-stack-arg-probe for windows and fix snprintf --- io.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/io.h b/io.h index 26c82f111..4fe46d756 100644 --- a/io.h +++ b/io.h @@ -49,7 +49,7 @@ enum ethash_io_rc { // small hack for windows. I don't feel I should use va_args and forward just // to have this one function properly cross-platform abstracted -#if defined(_WIN32) +#if defined(_WIN32) && !defined(__GNUC__) #define snprintf(...) sprintf_s(__VA_ARGS__) #endif From c9454b616a60f0d476333b655458c81830562f9a Mon Sep 17 00:00:00 2001 From: Gustav Simonsson Date: Thu, 7 May 2015 01:17:27 +0200 Subject: [PATCH 086/461] Add comment about stack probing and remove unused ifdefs --- util.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/util.h b/util.h index 0d2307f3d..259fffddd 100644 --- a/util.h +++ b/util.h @@ -26,11 +26,7 @@ extern "C" { #endif -//#ifdef _MSC_VER void debugf(char const* str, ...); -//#else -//#define debugf printf -//#endif static inline uint32_t min_u32(uint32_t a, uint32_t b) { From d635c98dbf2894d09fc8b96579463c804585091d Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Thu, 7 May 2015 13:24:56 +0200 Subject: [PATCH 087/461] Dag name should follow the spec. - Fixing DAG name so that it follow the spec as defined here: https://github.com/ethereum/wiki/wiki/Ethash-DAG --- io.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/io.h b/io.h index 26c82f111..19201c088 100644 --- a/io.h +++ b/io.h @@ -34,11 +34,12 @@ extern "C" { #endif // Maximum size for mutable part of DAG file name +// 6 is for "full-R", the suffix of the filename // 10 is for maximum number of digits of a uint32_t (for REVISION) -// 1 is for _ and 16 is for the first 16 hex digits for first 8 bytes of +// 1 is for - and 16 is for the first 16 hex digits for first 8 bytes of // the seedhash and last 1 is for the null terminating character // Reference: https://github.com/ethereum/wiki/wiki/Ethash-DAG -#define DAG_MUTABLE_NAME_MAX_SIZE (10 + 1 + 16 + 1) +#define DAG_MUTABLE_NAME_MAX_SIZE (6 + 10 + 1 + 16 + 1) /// Possible return values of @see ethash_io_prepare enum ethash_io_rc { ETHASH_IO_FAIL = 0, ///< There has been an IO failure @@ -176,7 +177,7 @@ static inline bool ethash_io_mutable_name( #if LITTLE_ENDIAN == BYTE_ORDER hash = ethash_swap_u64(hash); #endif - return snprintf(output, DAG_MUTABLE_NAME_MAX_SIZE, "%u_%016" PRIx64, revision, hash) >= 0; + return snprintf(output, DAG_MUTABLE_NAME_MAX_SIZE, "full-R%u-%016" PRIx64, revision, hash) >= 0; } #ifdef __cplusplus From 319de5aba2b75168c76bac77d56b74984568c1e5 Mon Sep 17 00:00:00 2001 From: Gustav Simonsson Date: Thu, 7 May 2015 13:50:11 +0200 Subject: [PATCH 088/461] Manual revert of src/libethash/util.h --- util.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/util.h b/util.h index 259fffddd..c5fc6e55b 100644 --- a/util.h +++ b/util.h @@ -26,7 +26,11 @@ extern "C" { #endif +#ifdef _MSC_VER void debugf(char const* str, ...); +#else +#define debugf printf +#endif static inline uint32_t min_u32(uint32_t a, uint32_t b) { From 747d73a9ab5a7f75cdbf39001848b8ae36f52cf7 Mon Sep 17 00:00:00 2001 From: Gustav Simonsson Date: Thu, 7 May 2015 14:22:11 +0200 Subject: [PATCH 089/461] Remove evil windows upper case --- io_win32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/io_win32.c b/io_win32.c index d9c54d141..2e6c8deb8 100644 --- a/io_win32.c +++ b/io_win32.c @@ -25,7 +25,7 @@ #include #include #include -#include +#include FILE* ethash_fopen(char const* file_name, char const* mode) { From 165c374fd4b2dfde482cdd62e3d391609d6e3865 Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Thu, 7 May 2015 17:10:44 +0200 Subject: [PATCH 090/461] New ethash API integration part 1 - cpp-ethereum now compiles with the new API - Proper integration with testing will come with the next commits --- eth/main.cpp | 4 +- ethminer/main.cpp | 4 +- libethash-cl/ethash_cl_miner.cpp | 4 - libethcore/Ethash.cpp | 25 +++-- libethcore/Ethash.h | 3 +- libethcore/EthashAux.cpp | 156 ++++++++++--------------------- libethcore/EthashAux.h | 36 +++---- libethcore/Exceptions.h | 3 +- test/libethcore/dagger.cpp | 2 + 9 files changed, 90 insertions(+), 147 deletions(-) diff --git a/eth/main.cpp b/eth/main.cpp index 801ee1a0f..571b80312 100644 --- a/eth/main.cpp +++ b/eth/main.cpp @@ -783,7 +783,7 @@ int main(int argc, char** argv) auto boundary = bi.boundary(); m = boost::to_lower_copy(string(argv[++i])); bi.nonce = h64(m); - auto r = EthashAux::eval(seedHash, powHash, bi.nonce); + auto r = EthashAux::eval((uint64_t)bi.number, powHash, bi.nonce); bool valid = r.value < boundary; cout << (valid ? "VALID :-)" : "INVALID :-(") << endl; cout << r.value << (valid ? " < " : " >= ") << boundary << endl; @@ -792,7 +792,7 @@ int main(int argc, char** argv) cout << " with seed as " << seedHash << endl; if (valid) cout << "(mixHash = " << r.mixHash << ")" << endl; - cout << "SHA3( light(seed) ) = " << sha3(EthashAux::light(seedHash)->data()) << endl; + cout << "SHA3( light(seed) ) = " << sha3(EthashAux::light((uint64_t)bi.number)->data()) << endl; exit(0); } catch (...) diff --git a/ethminer/main.cpp b/ethminer/main.cpp index 19324945f..25fdaa941 100644 --- a/ethminer/main.cpp +++ b/ethminer/main.cpp @@ -416,7 +416,7 @@ int main(int argc, char** argv) auto boundary = bi.boundary(); m = boost::to_lower_copy(string(argv[++i])); bi.nonce = h64(m); - auto r = EthashAux::eval(seedHash, powHash, bi.nonce); + auto r = EthashAux::eval((uint64_t)bi.number, powHash, bi.nonce); bool valid = r.value < boundary; cout << (valid ? "VALID :-)" : "INVALID :-(") << endl; cout << r.value << (valid ? " < " : " >= ") << boundary << endl; @@ -425,7 +425,7 @@ int main(int argc, char** argv) cout << " with seed as " << seedHash << endl; if (valid) cout << "(mixHash = " << r.mixHash << ")" << endl; - cout << "SHA3( light(seed) ) = " << sha3(EthashAux::light(seedHash)->data()) << endl; + cout << "SHA3( light(seed) ) = " << sha3(EthashAux::light((uint64_t)bi.number)->data()) << endl; exit(0); } catch (...) diff --git a/libethash-cl/ethash_cl_miner.cpp b/libethash-cl/ethash_cl_miner.cpp index 42098e09d..83a329d30 100644 --- a/libethash-cl/ethash_cl_miner.cpp +++ b/libethash-cl/ethash_cl_miner.cpp @@ -119,9 +119,7 @@ unsigned ethash_cl_miner::get_num_devices(unsigned _platformId) void ethash_cl_miner::finish() { if (m_queue()) - { m_queue.finish(); - } } bool ethash_cl_miner::init(uint8_t const* _dag, uint64_t _dagSize, unsigned workgroup_size, unsigned _platformId, unsigned _deviceId) @@ -161,9 +159,7 @@ bool ethash_cl_miner::init(uint8_t const* _dag, uint64_t _dagSize, unsigned work return false; } if (strncmp("OpenCL 1.1", device_version.c_str(), 10) == 0) - { m_opencl_1_1 = true; - } // create context m_context = cl::Context(std::vector(&device, &device + 1)); diff --git a/libethcore/Ethash.cpp b/libethcore/Ethash.cpp index 011f0b9e0..45addd278 100644 --- a/libethcore/Ethash.cpp +++ b/libethcore/Ethash.cpp @@ -36,6 +36,7 @@ #include #include #include +#include #if ETH_ETHASHCL || !ETH_TRUE #include #endif @@ -71,6 +72,7 @@ Ethash::WorkPackage Ethash::package(BlockInfo const& _bi) ret.boundary = _bi.boundary(); ret.headerHash = _bi.headerHash(WithoutNonce); ret.seedHash = _bi.seedHash(); + ret.blockNumber = (uint64_t) _bi.number; return ret; } @@ -87,10 +89,10 @@ bool Ethash::preVerify(BlockInfo const& _header) h256 boundary = u256((bigint(1) << 256) / _header.difficulty); return !!ethash_quick_check_difficulty( - _header.headerHash(WithoutNonce).data(), + (ethash_h256_t const*)_header.headerHash(WithoutNonce).data(), (uint64_t)(u64)_header.nonce, - _header.mixHash.data(), - boundary.data()); + (ethash_h256_t const*)_header.mixHash.data(), + (ethash_h256_t const*)boundary.data()); } bool Ethash::verify(BlockInfo const& _header) @@ -133,17 +135,14 @@ void Ethash::CPUMiner::workLoop() WorkPackage w = work(); - auto p = EthashAux::params(w.seedHash); - auto dag = EthashAux::full(w.seedHash); - auto dagPointer = dag->data.data(); - uint8_t const* headerHashPointer = w.headerHash.data(); + auto dag = EthashAux::full(w.blockNumber); h256 boundary = w.boundary; unsigned hashCount = 1; for (; !shouldStop(); tryNonce++, hashCount++) { - ethash_compute_full(ðashReturn, dagPointer, &p, headerHashPointer, tryNonce); - h256 value = h256(ethashReturn.result, h256::ConstructFromPointer); - if (value <= boundary && submitProof(Solution{(Nonce)(u64)tryNonce, h256(ethashReturn.mix_hash, h256::ConstructFromPointer)})) + ethashReturn = ethash_full_compute(dag->full, EthashAux::bytesToEthash256T(w.headerHash.data()), tryNonce); + h256 value = h256((uint8_t*)ðashReturn.result, h256::ConstructFromPointer); + if (value <= boundary && submitProof(Solution{(Nonce)(u64)tryNonce, h256((uint8_t*)ðashReturn.mix_hash, h256::ConstructFromPointer)})) break; if (!(hashCount % 1000)) accumulateHashes(1000); @@ -285,7 +284,7 @@ Ethash::GPUMiner::~GPUMiner() bool Ethash::GPUMiner::report(uint64_t _nonce) { Nonce n = (Nonce)(u64)_nonce; - Result r = EthashAux::eval(work().seedHash, work().headerHash, n); + Result r = EthashAux::eval(work().blockNumber, work().headerHash, n); if (r.value < work().boundary) return submitProof(Solution{n, r.mixHash}); return false; @@ -311,8 +310,8 @@ void Ethash::GPUMiner::workLoop() unsigned device = instances() > 1 ? index() : s_deviceId; - EthashAux::FullType dag = EthashAux::full(m_minerSeed); - m_miner->init(dag->data.data(), dag->data.size(), 32, s_platformId, device); + EthashAux::FullType dag = EthashAux::full(w.blockNumber); + m_miner->init((uint8_t const*)dag->data(), dag->size(), 32, s_platformId, device); } uint64_t upper64OfBoundary = (uint64_t)(u64)((u256)w.boundary >> 192); diff --git a/libethcore/Ethash.h b/libethcore/Ethash.h index 9a66e9865..1fcab55de 100644 --- a/libethcore/Ethash.h +++ b/libethcore/Ethash.h @@ -66,7 +66,8 @@ public: h256 boundary; h256 headerHash; ///< When h256() means "pause until notified a new work package is available". - h256 seedHash; + h256 seedHash; /// LTODO: IS this needed now that we use the block number instead? + uint64_t blockNumber; }; static const WorkPackage NullWorkPackage; diff --git a/libethcore/EthashAux.cpp b/libethcore/EthashAux.cpp index 0b9af98ac..52ced9d0d 100644 --- a/libethcore/EthashAux.cpp +++ b/libethcore/EthashAux.cpp @@ -34,28 +34,24 @@ #include #include #include "BlockInfo.h" +#include "Exceptions.h" using namespace std; using namespace chrono; using namespace dev; using namespace eth; + EthashAux* dev::eth::EthashAux::s_this = nullptr; EthashAux::~EthashAux() { } -ethash_params EthashAux::params(BlockInfo const& _header) -{ - return params((unsigned)_header.number); -} - -ethash_params EthashAux::params(unsigned _n) +ethash_h256_t EthashAux::bytesToEthash256T(uint8_t const* _bytes) { - ethash_params p; - p.cache_size = ethash_get_cachesize(_n); - p.full_size = ethash_get_datasize(_n); - return p; + ethash_h256_t ret; + memcpy(&ret, _bytes, 32); + return ret; } h256 EthashAux::seedHash(unsigned _number) @@ -82,27 +78,6 @@ h256 EthashAux::seedHash(unsigned _number) return get()->m_seedHashes[epoch]; } -ethash_params EthashAux::params(h256 const& _seedHash) -{ - Guard l(get()->x_epochs); - unsigned epoch = 0; - auto epochIter = get()->m_epochs.find(_seedHash); - if (epochIter == get()->m_epochs.end()) - { - // cdebug << "Searching for seedHash " << _seedHash; - for (h256 h; h != _seedHash && epoch < 2048; ++epoch, h = sha3(h), get()->m_epochs[h] = epoch) {} - if (epoch == 2048) - { - std::ostringstream error; - error << "apparent block number for " << _seedHash << " is too high; max is " << (ETHASH_EPOCH_LENGTH * 2048); - throw std::invalid_argument(error.str()); - } - } - else - epoch = epochIter->second; - return params(epoch * ETHASH_EPOCH_LENGTH); -} - void EthashAux::killCache(h256 const& _s) { RecursiveGuard l(x_this); @@ -111,114 +86,81 @@ void EthashAux::killCache(h256 const& _s) EthashAux::LightType EthashAux::light(BlockInfo const& _header) { - return light(_header.seedHash()); + return light((uint64_t)_header.number); } -EthashAux::LightType EthashAux::light(h256 const& _seedHash) +EthashAux::LightType EthashAux::light(uint64_t _blockNumber) { + h256 seedHash = EthashAux::seedHash(_blockNumber); RecursiveGuard l(get()->x_this); - LightType ret = get()->m_lights[_seedHash]; - return ret ? ret : (get()->m_lights[_seedHash] = make_shared(_seedHash)); + LightType ret = get()->m_lights[seedHash]; + return ret ? ret : (get()->m_lights[seedHash] = make_shared(_blockNumber)); } -EthashAux::LightAllocation::LightAllocation(h256 const& _seed) +EthashAux::LightAllocation::LightAllocation(uint64_t _blockNumber) { - auto p = params(_seed); - size = p.cache_size; - light = ethash_new_light(&p, _seed.data()); + light = ethash_light_new(_blockNumber); } EthashAux::LightAllocation::~LightAllocation() { - ethash_delete_light(light); + ethash_light_delete(light); } -EthashAux::FullType EthashAux::full(BlockInfo const& _header, bytesRef _dest, bool _createIfMissing) +EthashAux::FullAllocation::FullAllocation(ethash_light_t _light, ethash_callback_t _cb) { - return full(_header.seedHash(), _dest, _createIfMissing); + full = ethash_full_new(_light, _cb); } -EthashAux::FullType EthashAux::full(h256 const& _seedHash, bytesRef _dest, bool _createIfMissing) +EthashAux::FullAllocation::~FullAllocation() { - RecursiveGuard l(get()->x_this); - FullType ret = get()->m_fulls[_seedHash].lock(); - if (ret && _dest) - { - assert(ret->data.size() <= _dest.size()); - ret->data.copyTo(_dest); - return FullType(); - } - if (!ret) - { - // drop our last used cache sine we're allocating another 1GB. - get()->m_lastUsedFull.reset(); - - try { - boost::filesystem::create_directories(getDataDir("ethash")); - } catch (...) {} - - auto info = rlpList(Ethash::revision(), _seedHash); - std::string oldMemoFile = getDataDir("ethash") + "/full"; - std::string memoFile = getDataDir("ethash") + "/full-R" + toString(ETHASH_REVISION) + "-" + toHex(_seedHash.ref().cropped(0, 8)); - if (boost::filesystem::exists(oldMemoFile) && contents(oldMemoFile + ".info") == info) - { - // memofile valid - rename. - boost::filesystem::rename(oldMemoFile, memoFile); - } - - DEV_IGNORE_EXCEPTIONS(boost::filesystem::remove(oldMemoFile)); - DEV_IGNORE_EXCEPTIONS(boost::filesystem::remove(oldMemoFile + ".info")); + ethash_full_delete(full); +} - ethash_params p = params(_seedHash); - assert(!_dest || _dest.size() >= p.full_size); // must be big enough. +EthashAux::FullType EthashAux::full(BlockInfo const& _header) +{ + return full((uint64_t) _header.number); +} - bytesRef r = contentsNew(memoFile, _dest); - if (!r) - { - if (!_createIfMissing) - return FullType(); - // file didn't exist. - if (_dest) - // buffer was passed in - no insertion into cache nor need to allocate - r = _dest; - else - r = bytesRef(new byte[p.full_size], p.full_size); - ethash_prep_full(r.data(), &p, light(_seedHash)->light); - writeFile(memoFile, r); - } - if (_dest) - return FullType(); - ret = make_shared(r); - get()->m_fulls[_seedHash] = ret; +EthashAux::FullType EthashAux::full(uint64_t _blockNumber) +{ + h256 seedHash = EthashAux::seedHash(_blockNumber); + RecursiveGuard l(get()->x_this); + FullType ret = get()->m_fulls[seedHash].lock(); + if (ret) { + get()->m_lastUsedFull = ret; + return ret; } + get()->m_fulls[seedHash] = make_shared(light(_blockNumber)->light, nullptr); + ret = get()->m_fulls[seedHash].lock(); get()->m_lastUsedFull = ret; return ret; } -Ethash::Result EthashAux::eval(BlockInfo const& _header, Nonce const& _nonce) +Ethash::Result EthashAux::FullAllocation::compute(h256 const& _headerHash, Nonce const& _nonce) const { - return eval(_header.seedHash(), _header.headerHash(WithoutNonce), _nonce); + ethash_return_value_t r = ethash_full_compute(full, bytesToEthash256T(_headerHash.data()), (uint64_t)(u64)_nonce); + if (!r.success) + BOOST_THROW_EXCEPTION(DAGCreationFailure()); + return Ethash::Result{h256((uint8_t*)&r.result, h256::ConstructFromPointer), h256((uint8_t*)&r.mix_hash, h256::ConstructFromPointer)}; } -Ethash::Result EthashAux::FullAllocation::compute(h256 const& _seedHash, h256 const& _headerHash, Nonce const& _nonce) const +Ethash::Result EthashAux::LightAllocation::compute(h256 const& _headerHash, Nonce const& _nonce) const { - ethash_return_value r; - auto p = EthashAux::params(_seedHash); - ethash_compute_full(&r, data.data(), &p, _headerHash.data(), (uint64_t)(u64)_nonce); - return Ethash::Result{h256(r.result, h256::ConstructFromPointer), h256(r.mix_hash, h256::ConstructFromPointer)}; + ethash_return_value r = ethash_light_compute(light, bytesToEthash256T(_headerHash.data()), (uint64_t)(u64)_nonce); + if (!r.success) + BOOST_THROW_EXCEPTION(DAGCreationFailure()); + return Ethash::Result{h256((uint8_t*)&r.result, h256::ConstructFromPointer), h256((uint8_t*)&r.mix_hash, h256::ConstructFromPointer)}; } -Ethash::Result EthashAux::LightAllocation::compute(h256 const& _seedHash, h256 const& _headerHash, Nonce const& _nonce) const +Ethash::Result EthashAux::eval(BlockInfo const& _header, Nonce const& _nonce) { - ethash_return_value r; - auto p = EthashAux::params(_seedHash); - ethash_compute_light(&r, light, &p, _headerHash.data(), (uint64_t)(u64)_nonce); - return Ethash::Result{h256(r.result, h256::ConstructFromPointer), h256(r.mix_hash, h256::ConstructFromPointer)}; + return eval((uint64_t)_header.number, _header.headerHash(WithoutNonce), _nonce); } -Ethash::Result EthashAux::eval(h256 const& _seedHash, h256 const& _headerHash, Nonce const& _nonce) +Ethash::Result EthashAux::eval(uint64_t _blockNumber, h256 const& _headerHash, Nonce const& _nonce) { - if (auto dag = EthashAux::get()->full(_seedHash, bytesRef(), false)) - return dag->compute(_seedHash, _headerHash, _nonce); - return EthashAux::get()->light(_seedHash)->compute(_seedHash, _headerHash, _nonce); + if (auto dag = EthashAux::get()->full(_blockNumber)) + return dag->compute(_headerHash, _nonce); + return EthashAux::get()->light(_blockNumber)->compute(_headerHash, _nonce); } diff --git a/libethcore/EthashAux.h b/libethcore/EthashAux.h index 0389697f5..a2687766b 100644 --- a/libethcore/EthashAux.h +++ b/libethcore/EthashAux.h @@ -26,6 +26,7 @@ namespace dev { namespace eth{ + class EthashAux { public: @@ -33,39 +34,40 @@ public: static EthashAux* get() { if (!s_this) s_this = new EthashAux(); return s_this; } - struct FullAllocation - { - FullAllocation(bytesConstRef _d): data(_d) {} - ~FullAllocation() { delete [] data.data(); } - Ethash::Result compute(h256 const& _seedHash, h256 const& _headerHash, Nonce const& _nonce) const; - bytesConstRef const data; - }; - struct LightAllocation { - LightAllocation(h256 const& _seed); + LightAllocation(uint64_t _blockNumber); ~LightAllocation(); bytesConstRef data() const { return bytesConstRef((byte const*)light, size); } - Ethash::Result compute(h256 const& _seedHash, h256 const& _headerHash, Nonce const& _nonce) const; + Ethash::Result compute(h256 const& _headerHash, Nonce const& _nonce) const; ethash_light_t light; uint64_t size; }; + struct FullAllocation + { + FullAllocation(ethash_light_t _light, ethash_callback_t _cb); + ~FullAllocation(); + Ethash::Result compute(h256 const& _headerHash, Nonce const& _nonce) const; + void const* data() const { return ethash_full_dag(full); } + uint64_t size() const { return ethash_full_dag_size(full); } + ethash_full_t full; + }; + using LightType = std::shared_ptr; using FullType = std::shared_ptr; static h256 seedHash(unsigned _number); - static ethash_params params(BlockInfo const& _header); - static ethash_params params(h256 const& _seedHash); - static ethash_params params(unsigned _n); + static ethash_h256_t bytesToEthash256T(uint8_t const* _bytes); static LightType light(BlockInfo const& _header); - static LightType light(h256 const& _seedHash); - static FullType full(BlockInfo const& _header, bytesRef _dest = bytesRef(), bool _createIfMissing = true); - static FullType full(h256 const& _header, bytesRef _dest = bytesRef(), bool _createIfMissing = true); + static LightType light(uint64_t _blockNumber); + static FullType full(BlockInfo const& _header); + static FullType full(uint64_t _blockNumber); static Ethash::Result eval(BlockInfo const& _header) { return eval(_header, _header.nonce); } static Ethash::Result eval(BlockInfo const& _header, Nonce const& _nonce); - static Ethash::Result eval(h256 const& _seedHash, h256 const& _headerHash, Nonce const& _nonce); + static Ethash::Result eval(uint64_t _blockNumber, h256 const& _headerHash, Nonce const& _nonce); + private: EthashAux() {} diff --git a/libethcore/Exceptions.h b/libethcore/Exceptions.h index 3471a958f..8b73c96fe 100644 --- a/libethcore/Exceptions.h +++ b/libethcore/Exceptions.h @@ -73,6 +73,7 @@ class InvalidBlockNonce: virtual public dev::Exception {}; struct InvalidParentHash: virtual dev::Exception {}; struct InvalidNumber: virtual dev::Exception {}; struct InvalidContractAddress: virtual public dev::Exception {}; - +struct DAGCreationFailure: virtual public dev::Exception {}; +struct DAGComputeFailure: virtual public dev::Exception {}; } } diff --git a/test/libethcore/dagger.cpp b/test/libethcore/dagger.cpp index 119780346..e4ffb46f0 100644 --- a/test/libethcore/dagger.cpp +++ b/test/libethcore/dagger.cpp @@ -41,6 +41,7 @@ BOOST_AUTO_TEST_SUITE(DashimotoTests) BOOST_AUTO_TEST_CASE(basic_test) { +#if 0 // LTODO: Uncomment me and make me work !!! string testPath = test::getTestPath(); testPath += "/PoWTests"; @@ -78,6 +79,7 @@ BOOST_AUTO_TEST_CASE(basic_test) BOOST_REQUIRE_EQUAL(r.value, result); BOOST_REQUIRE_EQUAL(r.mixHash, header.mixHash); } +#endif } BOOST_AUTO_TEST_SUITE_END() From 40cf37dbb8ba6b5a4162f0c61e283a01cb0871df Mon Sep 17 00:00:00 2001 From: yann300 Date: Fri, 8 May 2015 10:31:10 +0200 Subject: [PATCH 091/461] - basic transaction creation. --- mix/ClientModel.cpp | 36 +++++++++++++++------ mix/ClientModel.h | 11 ++++--- mix/qml/QAddressView.qml | 57 +++++++++++++++++++++++++++++++++ mix/qml/StateListModel.qml | 8 +++-- mix/qml/StructView.qml | 29 ++--------------- mix/qml/TransactionDialog.qml | 55 +++++++++++++++++++++++++++++++ mix/qml/js/TransactionHelper.js | 3 +- 7 files changed, 156 insertions(+), 43 deletions(-) diff --git a/mix/ClientModel.cpp b/mix/ClientModel.cpp index 717757c70..7f4817c91 100644 --- a/mix/ClientModel.cpp +++ b/mix/ClientModel.cpp @@ -250,7 +250,10 @@ void ClientModel::setupState(QVariantMap _state) u256 value = (qvariant_cast(transaction.value("value")))->toU256Wei(); u256 gasPrice = (qvariant_cast(transaction.value("gasPrice")))->toU256Wei(); QString sender = transaction.value("sender").toString(); - bool isStdContract = (transaction.value("stdContract").toBool()); + bool isStdContract = transaction.value("stdContract").toBool(); + bool isContractCall; + if (!transaction.value("isContractCall").isNull()) + isContractCall = transaction.value("isContractCall").toBool(); if (isStdContract) { if (contractId.isEmpty()) //TODO: This is to support old project files, remove later @@ -266,7 +269,7 @@ void ClientModel::setupState(QVariantMap _state) { if (contractId.isEmpty() && m_codeModel->hasContract()) //TODO: This is to support old project files, remove later contractId = m_codeModel->contracts().keys()[0]; - TransactionSettings transactionSettings(contractId, functionId, value, gas, gasAuto, gasPrice, Secret(sender.toStdString())); + TransactionSettings transactionSettings(contractId, functionId, value, gas, gasAuto, gasPrice, Secret(sender.toStdString()), isContractCall); transactionSettings.parameterValues = transaction.value("parameters").toMap(); if (contractId == functionId || functionId == "Constructor") @@ -301,6 +304,13 @@ void ClientModel::executeSequence(vector const& _sequence, onStateReset(); for (TransactionSettings const& transaction: _sequence) { + if (!transaction.isContractCall) + { + QString address = resolveToken(transaction.contractId, deployedContracts); + callAddress(Address(address.toStdString()), bytes(), transaction); + onNewTransaction(); + continue; + } ContractCallDataEncoder encoder; if (!transaction.stdContractUrl.isEmpty()) { @@ -342,11 +352,8 @@ void ClientModel::executeSequence(vector const& _sequence, { QSolidityType const* type = p->type(); QVariant value = transaction.parameterValues.value(p->name()); - if (type->type().type == SolidityType::Type::Address && value.toString().startsWith("<") && value.toString().endsWith(">")) - { - QStringList nb = value.toString().remove("<").remove(">").split(" - "); - value = QVariant(QString::fromStdString("0x" + toHex(deployedContracts.at(nb.back().toInt()).ref()))); - } + if (type->type().type == SolidityType::Type::Address) + value = QVariant(resolveToken(value.toString(), deployedContracts)); encoder.encode(value, type->type()); } @@ -376,7 +383,7 @@ void ClientModel::executeSequence(vector const& _sequence, emit runStateChanged(); return; } - callContract(contractAddressIter->second, encoder.encodedData(), transaction); + callAddress(contractAddressIter->second, encoder.encodedData(), transaction); } } onNewTransaction(); @@ -399,6 +406,17 @@ void ClientModel::executeSequence(vector const& _sequence, }); } +QString ClientModel::resolveToken(QString const& _value, vector
const& _contracts) +{ + QString ret = _value; + if (_value.startsWith("<") && _value.endsWith(">")) + { + QStringList nb = ret.remove("<").remove(">").split(" - "); + ret = QString::fromStdString("0x" + toHex(_contracts.at(nb.back().toInt()).ref())); + } + return ret; +} + void ClientModel::showDebugger() { ExecutionResult last = m_client->lastExecution(); @@ -603,7 +621,7 @@ Address ClientModel::deployContract(bytes const& _code, TransactionSettings cons return newAddress; } -void ClientModel::callContract(Address const& _contract, bytes const& _data, TransactionSettings const& _tr) +void ClientModel::callAddress(Address const& _contract, bytes const& _data, TransactionSettings const& _tr) { m_client->submitTransaction(_tr.sender, _tr.value, _contract, _data, _tr.gas, _tr.gasPrice, _tr.gasAuto); } diff --git a/mix/ClientModel.h b/mix/ClientModel.h index 9b0529ae6..db11406d6 100644 --- a/mix/ClientModel.h +++ b/mix/ClientModel.h @@ -53,10 +53,10 @@ struct SolidityType; struct TransactionSettings { TransactionSettings() {} - TransactionSettings(QString const& _contractId, QString const& _functionId, u256 _value, u256 _gas, bool _gasAuto, u256 _gasPrice, Secret _sender): - contractId(_contractId), functionId(_functionId), value(_value), gas(_gas), gasAuto(_gasAuto), gasPrice(_gasPrice), sender(_sender) {} + TransactionSettings(QString const& _contractId, QString const& _functionId, u256 _value, u256 _gas, bool _gasAuto, u256 _gasPrice, Secret _sender, int _isContractCall): + contractId(_contractId), functionId(_functionId), value(_value), gas(_gas), gasAuto(_gasAuto), gasPrice(_gasPrice), sender(_sender), isContractCall(_isContractCall) {} TransactionSettings(QString const& _stdContractName, QString const& _stdContractUrl): - contractId(_stdContractName), gasAuto(true), stdContractUrl(_stdContractUrl) {} + contractId(_stdContractName), gasAuto(true), stdContractUrl(_stdContractUrl), isContractCall(true) {} /// Contract name QString contractId; @@ -76,6 +76,8 @@ struct TransactionSettings QString stdContractUrl; /// Sender Secret sender; + /// Is a call to a contract + bool isContractCall; }; @@ -220,12 +222,13 @@ private: QVariantMap gasCosts() const; void executeSequence(std::vector const& _sequence, std::map const& _accounts, Secret const& _miner); dev::Address deployContract(bytes const& _code, TransactionSettings const& _tr = TransactionSettings()); - void callContract(Address const& _contract, bytes const& _data, TransactionSettings const& _tr); + void callAddress(Address const& _contract, bytes const& _data, TransactionSettings const& _tr); void onNewTransaction(); void onStateReset(); void showDebuggerForTransaction(ExecutionResult const& _t); QVariant formatValue(SolidityType const& _type, dev::u256 const& _value); QVariant formatStorageValue(SolidityType const& _type, std::map const& _storage, unsigned _offset, dev::u256 const& _slot); + QString resolveToken(QString const& _value, std::vector
const& _contracts); std::atomic m_running; std::atomic m_mining; diff --git a/mix/qml/QAddressView.qml b/mix/qml/QAddressView.qml index 204e92508..19d98b166 100644 --- a/mix/qml/QAddressView.qml +++ b/mix/qml/QAddressView.qml @@ -8,6 +8,10 @@ Item property alias accountRef: ctrModel property string subType property bool readOnly + property alias currentIndex: trCombobox.currentIndex + property alias currentText: textinput.text + property variant accounts + signal indexChanged() id: editRoot height: 20 width: 320 @@ -17,6 +21,46 @@ Item id: boldFont } + function currentValue() { + return currentText; + } + + function currentType() + { + return accountRef.get(trCombobox.currentIndex).type; + } + + function load() + { + accountRef.clear(); + accountRef.append({"itemid": " - "}); + + if (subType === "contract" || subType === "address") + { + var trCr = 0; + for (var k = 0; k < transactionsModel.count; k++) + { + if (k >= transactionIndex) + break; + var tr = transactionsModel.get(k); + if (tr.functionId === tr.contractId /*&& (dec[1] === tr.contractId || item.subType === "address")*/) + { + accountRef.append({ "itemid": tr.contractId + " - " + trCr, "value": "<" + tr.contractId + " - " + trCr + ">", "type": "contract" }); + trCr++; + } + } + } + if (subType === "address") + { + for (k = 0; k < accounts.length; k++) + { + if (accounts[k].address === undefined) + accounts[k].address = clientModel.address(accounts[k].secret); + accountRef.append({ "itemid": accounts[k].name, "value": "0x" + accounts[k].address, "type": "address" }); + } + } + } + function init() { trCombobox.visible = !readOnly @@ -35,6 +79,18 @@ Item } } + function select(address) + { + for (var k = 0; k < accountRef.count; k++) + { + if (accountRef.get(k).value === address) + { + trCombobox.currentIndex = k; + break; + } + } + } + Rectangle { anchors.fill: parent radius: 4 @@ -96,6 +152,7 @@ Item { textinput.text = ""; } + indexChanged(); } } } diff --git a/mix/qml/StateListModel.qml b/mix/qml/StateListModel.qml index 889a2d940..d4aa678a6 100644 --- a/mix/qml/StateListModel.qml +++ b/mix/qml/StateListModel.qml @@ -46,6 +46,7 @@ Item { t.sender = defaultAccount; //support for old project var r = { + type: t.type, contractId: t.contractId, functionId: t.functionId, url: t.url, @@ -55,7 +56,8 @@ Item { gasAuto: t.gasAuto, stdContract: t.stdContract ? true : false, parameters: {}, - sender: t.sender + sender: t.sender, + isContractCall: t.isContractCall }; for (var key in t.parameters) r.parameters[key] = t.parameters[key]; @@ -100,6 +102,7 @@ Item { function toPlainTransactionItem(t) { var r = { + type: t.type, contractId: t.contractId, functionId: t.functionId, url: t.url, @@ -109,7 +112,8 @@ Item { gasPrice: { value: t.gasPrice.value, unit: t.gasPrice.unit }, stdContract: t.stdContract, sender: t.sender, - parameters: {} + parameters: {}, + isContractCall: t.isContractCall }; for (var key in t.parameters) r.parameters[key] = t.parameters[key]; diff --git a/mix/qml/StructView.qml b/mix/qml/StructView.qml index 4df9ace67..4feab2166 100644 --- a/mix/qml/StructView.qml +++ b/mix/qml/StructView.qml @@ -75,38 +75,13 @@ Column item.readOnly = context === "variable"; if (ptype.category === QSolidityType.Address) { + item.accounts = accounts item.value = getValue(); if (context === "parameter") { var dec = modelData.type.name.split(" "); item.subType = dec[0]; - item.accountRef.append({"itemid": " - "}); - - if (item.subType === "contract" || item.subType === "address") - { - var trCr = 0; - for (var k = 0; k < transactionsModel.count; k++) - { - if (k >= transactionIndex) - break; - var tr = transactionsModel.get(k); - if (tr.functionId === tr.contractId && (dec[1] === tr.contractId || item.subType === "address")) - { - item.accountRef.append({ "itemid": tr.contractId + " - " + trCr, "value": "<" + tr.contractId + " - " + trCr + ">", "type": "contract" }); - trCr++; - } - } - } - if (item.subType === "address") - { - for (k = 0; k < accounts.length; k++) - { - if (accounts[k].address === undefined) - accounts[k].address = clientModel.address(accounts[k].secret); - item.accountRef.append({ "itemid": accounts[k].name, "value": "0x" + accounts[k].address, "type": "address" }); - } - - } + item.load(); } item.init(); } diff --git a/mix/qml/TransactionDialog.qml b/mix/qml/TransactionDialog.qml index 66a98d19e..f56093336 100644 --- a/mix/qml/TransactionDialog.qml +++ b/mix/qml/TransactionDialog.qml @@ -82,6 +82,14 @@ Dialog { } initTypeLoader(); + trType.checked = item.isContractCall + trType.init(); + + recipients.accounts = senderComboBox.model; + recipients.subType = "address"; + recipients.load(); + recipients.init(); + recipients.select(contractId); visible = true; valueField.focus = true; } @@ -193,6 +201,13 @@ Dialog { item.functionId = transactionDialog.functionId; } + item.isContractCall = trType.checked; + if (!item.isContractCall) + { + item.functionId = recipients.currentText; + item.contractId = recipients.currentText; + } + item.sender = senderComboBox.model[senderComboBox.currentIndex].secret; item.parameters = paramValues; return item; @@ -238,6 +253,46 @@ Dialog { } } + RowLayout + { + id: rowIsContract + Layout.fillWidth: true + height: 150 + CheckBox { + id: trType + onCheckedChanged: + { + init(); + } + + function init() + { + rowFunction.visible = checked; + rowContract.visible = checked; + rowRecipient.visible = !checked; + } + + text: qsTr("is contract call") + checked: true + } + } + + RowLayout + { + id: rowRecipient + Layout.fillWidth: true + height: 150 + DefaultLabel { + Layout.preferredWidth: 75 + text: qsTr("Recipient") + } + + QAddressView + { + id: recipients + } + } + RowLayout { id: rowContract diff --git a/mix/qml/js/TransactionHelper.js b/mix/qml/js/TransactionHelper.js index be057917c..57b03757a 100644 --- a/mix/qml/js/TransactionHelper.js +++ b/mix/qml/js/TransactionHelper.js @@ -9,7 +9,8 @@ function defaultTransaction() gasAuto: true, gasPrice: createEther("100000", QEther.Wei), parameters: {}, - stdContract: false + stdContract: false, + isContractCall: true }; } From 446abc57e55b3d6ba70875a06fd09b7964ecc7fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Fri, 8 May 2015 11:00:17 +0200 Subject: [PATCH 092/461] testeth: fix --singletest option --- test/TestHelper.cpp | 89 +++++++++++++++----------------- test/TestHelper.h | 3 +- test/libethereum/blockchain.cpp | 2 +- test/libethereum/state.cpp | 2 +- test/libethereum/transaction.cpp | 2 +- test/libevm/vm.cpp | 2 +- 6 files changed, 47 insertions(+), 53 deletions(-) diff --git a/test/TestHelper.cpp b/test/TestHelper.cpp index 144a1a286..e0aad310f 100644 --- a/test/TestHelper.cpp +++ b/test/TestHelper.cpp @@ -549,58 +549,50 @@ void checkCallCreates(eth::Transactions _resultCallCreates, eth::Transactions _e } } -void userDefinedTest(string testTypeFlag, std::function doTests) +void userDefinedTest(std::function doTests) { - Options::get(); // parse command line options, e.g. to enable JIT + if (!Options::get().singleTest) + { + cnote << "Missing user test specification\nUsage: testeth --singletest \n"; + return; + } - for (int i = 1; i < boost::unit_test::framework::master_test_suite().argc; ++i) + auto& filename = Options::get().singleTestFile; + auto& testname = Options::get().singleTestName; + int currentVerbosity = g_logVerbosity; + g_logVerbosity = 12; + try { - string arg = boost::unit_test::framework::master_test_suite().argv[i]; - if (arg == testTypeFlag) - { - if (boost::unit_test::framework::master_test_suite().argc <= i + 2) - { - cnote << "Missing filename\nUsage: testeth " << testTypeFlag << " \n"; - return; - } - string filename = boost::unit_test::framework::master_test_suite().argv[i + 1]; - string testname = boost::unit_test::framework::master_test_suite().argv[i + 2]; - int currentVerbosity = g_logVerbosity; - g_logVerbosity = 12; - try - { - cnote << "Testing user defined test: " << filename; - json_spirit::mValue v; - string s = asString(contents(filename)); - BOOST_REQUIRE_MESSAGE(s.length() > 0, "Contents of " + filename + " is empty. "); - json_spirit::read_string(s, v); - json_spirit::mObject oSingleTest; - - json_spirit::mObject::const_iterator pos = v.get_obj().find(testname); - if (pos == v.get_obj().end()) - { - cnote << "Could not find test: " << testname << " in " << filename << "\n"; - return; - } - else - oSingleTest[pos->first] = pos->second; + cnote << "Testing user defined test: " << filename; + json_spirit::mValue v; + string s = asString(contents(filename)); + BOOST_REQUIRE_MESSAGE(s.length() > 0, "Contents of " + filename + " is empty. "); + json_spirit::read_string(s, v); + json_spirit::mObject oSingleTest; - json_spirit::mValue v_singleTest(oSingleTest); - doTests(v_singleTest, false); - } - catch (Exception const& _e) - { - BOOST_ERROR("Failed Test with Exception: " << diagnostic_information(_e)); - g_logVerbosity = currentVerbosity; - } - catch (std::exception const& _e) - { - BOOST_ERROR("Failed Test with Exception: " << _e.what()); - g_logVerbosity = currentVerbosity; - } - g_logVerbosity = currentVerbosity; + json_spirit::mObject::const_iterator pos = v.get_obj().find(testname); + if (pos == v.get_obj().end()) + { + cnote << "Could not find test: " << testname << " in " << filename << "\n"; + return; } + else + oSingleTest[pos->first] = pos->second; + + json_spirit::mValue v_singleTest(oSingleTest); + doTests(v_singleTest, false); + } + catch (Exception const& _e) + { + BOOST_ERROR("Failed Test with Exception: " << diagnostic_information(_e)); + g_logVerbosity = currentVerbosity; + } + catch (std::exception const& _e) + { + BOOST_ERROR("Failed Test with Exception: " << _e.what()); + g_logVerbosity = currentVerbosity; } + g_logVerbosity = currentVerbosity; } void executeTests(const string& _name, const string& _testPathAppendix, const boost::filesystem::path _pathToFiller, std::function doTests) @@ -740,10 +732,11 @@ Options::Options() inputLimits = true; bigData = true; } - else if (arg == "--singletest" && i + 1 < argc) + else if (arg == "--singletest" && i + 2 < argc) { singleTest = true; - singleTestName = argv[i + 1]; + singleTestFile = argv[i + 1]; + singleTestName = argv[i + 2]; } } } diff --git a/test/TestHelper.h b/test/TestHelper.h index 02f509e4c..631bc4df2 100644 --- a/test/TestHelper.h +++ b/test/TestHelper.h @@ -157,7 +157,7 @@ void checkLog(eth::LogEntries _resultLogs, eth::LogEntries _expectedLogs); void checkCallCreates(eth::Transactions _resultCallCreates, eth::Transactions _expectedCallCreates); void executeTests(const std::string& _name, const std::string& _testPathAppendix, const boost::filesystem::path _pathToFiller, std::function doTests); -void userDefinedTest(std::string testTypeFlag, std::function doTests); +void userDefinedTest(std::function doTests); RLPStream createRLPStreamFromTransactionFields(json_spirit::mObject& _tObj); eth::LastHashes lastHashes(u256 _currentBlockNumber); json_spirit::mObject fillJsonWithState(eth::State _state); @@ -189,6 +189,7 @@ public: /// Test selection /// @{ bool singleTest = false; + std::string singleTestFile; std::string singleTestName; bool performance = false; bool quadratic = false; diff --git a/test/libethereum/blockchain.cpp b/test/libethereum/blockchain.cpp index 954e65c8a..9eddb4657 100644 --- a/test/libethereum/blockchain.cpp +++ b/test/libethereum/blockchain.cpp @@ -711,7 +711,7 @@ BOOST_AUTO_TEST_CASE(bcWalletTest) BOOST_AUTO_TEST_CASE(userDefinedFile) { - dev::test::userDefinedTest("--singletest", dev::test::doBlockchainTests); + dev::test::userDefinedTest(dev::test::doBlockchainTests); } BOOST_AUTO_TEST_SUITE_END() diff --git a/test/libethereum/state.cpp b/test/libethereum/state.cpp index 93f7498b8..b7b45f93a 100644 --- a/test/libethereum/state.cpp +++ b/test/libethereum/state.cpp @@ -265,7 +265,7 @@ BOOST_AUTO_TEST_CASE(stRandom) BOOST_AUTO_TEST_CASE(userDefinedFileState) { - dev::test::userDefinedTest("--singletest", dev::test::doStateTests); + dev::test::userDefinedTest(dev::test::doStateTests); } BOOST_AUTO_TEST_SUITE_END() diff --git a/test/libethereum/transaction.cpp b/test/libethereum/transaction.cpp index 058d03322..017e51ded 100644 --- a/test/libethereum/transaction.cpp +++ b/test/libethereum/transaction.cpp @@ -195,7 +195,7 @@ BOOST_AUTO_TEST_CASE(ttCreateTest) BOOST_AUTO_TEST_CASE(userDefinedFile) { - dev::test::userDefinedTest("--singletest", dev::test::doTransactionTests); + dev::test::userDefinedTest(dev::test::doTransactionTests); } BOOST_AUTO_TEST_SUITE_END() diff --git a/test/libevm/vm.cpp b/test/libevm/vm.cpp index 8b5a7c5d3..2d67d7670 100644 --- a/test/libevm/vm.cpp +++ b/test/libevm/vm.cpp @@ -548,7 +548,7 @@ BOOST_AUTO_TEST_CASE(vmRandom) BOOST_AUTO_TEST_CASE(userDefinedFile) { - dev::test::userDefinedTest("--singletest", dev::test::doVMTests); + dev::test::userDefinedTest(dev::test::doVMTests); } BOOST_AUTO_TEST_SUITE_END() From 5fe68b07c1236c64f58fa7b42bcfb6cc6506e957 Mon Sep 17 00:00:00 2001 From: yann300 Date: Fri, 8 May 2015 14:14:27 +0200 Subject: [PATCH 093/461] small changes --- mix/ClientModel.cpp | 2 +- mix/qml/StateListModel.qml | 2 ++ mix/qml/TransactionDialog.qml | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/mix/ClientModel.cpp b/mix/ClientModel.cpp index d802d9a7b..95d4d497b 100644 --- a/mix/ClientModel.cpp +++ b/mix/ClientModel.cpp @@ -418,7 +418,7 @@ QString ClientModel::resolveToken(QString const& _value, vector
const& if (_value.startsWith("<") && _value.endsWith(">")) { QStringList nb = ret.remove("<").remove(">").split(" - "); - ret = QString::fromStdString("0x" + toHex(_contracts.at(nb.back().toInt()).ref())); + ret = QString::fromStdString("0x" + dev::toHex(_contracts.at(nb.back().toInt()).ref())); } return ret; } diff --git a/mix/qml/StateListModel.qml b/mix/qml/StateListModel.qml index d4aa678a6..3eac14a11 100644 --- a/mix/qml/StateListModel.qml +++ b/mix/qml/StateListModel.qml @@ -59,6 +59,8 @@ Item { sender: t.sender, isContractCall: t.isContractCall }; + if (r.isContractCall === undefined) + r.isContractCall = true; //support for old project for (var key in t.parameters) r.parameters[key] = t.parameters[key]; diff --git a/mix/qml/TransactionDialog.qml b/mix/qml/TransactionDialog.qml index f56093336..84abb854b 100644 --- a/mix/qml/TransactionDialog.qml +++ b/mix/qml/TransactionDialog.qml @@ -270,6 +270,8 @@ Dialog { rowFunction.visible = checked; rowContract.visible = checked; rowRecipient.visible = !checked; + paramLabel.visible = checked; + paramScroll.visible = checked; } text: qsTr("is contract call") From 6b28fbe4a6113897d121257a5d97797c014c583d Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Fri, 8 May 2015 15:55:27 +0200 Subject: [PATCH 094/461] Further fixes in Ethash integration and testing --- libethcore/Ethash.cpp | 3 ++- libethcore/EthashAux.cpp | 26 +++++++++++++++++++++----- libethcore/EthashAux.h | 8 +++++--- test/libethcore/dagger.cpp | 8 +++----- 4 files changed, 31 insertions(+), 14 deletions(-) diff --git a/libethcore/Ethash.cpp b/libethcore/Ethash.cpp index 45addd278..163e1140b 100644 --- a/libethcore/Ethash.cpp +++ b/libethcore/Ethash.cpp @@ -311,7 +311,8 @@ void Ethash::GPUMiner::workLoop() unsigned device = instances() > 1 ? index() : s_deviceId; EthashAux::FullType dag = EthashAux::full(w.blockNumber); - m_miner->init((uint8_t const*)dag->data(), dag->size(), 32, s_platformId, device); + bytesConstRef dagData = dag->data(); + m_miner->init(dagData.data(), dagData.size(), 32, s_platformId, device); } uint64_t upper64OfBoundary = (uint64_t)(u64)((u256)w.boundary >> 192); diff --git a/libethcore/EthashAux.cpp b/libethcore/EthashAux.cpp index 52ced9d0d..0f4591d7d 100644 --- a/libethcore/EthashAux.cpp +++ b/libethcore/EthashAux.cpp @@ -33,6 +33,7 @@ #include #include #include +#include #include "BlockInfo.h" #include "Exceptions.h" using namespace std; @@ -54,6 +55,11 @@ ethash_h256_t EthashAux::bytesToEthash256T(uint8_t const* _bytes) return ret; } +uint64_t EthashAux::cacheSize(BlockInfo const& _header) +{ + return ethash_get_cachesize((uint64_t)_header.number); +} + h256 EthashAux::seedHash(unsigned _number) { unsigned epoch = _number / ETHASH_EPOCH_LENGTH; @@ -91,8 +97,8 @@ EthashAux::LightType EthashAux::light(BlockInfo const& _header) EthashAux::LightType EthashAux::light(uint64_t _blockNumber) { - h256 seedHash = EthashAux::seedHash(_blockNumber); RecursiveGuard l(get()->x_this); + h256 seedHash = EthashAux::seedHash(_blockNumber); LightType ret = get()->m_lights[seedHash]; return ret ? ret : (get()->m_lights[seedHash] = make_shared(_blockNumber)); } @@ -100,6 +106,7 @@ EthashAux::LightType EthashAux::light(uint64_t _blockNumber) EthashAux::LightAllocation::LightAllocation(uint64_t _blockNumber) { light = ethash_light_new(_blockNumber); + size = ethash_get_cachesize(_blockNumber); } EthashAux::LightAllocation::~LightAllocation() @@ -107,6 +114,11 @@ EthashAux::LightAllocation::~LightAllocation() ethash_light_delete(light); } +bytesConstRef EthashAux::LightAllocation::data() const +{ + return bytesConstRef((byte const*)light->cache, size); +} + EthashAux::FullAllocation::FullAllocation(ethash_light_t _light, ethash_callback_t _cb) { full = ethash_full_new(_light, _cb); @@ -117,6 +129,11 @@ EthashAux::FullAllocation::~FullAllocation() ethash_full_delete(full); } +bytesConstRef EthashAux::FullAllocation::data() const +{ + return bytesConstRef((byte const*)ethash_full_dag(full), size()); +} + EthashAux::FullType EthashAux::full(BlockInfo const& _header) { return full((uint64_t) _header.number); @@ -124,16 +141,15 @@ EthashAux::FullType EthashAux::full(BlockInfo const& _header) EthashAux::FullType EthashAux::full(uint64_t _blockNumber) { - h256 seedHash = EthashAux::seedHash(_blockNumber); RecursiveGuard l(get()->x_this); + h256 seedHash = EthashAux::seedHash(_blockNumber); FullType ret = get()->m_fulls[seedHash].lock(); if (ret) { get()->m_lastUsedFull = ret; return ret; } - get()->m_fulls[seedHash] = make_shared(light(_blockNumber)->light, nullptr); - ret = get()->m_fulls[seedHash].lock(); - get()->m_lastUsedFull = ret; + ret = get()->m_lastUsedFull = make_shared(light(_blockNumber)->light, nullptr); + get()->m_fulls[seedHash] = ret; return ret; } diff --git a/libethcore/EthashAux.h b/libethcore/EthashAux.h index a2687766b..6422f0db9 100644 --- a/libethcore/EthashAux.h +++ b/libethcore/EthashAux.h @@ -38,7 +38,7 @@ public: { LightAllocation(uint64_t _blockNumber); ~LightAllocation(); - bytesConstRef data() const { return bytesConstRef((byte const*)light, size); } + bytesConstRef data() const; Ethash::Result compute(h256 const& _headerHash, Nonce const& _nonce) const; ethash_light_t light; uint64_t size; @@ -49,16 +49,18 @@ public: FullAllocation(ethash_light_t _light, ethash_callback_t _cb); ~FullAllocation(); Ethash::Result compute(h256 const& _headerHash, Nonce const& _nonce) const; - void const* data() const { return ethash_full_dag(full); } + bytesConstRef data() const; uint64_t size() const { return ethash_full_dag_size(full); } ethash_full_t full; }; - + using LightType = std::shared_ptr; using FullType = std::shared_ptr; static h256 seedHash(unsigned _number); static ethash_h256_t bytesToEthash256T(uint8_t const* _bytes); + static uint64_t cacheSize(BlockInfo const& _header); + static LightType light(BlockInfo const& _header); static LightType light(uint64_t _blockNumber); static FullType full(BlockInfo const& _header); diff --git a/test/libethcore/dagger.cpp b/test/libethcore/dagger.cpp index e4ffb46f0..4faf0a283 100644 --- a/test/libethcore/dagger.cpp +++ b/test/libethcore/dagger.cpp @@ -41,7 +41,6 @@ BOOST_AUTO_TEST_SUITE(DashimotoTests) BOOST_AUTO_TEST_CASE(basic_test) { -#if 0 // LTODO: Uncomment me and make me work !!! string testPath = test::getTestPath(); testPath += "/PoWTests"; @@ -64,14 +63,14 @@ BOOST_AUTO_TEST_CASE(basic_test) unsigned cacheSize(o["cache_size"].get_int()); h256 cacheHash(o["cache_hash"].get_str()); - BOOST_REQUIRE_EQUAL(EthashAux::get()->params(header).cache_size, cacheSize); + BOOST_REQUIRE_EQUAL(EthashAux::get()->light(header)->size, cacheSize); BOOST_REQUIRE_EQUAL(sha3(EthashAux::get()->light(header)->data()), cacheHash); #if TEST_FULL unsigned fullSize(o["full_size"].get_int()); h256 fullHash(o["full_hash"].get_str()); - BOOST_REQUIRE_EQUAL(EthashAux::get()->full(header).size(), fullSize); - BOOST_REQUIRE_EQUAL(sha3(EthashAux::get()->full(header)), fullHash); + BOOST_REQUIRE_EQUAL(EthashAux::get()->full(header)->size(), fullSize); + BOOST_REQUIRE_EQUAL(sha3(EthashAux::get()->full(header)->data()), fullHash); #endif h256 result(o["result"].get_str()); @@ -79,7 +78,6 @@ BOOST_AUTO_TEST_CASE(basic_test) BOOST_REQUIRE_EQUAL(r.value, result); BOOST_REQUIRE_EQUAL(r.mixHash, header.mixHash); } -#endif } BOOST_AUTO_TEST_SUITE_END() From 4134160f9a94d9e3b7f44868deb9dacec2c5d52d Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Fri, 8 May 2015 16:52:56 +0200 Subject: [PATCH 095/461] Remove unneeded function for ethash to our h256 conversion --- libethcore/Ethash.cpp | 2 +- libethcore/EthashAux.cpp | 12 ++---------- libethcore/EthashAux.h | 1 - 3 files changed, 3 insertions(+), 12 deletions(-) diff --git a/libethcore/Ethash.cpp b/libethcore/Ethash.cpp index 163e1140b..db1a17b0a 100644 --- a/libethcore/Ethash.cpp +++ b/libethcore/Ethash.cpp @@ -140,7 +140,7 @@ void Ethash::CPUMiner::workLoop() unsigned hashCount = 1; for (; !shouldStop(); tryNonce++, hashCount++) { - ethashReturn = ethash_full_compute(dag->full, EthashAux::bytesToEthash256T(w.headerHash.data()), tryNonce); + ethashReturn = ethash_full_compute(dag->full, *(ethash_h256_t*)w.headerHash.data(), tryNonce); h256 value = h256((uint8_t*)ðashReturn.result, h256::ConstructFromPointer); if (value <= boundary && submitProof(Solution{(Nonce)(u64)tryNonce, h256((uint8_t*)ðashReturn.mix_hash, h256::ConstructFromPointer)})) break; diff --git a/libethcore/EthashAux.cpp b/libethcore/EthashAux.cpp index 0f4591d7d..8851f4c7b 100644 --- a/libethcore/EthashAux.cpp +++ b/libethcore/EthashAux.cpp @@ -41,20 +41,12 @@ using namespace chrono; using namespace dev; using namespace eth; - EthashAux* dev::eth::EthashAux::s_this = nullptr; EthashAux::~EthashAux() { } -ethash_h256_t EthashAux::bytesToEthash256T(uint8_t const* _bytes) -{ - ethash_h256_t ret; - memcpy(&ret, _bytes, 32); - return ret; -} - uint64_t EthashAux::cacheSize(BlockInfo const& _header) { return ethash_get_cachesize((uint64_t)_header.number); @@ -155,7 +147,7 @@ EthashAux::FullType EthashAux::full(uint64_t _blockNumber) Ethash::Result EthashAux::FullAllocation::compute(h256 const& _headerHash, Nonce const& _nonce) const { - ethash_return_value_t r = ethash_full_compute(full, bytesToEthash256T(_headerHash.data()), (uint64_t)(u64)_nonce); + ethash_return_value_t r = ethash_full_compute(full, *(ethash_h256_t*)_headerHash.data(), (uint64_t)(u64)_nonce); if (!r.success) BOOST_THROW_EXCEPTION(DAGCreationFailure()); return Ethash::Result{h256((uint8_t*)&r.result, h256::ConstructFromPointer), h256((uint8_t*)&r.mix_hash, h256::ConstructFromPointer)}; @@ -163,7 +155,7 @@ Ethash::Result EthashAux::FullAllocation::compute(h256 const& _headerHash, Nonce Ethash::Result EthashAux::LightAllocation::compute(h256 const& _headerHash, Nonce const& _nonce) const { - ethash_return_value r = ethash_light_compute(light, bytesToEthash256T(_headerHash.data()), (uint64_t)(u64)_nonce); + ethash_return_value r = ethash_light_compute(light, *(ethash_h256_t*)_headerHash.data(), (uint64_t)(u64)_nonce); if (!r.success) BOOST_THROW_EXCEPTION(DAGCreationFailure()); return Ethash::Result{h256((uint8_t*)&r.result, h256::ConstructFromPointer), h256((uint8_t*)&r.mix_hash, h256::ConstructFromPointer)}; diff --git a/libethcore/EthashAux.h b/libethcore/EthashAux.h index 6422f0db9..3a5abf3e3 100644 --- a/libethcore/EthashAux.h +++ b/libethcore/EthashAux.h @@ -58,7 +58,6 @@ public: using FullType = std::shared_ptr; static h256 seedHash(unsigned _number); - static ethash_h256_t bytesToEthash256T(uint8_t const* _bytes); static uint64_t cacheSize(BlockInfo const& _header); static LightType light(BlockInfo const& _header); From ab7b092b47732a3f5c0b8d3c38fc2c0ff7e947dd Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Fri, 8 May 2015 17:25:21 +0200 Subject: [PATCH 096/461] Fix EthashAux eval(). Dagger tests now pass --- libethcore/EthashAux.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libethcore/EthashAux.cpp b/libethcore/EthashAux.cpp index 8851f4c7b..5a1741070 100644 --- a/libethcore/EthashAux.cpp +++ b/libethcore/EthashAux.cpp @@ -135,8 +135,9 @@ EthashAux::FullType EthashAux::full(uint64_t _blockNumber) { RecursiveGuard l(get()->x_this); h256 seedHash = EthashAux::seedHash(_blockNumber); - FullType ret = get()->m_fulls[seedHash].lock(); - if (ret) { + FullType ret; + if ((ret = get()->m_fulls[seedHash].lock())) + { get()->m_lastUsedFull = ret; return ret; } @@ -168,7 +169,8 @@ Ethash::Result EthashAux::eval(BlockInfo const& _header, Nonce const& _nonce) Ethash::Result EthashAux::eval(uint64_t _blockNumber, h256 const& _headerHash, Nonce const& _nonce) { - if (auto dag = EthashAux::get()->full(_blockNumber)) + h256 seedHash = EthashAux::seedHash(_blockNumber); + if (FullType dag = get()->m_fulls[seedHash].lock()) return dag->compute(_headerHash, _nonce); return EthashAux::get()->light(_blockNumber)->compute(_headerHash, _nonce); } From 7802a9e00cca9070a7d20f8157611cfed26c2ecb Mon Sep 17 00:00:00 2001 From: yann300 Date: Fri, 8 May 2015 17:27:15 +0200 Subject: [PATCH 097/461] bug fix --- mix/ClientModel.cpp | 36 ++++++++----- mix/ClientModel.h | 11 ++-- mix/qml/QAddressView.qml | 5 ++ mix/qml/StateDialog.qml | 4 +- mix/qml/StateListModel.qml | 14 +++-- mix/qml/TransactionDialog.qml | 92 +++++++++++++++++++++++---------- mix/qml/js/TransactionHelper.js | 3 +- 7 files changed, 112 insertions(+), 53 deletions(-) diff --git a/mix/ClientModel.cpp b/mix/ClientModel.cpp index 95d4d497b..a58366046 100644 --- a/mix/ClientModel.cpp +++ b/mix/ClientModel.cpp @@ -256,9 +256,9 @@ void ClientModel::setupState(QVariantMap _state) u256 gasPrice = (qvariant_cast(transaction.value("gasPrice")))->toU256Wei(); QString sender = transaction.value("sender").toString(); bool isStdContract = transaction.value("stdContract").toBool(); - bool isContractCall; - if (!transaction.value("isContractCall").isNull()) - isContractCall = transaction.value("isContractCall").toBool(); + bool isContractCreation; + if (!transaction.value("isContractCreation").isNull()) + isContractCreation = transaction.value("isContractCreation").toBool(); if (isStdContract) { if (contractId.isEmpty()) //TODO: This is to support old project files, remove later @@ -274,7 +274,7 @@ void ClientModel::setupState(QVariantMap _state) { if (contractId.isEmpty() && m_codeModel->hasContract()) //TODO: This is to support old project files, remove later contractId = m_codeModel->contracts().keys()[0]; - TransactionSettings transactionSettings(contractId, functionId, value, gas, gasAuto, gasPrice, Secret(sender.toStdString()), isContractCall); + TransactionSettings transactionSettings(contractId, functionId, value, gas, gasAuto, gasPrice, Secret(sender.toStdString()), isContractCreation); transactionSettings.parameterValues = transaction.value("parameters").toMap(); if (contractId == functionId || functionId == "Constructor") @@ -310,9 +310,10 @@ void ClientModel::executeSequence(vector const& _sequence, m_gasCosts.clear(); for (TransactionSettings const& transaction: _sequence) { - if (!transaction.isContractCall) + QString contractName = resolveContractName(transaction.contractId); + QString address = resolveToken(transaction.contractId, deployedContracts); + if (transaction.functionId == "(transfert)") { - QString address = resolveToken(transaction.contractId, deployedContracts); callAddress(Address(address.toStdString()), bytes(), transaction); onNewTransaction(); continue; @@ -332,7 +333,7 @@ void ClientModel::executeSequence(vector const& _sequence, else { //encode data - CompiledContract const& compilerRes = m_codeModel->contract(transaction.contractId); + CompiledContract const& compilerRes = m_codeModel->contract(contractName); QFunctionDefinition const* f = nullptr; bytes contractCode = compilerRes.bytes(); shared_ptr contractDef = compilerRes.sharedContract(); @@ -363,7 +364,7 @@ void ClientModel::executeSequence(vector const& _sequence, encoder.encode(value, type->type()); } - if (transaction.functionId.isEmpty() || transaction.functionId == transaction.contractId) + if (transaction.functionId.isEmpty() || transaction.functionId == contractName) { bytes param = encoder.encodedData(); contractCode.insert(contractCode.end(), param.begin(), param.end()); @@ -372,8 +373,9 @@ void ClientModel::executeSequence(vector const& _sequence, auto contractAddressIter = m_contractAddresses.find(transaction.contractId); if (contractAddressIter == m_contractAddresses.end() || newAddress != contractAddressIter->second) { - m_contractAddresses[transaction.contractId] = newAddress; - m_contractNames[newAddress] = transaction.contractId; + QString contractToken = "<" + transaction.contractId + " - " + QString::number(deployedContracts.size() - 1) + ">"; + m_contractAddresses[contractToken] = newAddress; + m_contractNames[newAddress] = contractToken; contractAddressesChanged(); } gasCostsChanged(); @@ -388,7 +390,7 @@ void ClientModel::executeSequence(vector const& _sequence, emit runStateChanged(); return; } - callAddress(contractAddressIter->second, encoder.encodedData(), transaction); + callAddress(Address(address.toStdString()), encoder.encodedData(), transaction); } m_gasCosts.append(m_client->lastExecution().gasUsed); } @@ -423,6 +425,14 @@ QString ClientModel::resolveToken(QString const& _value, vector
const& return ret; } +QString ClientModel::resolveContractName(QString const& _value) +{ + QString ret = _value; + if (_value.startsWith("<") && _value.endsWith(">")) + ret = ret.remove("<").remove(">").split(" - ").first(); + return ret; +} + void ClientModel::showDebugger() { ExecutionResult last = m_client->lastExecution(); @@ -446,7 +456,7 @@ void ClientModel::showDebuggerForTransaction(ExecutionResult const& _t) //try to resolve contract for source level debugging auto nameIter = m_contractNames.find(code.address); CompiledContract const* compilerRes = nullptr; - if (nameIter != m_contractNames.end() && (compilerRes = m_codeModel->tryGetContract(nameIter->second))) //returned object is guaranteed to live till the end of event handler in main thread + if (nameIter != m_contractNames.end() && (compilerRes = m_codeModel->tryGetContract(resolveContractName(nameIter->second)))) //returned object is guaranteed to live till the end of event handler in main thread { eth::AssemblyItems assemblyItems = !_t.isConstructor() ? compilerRes->assemblyItems() : compilerRes->constructorAssemblyItems(); codes.back()->setDocument(compilerRes->documentId()); @@ -707,7 +717,7 @@ void ClientModel::onNewTransaction() auto contractAddressIter = m_contractNames.find(contractAddress); if (contractAddressIter != m_contractNames.end()) { - CompiledContract const& compilerRes = m_codeModel->contract(contractAddressIter->second); + CompiledContract const& compilerRes = m_codeModel->contract(resolveContractName(contractAddressIter->second)); const QContractDefinition* def = compilerRes.contract(); contract = def->name(); if (abi) diff --git a/mix/ClientModel.h b/mix/ClientModel.h index 46cabe450..15cdc7086 100644 --- a/mix/ClientModel.h +++ b/mix/ClientModel.h @@ -53,10 +53,10 @@ struct SolidityType; struct TransactionSettings { TransactionSettings() {} - TransactionSettings(QString const& _contractId, QString const& _functionId, u256 _value, u256 _gas, bool _gasAuto, u256 _gasPrice, Secret _sender, int _isContractCall): - contractId(_contractId), functionId(_functionId), value(_value), gas(_gas), gasAuto(_gasAuto), gasPrice(_gasPrice), sender(_sender), isContractCall(_isContractCall) {} + TransactionSettings(QString const& _contractId, QString const& _functionId, u256 _value, u256 _gas, bool _gasAuto, u256 _gasPrice, Secret _sender, int _isContractCreation): + contractId(_contractId), functionId(_functionId), value(_value), gas(_gas), gasAuto(_gasAuto), gasPrice(_gasPrice), sender(_sender), isContractCreation(_isContractCreation) {} TransactionSettings(QString const& _stdContractName, QString const& _stdContractUrl): - contractId(_stdContractName), gasAuto(true), stdContractUrl(_stdContractUrl), isContractCall(true) {} + contractId(_stdContractName), gasAuto(true), stdContractUrl(_stdContractUrl), isContractCreation(true) {} /// Contract name QString contractId; @@ -76,8 +76,8 @@ struct TransactionSettings QString stdContractUrl; /// Sender Secret sender; - /// Is a call to a contract - bool isContractCall; + /// Tr deploys a contract + bool isContractCreation; }; @@ -231,6 +231,7 @@ private: QVariant formatValue(SolidityType const& _type, dev::u256 const& _value); QVariant formatStorageValue(SolidityType const& _type, std::map const& _storage, unsigned _offset, dev::u256 const& _slot); QString resolveToken(QString const& _value, std::vector
const& _contracts); + QString resolveContractName(QString const& _value); std::atomic m_running; std::atomic m_mining; diff --git a/mix/qml/QAddressView.qml b/mix/qml/QAddressView.qml index 19d98b166..c880f0904 100644 --- a/mix/qml/QAddressView.qml +++ b/mix/qml/QAddressView.qml @@ -30,6 +30,11 @@ Item return accountRef.get(trCombobox.currentIndex).type; } + function current() + { + return accountRef.get(trCombobox.currentIndex); + } + function load() { accountRef.clear(); diff --git a/mix/qml/StateDialog.qml b/mix/qml/StateDialog.qml index 13d01d474..f8da6dabd 100644 --- a/mix/qml/StateDialog.qml +++ b/mix/qml/StateDialog.qml @@ -436,7 +436,7 @@ Dialog { model: transactionsModel headerVisible: false TableViewColumn { - role: "name" + role: "label" title: qsTr("Name") width: 150 delegate: Item { @@ -476,7 +476,7 @@ Dialog { text: { if (styleData.row >= 0) return transactionsModel.get( - styleData.row).functionId + styleData.row).label else return "" } diff --git a/mix/qml/StateListModel.qml b/mix/qml/StateListModel.qml index 3eac14a11..a6069d620 100644 --- a/mix/qml/StateListModel.qml +++ b/mix/qml/StateListModel.qml @@ -57,10 +57,15 @@ Item { stdContract: t.stdContract ? true : false, parameters: {}, sender: t.sender, - isContractCall: t.isContractCall + isContractCreation: t.isContractCreation, + label: t.label }; - if (r.isContractCall === undefined) - r.isContractCall = true; //support for old project + + if (!r.label) + r.label = r.contractId + " " + r.functionId; + + if (r.isContractCreation === undefined) + r.isContractCreation = true; //support for old project for (var key in t.parameters) r.parameters[key] = t.parameters[key]; @@ -115,7 +120,8 @@ Item { stdContract: t.stdContract, sender: t.sender, parameters: {}, - isContractCall: t.isContractCall + isContractCreation: t.isContractCreation, + label: t.label }; for (var key in t.parameters) r.parameters[key] = t.parameters[key]; diff --git a/mix/qml/TransactionDialog.qml b/mix/qml/TransactionDialog.qml index 84abb854b..d26fbaf5a 100644 --- a/mix/qml/TransactionDialog.qml +++ b/mix/qml/TransactionDialog.qml @@ -66,34 +66,46 @@ Dialog { contractIndex = 0; //@todo suggest unused contract contractComboBox.currentIndex = contractIndex; - loadFunctions(contractComboBox.currentValue()); + recipients.accounts = senderComboBox.model; + recipients.subType = "address"; + recipients.load(); + recipients.init(); + recipients.select(contractId); + + if (item.isContractCreation) + loadFunctions(contractComboBox.currentValue()); + else + loadFunctions(contractFromToken(recipients.currentValue())) selectFunction(functionId); + trType.checked = item.isContractCreation + trType.init(); + paramsModel = []; - if (functionId !== contractComboBox.currentValue()) + if (item.isContractCreation) + loadCtorParameters(); + else loadParameters(); - else { - var contract = codeModel.contracts[contractId]; - if (contract) { - var params = contract.contract.constructor.parameters; - for (var p = 0; p < params.length; p++) - loadParameter(params[p]); - } - } - initTypeLoader(); - trType.checked = item.isContractCall - trType.init(); - recipients.accounts = senderComboBox.model; - recipients.subType = "address"; - recipients.load(); - recipients.init(); - recipients.select(contractId); + visible = true; valueField.focus = true; } + function loadCtorParameters(contractId) + { + paramsModel = []; + console.log(contractId); + var contract = codeModel.contracts[contractId]; + if (contract) { + var params = contract.contract.constructor.parameters; + for (var p = 0; p < params.length; p++) + loadParameter(params[p]); + } + initTypeLoader(); + } + function loadFunctions(contractId) { functionsModel.clear(); @@ -104,9 +116,7 @@ Dialog { functionsModel.append({ text: functions[f].name }); } } - //append constructor - functionsModel.append({ text: contractId }); - + functionsModel.append({ text: "(transfert)" }); } function selectContract(contractName) @@ -144,7 +154,7 @@ Dialog { function loadParameters() { paramsModel = [] if (functionComboBox.currentIndex >= 0 && functionComboBox.currentIndex < functionsModel.count) { - var contract = codeModel.contracts[contractComboBox.currentValue()]; + var contract = codeModel.contracts[contractFromToken(recipients.currentValue())]; if (contract) { var func = contract.contract.functions[functionComboBox.currentIndex]; if (func) { @@ -201,17 +211,32 @@ Dialog { item.functionId = transactionDialog.functionId; } - item.isContractCall = trType.checked; - if (!item.isContractCall) + item.isContractCreation = trType.checked; + if (!item.isContractCreation) { - item.functionId = recipients.currentText; item.contractId = recipients.currentText; + item.label = item.contractId + " " + item.functionId; + if (recipients.current().type === "address") + item.functionId = "(transfert)"; + } + else + { + item.functionId = item.contractId; + item.label = qsTr("Deploy") + " " + item.contractId; } item.sender = senderComboBox.model[senderComboBox.currentIndex].secret; item.parameters = paramValues; return item; } + + function contractFromToken(token) + { + if (token.indexOf('<') === 0) + return token.replace("<", "").replace(">", "").split(" - ")[0]; + return token; + } + contentItem: Rectangle { color: transactionDialogStyle.generic.backgroundColor ColumnLayout { @@ -267,14 +292,17 @@ Dialog { function init() { - rowFunction.visible = checked; + rowFunction.visible = !checked; rowContract.visible = checked; rowRecipient.visible = !checked; paramLabel.visible = checked; paramScroll.visible = checked; + functionComboBox.enabled = !checked; + if (checked) + loadCtorParameters(contractComboBox.currentValue()); } - text: qsTr("is contract call") + text: qsTr("is contract creation") checked: true } } @@ -292,6 +320,14 @@ Dialog { QAddressView { id: recipients + onIndexChanged: + { + rowFunction.visible = current().type === "contract"; + paramLabel.visible = current().type === "contract"; + paramScroll.visible = current().type === "contract"; + if (!rowIsContract.checked) + loadFunctions(contractFromToken(recipients.currentValue())) + } } } @@ -317,7 +353,7 @@ Dialog { id: contractsModel } onCurrentIndexChanged: { - loadFunctions(currentValue()); + loadCtorParameters(currentValue()); } } } diff --git a/mix/qml/js/TransactionHelper.js b/mix/qml/js/TransactionHelper.js index 01fe65b5d..33072fdba 100644 --- a/mix/qml/js/TransactionHelper.js +++ b/mix/qml/js/TransactionHelper.js @@ -10,7 +10,8 @@ function defaultTransaction() gasPrice: createEther("100000", QEther.Wei), parameters: {}, stdContract: false, - isContractCall: true + isContractCreation: true, + label: "" }; } From 0e7d6d77e5be791b2479440b9b6b427a6d978f28 Mon Sep 17 00:00:00 2001 From: yann300 Date: Fri, 8 May 2015 17:36:29 +0200 Subject: [PATCH 098/461] small changes --- mix/qml/StateListModel.qml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mix/qml/StateListModel.qml b/mix/qml/StateListModel.qml index a6069d620..a7b83aec9 100644 --- a/mix/qml/StateListModel.qml +++ b/mix/qml/StateListModel.qml @@ -62,10 +62,8 @@ Item { }; if (!r.label) - r.label = r.contractId + " " + r.functionId; + r.label = r.contractId + " - " + r.functionId; - if (r.isContractCreation === undefined) - r.isContractCreation = true; //support for old project for (var key in t.parameters) r.parameters[key] = t.parameters[key]; From 3fc50e3615348b86e97725afe63a61ebb712da41 Mon Sep 17 00:00:00 2001 From: yann300 Date: Fri, 8 May 2015 18:12:49 +0200 Subject: [PATCH 099/461] bux fix --- mix/ClientModel.cpp | 12 ++++++++++-- mix/ClientModel.h | 1 + mix/qml/StateListModel.qml | 3 +++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/mix/ClientModel.cpp b/mix/ClientModel.cpp index a58366046..8067f62c4 100644 --- a/mix/ClientModel.cpp +++ b/mix/ClientModel.cpp @@ -373,7 +373,7 @@ void ClientModel::executeSequence(vector const& _sequence, auto contractAddressIter = m_contractAddresses.find(transaction.contractId); if (contractAddressIter == m_contractAddresses.end() || newAddress != contractAddressIter->second) { - QString contractToken = "<" + transaction.contractId + " - " + QString::number(deployedContracts.size() - 1) + ">"; + QString contractToken = retrieveToken(transaction.contractId, deployedContracts); m_contractAddresses[contractToken] = newAddress; m_contractNames[newAddress] = contractToken; contractAddressesChanged(); @@ -382,7 +382,7 @@ void ClientModel::executeSequence(vector const& _sequence, } else { - auto contractAddressIter = m_contractAddresses.find(transaction.contractId); + auto contractAddressIter = m_contractAddresses.find(retrieveToken(transaction.contractId, deployedContracts)); if (contractAddressIter == m_contractAddresses.end()) { emit runFailed("Contract '" + transaction.contractId + tr(" not deployed.") + "' " + tr(" Cannot call ") + transaction.functionId); @@ -425,6 +425,14 @@ QString ClientModel::resolveToken(QString const& _value, vector
const& return ret; } +QString ClientModel::retrieveToken(QString const& _value, vector
const& _contracts) +{ + QString ret = _value; + if (!_value.startsWith("<") && !_value.endsWith(">")) + return "<" + _value + " - " + QString::number(_contracts.size() - 1) + ">"; + return ret; +} + QString ClientModel::resolveContractName(QString const& _value) { QString ret = _value; diff --git a/mix/ClientModel.h b/mix/ClientModel.h index 15cdc7086..2ba37f593 100644 --- a/mix/ClientModel.h +++ b/mix/ClientModel.h @@ -232,6 +232,7 @@ private: QVariant formatStorageValue(SolidityType const& _type, std::map const& _storage, unsigned _offset, dev::u256 const& _slot); QString resolveToken(QString const& _value, std::vector
const& _contracts); QString resolveContractName(QString const& _value); + QString retrieveToken(QString const& _value, std::vector
const& _contracts); std::atomic m_running; std::atomic m_mining; diff --git a/mix/qml/StateListModel.qml b/mix/qml/StateListModel.qml index a7b83aec9..b4eed525d 100644 --- a/mix/qml/StateListModel.qml +++ b/mix/qml/StateListModel.qml @@ -64,6 +64,9 @@ Item { if (!r.label) r.label = r.contractId + " - " + r.functionId; + if (r.isContractCreation === undefined) + r.isContractCreation = r.functionId === r.contractId; + for (var key in t.parameters) r.parameters[key] = t.parameters[key]; From dc7df3cc0713561526bf547eb8dfaa8dda42d0da Mon Sep 17 00:00:00 2001 From: Vlad Gluhovsky Date: Sun, 10 May 2015 15:18:13 +0200 Subject: [PATCH 100/461] Test for Capability class Basic configuration for sending and receiving messgaes. --- test/libp2p/capability.cpp | 157 +++++++++++++++++++++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100644 test/libp2p/capability.cpp diff --git a/test/libp2p/capability.cpp b/test/libp2p/capability.cpp new file mode 100644 index 000000000..2dcf9b4ba --- /dev/null +++ b/test/libp2p/capability.cpp @@ -0,0 +1,157 @@ +/* +This file is part of cpp-ethereum. + +cpp-ethereum is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +cpp-ethereum is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with cpp-ethereum. If not, see . +*/ +/** @file capability.cpp +* @author Vladislav Gluhovsky +* @date May 2015 +*/ + +#include +#include +#include +#include +#include +#include +#include +#include + +using namespace std; +using namespace dev; +using namespace dev::p2p; + +struct P2PFixture +{ + P2PFixture() { dev::p2p::NodeIPEndpoint::test_allowLocal = true; } + ~P2PFixture() { dev::p2p::NodeIPEndpoint::test_allowLocal = false; } +}; + +struct VerbosityHolder +{ + int m_oldLogVerbosity; + VerbosityHolder() : m_oldLogVerbosity(g_logVerbosity) { g_logVerbosity = 10; } + ~VerbosityHolder() { g_logVerbosity = m_oldLogVerbosity; } +}; + +class TestCapability : public Capability +{ + int m_cntReceivedMessages; + int m_testSum; + +public: + TestCapability(Session* _s, HostCapabilityFace* _h, unsigned _idOffset) : Capability(_s, _h, _idOffset), m_cntReceivedMessages(0), m_testSum(0) {} + virtual ~TestCapability() {} + int countReceivedMessages() { return m_cntReceivedMessages; } + int testSum() { return m_testSum; } + static std::string name() { return "test"; } + static u256 version() { return 2; } + static unsigned messageCount() { return UserPacket + 1; } + + void sendTestMessage(int _i) + { + RLPStream s; + prep(s, UserPacket, 1); + s << _i; + sealAndSend(s); + } + +protected: + virtual bool interpret(unsigned _id, RLP const& _r) override + { + cnote << "Capability::interpret(): custom message received"; + BOOST_REQUIRE_EQUAL(_id, UserPacket); + ++m_cntReceivedMessages; + int i = _r[0].toInt(); + m_testSum += i; + return true; + } +}; + +class TestHostCapability : public HostCapability, public Worker +{ +public: + TestHostCapability() : Worker("test") {} + virtual ~TestHostCapability() {} + + void sendTestMessage(NodeId const& _id, int _x) + { + for (auto i: peerSessions()) + if (_id == i.second->id) + i.first->cap().get()->sendTestMessage(_x); + } + + std::pair retrieveTestData(NodeId const& _id) + { + int cnt = 0; + int checksum = 0; + for (auto i : peerSessions()) + if (_id == i.second->id) + { + cnt += i.first->cap().get()->countReceivedMessages(); + checksum += i.first->cap().get()->testSum(); + } + + return std::pair(cnt, checksum); + } +}; + +BOOST_FIXTURE_TEST_SUITE(p2pCapability, P2PFixture) + +BOOST_AUTO_TEST_CASE(capability) +{ + VerbosityHolder verbosityHolder; + cnote << "Testing Capability..."; + + const char* const localhost = "127.0.0.1"; + NetworkPreferences prefs1(localhost, 30301, false); + NetworkPreferences prefs2(localhost, 30302, false); + + Host host1("Test", prefs1); + auto thc1 = host1.registerCapability(new TestHostCapability()); + host1.start(); + + Host host2("Test", prefs2); + auto thc2 = host2.registerCapability(new TestHostCapability()); + host2.start(); + + int const step = 10; + + for (int i = 0; i < 3000; i += step) + if (!host1.isStarted() || !host2.isStarted()) + this_thread::sleep_for(chrono::milliseconds(step)); + + BOOST_REQUIRE(host1.isStarted() && host2.isStarted()); + host1.requirePeer(host2.id(), NodeIPEndpoint(bi::address::from_string(localhost), prefs2.listenPort, prefs2.listenPort)); + + for (int i = 0; i < 3000; i += step) + if (!host1.peerCount() || !host2.peerCount()) + this_thread::sleep_for(chrono::milliseconds(step)); + + BOOST_REQUIRE(host1.peerCount() > 0 && host2.peerCount() > 0); + + int const target = 7; + int checksum = 0; + for (int i = 0; i < target; checksum += i++) + thc2->sendTestMessage(host1.id(), i); + + this_thread::sleep_for(chrono::seconds(1)); + std::pair testData = thc1->retrieveTestData(host2.id()); + BOOST_REQUIRE_EQUAL(target, testData.first); + BOOST_REQUIRE_EQUAL(checksum, testData.second); +} + +BOOST_AUTO_TEST_SUITE_END() + + From 13a744559744831e4cb0c13592df070148077359 Mon Sep 17 00:00:00 2001 From: Marek Kotewicz Date: Sun, 10 May 2015 15:52:25 +0200 Subject: [PATCH 101/461] Squashed 'libjsqrc/ethereumjs/' changes from 3b799d1..e908439 e908439 version 0.3.6 091c8e5 Merge branch 'develop' into tcoulter 272837e cleaned up param.js 38a13bc removed unused functions from coder.js 8e3158f Merge pull request #196 from debris/new_abi c6a57b3 cleanup and documentation 6e60e1f new solidity abi decoding 3f0d1c8 new abi proposal implementation of encoding 39d70e8 Merge pull request #195 from debris/fixed_abi f963855 removed unused functions from abi.js c59419e added new "dave" example 860ad2c fixed #194 22ca9b0 Merge branch 'develop' of https://github.com/ethereum/ethereum.js into develop 6739a1b "dave" example 08f3aae add optional nonce property to sendTransaction 2ca4240 Add error handling to synchronous methods (obligatory warning against using synchronous calls at all). 4690130 version 0.3.5 7949f6a Merge pull request #187 from debris/encoding 944c5cc removed unused test files 8a9c9c5 Merge branch 'develop' into encoding 330b0da more tests for encoding and decoding solidity params b064eab Handle this error properly. For instance, without this, if we cannot connect to the RPC client, JSON won't be able to parse the result (there is none), in which case would cause a RuntimeException. 7989607 version 0.3.4 afb61d5 Merge branch 'master' into develop 97f6e7d build files again 539ef7b Merge pull request #186 from ethereum/eventFilterFix ec0dc44 Merge pull request #188 from ethereum/develop bd73ccc added eth_hashrate baed4c8 fixed old encoding e9ec708 fixed event from and toBlock git-subtree-dir: libjsqrc/ethereumjs git-subtree-split: e90843973f3ae554069347b61cb5b393091c34d1 --- bower.json | 2 +- dist/web3-light.js | 448 ++++++++-------- dist/web3-light.js.map | 22 +- dist/web3-light.min.js | 4 +- dist/web3.js | 448 ++++++++-------- dist/web3.js.map | 22 +- dist/web3.min.js | 4 +- example/event_inc.html | 2 +- lib/solidity/abi.js | 103 +--- lib/solidity/coder.js | 85 +-- lib/solidity/formatters.js | 14 +- lib/solidity/param.js | 191 +++++-- lib/solidity/utils.js | 5 + lib/version.json | 2 +- lib/web3/eth.js | 17 +- lib/web3/event.js | 2 +- lib/web3/formatters.js | 2 +- lib/web3/httpprovider.js | 23 +- package.js | 2 +- package.json | 2 +- test/abi.inputParser.js | 515 ------------------- test/abi.outputParser.js | 419 --------------- test/coder.decodeParam.js | 45 +- test/coder.encodeParam.js | 82 ++- test/contract.js | 1 + test/event.encode.js | 26 + test/formatters.inputTransactionFormatter.js | 70 ++- test/web3.eth.filter.js | 15 + test/web3.eth.hashRate.js | 38 ++ 29 files changed, 926 insertions(+), 1685 deletions(-) delete mode 100644 test/abi.inputParser.js delete mode 100644 test/abi.outputParser.js create mode 100644 test/web3.eth.hashRate.js diff --git a/bower.json b/bower.json index f8abf431d..db9a4702d 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "web3", "namespace": "ethereum", - "version": "0.3.3", + "version": "0.3.6", "description": "Ethereum Compatible JavaScript API", "main": [ "./dist/web3.js", diff --git a/dist/web3-light.js b/dist/web3-light.js index bfc246f66..c128634de 100644 --- a/dist/web3-light.js +++ b/dist/web3-light.js @@ -22,118 +22,29 @@ require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof requ * @date 2014 */ -var utils = require('../utils/utils'); var coder = require('./coder'); -var solUtils = require('./utils'); - -/** - * Formats input params to bytes - * - * @method formatInput - * @param {Array} abi inputs of method - * @param {Array} params that will be formatted to bytes - * @returns bytes representation of input params - */ -var formatInput = function (inputs, params) { - var i = inputs.map(function (input) { - return input.type; - }); - return coder.encodeParams(i, params); -}; - -/** - * Formats output bytes back to param list - * - * @method formatOutput - * @param {Array} abi outputs of method - * @param {String} bytes represention of output - * @returns {Array} output params - */ -var formatOutput = function (outs, bytes) { - var o = outs.map(function (out) { - return out.type; - }); - - return coder.decodeParams(o, bytes); -}; - -/** - * Should be called to create input parser for contract with given abi - * - * @method inputParser - * @param {Array} contract abi - * @returns {Object} input parser object for given json abi - * TODO: refactor creating the parser, do not double logic from contract - */ -var inputParser = function (json) { - var parser = {}; - json.forEach(function (method) { - var displayName = utils.extractDisplayName(method.name); - var typeName = utils.extractTypeName(method.name); - - var impl = function () { - var params = Array.prototype.slice.call(arguments); - return formatInput(method.inputs, params); - }; - - if (parser[displayName] === undefined) { - parser[displayName] = impl; - } - - parser[displayName][typeName] = impl; - }); - - return parser; -}; - -/** - * Should be called to create output parser for contract with given abi - * - * @method outputParser - * @param {Array} contract abi - * @returns {Object} output parser for given json abi - */ -var outputParser = function (json) { - var parser = {}; - json.forEach(function (method) { - - var displayName = utils.extractDisplayName(method.name); - var typeName = utils.extractTypeName(method.name); - - var impl = function (output) { - return formatOutput(method.outputs, output); - }; - - if (parser[displayName] === undefined) { - parser[displayName] = impl; - } - - parser[displayName][typeName] = impl; - }); - - return parser; -}; +var utils = require('./utils'); var formatConstructorParams = function (abi, params) { - var constructor = solUtils.getConstructor(abi, params.length); + var constructor = utils.getConstructor(abi, params.length); if (!constructor) { if (params.length > 0) { console.warn("didn't found matching constructor, using default one"); } return ''; } - return formatInput(constructor.inputs, params); + + return coder.encodeParams(constructor.inputs.map(function (input) { + return input.type; + }), params); }; module.exports = { - inputParser: inputParser, - outputParser: outputParser, - formatInput: formatInput, - formatOutput: formatOutput, formatConstructorParams: formatConstructorParams }; -},{"../utils/utils":8,"./coder":2,"./utils":5}],2:[function(require,module,exports){ + +},{"./coder":2,"./utils":5}],2:[function(require,module,exports){ /* This file is part of ethereum.js. @@ -213,9 +124,8 @@ SolidityType.prototype.formatInput = function (param, arrayType) { return param.map(function (p) { return self._inputFormatter(p); }).reduce(function (acc, current) { - acc.appendArrayElement(current); - return acc; - }, new SolidityParam('', f.formatInputInt(param.length).value)); + return acc.combine(current); + }, f.formatInputInt(param.length)).withOffset(32); } return this._inputFormatter(param); }; @@ -232,9 +142,9 @@ SolidityType.prototype.formatOutput = function (param, arrayType) { if (arrayType) { // let's assume, that we solidity will never return long arrays :P var result = []; - var length = new BigNumber(param.prefix, 16); + var length = new BigNumber(param.dynamicPart().slice(0, 64), 16); for (var i = 0; i < length * 64; i += 64) { - result.push(this._outputFormatter(new SolidityParam(param.suffix.slice(i, i + 64)))); + result.push(this._outputFormatter(new SolidityParam(param.dynamicPart().substr(i + 64, 64)))); } return result; } @@ -242,31 +152,21 @@ SolidityType.prototype.formatOutput = function (param, arrayType) { }; /** - * Should be used to check if a type is variadic + * Should be used to slice single param from bytes * - * @method isVariadicType - * @param {String} type - * @returns {Bool} true if the type is variadic - */ -SolidityType.prototype.isVariadicType = function (type) { - return isArrayType(type) || this._mode === 'bytes'; -}; - -/** - * Should be used to shift param from params group - * - * @method shiftParam + * @method sliceParam + * @param {String} bytes + * @param {Number} index of param to slice * @param {String} type - * @returns {SolidityParam} shifted param + * @returns {SolidityParam} param */ -SolidityType.prototype.shiftParam = function (type, param) { +SolidityType.prototype.sliceParam = function (bytes, index, type) { if (this._mode === 'bytes') { - return param.shiftBytes(); + return SolidityParam.decodeBytes(bytes, index); } else if (isArrayType(type)) { - var length = new BigNumber(param.prefix.slice(0, 64), 16); - return param.shiftArray(length); + return SolidityParam.decodeArray(bytes, index); } - return param.shiftValue(); + return SolidityParam.decodeParam(bytes, index); }; /** @@ -296,28 +196,6 @@ SolidityCoder.prototype._requireType = function (type) { return solidityType; }; -/** - * Should be used to transform plain bytes to SolidityParam object - * - * @method _bytesToParam - * @param {Array} types of params - * @param {String} bytes to be transformed to SolidityParam - * @return {SolidityParam} SolidityParam for this group of params - */ -SolidityCoder.prototype._bytesToParam = function (types, bytes) { - var self = this; - var prefixTypes = types.reduce(function (acc, type) { - return self._requireType(type).isVariadicType(type) ? acc + 1 : acc; - }, 0); - var valueTypes = types.length - prefixTypes; - - var prefix = bytes.slice(0, prefixTypes * 64); - bytes = bytes.slice(prefixTypes * 64); - var value = bytes.slice(0, valueTypes * 64); - var suffix = bytes.slice(valueTypes * 64); - return new SolidityParam(value, prefix, suffix); -}; - /** * Should be used to transform plain param of given type to SolidityParam * @@ -352,24 +230,11 @@ SolidityCoder.prototype.encodeParam = function (type, param) { */ SolidityCoder.prototype.encodeParams = function (types, params) { var self = this; - return types.map(function (type, index) { + var solidityParams = types.map(function (type, index) { return self._formatInput(type, params[index]); - }).reduce(function (acc, solidityParam) { - acc.append(solidityParam); - return acc; - }, new SolidityParam()).encode(); -}; + }); -/** - * Should be used to transform SolidityParam to plain param - * - * @method _formatOutput - * @param {String} type - * @param {SolidityParam} param - * @return {Object} plain param - */ -SolidityCoder.prototype._formatOutput = function (type, param) { - return this._requireType(type).formatOutput(param, isArrayType(type)); + return SolidityParam.encodeList(solidityParams); }; /** @@ -381,7 +246,7 @@ SolidityCoder.prototype._formatOutput = function (type, param) { * @return {Object} plain param */ SolidityCoder.prototype.decodeParam = function (type, bytes) { - return this._formatOutput(type, this._bytesToParam([type], bytes)); + return this.decodeParams([type], bytes)[0]; }; /** @@ -394,10 +259,9 @@ SolidityCoder.prototype.decodeParam = function (type, bytes) { */ SolidityCoder.prototype.decodeParams = function (types, bytes) { var self = this; - var param = this._bytesToParam(types, bytes); - return types.map(function (type) { + return types.map(function (type, index) { var solidityType = self._requireType(type); - var p = solidityType.shiftParam(type, param); + var p = solidityType.sliceParam(bytes, index, type); return solidityType.formatOutput(p, isArrayType(type)); }); }; @@ -530,7 +394,7 @@ var formatInputBytes = function (value) { */ var formatInputDynamicBytes = function (value) { var result = utils.fromAscii(value, c.ETH_PADDING).substr(2); - return new SolidityParam('', formatInputInt(value.length).value, result); + return new SolidityParam(formatInputInt(value.length).value + result, 32); }; /** @@ -576,7 +440,7 @@ var signedIsNegative = function (value) { * @returns {BigNumber} right-aligned output bytes formatted to big number */ var formatOutputInt = function (param) { - var value = param.value || "0"; + var value = param.staticPart() || "0"; // check if it's negative number // it it is, return two's complement @@ -594,7 +458,7 @@ var formatOutputInt = function (param) { * @returns {BigNumeber} right-aligned output bytes formatted to uint */ var formatOutputUInt = function (param) { - var value = param.value || "0"; + var value = param.staticPart() || "0"; return new BigNumber(value, 16); }; @@ -628,7 +492,7 @@ var formatOutputUReal = function (param) { * @returns {Boolean} right-aligned input bytes formatted to bool */ var formatOutputBool = function (param) { - return param.value === '0000000000000000000000000000000000000000000000000000000000000001' ? true : false; + return param.staticPart() === '0000000000000000000000000000000000000000000000000000000000000001' ? true : false; }; /** @@ -640,7 +504,7 @@ var formatOutputBool = function (param) { */ var formatOutputBytes = function (param) { // length might also be important! - return utils.toAscii(param.value); + return utils.toAscii(param.staticPart()); }; /** @@ -652,7 +516,7 @@ var formatOutputBytes = function (param) { */ var formatOutputDynamicBytes = function (param) { // length might also be important! - return utils.toAscii(param.suffix); + return utils.toAscii(param.dynamicPart().slice(64)); }; /** @@ -663,7 +527,7 @@ var formatOutputDynamicBytes = function (param) { * @returns {String} address */ var formatOutputAddress = function (param) { - var value = param.value; + var value = param.staticPart(); return "0x" + value.slice(value.length - 40, value.length); }; @@ -707,91 +571,196 @@ module.exports = { * @date 2015 */ +var utils = require('../utils/utils'); + /** * SolidityParam object prototype. * Should be used when encoding, decoding solidity bytes */ -var SolidityParam = function (value, prefix, suffix) { - this.prefix = prefix || ''; +var SolidityParam = function (value, offset) { this.value = value || ''; - this.suffix = suffix || ''; + this.offset = offset; // offset in bytes +}; + +/** + * This method should be used to get length of params's dynamic part + * + * @method dynamicPartLength + * @returns {Number} length of dynamic part (in bytes) + */ +SolidityParam.prototype.dynamicPartLength = function () { + return this.dynamicPart().length / 2; +}; + +/** + * This method should be used to create copy of solidity param with different offset + * + * @method withOffset + * @param {Number} offset length in bytes + * @returns {SolidityParam} new solidity param with applied offset + */ +SolidityParam.prototype.withOffset = function (offset) { + return new SolidityParam(this.value, offset); }; /** - * This method should be used to encode two params one after another + * This method should be used to combine solidity params together + * eg. when appending an array * - * @method append - * @param {SolidityParam} param that it appended after this + * @method combine + * @param {SolidityParam} param with which we should combine + * @param {SolidityParam} result of combination */ -SolidityParam.prototype.append = function (param) { - this.prefix += param.prefix; - this.value += param.value; - this.suffix += param.suffix; +SolidityParam.prototype.combine = function (param) { + return new SolidityParam(this.value + param.value); }; /** - * This method should be used to encode next param in an array + * This method should be called to check if param has dynamic size. + * If it has, it returns true, otherwise false * - * @method appendArrayElement - * @param {SolidityParam} param that is appended to an array + * @method isDynamic + * @returns {Boolean} */ -SolidityParam.prototype.appendArrayElement = function (param) { - this.suffix += param.value; - this.prefix += param.prefix; - // TODO: suffix not supported = it's required for nested arrays; +SolidityParam.prototype.isDynamic = function () { + return this.value.length > 64; }; /** - * This method should be used to create bytearrays from param + * This method should be called to transform offset to bytes + * + * @method offsetAsBytes + * @returns {String} bytes representation of offset + */ +SolidityParam.prototype.offsetAsBytes = function () { + return !this.isDynamic() ? '' : utils.padLeft(utils.toTwosComplement(this.offset).toString(16), 64); +}; + +/** + * This method should be called to get static part of param + * + * @method staticPart + * @returns {String} offset if it is a dynamic param, otherwise value + */ +SolidityParam.prototype.staticPart = function () { + if (!this.isDynamic()) { + return this.value; + } + return this.offsetAsBytes(); +}; + +/** + * This method should be called to get dynamic part of param + * + * @method dynamicPart + * @returns {String} returns a value if it is a dynamic param, otherwise empty string + */ +SolidityParam.prototype.dynamicPart = function () { + return this.isDynamic() ? this.value : ''; +}; + +/** + * This method should be called to encode param * * @method encode - * @return {String} encoded param(s) + * @returns {String} */ SolidityParam.prototype.encode = function () { - return this.prefix + this.value + this.suffix; + return this.staticPart() + this.dynamicPart(); }; /** - * This method should be used to shift first param from group of params + * This method should be called to encode array of params * - * @method shiftValue - * @return {SolidityParam} first value param + * @method encodeList + * @param {Array[SolidityParam]} params + * @returns {String} */ -SolidityParam.prototype.shiftValue = function () { - var value = this.value.slice(0, 64); - this.value = this.value.slice(64); - return new SolidityParam(value); +SolidityParam.encodeList = function (params) { + + // updating offsets + var totalOffset = params.length * 32; + var offsetParams = params.map(function (param) { + if (!param.isDynamic()) { + return param; + } + var offset = totalOffset; + totalOffset += param.dynamicPartLength(); + return param.withOffset(offset); + }); + + // encode everything! + return offsetParams.reduce(function (result, param) { + return result + param.dynamicPart(); + }, offsetParams.reduce(function (result, param) { + return result + param.staticPart(); + }, '')); }; /** - * This method should be used to first bytes param from group of params + * This method should be used to decode plain (static) solidity param at given index * - * @method shiftBytes - * @return {SolidityParam} first bytes param + * @method decodeParam + * @param {String} bytes + * @param {Number} index + * @returns {SolidityParam} */ -SolidityParam.prototype.shiftBytes = function () { - return this.shiftArray(1); +SolidityParam.decodeParam = function (bytes, index) { + index = index || 0; + return new SolidityParam(bytes.substr(index * 64, 64)); }; /** - * This method should be used to shift an array from group of params - * - * @method shiftArray - * @param {Number} size of an array to shift - * @return {SolidityParam} first array param + * This method should be called to get offset value from bytes at given index + * + * @method getOffset + * @param {String} bytes + * @param {Number} index + * @returns {Number} offset as number + */ +var getOffset = function (bytes, index) { + // we can do this cause offset is rather small + return parseInt('0x' + bytes.substr(index * 64, 64)); +}; + +/** + * This method should be called to decode solidity bytes param at given index + * + * @method decodeBytes + * @param {String} bytes + * @param {Number} index + * @returns {SolidityParam} + */ +SolidityParam.decodeBytes = function (bytes, index) { + index = index || 0; + //TODO add support for strings longer than 32 bytes + //var length = parseInt('0x' + bytes.substr(offset * 64, 64)); + + var offset = getOffset(bytes, index); + + // 2 * , cause we also parse length + return new SolidityParam(bytes.substr(offset * 2, 2 * 64)); +}; + +/** + * This method should be used to decode solidity array at given index + * + * @method decodeArray + * @param {String} bytes + * @param {Number} index + * @returns {SolidityParam} */ -SolidityParam.prototype.shiftArray = function (length) { - var prefix = this.prefix.slice(0, 64); - this.prefix = this.value.slice(64); - var suffix = this.suffix.slice(0, 64 * length); - this.suffix = this.suffix.slice(64 * length); - return new SolidityParam('', prefix, suffix); +SolidityParam.decodeArray = function (bytes, index) { + index = index || 0; + var offset = getOffset(bytes, index); + var length = parseInt('0x' + bytes.substr(offset * 2, 64)); + return new SolidityParam(bytes.substr(offset * 2, (length + 1) * 64)); }; module.exports = SolidityParam; -},{}],5:[function(require,module,exports){ +},{"../utils/utils":8}],5:[function(require,module,exports){ /* This file is part of ethereum.js. @@ -828,6 +797,11 @@ var getConstructor = function (abi, numberOfArgs) { })[0]; }; +//var getSupremeType = function (type) { + //return type.substr(0, type.indexOf('[')) + ']'; +//}; + + module.exports = { getConstructor: getConstructor }; @@ -1394,7 +1368,7 @@ module.exports = { },{"bignumber.js":"bignumber.js"}],9:[function(require,module,exports){ module.exports={ - "version": "0.3.3" + "version": "0.3.6" } },{}],10:[function(require,module,exports){ @@ -1796,7 +1770,7 @@ module.exports = { /** * Web3 - * + * * @module web3 */ @@ -1850,16 +1824,16 @@ var uncleCountCall = function (args) { /// @returns an array of objects describing web3.eth api methods var getBalance = new Method({ - name: 'getBalance', - call: 'eth_getBalance', + name: 'getBalance', + call: 'eth_getBalance', params: 2, inputFormatter: [utils.toAddress, formatters.inputDefaultBlockNumberFormatter], outputFormatter: formatters.outputBigNumberFormatter }); var getStorageAt = new Method({ - name: 'getStorageAt', - call: 'eth_getStorageAt', + name: 'getStorageAt', + call: 'eth_getStorageAt', params: 3, inputFormatter: [null, utils.toHex, formatters.inputDefaultBlockNumberFormatter] }); @@ -1872,7 +1846,7 @@ var getCode = new Method({ }); var getBlock = new Method({ - name: 'getBlock', + name: 'getBlock', call: blockCall, params: 2, inputFormatter: [formatters.inputBlockNumberFormatter, function (val) { return !!val; }], @@ -1997,6 +1971,11 @@ var properties = [ name: 'mining', getter: 'eth_mining' }), + new Property({ + name: 'hashrate', + getter: 'eth_hashrate', + outputFormatter: utils.toDecimal + }), new Property({ name: 'gasPrice', getter: 'eth_gasPrice', @@ -2118,7 +2097,7 @@ SolidityEvent.prototype.encode = function (indexed, options) { ['fromBlock', 'toBlock'].filter(function (f) { return options[f] !== undefined; }).forEach(function (f) { - result[f] = utils.toHex(options[f]); + result[f] = formatters.inputBlockNumberFormatter(options[f]); }); result.topics = []; @@ -2447,7 +2426,7 @@ var inputTransactionFormatter = function (options){ delete options.code; } - ['gasPrice', 'gas', 'value'].filter(function (key) { + ['gasPrice', 'gas', 'value', 'nonce'].filter(function (key) { return options[key] !== undefined; }).forEach(function(key){ options[key] = utils.fromDecimal(options[key]); @@ -2796,15 +2775,32 @@ HttpProvider.prototype.send = function (payload) { //if (request.status !== 200) { //return; //} - return JSON.parse(request.responseText); + + var result = request.responseText; + + try { + result = JSON.parse(result); + } catch(e) { + throw errors.InvalidResponse(result); + } + + return result; }; HttpProvider.prototype.sendAsync = function (payload, callback) { var request = new XMLHttpRequest(); request.onreadystatechange = function() { if (request.readyState === 4) { - // TODO: handle the error properly here!!! - callback(null, JSON.parse(request.responseText)); + var result = request.responseText; + var error = null; + + try { + result = JSON.parse(result); + } catch(e) { + error = errors.InvalidResponse(result); + } + + callback(error, result); } }; diff --git a/dist/web3-light.js.map b/dist/web3-light.js.map index 41c3fe4e1..31e9b5a44 100644 --- a/dist/web3-light.js.map +++ b/dist/web3-light.js.map @@ -34,30 +34,30 @@ "index.js" ], "names": [], - "mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1dA;AACA;AACA;AACA;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrGA;;ACAA;AACA;AACA;AACA;AACA;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA", + "mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1RA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1dA;AACA;AACA;AACA;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5PA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrGA;;ACAA;AACA;AACA;AACA;AACA;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA", "file": "generated.js", "sourceRoot": "", "sourcesContent": [ "(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o.\n*/\n/** \n * @file abi.js\n * @author Marek Kotewicz \n * @author Gav Wood \n * @date 2014\n */\n\nvar utils = require('../utils/utils');\nvar coder = require('./coder');\nvar solUtils = require('./utils');\n\n/**\n * Formats input params to bytes\n *\n * @method formatInput\n * @param {Array} abi inputs of method\n * @param {Array} params that will be formatted to bytes\n * @returns bytes representation of input params\n */\nvar formatInput = function (inputs, params) {\n var i = inputs.map(function (input) {\n return input.type;\n });\n return coder.encodeParams(i, params);\n};\n\n/** \n * Formats output bytes back to param list\n *\n * @method formatOutput\n * @param {Array} abi outputs of method\n * @param {String} bytes represention of output\n * @returns {Array} output params\n */\nvar formatOutput = function (outs, bytes) {\n var o = outs.map(function (out) {\n return out.type;\n });\n \n return coder.decodeParams(o, bytes); \n};\n\n/**\n * Should be called to create input parser for contract with given abi\n *\n * @method inputParser\n * @param {Array} contract abi\n * @returns {Object} input parser object for given json abi\n * TODO: refactor creating the parser, do not double logic from contract\n */\nvar inputParser = function (json) {\n var parser = {};\n json.forEach(function (method) {\n var displayName = utils.extractDisplayName(method.name);\n var typeName = utils.extractTypeName(method.name);\n\n var impl = function () {\n var params = Array.prototype.slice.call(arguments);\n return formatInput(method.inputs, params);\n };\n\n if (parser[displayName] === undefined) {\n parser[displayName] = impl;\n }\n\n parser[displayName][typeName] = impl;\n });\n\n return parser;\n};\n\n/**\n * Should be called to create output parser for contract with given abi\n *\n * @method outputParser\n * @param {Array} contract abi\n * @returns {Object} output parser for given json abi\n */\nvar outputParser = function (json) {\n var parser = {};\n json.forEach(function (method) {\n\n var displayName = utils.extractDisplayName(method.name);\n var typeName = utils.extractTypeName(method.name);\n\n var impl = function (output) {\n return formatOutput(method.outputs, output);\n };\n\n if (parser[displayName] === undefined) {\n parser[displayName] = impl;\n }\n\n parser[displayName][typeName] = impl;\n });\n\n return parser;\n};\n\nvar formatConstructorParams = function (abi, params) {\n var constructor = solUtils.getConstructor(abi, params.length);\n if (!constructor) {\n if (params.length > 0) {\n console.warn(\"didn't found matching constructor, using default one\");\n }\n return '';\n }\n return formatInput(constructor.inputs, params);\n};\n\nmodule.exports = {\n inputParser: inputParser,\n outputParser: outputParser,\n formatInput: formatInput,\n formatOutput: formatOutput,\n formatConstructorParams: formatConstructorParams\n};\n", - "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file coder.js\n * @author Marek Kotewicz \n * @date 2015\n */\n\nvar BigNumber = require('bignumber.js');\nvar utils = require('../utils/utils');\nvar f = require('./formatters');\nvar SolidityParam = require('./param');\n\n/**\n * Should be used to check if a type is an array type\n *\n * @method isArrayType\n * @param {String} type\n * @return {Bool} true is the type is an array, otherwise false\n */\nvar isArrayType = function (type) {\n return type.slice(-2) === '[]';\n};\n\n/**\n * SolidityType prototype is used to encode/decode solidity params of certain type\n */\nvar SolidityType = function (config) {\n this._name = config.name;\n this._match = config.match;\n this._mode = config.mode;\n this._inputFormatter = config.inputFormatter;\n this._outputFormatter = config.outputFormatter;\n};\n\n/**\n * Should be used to determine if this SolidityType do match given type\n *\n * @method isType\n * @param {String} name\n * @return {Bool} true if type match this SolidityType, otherwise false\n */\nSolidityType.prototype.isType = function (name) {\n if (this._match === 'strict') {\n return this._name === name || (name.indexOf(this._name) === 0 && name.slice(this._name.length) === '[]');\n } else if (this._match === 'prefix') {\n // TODO better type detection!\n return name.indexOf(this._name) === 0;\n }\n};\n\n/**\n * Should be used to transform plain param to SolidityParam object\n *\n * @method formatInput\n * @param {Object} param - plain object, or an array of objects\n * @param {Bool} arrayType - true if a param should be encoded as an array\n * @return {SolidityParam} encoded param wrapped in SolidityParam object \n */\nSolidityType.prototype.formatInput = function (param, arrayType) {\n if (utils.isArray(param) && arrayType) { // TODO: should fail if this two are not the same\n var self = this;\n return param.map(function (p) {\n return self._inputFormatter(p);\n }).reduce(function (acc, current) {\n acc.appendArrayElement(current);\n return acc;\n }, new SolidityParam('', f.formatInputInt(param.length).value));\n } \n return this._inputFormatter(param);\n};\n\n/**\n * Should be used to transoform SolidityParam to plain param\n *\n * @method formatOutput\n * @param {SolidityParam} byteArray\n * @param {Bool} arrayType - true if a param should be decoded as an array\n * @return {Object} plain decoded param\n */\nSolidityType.prototype.formatOutput = function (param, arrayType) {\n if (arrayType) {\n // let's assume, that we solidity will never return long arrays :P \n var result = [];\n var length = new BigNumber(param.prefix, 16);\n for (var i = 0; i < length * 64; i += 64) {\n result.push(this._outputFormatter(new SolidityParam(param.suffix.slice(i, i + 64))));\n }\n return result;\n }\n return this._outputFormatter(param);\n};\n\n/**\n * Should be used to check if a type is variadic\n *\n * @method isVariadicType\n * @param {String} type\n * @returns {Bool} true if the type is variadic\n */\nSolidityType.prototype.isVariadicType = function (type) {\n return isArrayType(type) || this._mode === 'bytes';\n};\n\n/**\n * Should be used to shift param from params group\n *\n * @method shiftParam\n * @param {String} type\n * @returns {SolidityParam} shifted param\n */\nSolidityType.prototype.shiftParam = function (type, param) {\n if (this._mode === 'bytes') {\n return param.shiftBytes();\n } else if (isArrayType(type)) {\n var length = new BigNumber(param.prefix.slice(0, 64), 16);\n return param.shiftArray(length);\n }\n return param.shiftValue();\n};\n\n/**\n * SolidityCoder prototype should be used to encode/decode solidity params of any type\n */\nvar SolidityCoder = function (types) {\n this._types = types;\n};\n\n/**\n * This method should be used to transform type to SolidityType\n *\n * @method _requireType\n * @param {String} type\n * @returns {SolidityType} \n * @throws {Error} throws if no matching type is found\n */\nSolidityCoder.prototype._requireType = function (type) {\n var solidityType = this._types.filter(function (t) {\n return t.isType(type);\n })[0];\n\n if (!solidityType) {\n throw Error('invalid solidity type!: ' + type);\n }\n\n return solidityType;\n};\n\n/**\n * Should be used to transform plain bytes to SolidityParam object\n *\n * @method _bytesToParam\n * @param {Array} types of params\n * @param {String} bytes to be transformed to SolidityParam\n * @return {SolidityParam} SolidityParam for this group of params\n */\nSolidityCoder.prototype._bytesToParam = function (types, bytes) {\n var self = this;\n var prefixTypes = types.reduce(function (acc, type) {\n return self._requireType(type).isVariadicType(type) ? acc + 1 : acc;\n }, 0);\n var valueTypes = types.length - prefixTypes;\n\n var prefix = bytes.slice(0, prefixTypes * 64);\n bytes = bytes.slice(prefixTypes * 64);\n var value = bytes.slice(0, valueTypes * 64);\n var suffix = bytes.slice(valueTypes * 64);\n return new SolidityParam(value, prefix, suffix); \n};\n\n/**\n * Should be used to transform plain param of given type to SolidityParam\n *\n * @method _formatInput\n * @param {String} type of param\n * @param {Object} plain param\n * @return {SolidityParam}\n */\nSolidityCoder.prototype._formatInput = function (type, param) {\n return this._requireType(type).formatInput(param, isArrayType(type));\n};\n\n/**\n * Should be used to encode plain param\n *\n * @method encodeParam\n * @param {String} type\n * @param {Object} plain param\n * @return {String} encoded plain param\n */\nSolidityCoder.prototype.encodeParam = function (type, param) {\n return this._formatInput(type, param).encode();\n};\n\n/**\n * Should be used to encode list of params\n *\n * @method encodeParams\n * @param {Array} types\n * @param {Array} params\n * @return {String} encoded list of params\n */\nSolidityCoder.prototype.encodeParams = function (types, params) {\n var self = this;\n return types.map(function (type, index) {\n return self._formatInput(type, params[index]);\n }).reduce(function (acc, solidityParam) {\n acc.append(solidityParam);\n return acc;\n }, new SolidityParam()).encode();\n};\n\n/**\n * Should be used to transform SolidityParam to plain param\n *\n * @method _formatOutput\n * @param {String} type\n * @param {SolidityParam} param\n * @return {Object} plain param\n */\nSolidityCoder.prototype._formatOutput = function (type, param) {\n return this._requireType(type).formatOutput(param, isArrayType(type));\n};\n\n/**\n * Should be used to decode bytes to plain param\n *\n * @method decodeParam\n * @param {String} type\n * @param {String} bytes\n * @return {Object} plain param\n */\nSolidityCoder.prototype.decodeParam = function (type, bytes) {\n return this._formatOutput(type, this._bytesToParam([type], bytes));\n};\n\n/**\n * Should be used to decode list of params\n *\n * @method decodeParam\n * @param {Array} types\n * @param {String} bytes\n * @return {Array} array of plain params\n */\nSolidityCoder.prototype.decodeParams = function (types, bytes) {\n var self = this;\n var param = this._bytesToParam(types, bytes);\n return types.map(function (type) {\n var solidityType = self._requireType(type);\n var p = solidityType.shiftParam(type, param);\n return solidityType.formatOutput(p, isArrayType(type));\n });\n};\n\nvar coder = new SolidityCoder([\n new SolidityType({\n name: 'address',\n match: 'strict',\n mode: 'value',\n inputFormatter: f.formatInputInt,\n outputFormatter: f.formatOutputAddress\n }),\n new SolidityType({\n name: 'bool',\n match: 'strict',\n mode: 'value',\n inputFormatter: f.formatInputBool,\n outputFormatter: f.formatOutputBool\n }),\n new SolidityType({\n name: 'int',\n match: 'prefix',\n mode: 'value',\n inputFormatter: f.formatInputInt,\n outputFormatter: f.formatOutputInt,\n }),\n new SolidityType({\n name: 'uint',\n match: 'prefix',\n mode: 'value',\n inputFormatter: f.formatInputInt,\n outputFormatter: f.formatOutputUInt\n }),\n new SolidityType({\n name: 'bytes',\n match: 'strict',\n mode: 'bytes',\n inputFormatter: f.formatInputDynamicBytes,\n outputFormatter: f.formatOutputDynamicBytes\n }),\n new SolidityType({\n name: 'bytes',\n match: 'prefix',\n mode: 'value',\n inputFormatter: f.formatInputBytes,\n outputFormatter: f.formatOutputBytes\n }),\n new SolidityType({\n name: 'real',\n match: 'prefix',\n mode: 'value',\n inputFormatter: f.formatInputReal,\n outputFormatter: f.formatOutputReal\n }),\n new SolidityType({\n name: 'ureal',\n match: 'prefix',\n mode: 'value',\n inputFormatter: f.formatInputReal,\n outputFormatter: f.formatOutputUReal\n })\n]);\n\nmodule.exports = coder;\n\n", - "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file formatters.js\n * @author Marek Kotewicz \n * @date 2015\n */\n\nvar BigNumber = require('bignumber.js');\nvar utils = require('../utils/utils');\nvar c = require('../utils/config');\nvar SolidityParam = require('./param');\n\n\n/**\n * Formats input value to byte representation of int\n * If value is negative, return it's two's complement\n * If the value is floating point, round it down\n *\n * @method formatInputInt\n * @param {String|Number|BigNumber} value that needs to be formatted\n * @returns {SolidityParam}\n */\nvar formatInputInt = function (value) {\n var padding = c.ETH_PADDING * 2;\n BigNumber.config(c.ETH_BIGNUMBER_ROUNDING_MODE);\n var result = utils.padLeft(utils.toTwosComplement(value).round().toString(16), padding);\n return new SolidityParam(result);\n};\n\n/**\n * Formats input value to byte representation of string\n *\n * @method formatInputBytes\n * @param {String}\n * @returns {SolidityParam}\n */\nvar formatInputBytes = function (value) {\n var result = utils.fromAscii(value, c.ETH_PADDING).substr(2);\n return new SolidityParam(result);\n};\n\n/**\n * Formats input value to byte representation of string\n *\n * @method formatInputDynamicBytes\n * @param {String}\n * @returns {SolidityParam}\n */\nvar formatInputDynamicBytes = function (value) {\n var result = utils.fromAscii(value, c.ETH_PADDING).substr(2);\n return new SolidityParam('', formatInputInt(value.length).value, result);\n};\n\n/**\n * Formats input value to byte representation of bool\n *\n * @method formatInputBool\n * @param {Boolean}\n * @returns {SolidityParam}\n */\nvar formatInputBool = function (value) {\n var result = '000000000000000000000000000000000000000000000000000000000000000' + (value ? '1' : '0');\n return new SolidityParam(result);\n};\n\n/**\n * Formats input value to byte representation of real\n * Values are multiplied by 2^m and encoded as integers\n *\n * @method formatInputReal\n * @param {String|Number|BigNumber}\n * @returns {SolidityParam}\n */\nvar formatInputReal = function (value) {\n return formatInputInt(new BigNumber(value).times(new BigNumber(2).pow(128)));\n};\n\n/**\n * Check if input value is negative\n *\n * @method signedIsNegative\n * @param {String} value is hex format\n * @returns {Boolean} true if it is negative, otherwise false\n */\nvar signedIsNegative = function (value) {\n return (new BigNumber(value.substr(0, 1), 16).toString(2).substr(0, 1)) === '1';\n};\n\n/**\n * Formats right-aligned output bytes to int\n *\n * @method formatOutputInt\n * @param {SolidityParam} param\n * @returns {BigNumber} right-aligned output bytes formatted to big number\n */\nvar formatOutputInt = function (param) {\n var value = param.value || \"0\";\n\n // check if it's negative number\n // it it is, return two's complement\n if (signedIsNegative(value)) {\n return new BigNumber(value, 16).minus(new BigNumber('ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff', 16)).minus(1);\n }\n return new BigNumber(value, 16);\n};\n\n/**\n * Formats right-aligned output bytes to uint\n *\n * @method formatOutputUInt\n * @param {SolidityParam}\n * @returns {BigNumeber} right-aligned output bytes formatted to uint\n */\nvar formatOutputUInt = function (param) {\n var value = param.value || \"0\";\n return new BigNumber(value, 16);\n};\n\n/**\n * Formats right-aligned output bytes to real\n *\n * @method formatOutputReal\n * @param {SolidityParam}\n * @returns {BigNumber} input bytes formatted to real\n */\nvar formatOutputReal = function (param) {\n return formatOutputInt(param).dividedBy(new BigNumber(2).pow(128)); \n};\n\n/**\n * Formats right-aligned output bytes to ureal\n *\n * @method formatOutputUReal\n * @param {SolidityParam}\n * @returns {BigNumber} input bytes formatted to ureal\n */\nvar formatOutputUReal = function (param) {\n return formatOutputUInt(param).dividedBy(new BigNumber(2).pow(128)); \n};\n\n/**\n * Should be used to format output bool\n *\n * @method formatOutputBool\n * @param {SolidityParam}\n * @returns {Boolean} right-aligned input bytes formatted to bool\n */\nvar formatOutputBool = function (param) {\n return param.value === '0000000000000000000000000000000000000000000000000000000000000001' ? true : false;\n};\n\n/**\n * Should be used to format output string\n *\n * @method formatOutputBytes\n * @param {SolidityParam} left-aligned hex representation of string\n * @returns {String} ascii string\n */\nvar formatOutputBytes = function (param) {\n // length might also be important!\n return utils.toAscii(param.value);\n};\n\n/**\n * Should be used to format output string\n *\n * @method formatOutputDynamicBytes\n * @param {SolidityParam} left-aligned hex representation of string\n * @returns {String} ascii string\n */\nvar formatOutputDynamicBytes = function (param) {\n // length might also be important!\n return utils.toAscii(param.suffix);\n};\n\n/**\n * Should be used to format output address\n *\n * @method formatOutputAddress\n * @param {SolidityParam} right-aligned input bytes\n * @returns {String} address\n */\nvar formatOutputAddress = function (param) {\n var value = param.value;\n return \"0x\" + value.slice(value.length - 40, value.length);\n};\n\nmodule.exports = {\n formatInputInt: formatInputInt,\n formatInputBytes: formatInputBytes,\n formatInputDynamicBytes: formatInputDynamicBytes,\n formatInputBool: formatInputBool,\n formatInputReal: formatInputReal,\n formatOutputInt: formatOutputInt,\n formatOutputUInt: formatOutputUInt,\n formatOutputReal: formatOutputReal,\n formatOutputUReal: formatOutputUReal,\n formatOutputBool: formatOutputBool,\n formatOutputBytes: formatOutputBytes,\n formatOutputDynamicBytes: formatOutputDynamicBytes,\n formatOutputAddress: formatOutputAddress\n};\n\n", - "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file param.js\n * @author Marek Kotewicz \n * @date 2015\n */\n\n/**\n * SolidityParam object prototype.\n * Should be used when encoding, decoding solidity bytes\n */\nvar SolidityParam = function (value, prefix, suffix) {\n this.prefix = prefix || '';\n this.value = value || '';\n this.suffix = suffix || '';\n};\n\n/**\n * This method should be used to encode two params one after another\n *\n * @method append\n * @param {SolidityParam} param that it appended after this\n */\nSolidityParam.prototype.append = function (param) {\n this.prefix += param.prefix;\n this.value += param.value;\n this.suffix += param.suffix;\n};\n\n/**\n * This method should be used to encode next param in an array\n *\n * @method appendArrayElement\n * @param {SolidityParam} param that is appended to an array\n */\nSolidityParam.prototype.appendArrayElement = function (param) {\n this.suffix += param.value;\n this.prefix += param.prefix;\n // TODO: suffix not supported = it's required for nested arrays;\n};\n\n/**\n * This method should be used to create bytearrays from param\n *\n * @method encode\n * @return {String} encoded param(s)\n */\nSolidityParam.prototype.encode = function () {\n return this.prefix + this.value + this.suffix;\n};\n\n/**\n * This method should be used to shift first param from group of params\n *\n * @method shiftValue\n * @return {SolidityParam} first value param\n */\nSolidityParam.prototype.shiftValue = function () {\n var value = this.value.slice(0, 64);\n this.value = this.value.slice(64);\n return new SolidityParam(value);\n};\n\n/**\n * This method should be used to first bytes param from group of params\n *\n * @method shiftBytes\n * @return {SolidityParam} first bytes param\n */\nSolidityParam.prototype.shiftBytes = function () {\n return this.shiftArray(1); \n};\n\n/**\n * This method should be used to shift an array from group of params \n * \n * @method shiftArray\n * @param {Number} size of an array to shift\n * @return {SolidityParam} first array param\n */\nSolidityParam.prototype.shiftArray = function (length) {\n var prefix = this.prefix.slice(0, 64);\n this.prefix = this.value.slice(64);\n var suffix = this.suffix.slice(0, 64 * length);\n this.suffix = this.suffix.slice(64 * length);\n return new SolidityParam('', prefix, suffix);\n};\n\nmodule.exports = SolidityParam;\n\n", - "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/**\n * @file utils.js\n * @author Marek Kotewicz \n * @date 2015\n */\n\n/**\n * Returns the contstructor with matching number of arguments\n *\n * @method getConstructor\n * @param {Array} abi\n * @param {Number} numberOfArgs\n * @returns {Object} constructor function abi\n */\nvar getConstructor = function (abi, numberOfArgs) {\n return abi.filter(function (f) {\n return f.type === 'constructor' && f.inputs.length === numberOfArgs;\n })[0];\n};\n\nmodule.exports = {\n getConstructor: getConstructor\n};\n\n", + "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file abi.js\n * @author Marek Kotewicz \n * @author Gav Wood \n * @date 2014\n */\n\nvar coder = require('./coder');\nvar utils = require('./utils');\n\nvar formatConstructorParams = function (abi, params) {\n var constructor = utils.getConstructor(abi, params.length);\n if (!constructor) {\n if (params.length > 0) {\n console.warn(\"didn't found matching constructor, using default one\");\n }\n return '';\n }\n\n return coder.encodeParams(constructor.inputs.map(function (input) {\n return input.type;\n }), params);\n};\n\nmodule.exports = {\n formatConstructorParams: formatConstructorParams\n};\n\n", + "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file coder.js\n * @author Marek Kotewicz \n * @date 2015\n */\n\nvar BigNumber = require('bignumber.js');\nvar utils = require('../utils/utils');\nvar f = require('./formatters');\nvar SolidityParam = require('./param');\n\n/**\n * Should be used to check if a type is an array type\n *\n * @method isArrayType\n * @param {String} type\n * @return {Bool} true is the type is an array, otherwise false\n */\nvar isArrayType = function (type) {\n return type.slice(-2) === '[]';\n};\n\n/**\n * SolidityType prototype is used to encode/decode solidity params of certain type\n */\nvar SolidityType = function (config) {\n this._name = config.name;\n this._match = config.match;\n this._mode = config.mode;\n this._inputFormatter = config.inputFormatter;\n this._outputFormatter = config.outputFormatter;\n};\n\n/**\n * Should be used to determine if this SolidityType do match given type\n *\n * @method isType\n * @param {String} name\n * @return {Bool} true if type match this SolidityType, otherwise false\n */\nSolidityType.prototype.isType = function (name) {\n if (this._match === 'strict') {\n return this._name === name || (name.indexOf(this._name) === 0 && name.slice(this._name.length) === '[]');\n } else if (this._match === 'prefix') {\n // TODO better type detection!\n return name.indexOf(this._name) === 0;\n }\n};\n\n/**\n * Should be used to transform plain param to SolidityParam object\n *\n * @method formatInput\n * @param {Object} param - plain object, or an array of objects\n * @param {Bool} arrayType - true if a param should be encoded as an array\n * @return {SolidityParam} encoded param wrapped in SolidityParam object \n */\nSolidityType.prototype.formatInput = function (param, arrayType) {\n if (utils.isArray(param) && arrayType) { // TODO: should fail if this two are not the same\n var self = this;\n return param.map(function (p) {\n return self._inputFormatter(p);\n }).reduce(function (acc, current) {\n return acc.combine(current);\n }, f.formatInputInt(param.length)).withOffset(32);\n } \n return this._inputFormatter(param);\n};\n\n/**\n * Should be used to transoform SolidityParam to plain param\n *\n * @method formatOutput\n * @param {SolidityParam} byteArray\n * @param {Bool} arrayType - true if a param should be decoded as an array\n * @return {Object} plain decoded param\n */\nSolidityType.prototype.formatOutput = function (param, arrayType) {\n if (arrayType) {\n // let's assume, that we solidity will never return long arrays :P \n var result = [];\n var length = new BigNumber(param.dynamicPart().slice(0, 64), 16);\n for (var i = 0; i < length * 64; i += 64) {\n result.push(this._outputFormatter(new SolidityParam(param.dynamicPart().substr(i + 64, 64))));\n }\n return result;\n }\n return this._outputFormatter(param);\n};\n\n/**\n * Should be used to slice single param from bytes\n *\n * @method sliceParam\n * @param {String} bytes\n * @param {Number} index of param to slice\n * @param {String} type\n * @returns {SolidityParam} param\n */\nSolidityType.prototype.sliceParam = function (bytes, index, type) {\n if (this._mode === 'bytes') {\n return SolidityParam.decodeBytes(bytes, index);\n } else if (isArrayType(type)) {\n return SolidityParam.decodeArray(bytes, index);\n }\n return SolidityParam.decodeParam(bytes, index);\n};\n\n/**\n * SolidityCoder prototype should be used to encode/decode solidity params of any type\n */\nvar SolidityCoder = function (types) {\n this._types = types;\n};\n\n/**\n * This method should be used to transform type to SolidityType\n *\n * @method _requireType\n * @param {String} type\n * @returns {SolidityType} \n * @throws {Error} throws if no matching type is found\n */\nSolidityCoder.prototype._requireType = function (type) {\n var solidityType = this._types.filter(function (t) {\n return t.isType(type);\n })[0];\n\n if (!solidityType) {\n throw Error('invalid solidity type!: ' + type);\n }\n\n return solidityType;\n};\n\n/**\n * Should be used to transform plain param of given type to SolidityParam\n *\n * @method _formatInput\n * @param {String} type of param\n * @param {Object} plain param\n * @return {SolidityParam}\n */\nSolidityCoder.prototype._formatInput = function (type, param) {\n return this._requireType(type).formatInput(param, isArrayType(type));\n};\n\n/**\n * Should be used to encode plain param\n *\n * @method encodeParam\n * @param {String} type\n * @param {Object} plain param\n * @return {String} encoded plain param\n */\nSolidityCoder.prototype.encodeParam = function (type, param) {\n return this._formatInput(type, param).encode();\n};\n\n/**\n * Should be used to encode list of params\n *\n * @method encodeParams\n * @param {Array} types\n * @param {Array} params\n * @return {String} encoded list of params\n */\nSolidityCoder.prototype.encodeParams = function (types, params) {\n var self = this;\n var solidityParams = types.map(function (type, index) {\n return self._formatInput(type, params[index]);\n });\n\n return SolidityParam.encodeList(solidityParams);\n};\n\n/**\n * Should be used to decode bytes to plain param\n *\n * @method decodeParam\n * @param {String} type\n * @param {String} bytes\n * @return {Object} plain param\n */\nSolidityCoder.prototype.decodeParam = function (type, bytes) {\n return this.decodeParams([type], bytes)[0];\n};\n\n/**\n * Should be used to decode list of params\n *\n * @method decodeParam\n * @param {Array} types\n * @param {String} bytes\n * @return {Array} array of plain params\n */\nSolidityCoder.prototype.decodeParams = function (types, bytes) {\n var self = this;\n return types.map(function (type, index) {\n var solidityType = self._requireType(type);\n var p = solidityType.sliceParam(bytes, index, type);\n return solidityType.formatOutput(p, isArrayType(type));\n });\n};\n\nvar coder = new SolidityCoder([\n new SolidityType({\n name: 'address',\n match: 'strict',\n mode: 'value',\n inputFormatter: f.formatInputInt,\n outputFormatter: f.formatOutputAddress\n }),\n new SolidityType({\n name: 'bool',\n match: 'strict',\n mode: 'value',\n inputFormatter: f.formatInputBool,\n outputFormatter: f.formatOutputBool\n }),\n new SolidityType({\n name: 'int',\n match: 'prefix',\n mode: 'value',\n inputFormatter: f.formatInputInt,\n outputFormatter: f.formatOutputInt,\n }),\n new SolidityType({\n name: 'uint',\n match: 'prefix',\n mode: 'value',\n inputFormatter: f.formatInputInt,\n outputFormatter: f.formatOutputUInt\n }),\n new SolidityType({\n name: 'bytes',\n match: 'strict',\n mode: 'bytes',\n inputFormatter: f.formatInputDynamicBytes,\n outputFormatter: f.formatOutputDynamicBytes\n }),\n new SolidityType({\n name: 'bytes',\n match: 'prefix',\n mode: 'value',\n inputFormatter: f.formatInputBytes,\n outputFormatter: f.formatOutputBytes\n }),\n new SolidityType({\n name: 'real',\n match: 'prefix',\n mode: 'value',\n inputFormatter: f.formatInputReal,\n outputFormatter: f.formatOutputReal\n }),\n new SolidityType({\n name: 'ureal',\n match: 'prefix',\n mode: 'value',\n inputFormatter: f.formatInputReal,\n outputFormatter: f.formatOutputUReal\n })\n]);\n\nmodule.exports = coder;\n\n", + "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file formatters.js\n * @author Marek Kotewicz \n * @date 2015\n */\n\nvar BigNumber = require('bignumber.js');\nvar utils = require('../utils/utils');\nvar c = require('../utils/config');\nvar SolidityParam = require('./param');\n\n\n/**\n * Formats input value to byte representation of int\n * If value is negative, return it's two's complement\n * If the value is floating point, round it down\n *\n * @method formatInputInt\n * @param {String|Number|BigNumber} value that needs to be formatted\n * @returns {SolidityParam}\n */\nvar formatInputInt = function (value) {\n var padding = c.ETH_PADDING * 2;\n BigNumber.config(c.ETH_BIGNUMBER_ROUNDING_MODE);\n var result = utils.padLeft(utils.toTwosComplement(value).round().toString(16), padding);\n return new SolidityParam(result);\n};\n\n/**\n * Formats input value to byte representation of string\n *\n * @method formatInputBytes\n * @param {String}\n * @returns {SolidityParam}\n */\nvar formatInputBytes = function (value) {\n var result = utils.fromAscii(value, c.ETH_PADDING).substr(2);\n return new SolidityParam(result);\n};\n\n/**\n * Formats input value to byte representation of string\n *\n * @method formatInputDynamicBytes\n * @param {String}\n * @returns {SolidityParam}\n */\nvar formatInputDynamicBytes = function (value) {\n var result = utils.fromAscii(value, c.ETH_PADDING).substr(2);\n return new SolidityParam(formatInputInt(value.length).value + result, 32);\n};\n\n/**\n * Formats input value to byte representation of bool\n *\n * @method formatInputBool\n * @param {Boolean}\n * @returns {SolidityParam}\n */\nvar formatInputBool = function (value) {\n var result = '000000000000000000000000000000000000000000000000000000000000000' + (value ? '1' : '0');\n return new SolidityParam(result);\n};\n\n/**\n * Formats input value to byte representation of real\n * Values are multiplied by 2^m and encoded as integers\n *\n * @method formatInputReal\n * @param {String|Number|BigNumber}\n * @returns {SolidityParam}\n */\nvar formatInputReal = function (value) {\n return formatInputInt(new BigNumber(value).times(new BigNumber(2).pow(128)));\n};\n\n/**\n * Check if input value is negative\n *\n * @method signedIsNegative\n * @param {String} value is hex format\n * @returns {Boolean} true if it is negative, otherwise false\n */\nvar signedIsNegative = function (value) {\n return (new BigNumber(value.substr(0, 1), 16).toString(2).substr(0, 1)) === '1';\n};\n\n/**\n * Formats right-aligned output bytes to int\n *\n * @method formatOutputInt\n * @param {SolidityParam} param\n * @returns {BigNumber} right-aligned output bytes formatted to big number\n */\nvar formatOutputInt = function (param) {\n var value = param.staticPart() || \"0\";\n\n // check if it's negative number\n // it it is, return two's complement\n if (signedIsNegative(value)) {\n return new BigNumber(value, 16).minus(new BigNumber('ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff', 16)).minus(1);\n }\n return new BigNumber(value, 16);\n};\n\n/**\n * Formats right-aligned output bytes to uint\n *\n * @method formatOutputUInt\n * @param {SolidityParam}\n * @returns {BigNumeber} right-aligned output bytes formatted to uint\n */\nvar formatOutputUInt = function (param) {\n var value = param.staticPart() || \"0\";\n return new BigNumber(value, 16);\n};\n\n/**\n * Formats right-aligned output bytes to real\n *\n * @method formatOutputReal\n * @param {SolidityParam}\n * @returns {BigNumber} input bytes formatted to real\n */\nvar formatOutputReal = function (param) {\n return formatOutputInt(param).dividedBy(new BigNumber(2).pow(128)); \n};\n\n/**\n * Formats right-aligned output bytes to ureal\n *\n * @method formatOutputUReal\n * @param {SolidityParam}\n * @returns {BigNumber} input bytes formatted to ureal\n */\nvar formatOutputUReal = function (param) {\n return formatOutputUInt(param).dividedBy(new BigNumber(2).pow(128)); \n};\n\n/**\n * Should be used to format output bool\n *\n * @method formatOutputBool\n * @param {SolidityParam}\n * @returns {Boolean} right-aligned input bytes formatted to bool\n */\nvar formatOutputBool = function (param) {\n return param.staticPart() === '0000000000000000000000000000000000000000000000000000000000000001' ? true : false;\n};\n\n/**\n * Should be used to format output string\n *\n * @method formatOutputBytes\n * @param {SolidityParam} left-aligned hex representation of string\n * @returns {String} ascii string\n */\nvar formatOutputBytes = function (param) {\n // length might also be important!\n return utils.toAscii(param.staticPart());\n};\n\n/**\n * Should be used to format output string\n *\n * @method formatOutputDynamicBytes\n * @param {SolidityParam} left-aligned hex representation of string\n * @returns {String} ascii string\n */\nvar formatOutputDynamicBytes = function (param) {\n // length might also be important!\n return utils.toAscii(param.dynamicPart().slice(64));\n};\n\n/**\n * Should be used to format output address\n *\n * @method formatOutputAddress\n * @param {SolidityParam} right-aligned input bytes\n * @returns {String} address\n */\nvar formatOutputAddress = function (param) {\n var value = param.staticPart();\n return \"0x\" + value.slice(value.length - 40, value.length);\n};\n\nmodule.exports = {\n formatInputInt: formatInputInt,\n formatInputBytes: formatInputBytes,\n formatInputDynamicBytes: formatInputDynamicBytes,\n formatInputBool: formatInputBool,\n formatInputReal: formatInputReal,\n formatOutputInt: formatOutputInt,\n formatOutputUInt: formatOutputUInt,\n formatOutputReal: formatOutputReal,\n formatOutputUReal: formatOutputUReal,\n formatOutputBool: formatOutputBool,\n formatOutputBytes: formatOutputBytes,\n formatOutputDynamicBytes: formatOutputDynamicBytes,\n formatOutputAddress: formatOutputAddress\n};\n\n", + "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file param.js\n * @author Marek Kotewicz \n * @date 2015\n */\n\nvar utils = require('../utils/utils');\n\n/**\n * SolidityParam object prototype.\n * Should be used when encoding, decoding solidity bytes\n */\nvar SolidityParam = function (value, offset) {\n this.value = value || '';\n this.offset = offset; // offset in bytes\n};\n\n/**\n * This method should be used to get length of params's dynamic part\n * \n * @method dynamicPartLength\n * @returns {Number} length of dynamic part (in bytes)\n */\nSolidityParam.prototype.dynamicPartLength = function () {\n return this.dynamicPart().length / 2;\n};\n\n/**\n * This method should be used to create copy of solidity param with different offset\n *\n * @method withOffset\n * @param {Number} offset length in bytes\n * @returns {SolidityParam} new solidity param with applied offset\n */\nSolidityParam.prototype.withOffset = function (offset) {\n return new SolidityParam(this.value, offset);\n};\n\n/**\n * This method should be used to combine solidity params together\n * eg. when appending an array\n *\n * @method combine\n * @param {SolidityParam} param with which we should combine\n * @param {SolidityParam} result of combination\n */\nSolidityParam.prototype.combine = function (param) {\n return new SolidityParam(this.value + param.value); \n};\n\n/**\n * This method should be called to check if param has dynamic size.\n * If it has, it returns true, otherwise false\n *\n * @method isDynamic\n * @returns {Boolean}\n */\nSolidityParam.prototype.isDynamic = function () {\n return this.value.length > 64;\n};\n\n/**\n * This method should be called to transform offset to bytes\n *\n * @method offsetAsBytes\n * @returns {String} bytes representation of offset\n */\nSolidityParam.prototype.offsetAsBytes = function () {\n return !this.isDynamic() ? '' : utils.padLeft(utils.toTwosComplement(this.offset).toString(16), 64);\n};\n\n/**\n * This method should be called to get static part of param\n *\n * @method staticPart\n * @returns {String} offset if it is a dynamic param, otherwise value\n */\nSolidityParam.prototype.staticPart = function () {\n if (!this.isDynamic()) {\n return this.value; \n } \n return this.offsetAsBytes();\n};\n\n/**\n * This method should be called to get dynamic part of param\n *\n * @method dynamicPart\n * @returns {String} returns a value if it is a dynamic param, otherwise empty string\n */\nSolidityParam.prototype.dynamicPart = function () {\n return this.isDynamic() ? this.value : '';\n};\n\n/**\n * This method should be called to encode param\n *\n * @method encode\n * @returns {String}\n */\nSolidityParam.prototype.encode = function () {\n return this.staticPart() + this.dynamicPart();\n};\n\n/**\n * This method should be called to encode array of params\n *\n * @method encodeList\n * @param {Array[SolidityParam]} params\n * @returns {String}\n */\nSolidityParam.encodeList = function (params) {\n \n // updating offsets\n var totalOffset = params.length * 32;\n var offsetParams = params.map(function (param) {\n if (!param.isDynamic()) {\n return param;\n }\n var offset = totalOffset;\n totalOffset += param.dynamicPartLength();\n return param.withOffset(offset);\n });\n\n // encode everything!\n return offsetParams.reduce(function (result, param) {\n return result + param.dynamicPart();\n }, offsetParams.reduce(function (result, param) {\n return result + param.staticPart();\n }, ''));\n};\n\n/**\n * This method should be used to decode plain (static) solidity param at given index\n *\n * @method decodeParam\n * @param {String} bytes\n * @param {Number} index\n * @returns {SolidityParam}\n */\nSolidityParam.decodeParam = function (bytes, index) {\n index = index || 0;\n return new SolidityParam(bytes.substr(index * 64, 64)); \n};\n\n/**\n * This method should be called to get offset value from bytes at given index\n *\n * @method getOffset\n * @param {String} bytes\n * @param {Number} index\n * @returns {Number} offset as number\n */\nvar getOffset = function (bytes, index) {\n // we can do this cause offset is rather small\n return parseInt('0x' + bytes.substr(index * 64, 64));\n};\n\n/**\n * This method should be called to decode solidity bytes param at given index\n *\n * @method decodeBytes\n * @param {String} bytes\n * @param {Number} index\n * @returns {SolidityParam}\n */\nSolidityParam.decodeBytes = function (bytes, index) {\n index = index || 0;\n //TODO add support for strings longer than 32 bytes\n //var length = parseInt('0x' + bytes.substr(offset * 64, 64));\n\n var offset = getOffset(bytes, index);\n\n // 2 * , cause we also parse length\n return new SolidityParam(bytes.substr(offset * 2, 2 * 64));\n};\n\n/**\n * This method should be used to decode solidity array at given index\n *\n * @method decodeArray\n * @param {String} bytes\n * @param {Number} index\n * @returns {SolidityParam}\n */\nSolidityParam.decodeArray = function (bytes, index) {\n index = index || 0;\n var offset = getOffset(bytes, index);\n var length = parseInt('0x' + bytes.substr(offset * 2, 64));\n return new SolidityParam(bytes.substr(offset * 2, (length + 1) * 64));\n};\n\nmodule.exports = SolidityParam;\n\n", + "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/**\n * @file utils.js\n * @author Marek Kotewicz \n * @date 2015\n */\n\n/**\n * Returns the contstructor with matching number of arguments\n *\n * @method getConstructor\n * @param {Array} abi\n * @param {Number} numberOfArgs\n * @returns {Object} constructor function abi\n */\nvar getConstructor = function (abi, numberOfArgs) {\n return abi.filter(function (f) {\n return f.type === 'constructor' && f.inputs.length === numberOfArgs;\n })[0];\n};\n\n//var getSupremeType = function (type) {\n //return type.substr(0, type.indexOf('[')) + ']';\n//};\n\n\nmodule.exports = {\n getConstructor: getConstructor\n};\n\n", "'use strict';\n\n// go env doesn't have and need XMLHttpRequest\nif (typeof XMLHttpRequest === 'undefined') {\n exports.XMLHttpRequest = {};\n} else {\n exports.XMLHttpRequest = XMLHttpRequest; // jshint ignore:line\n}\n\n", "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** @file config.js\n * @authors:\n * Marek Kotewicz \n * @date 2015\n */\n\n/**\n * Utils\n * \n * @module utils\n */\n\n/**\n * Utility functions\n * \n * @class [utils] config\n * @constructor\n */\n\n/// required to define ETH_BIGNUMBER_ROUNDING_MODE\nvar BigNumber = require('bignumber.js');\n\nvar ETH_UNITS = [ \n 'wei', \n 'Kwei', \n 'Mwei', \n 'Gwei', \n 'szabo', \n 'finney', \n 'ether', \n 'grand', \n 'Mether', \n 'Gether', \n 'Tether', \n 'Pether', \n 'Eether', \n 'Zether', \n 'Yether', \n 'Nether', \n 'Dether', \n 'Vether', \n 'Uether' \n];\n\nmodule.exports = {\n ETH_PADDING: 32,\n ETH_SIGNATURE_LENGTH: 4,\n ETH_UNITS: ETH_UNITS,\n ETH_BIGNUMBER_ROUNDING_MODE: { ROUNDING_MODE: BigNumber.ROUND_DOWN },\n ETH_POLLING_TIMEOUT: 1000,\n defaultBlock: 'latest',\n defaultAccount: undefined\n};\n\n", "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file utils.js\n * @author Marek Kotewicz \n * @date 2015\n */\n\n/**\n * Utils\n * \n * @module utils\n */\n\n/**\n * Utility functions\n * \n * @class [utils] utils\n * @constructor\n */\n\nvar BigNumber = require('bignumber.js');\n\nvar unitMap = {\n 'wei': '1',\n 'kwei': '1000',\n 'ada': '1000',\n 'mwei': '1000000',\n 'babbage': '1000000',\n 'gwei': '1000000000',\n 'shannon': '1000000000',\n 'szabo': '1000000000000',\n 'finney': '1000000000000000',\n 'ether': '1000000000000000000',\n 'kether': '1000000000000000000000',\n 'grand': '1000000000000000000000',\n 'einstein': '1000000000000000000000',\n 'mether': '1000000000000000000000000',\n 'gether': '1000000000000000000000000000',\n 'tether': '1000000000000000000000000000000'\n};\n\n/**\n * Should be called to pad string to expected length\n *\n * @method padLeft\n * @param {String} string to be padded\n * @param {Number} characters that result string should have\n * @param {String} sign, by default 0\n * @returns {String} right aligned string\n */\nvar padLeft = function (string, chars, sign) {\n return new Array(chars - string.length + 1).join(sign ? sign : \"0\") + string;\n};\n\n/** \n * Should be called to get sting from it's hex representation\n *\n * @method toAscii\n * @param {String} string in hex\n * @returns {String} ascii string representation of hex value\n */\nvar toAscii = function(hex) {\n// Find termination\n var str = \"\";\n var i = 0, l = hex.length;\n if (hex.substring(0, 2) === '0x') {\n i = 2;\n }\n for (; i < l; i+=2) {\n var code = parseInt(hex.substr(i, 2), 16);\n if (code === 0) {\n break;\n }\n\n str += String.fromCharCode(code);\n }\n\n return str;\n};\n \n/**\n * Shold be called to get hex representation (prefixed by 0x) of ascii string \n *\n * @method toHexNative\n * @param {String} string\n * @returns {String} hex representation of input string\n */\nvar toHexNative = function(str) {\n var hex = \"\";\n for(var i = 0; i < str.length; i++) {\n var n = str.charCodeAt(i).toString(16);\n hex += n.length < 2 ? '0' + n : n;\n }\n\n return hex;\n};\n\n/**\n * Shold be called to get hex representation (prefixed by 0x) of ascii string \n *\n * @method fromAscii\n * @param {String} string\n * @param {Number} optional padding\n * @returns {String} hex representation of input string\n */\nvar fromAscii = function(str, pad) {\n pad = pad === undefined ? 0 : pad;\n var hex = toHexNative(str);\n while (hex.length < pad*2)\n hex += \"00\";\n return \"0x\" + hex;\n};\n\n/**\n * Should be used to create full function/event name from json abi\n *\n * @method transformToFullName\n * @param {Object} json-abi\n * @return {String} full fnction/event name\n */\nvar transformToFullName = function (json) {\n if (json.name.indexOf('(') !== -1) {\n return json.name;\n }\n\n var typeName = json.inputs.map(function(i){return i.type; }).join();\n return json.name + '(' + typeName + ')';\n};\n\n/**\n * Should be called to get display name of contract function\n * \n * @method extractDisplayName\n * @param {String} name of function/event\n * @returns {String} display name for function/event eg. multiply(uint256) -> multiply\n */\nvar extractDisplayName = function (name) {\n var length = name.indexOf('('); \n return length !== -1 ? name.substr(0, length) : name;\n};\n\n/// @returns overloaded part of function/event name\nvar extractTypeName = function (name) {\n /// TODO: make it invulnerable\n var length = name.indexOf('(');\n return length !== -1 ? name.substr(length + 1, name.length - 1 - (length + 1)).replace(' ', '') : \"\";\n};\n\n/**\n * Converts value to it's decimal representation in string\n *\n * @method toDecimal\n * @param {String|Number|BigNumber}\n * @return {String}\n */\nvar toDecimal = function (value) {\n return toBigNumber(value).toNumber();\n};\n\n/**\n * Converts value to it's hex representation\n *\n * @method fromDecimal\n * @param {String|Number|BigNumber}\n * @return {String}\n */\nvar fromDecimal = function (value) {\n var number = toBigNumber(value);\n var result = number.toString(16);\n\n return number.lessThan(0) ? '-0x' + result.substr(1) : '0x' + result;\n};\n\n/**\n * Auto converts any given value into it's hex representation.\n *\n * And even stringifys objects before.\n *\n * @method toHex\n * @param {String|Number|BigNumber|Object}\n * @return {String}\n */\nvar toHex = function (val) {\n /*jshint maxcomplexity:7 */\n\n if (isBoolean(val))\n return fromDecimal(+val);\n\n if (isBigNumber(val))\n return fromDecimal(val);\n\n if (isObject(val))\n return fromAscii(JSON.stringify(val));\n\n // if its a negative number, pass it through fromDecimal\n if (isString(val)) {\n if (val.indexOf('-0x') === 0)\n return fromDecimal(val);\n else if (!isFinite(val))\n return fromAscii(val);\n }\n\n return fromDecimal(val);\n};\n\n/**\n * Returns value of unit in Wei\n *\n * @method getValueOfUnit\n * @param {String} unit the unit to convert to, default ether\n * @returns {BigNumber} value of the unit (in Wei)\n * @throws error if the unit is not correct:w\n */\nvar getValueOfUnit = function (unit) {\n unit = unit ? unit.toLowerCase() : 'ether';\n var unitValue = unitMap[unit];\n if (unitValue === undefined) {\n throw new Error('This unit doesn\\'t exists, please use the one of the following units' + JSON.stringify(unitMap, null, 2));\n }\n return new BigNumber(unitValue, 10);\n};\n\n/**\n * Takes a number of wei and converts it to any other ether unit.\n *\n * Possible units are:\n * - kwei/ada\n * - mwei/babbage\n * - gwei/shannon\n * - szabo\n * - finney\n * - ether\n * - kether/grand/einstein\n * - mether\n * - gether\n * - tether\n *\n * @method fromWei\n * @param {Number|String} number can be a number, number string or a HEX of a decimal\n * @param {String} unit the unit to convert to, default ether\n * @return {String|Object} When given a BigNumber object it returns one as well, otherwise a number\n*/\nvar fromWei = function(number, unit) {\n var returnValue = toBigNumber(number).dividedBy(getValueOfUnit(unit));\n\n return isBigNumber(number) ? returnValue : returnValue.toString(10); \n};\n\n/**\n * Takes a number of a unit and converts it to wei.\n *\n * Possible units are:\n * - kwei/ada\n * - mwei/babbage\n * - gwei/shannon\n * - szabo\n * - finney\n * - ether\n * - kether/grand/einstein\n * - mether\n * - gether\n * - tether\n *\n * @method toWei\n * @param {Number|String|BigNumber} number can be a number, number string or a HEX of a decimal\n * @param {String} unit the unit to convert from, default ether\n * @return {String|Object} When given a BigNumber object it returns one as well, otherwise a number\n*/\nvar toWei = function(number, unit) {\n var returnValue = toBigNumber(number).times(getValueOfUnit(unit));\n\n return isBigNumber(number) ? returnValue : returnValue.toString(10); \n};\n\n/**\n * Takes an input and transforms it into an bignumber\n *\n * @method toBigNumber\n * @param {Number|String|BigNumber} a number, string, HEX string or BigNumber\n * @return {BigNumber} BigNumber\n*/\nvar toBigNumber = function(number) {\n /*jshint maxcomplexity:5 */\n number = number || 0;\n if (isBigNumber(number))\n return number;\n\n if (isString(number) && (number.indexOf('0x') === 0 || number.indexOf('-0x') === 0)) {\n return new BigNumber(number.replace('0x',''), 16);\n }\n \n return new BigNumber(number.toString(10), 10);\n};\n\n/**\n * Takes and input transforms it into bignumber and if it is negative value, into two's complement\n *\n * @method toTwosComplement\n * @param {Number|String|BigNumber}\n * @return {BigNumber}\n */\nvar toTwosComplement = function (number) {\n var bigNumber = toBigNumber(number);\n if (bigNumber.lessThan(0)) {\n return new BigNumber(\"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\", 16).plus(bigNumber).plus(1);\n }\n return bigNumber;\n};\n\n/**\n * Checks if the given string is strictly an address\n *\n * @method isStrictAddress\n * @param {String} address the given HEX adress\n * @return {Boolean}\n*/\nvar isStrictAddress = function (address) {\n return /^0x[0-9a-f]{40}$/.test(address);\n};\n\n/**\n * Checks if the given string is an address\n *\n * @method isAddress\n * @param {String} address the given HEX adress\n * @return {Boolean}\n*/\nvar isAddress = function (address) {\n return /^(0x)?[0-9a-f]{40}$/.test(address);\n};\n\n/**\n * Transforms given string to valid 20 bytes-length addres with 0x prefix\n *\n * @method toAddress\n * @param {String} address\n * @return {String} formatted address\n */\nvar toAddress = function (address) {\n if (isStrictAddress(address)) {\n return address;\n }\n \n if (/^[0-9a-f]{40}$/.test(address)) {\n return '0x' + address;\n }\n\n return '0x' + padLeft(toHex(address).substr(2), 40);\n};\n\n/**\n * Returns true if object is BigNumber, otherwise false\n *\n * @method isBigNumber\n * @param {Object}\n * @return {Boolean} \n */\nvar isBigNumber = function (object) {\n return object instanceof BigNumber ||\n (object && object.constructor && object.constructor.name === 'BigNumber');\n};\n\n/**\n * Returns true if object is string, otherwise false\n * \n * @method isString\n * @param {Object}\n * @return {Boolean}\n */\nvar isString = function (object) {\n return typeof object === 'string' ||\n (object && object.constructor && object.constructor.name === 'String');\n};\n\n/**\n * Returns true if object is function, otherwise false\n *\n * @method isFunction\n * @param {Object}\n * @return {Boolean}\n */\nvar isFunction = function (object) {\n return typeof object === 'function';\n};\n\n/**\n * Returns true if object is Objet, otherwise false\n *\n * @method isObject\n * @param {Object}\n * @return {Boolean}\n */\nvar isObject = function (object) {\n return typeof object === 'object';\n};\n\n/**\n * Returns true if object is boolean, otherwise false\n *\n * @method isBoolean\n * @param {Object}\n * @return {Boolean}\n */\nvar isBoolean = function (object) {\n return typeof object === 'boolean';\n};\n\n/**\n * Returns true if object is array, otherwise false\n *\n * @method isArray\n * @param {Object}\n * @return {Boolean}\n */\nvar isArray = function (object) {\n return object instanceof Array; \n};\n\n/**\n * Returns true if given string is valid json object\n * \n * @method isJson\n * @param {String}\n * @return {Boolean}\n */\nvar isJson = function (str) {\n try {\n return !!JSON.parse(str);\n } catch (e) {\n return false;\n }\n};\n\nmodule.exports = {\n padLeft: padLeft,\n toHex: toHex,\n toDecimal: toDecimal,\n fromDecimal: fromDecimal,\n toAscii: toAscii,\n fromAscii: fromAscii,\n transformToFullName: transformToFullName,\n extractDisplayName: extractDisplayName,\n extractTypeName: extractTypeName,\n toWei: toWei,\n fromWei: fromWei,\n toBigNumber: toBigNumber,\n toTwosComplement: toTwosComplement,\n toAddress: toAddress,\n isBigNumber: isBigNumber,\n isStrictAddress: isStrictAddress,\n isAddress: isAddress,\n isFunction: isFunction,\n isString: isString,\n isObject: isObject,\n isBoolean: isBoolean,\n isArray: isArray,\n isJson: isJson\n};\n\n", - "module.exports={\n \"version\": \"0.3.3\"\n}\n", + "module.exports={\n \"version\": \"0.3.6\"\n}\n", "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** @file web3.js\n * @authors:\n * Jeffrey Wilcke \n * Marek Kotewicz \n * Marian Oancea \n * Fabian Vogelsteller \n * Gav Wood \n * @date 2014\n */\n\nvar version = require('./version.json');\nvar net = require('./web3/net');\nvar eth = require('./web3/eth');\nvar db = require('./web3/db');\nvar shh = require('./web3/shh');\nvar watches = require('./web3/watches');\nvar Filter = require('./web3/filter');\nvar utils = require('./utils/utils');\nvar formatters = require('./web3/formatters');\nvar RequestManager = require('./web3/requestmanager');\nvar c = require('./utils/config');\nvar Method = require('./web3/method');\nvar Property = require('./web3/property');\n\nvar web3Methods = [\n new Method({\n name: 'sha3',\n call: 'web3_sha3',\n params: 1\n })\n];\n\nvar web3Properties = [\n new Property({\n name: 'version.client',\n getter: 'web3_clientVersion'\n }),\n new Property({\n name: 'version.network',\n getter: 'net_version',\n inputFormatter: utils.toDecimal\n }),\n new Property({\n name: 'version.ethereum',\n getter: 'eth_protocolVersion',\n inputFormatter: utils.toDecimal\n }),\n new Property({\n name: 'version.whisper',\n getter: 'shh_version',\n inputFormatter: utils.toDecimal\n })\n];\n\n/// creates methods in a given object based on method description on input\n/// setups api calls for these methods\nvar setupMethods = function (obj, methods) {\n methods.forEach(function (method) {\n method.attachToObject(obj);\n });\n};\n\n/// creates properties in a given object based on properties description on input\n/// setups api calls for these properties\nvar setupProperties = function (obj, properties) {\n properties.forEach(function (property) {\n property.attachToObject(obj);\n });\n};\n\n/// setups web3 object, and it's in-browser executed methods\nvar web3 = {};\nweb3.providers = {};\nweb3.version = {};\nweb3.version.api = version.version;\nweb3.eth = {};\n\n/*jshint maxparams:4 */\nweb3.eth.filter = function (fil, eventParams, options, formatter) {\n\n // if its event, treat it differently\n // TODO: simplify and remove\n if (fil._isEvent) {\n return fil(eventParams, options);\n }\n\n // what outputLogFormatter? that's wrong\n //return new Filter(fil, watches.eth(), formatters.outputLogFormatter);\n return new Filter(fil, watches.eth(), formatter || formatters.outputLogFormatter);\n};\n/*jshint maxparams:3 */\n\nweb3.shh = {};\nweb3.shh.filter = function (fil) {\n return new Filter(fil, watches.shh(), formatters.outputPostFormatter);\n};\nweb3.net = {};\nweb3.db = {};\nweb3.setProvider = function (provider) {\n RequestManager.getInstance().setProvider(provider);\n};\nweb3.reset = function () {\n RequestManager.getInstance().reset();\n c.defaultBlock = 'latest';\n c.defaultAccount = undefined;\n};\nweb3.toHex = utils.toHex;\nweb3.toAscii = utils.toAscii;\nweb3.fromAscii = utils.fromAscii;\nweb3.toDecimal = utils.toDecimal;\nweb3.fromDecimal = utils.fromDecimal;\nweb3.toBigNumber = utils.toBigNumber;\nweb3.toWei = utils.toWei;\nweb3.fromWei = utils.fromWei;\nweb3.isAddress = utils.isAddress;\n\n// ADD defaultblock\nObject.defineProperty(web3.eth, 'defaultBlock', {\n get: function () {\n return c.defaultBlock;\n },\n set: function (val) {\n c.defaultBlock = val;\n return val;\n }\n});\n\nObject.defineProperty(web3.eth, 'defaultAccount', {\n get: function () {\n return c.defaultAccount;\n },\n set: function (val) {\n c.defaultAccount = val;\n return val;\n }\n});\n\n/// setups all api methods\nsetupMethods(web3, web3Methods);\nsetupProperties(web3, web3Properties);\nsetupMethods(web3.net, net.methods);\nsetupProperties(web3.net, net.properties);\nsetupMethods(web3.eth, eth.methods);\nsetupProperties(web3.eth, eth.properties);\nsetupMethods(web3.db, db.methods);\nsetupMethods(web3.shh, shh.methods);\n\nmodule.exports = web3;\n\n", "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file contract.js\n * @author Marek Kotewicz \n * @date 2014\n */\n\nvar web3 = require('../web3'); \nvar solAbi = require('../solidity/abi');\nvar utils = require('../utils/utils');\nvar SolidityEvent = require('./event');\nvar SolidityFunction = require('./function');\n\nvar addFunctionsToContract = function (contract, desc) {\n desc.filter(function (json) {\n return json.type === 'function';\n }).map(function (json) {\n return new SolidityFunction(json, contract.address);\n }).forEach(function (f) {\n f.attachToContract(contract);\n });\n};\n\nvar addEventsToContract = function (contract, desc) {\n desc.filter(function (json) {\n return json.type === 'event';\n }).map(function (json) {\n return new SolidityEvent(json, contract.address);\n }).forEach(function (e) {\n e.attachToContract(contract);\n });\n};\n\n/**\n * This method should be called when we want to call / transact some solidity method from javascript\n * it returns an object which has same methods available as solidity contract description\n * usage example: \n *\n * var abi = [{\n * name: 'myMethod',\n * inputs: [{ name: 'a', type: 'string' }],\n * outputs: [{name: 'd', type: 'string' }]\n * }]; // contract abi\n *\n * var MyContract = web3.eth.contract(abi); // creation of contract prototype\n *\n * var contractInstance = new MyContract('0x0123123121');\n *\n * contractInstance.myMethod('this is test string param for call'); // myMethod call (implicit, default)\n * contractInstance.call().myMethod('this is test string param for call'); // myMethod call (explicit)\n * contractInstance.sendTransaction().myMethod('this is test string param for transact'); // myMethod sendTransaction\n *\n * @param abi - abi json description of the contract, which is being created\n * @returns contract object\n */\nvar contract = function (abi) {\n\n // return prototype\n return Contract.bind(null, abi);\n};\n\nvar Contract = function (abi, options) {\n\n this.address = '';\n if (utils.isAddress(options)) {\n this.address = options;\n } else { // is an object!\n // TODO, parse the rest of the args\n options = options || {};\n var args = Array.prototype.slice.call(arguments, 2);\n var bytes = solAbi.formatConstructorParams(abi, args);\n options.data += bytes;\n this.address = web3.eth.sendTransaction(options);\n }\n\n addFunctionsToContract(this, abi);\n addEventsToContract(this, abi);\n};\n\nContract.prototype.call = function () {\n console.error('contract.call is deprecated');\n return this;\n};\n\nContract.prototype.sendTransaction = function () {\n console.error('contract.sendTransact is deprecated');\n return this;\n};\n\nmodule.exports = contract;\n\n", "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** @file db.js\n * @authors:\n * Marek Kotewicz \n * @date 2015\n */\n\nvar Method = require('./method');\n\nvar putString = new Method({\n name: 'putString',\n call: 'db_putString',\n params: 3\n});\n\n\nvar getString = new Method({\n name: 'getString',\n call: 'db_getString',\n params: 2\n});\n\nvar putHex = new Method({\n name: 'putHex',\n call: 'db_putHex',\n params: 3\n});\n\nvar getHex = new Method({\n name: 'getHex',\n call: 'db_getHex',\n params: 2\n});\n\nvar methods = [\n putString, getString, putHex, getHex\n];\n\nmodule.exports = {\n methods: methods\n};\n", "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file errors.js\n * @author Marek Kotewicz \n * @date 2015\n */\n\nmodule.exports = {\n InvalidNumberOfParams: function () {\n return new Error('Invalid number of input parameters');\n },\n InvalidConnection: function (host){\n return new Error('CONNECTION ERROR: Couldn\\'t connect to node '+ host +', is it running?');\n },\n InvalidProvider: function () {\n return new Error('Providor not set or invalid');\n },\n InvalidResponse: function (result){\n var message = !!result && !!result.error && !!result.error.message ? result.error.message : 'Invalid JSON RPC response';\n return new Error(message);\n }\n};\n\n", - "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/**\n * @file eth.js\n * @author Marek Kotewicz \n * @author Fabian Vogelsteller \n * @date 2015\n */\n\n/**\n * Web3\n * \n * @module web3\n */\n\n/**\n * Eth methods and properties\n *\n * An example method object can look as follows:\n *\n * {\n * name: 'getBlock',\n * call: blockCall,\n * params: 2,\n * outputFormatter: formatters.outputBlockFormatter,\n * inputFormatter: [ // can be a formatter funciton or an array of functions. Where each item in the array will be used for one parameter\n * utils.toHex, // formats paramter 1\n * function(param){ return !!param; } // formats paramter 2\n * ]\n * },\n *\n * @class [web3] eth\n * @constructor\n */\n\n\"use strict\";\n\nvar formatters = require('./formatters');\nvar utils = require('../utils/utils');\nvar Method = require('./method');\nvar Property = require('./property');\n\nvar blockCall = function (args) {\n return (utils.isString(args[0]) && args[0].indexOf('0x') === 0) ? \"eth_getBlockByHash\" : \"eth_getBlockByNumber\";\n};\n\nvar transactionFromBlockCall = function (args) {\n return (utils.isString(args[0]) && args[0].indexOf('0x') === 0) ? 'eth_getTransactionByBlockHashAndIndex' : 'eth_getTransactionByBlockNumberAndIndex';\n};\n\nvar uncleCall = function (args) {\n return (utils.isString(args[0]) && args[0].indexOf('0x') === 0) ? 'eth_getUncleByBlockHashAndIndex' : 'eth_getUncleByBlockNumberAndIndex';\n};\n\nvar getBlockTransactionCountCall = function (args) {\n return (utils.isString(args[0]) && args[0].indexOf('0x') === 0) ? 'eth_getBlockTransactionCountByHash' : 'eth_getBlockTransactionCountByNumber';\n};\n\nvar uncleCountCall = function (args) {\n return (utils.isString(args[0]) && args[0].indexOf('0x') === 0) ? 'eth_getUncleCountByBlockHash' : 'eth_getUncleCountByBlockNumber';\n};\n\n/// @returns an array of objects describing web3.eth api methods\n\nvar getBalance = new Method({\n name: 'getBalance', \n call: 'eth_getBalance', \n params: 2,\n inputFormatter: [utils.toAddress, formatters.inputDefaultBlockNumberFormatter],\n outputFormatter: formatters.outputBigNumberFormatter\n});\n\nvar getStorageAt = new Method({\n name: 'getStorageAt', \n call: 'eth_getStorageAt', \n params: 3,\n inputFormatter: [null, utils.toHex, formatters.inputDefaultBlockNumberFormatter]\n});\n\nvar getCode = new Method({\n name: 'getCode',\n call: 'eth_getCode',\n params: 2,\n inputFormatter: [utils.toAddress, formatters.inputDefaultBlockNumberFormatter]\n});\n\nvar getBlock = new Method({\n name: 'getBlock', \n call: blockCall,\n params: 2,\n inputFormatter: [formatters.inputBlockNumberFormatter, function (val) { return !!val; }],\n outputFormatter: formatters.outputBlockFormatter\n});\n\nvar getUncle = new Method({\n name: 'getUncle',\n call: uncleCall,\n params: 2,\n inputFormatter: [formatters.inputBlockNumberFormatter, utils.toHex],\n outputFormatter: formatters.outputBlockFormatter,\n\n});\n\nvar getCompilers = new Method({\n name: 'getCompilers',\n call: 'eth_getCompilers',\n params: 0\n});\n\nvar getBlockTransactionCount = new Method({\n name: 'getBlockTransactionCount',\n call: getBlockTransactionCountCall,\n params: 1,\n inputFormatter: [formatters.inputBlockNumberFormatter],\n outputFormatter: utils.toDecimal\n});\n\nvar getBlockUncleCount = new Method({\n name: 'getBlockUncleCount',\n call: uncleCountCall,\n params: 1,\n inputFormatter: [formatters.inputBlockNumberFormatter],\n outputFormatter: utils.toDecimal\n});\n\nvar getTransaction = new Method({\n name: 'getTransaction',\n call: 'eth_getTransactionByHash',\n params: 1,\n outputFormatter: formatters.outputTransactionFormatter\n});\n\nvar getTransactionFromBlock = new Method({\n name: 'getTransactionFromBlock',\n call: transactionFromBlockCall,\n params: 2,\n inputFormatter: [formatters.inputBlockNumberFormatter, utils.toHex],\n outputFormatter: formatters.outputTransactionFormatter\n});\n\nvar getTransactionCount = new Method({\n name: 'getTransactionCount',\n call: 'eth_getTransactionCount',\n params: 2,\n inputFormatter: [null, formatters.inputDefaultBlockNumberFormatter],\n outputFormatter: utils.toDecimal\n});\n\nvar sendTransaction = new Method({\n name: 'sendTransaction',\n call: 'eth_sendTransaction',\n params: 1,\n inputFormatter: [formatters.inputTransactionFormatter]\n});\n\nvar call = new Method({\n name: 'call',\n call: 'eth_call',\n params: 2,\n inputFormatter: [formatters.inputTransactionFormatter, formatters.inputDefaultBlockNumberFormatter]\n});\n\nvar compileSolidity = new Method({\n name: 'compile.solidity',\n call: 'eth_compileSolidity',\n params: 1\n});\n\nvar compileLLL = new Method({\n name: 'compile.lll',\n call: 'eth_compileLLL',\n params: 1\n});\n\nvar compileSerpent = new Method({\n name: 'compile.serpent',\n call: 'eth_compileSerpent',\n params: 1\n});\n\nvar methods = [\n getBalance,\n getStorageAt,\n getCode,\n getBlock,\n getUncle,\n getCompilers,\n getBlockTransactionCount,\n getBlockUncleCount,\n getTransaction,\n getTransactionFromBlock,\n getTransactionCount,\n call,\n sendTransaction,\n compileSolidity,\n compileLLL,\n compileSerpent,\n];\n\n/// @returns an array of objects describing web3.eth api properties\n\n\n\nvar properties = [\n new Property({\n name: 'coinbase',\n getter: 'eth_coinbase'\n }),\n new Property({\n name: 'mining',\n getter: 'eth_mining'\n }),\n new Property({\n name: 'gasPrice',\n getter: 'eth_gasPrice',\n outputFormatter: formatters.outputBigNumberFormatter\n }),\n new Property({\n name: 'accounts',\n getter: 'eth_accounts'\n }),\n new Property({\n name: 'blockNumber',\n getter: 'eth_blockNumber',\n outputFormatter: utils.toDecimal\n })\n];\n\nmodule.exports = {\n methods: methods,\n properties: properties\n};\n\n", - "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file event.js\n * @author Marek Kotewicz \n * @date 2014\n */\n\nvar utils = require('../utils/utils');\nvar coder = require('../solidity/coder');\nvar web3 = require('../web3');\nvar formatters = require('./formatters');\n\n/**\n * This prototype should be used to create event filters\n */\nvar SolidityEvent = function (json, address) {\n this._params = json.inputs;\n this._name = utils.transformToFullName(json);\n this._address = address;\n this._anonymous = json.anonymous;\n};\n\n/**\n * Should be used to get filtered param types\n *\n * @method types\n * @param {Bool} decide if returned typed should be indexed\n * @return {Array} array of types\n */\nSolidityEvent.prototype.types = function (indexed) {\n return this._params.filter(function (i) {\n return i.indexed === indexed;\n }).map(function (i) {\n return i.type;\n });\n};\n\n/**\n * Should be used to get event display name\n *\n * @method displayName\n * @return {String} event display name\n */\nSolidityEvent.prototype.displayName = function () {\n return utils.extractDisplayName(this._name);\n};\n\n/**\n * Should be used to get event type name\n *\n * @method typeName\n * @return {String} event type name\n */\nSolidityEvent.prototype.typeName = function () {\n return utils.extractTypeName(this._name);\n};\n\n/**\n * Should be used to get event signature\n *\n * @method signature\n * @return {String} event signature\n */\nSolidityEvent.prototype.signature = function () {\n return web3.sha3(web3.fromAscii(this._name)).slice(2);\n};\n\n/**\n * Should be used to encode indexed params and options to one final object\n * \n * @method encode\n * @param {Object} indexed\n * @param {Object} options\n * @return {Object} everything combined together and encoded\n */\nSolidityEvent.prototype.encode = function (indexed, options) {\n indexed = indexed || {};\n options = options || {};\n var result = {};\n\n ['fromBlock', 'toBlock'].filter(function (f) {\n return options[f] !== undefined;\n }).forEach(function (f) {\n result[f] = utils.toHex(options[f]);\n });\n\n result.topics = [];\n\n if (!this._anonymous) {\n result.address = this._address;\n result.topics.push('0x' + this.signature());\n }\n\n var indexedTopics = this._params.filter(function (i) {\n return i.indexed === true;\n }).map(function (i) {\n var value = indexed[i.name];\n if (value === undefined || value === null) {\n return null;\n }\n \n if (utils.isArray(value)) {\n return value.map(function (v) {\n return '0x' + coder.encodeParam(i.type, v);\n });\n }\n return '0x' + coder.encodeParam(i.type, value);\n });\n\n result.topics = result.topics.concat(indexedTopics);\n\n return result;\n};\n\n/**\n * Should be used to decode indexed params and options\n *\n * @method decode\n * @param {Object} data\n * @return {Object} result object with decoded indexed && not indexed params\n */\nSolidityEvent.prototype.decode = function (data) {\n \n data.data = data.data || '';\n data.topics = data.topics || [];\n\n var argTopics = this._anonymous ? data.topics : data.topics.slice(1);\n var indexedData = argTopics.map(function (topics) { return topics.slice(2); }).join(\"\");\n var indexedParams = coder.decodeParams(this.types(true), indexedData); \n\n var notIndexedData = data.data.slice(2);\n var notIndexedParams = coder.decodeParams(this.types(false), notIndexedData);\n \n var result = formatters.outputLogFormatter(data);\n result.event = this.displayName();\n result.address = data.address;\n\n result.args = this._params.reduce(function (acc, current) {\n acc[current.name] = current.indexed ? indexedParams.shift() : notIndexedParams.shift();\n return acc;\n }, {});\n\n delete result.data;\n delete result.topics;\n\n return result;\n};\n\n/**\n * Should be used to create new filter object from event\n *\n * @method execute\n * @param {Object} indexed\n * @param {Object} options\n * @return {Object} filter object\n */\nSolidityEvent.prototype.execute = function (indexed, options) {\n var o = this.encode(indexed, options);\n var formatter = this.decode.bind(this);\n return web3.eth.filter(o, undefined, undefined, formatter);\n};\n\n/**\n * Should be used to attach event to contract object\n *\n * @method attachToContract\n * @param {Contract}\n */\nSolidityEvent.prototype.attachToContract = function (contract) {\n var execute = this.execute.bind(this);\n var displayName = this.displayName();\n if (!contract[displayName]) {\n contract[displayName] = execute;\n }\n contract[displayName][this.typeName()] = this.execute.bind(this, contract);\n};\n\nmodule.exports = SolidityEvent;\n\n", + "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/**\n * @file eth.js\n * @author Marek Kotewicz \n * @author Fabian Vogelsteller \n * @date 2015\n */\n\n/**\n * Web3\n *\n * @module web3\n */\n\n/**\n * Eth methods and properties\n *\n * An example method object can look as follows:\n *\n * {\n * name: 'getBlock',\n * call: blockCall,\n * params: 2,\n * outputFormatter: formatters.outputBlockFormatter,\n * inputFormatter: [ // can be a formatter funciton or an array of functions. Where each item in the array will be used for one parameter\n * utils.toHex, // formats paramter 1\n * function(param){ return !!param; } // formats paramter 2\n * ]\n * },\n *\n * @class [web3] eth\n * @constructor\n */\n\n\"use strict\";\n\nvar formatters = require('./formatters');\nvar utils = require('../utils/utils');\nvar Method = require('./method');\nvar Property = require('./property');\n\nvar blockCall = function (args) {\n return (utils.isString(args[0]) && args[0].indexOf('0x') === 0) ? \"eth_getBlockByHash\" : \"eth_getBlockByNumber\";\n};\n\nvar transactionFromBlockCall = function (args) {\n return (utils.isString(args[0]) && args[0].indexOf('0x') === 0) ? 'eth_getTransactionByBlockHashAndIndex' : 'eth_getTransactionByBlockNumberAndIndex';\n};\n\nvar uncleCall = function (args) {\n return (utils.isString(args[0]) && args[0].indexOf('0x') === 0) ? 'eth_getUncleByBlockHashAndIndex' : 'eth_getUncleByBlockNumberAndIndex';\n};\n\nvar getBlockTransactionCountCall = function (args) {\n return (utils.isString(args[0]) && args[0].indexOf('0x') === 0) ? 'eth_getBlockTransactionCountByHash' : 'eth_getBlockTransactionCountByNumber';\n};\n\nvar uncleCountCall = function (args) {\n return (utils.isString(args[0]) && args[0].indexOf('0x') === 0) ? 'eth_getUncleCountByBlockHash' : 'eth_getUncleCountByBlockNumber';\n};\n\n/// @returns an array of objects describing web3.eth api methods\n\nvar getBalance = new Method({\n name: 'getBalance',\n call: 'eth_getBalance',\n params: 2,\n inputFormatter: [utils.toAddress, formatters.inputDefaultBlockNumberFormatter],\n outputFormatter: formatters.outputBigNumberFormatter\n});\n\nvar getStorageAt = new Method({\n name: 'getStorageAt',\n call: 'eth_getStorageAt',\n params: 3,\n inputFormatter: [null, utils.toHex, formatters.inputDefaultBlockNumberFormatter]\n});\n\nvar getCode = new Method({\n name: 'getCode',\n call: 'eth_getCode',\n params: 2,\n inputFormatter: [utils.toAddress, formatters.inputDefaultBlockNumberFormatter]\n});\n\nvar getBlock = new Method({\n name: 'getBlock',\n call: blockCall,\n params: 2,\n inputFormatter: [formatters.inputBlockNumberFormatter, function (val) { return !!val; }],\n outputFormatter: formatters.outputBlockFormatter\n});\n\nvar getUncle = new Method({\n name: 'getUncle',\n call: uncleCall,\n params: 2,\n inputFormatter: [formatters.inputBlockNumberFormatter, utils.toHex],\n outputFormatter: formatters.outputBlockFormatter,\n\n});\n\nvar getCompilers = new Method({\n name: 'getCompilers',\n call: 'eth_getCompilers',\n params: 0\n});\n\nvar getBlockTransactionCount = new Method({\n name: 'getBlockTransactionCount',\n call: getBlockTransactionCountCall,\n params: 1,\n inputFormatter: [formatters.inputBlockNumberFormatter],\n outputFormatter: utils.toDecimal\n});\n\nvar getBlockUncleCount = new Method({\n name: 'getBlockUncleCount',\n call: uncleCountCall,\n params: 1,\n inputFormatter: [formatters.inputBlockNumberFormatter],\n outputFormatter: utils.toDecimal\n});\n\nvar getTransaction = new Method({\n name: 'getTransaction',\n call: 'eth_getTransactionByHash',\n params: 1,\n outputFormatter: formatters.outputTransactionFormatter\n});\n\nvar getTransactionFromBlock = new Method({\n name: 'getTransactionFromBlock',\n call: transactionFromBlockCall,\n params: 2,\n inputFormatter: [formatters.inputBlockNumberFormatter, utils.toHex],\n outputFormatter: formatters.outputTransactionFormatter\n});\n\nvar getTransactionCount = new Method({\n name: 'getTransactionCount',\n call: 'eth_getTransactionCount',\n params: 2,\n inputFormatter: [null, formatters.inputDefaultBlockNumberFormatter],\n outputFormatter: utils.toDecimal\n});\n\nvar sendTransaction = new Method({\n name: 'sendTransaction',\n call: 'eth_sendTransaction',\n params: 1,\n inputFormatter: [formatters.inputTransactionFormatter]\n});\n\nvar call = new Method({\n name: 'call',\n call: 'eth_call',\n params: 2,\n inputFormatter: [formatters.inputTransactionFormatter, formatters.inputDefaultBlockNumberFormatter]\n});\n\nvar compileSolidity = new Method({\n name: 'compile.solidity',\n call: 'eth_compileSolidity',\n params: 1\n});\n\nvar compileLLL = new Method({\n name: 'compile.lll',\n call: 'eth_compileLLL',\n params: 1\n});\n\nvar compileSerpent = new Method({\n name: 'compile.serpent',\n call: 'eth_compileSerpent',\n params: 1\n});\n\nvar methods = [\n getBalance,\n getStorageAt,\n getCode,\n getBlock,\n getUncle,\n getCompilers,\n getBlockTransactionCount,\n getBlockUncleCount,\n getTransaction,\n getTransactionFromBlock,\n getTransactionCount,\n call,\n sendTransaction,\n compileSolidity,\n compileLLL,\n compileSerpent,\n];\n\n/// @returns an array of objects describing web3.eth api properties\n\n\n\nvar properties = [\n new Property({\n name: 'coinbase',\n getter: 'eth_coinbase'\n }),\n new Property({\n name: 'mining',\n getter: 'eth_mining'\n }),\n new Property({\n name: 'hashrate',\n getter: 'eth_hashrate',\n outputFormatter: utils.toDecimal\n }),\n new Property({\n name: 'gasPrice',\n getter: 'eth_gasPrice',\n outputFormatter: formatters.outputBigNumberFormatter\n }),\n new Property({\n name: 'accounts',\n getter: 'eth_accounts'\n }),\n new Property({\n name: 'blockNumber',\n getter: 'eth_blockNumber',\n outputFormatter: utils.toDecimal\n })\n];\n\nmodule.exports = {\n methods: methods,\n properties: properties\n};\n\n", + "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file event.js\n * @author Marek Kotewicz \n * @date 2014\n */\n\nvar utils = require('../utils/utils');\nvar coder = require('../solidity/coder');\nvar web3 = require('../web3');\nvar formatters = require('./formatters');\n\n/**\n * This prototype should be used to create event filters\n */\nvar SolidityEvent = function (json, address) {\n this._params = json.inputs;\n this._name = utils.transformToFullName(json);\n this._address = address;\n this._anonymous = json.anonymous;\n};\n\n/**\n * Should be used to get filtered param types\n *\n * @method types\n * @param {Bool} decide if returned typed should be indexed\n * @return {Array} array of types\n */\nSolidityEvent.prototype.types = function (indexed) {\n return this._params.filter(function (i) {\n return i.indexed === indexed;\n }).map(function (i) {\n return i.type;\n });\n};\n\n/**\n * Should be used to get event display name\n *\n * @method displayName\n * @return {String} event display name\n */\nSolidityEvent.prototype.displayName = function () {\n return utils.extractDisplayName(this._name);\n};\n\n/**\n * Should be used to get event type name\n *\n * @method typeName\n * @return {String} event type name\n */\nSolidityEvent.prototype.typeName = function () {\n return utils.extractTypeName(this._name);\n};\n\n/**\n * Should be used to get event signature\n *\n * @method signature\n * @return {String} event signature\n */\nSolidityEvent.prototype.signature = function () {\n return web3.sha3(web3.fromAscii(this._name)).slice(2);\n};\n\n/**\n * Should be used to encode indexed params and options to one final object\n * \n * @method encode\n * @param {Object} indexed\n * @param {Object} options\n * @return {Object} everything combined together and encoded\n */\nSolidityEvent.prototype.encode = function (indexed, options) {\n indexed = indexed || {};\n options = options || {};\n var result = {};\n\n ['fromBlock', 'toBlock'].filter(function (f) {\n return options[f] !== undefined;\n }).forEach(function (f) {\n result[f] = formatters.inputBlockNumberFormatter(options[f]);\n });\n\n result.topics = [];\n\n if (!this._anonymous) {\n result.address = this._address;\n result.topics.push('0x' + this.signature());\n }\n\n var indexedTopics = this._params.filter(function (i) {\n return i.indexed === true;\n }).map(function (i) {\n var value = indexed[i.name];\n if (value === undefined || value === null) {\n return null;\n }\n \n if (utils.isArray(value)) {\n return value.map(function (v) {\n return '0x' + coder.encodeParam(i.type, v);\n });\n }\n return '0x' + coder.encodeParam(i.type, value);\n });\n\n result.topics = result.topics.concat(indexedTopics);\n\n return result;\n};\n\n/**\n * Should be used to decode indexed params and options\n *\n * @method decode\n * @param {Object} data\n * @return {Object} result object with decoded indexed && not indexed params\n */\nSolidityEvent.prototype.decode = function (data) {\n \n data.data = data.data || '';\n data.topics = data.topics || [];\n\n var argTopics = this._anonymous ? data.topics : data.topics.slice(1);\n var indexedData = argTopics.map(function (topics) { return topics.slice(2); }).join(\"\");\n var indexedParams = coder.decodeParams(this.types(true), indexedData); \n\n var notIndexedData = data.data.slice(2);\n var notIndexedParams = coder.decodeParams(this.types(false), notIndexedData);\n \n var result = formatters.outputLogFormatter(data);\n result.event = this.displayName();\n result.address = data.address;\n\n result.args = this._params.reduce(function (acc, current) {\n acc[current.name] = current.indexed ? indexedParams.shift() : notIndexedParams.shift();\n return acc;\n }, {});\n\n delete result.data;\n delete result.topics;\n\n return result;\n};\n\n/**\n * Should be used to create new filter object from event\n *\n * @method execute\n * @param {Object} indexed\n * @param {Object} options\n * @return {Object} filter object\n */\nSolidityEvent.prototype.execute = function (indexed, options) {\n var o = this.encode(indexed, options);\n var formatter = this.decode.bind(this);\n return web3.eth.filter(o, undefined, undefined, formatter);\n};\n\n/**\n * Should be used to attach event to contract object\n *\n * @method attachToContract\n * @param {Contract}\n */\nSolidityEvent.prototype.attachToContract = function (contract) {\n var execute = this.execute.bind(this);\n var displayName = this.displayName();\n if (!contract[displayName]) {\n contract[displayName] = execute;\n }\n contract[displayName][this.typeName()] = this.execute.bind(this, contract);\n};\n\nmodule.exports = SolidityEvent;\n\n", "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** @file filter.js\n * @authors:\n * Jeffrey Wilcke \n * Marek Kotewicz \n * Marian Oancea \n * Fabian Vogelsteller \n * Gav Wood \n * @date 2014\n */\n\nvar RequestManager = require('./requestmanager');\nvar formatters = require('./formatters');\nvar utils = require('../utils/utils');\n\n/**\n* Converts a given topic to a hex string, but also allows null values.\n*\n* @param {Mixed} value\n* @return {String}\n*/\nvar toTopic = function(value){\n\n if(value === null || typeof value === 'undefined')\n return null;\n\n value = String(value);\n\n if(value.indexOf('0x') === 0)\n return value;\n else\n return utils.fromAscii(value);\n};\n\n/// This method should be called on options object, to verify deprecated properties && lazy load dynamic ones\n/// @param should be string or object\n/// @returns options string or object\nvar getOptions = function (options) {\n\n if (utils.isString(options)) {\n return options;\n } \n\n options = options || {};\n\n // make sure topics, get converted to hex\n options.topics = options.topics || [];\n options.topics = options.topics.map(function(topic){\n return (utils.isArray(topic)) ? topic.map(toTopic) : toTopic(topic);\n });\n\n // lazy load\n return {\n topics: options.topics,\n to: options.to,\n address: options.address,\n fromBlock: formatters.inputBlockNumberFormatter(options.fromBlock),\n toBlock: formatters.inputBlockNumberFormatter(options.toBlock) \n }; \n};\n\nvar Filter = function (options, methods, formatter) {\n var implementation = {};\n methods.forEach(function (method) {\n method.attachToObject(implementation);\n });\n this.options = getOptions(options);\n this.implementation = implementation;\n this.callbacks = [];\n this.formatter = formatter;\n this.filterId = this.implementation.newFilter(this.options);\n};\n\nFilter.prototype.watch = function (callback) {\n this.callbacks.push(callback);\n var self = this;\n\n var onMessage = function (error, messages) {\n if (error) {\n return self.callbacks.forEach(function (callback) {\n callback(error);\n });\n }\n\n messages.forEach(function (message) {\n message = self.formatter ? self.formatter(message) : message;\n self.callbacks.forEach(function (callback) {\n callback(null, message);\n });\n });\n };\n\n // call getFilterLogs on start\n if (!utils.isString(this.options)) {\n this.get(function (err, messages) {\n // don't send all the responses to all the watches again... just to this one\n if (err) {\n callback(err);\n }\n\n messages.forEach(function (message) {\n callback(null, message);\n });\n });\n }\n\n RequestManager.getInstance().startPolling({\n method: this.implementation.poll.call,\n params: [this.filterId],\n }, this.filterId, onMessage, this.stopWatching.bind(this));\n};\n\nFilter.prototype.stopWatching = function () {\n RequestManager.getInstance().stopPolling(this.filterId);\n this.implementation.uninstallFilter(this.filterId);\n this.callbacks = [];\n};\n\nFilter.prototype.get = function (callback) {\n var self = this;\n if (utils.isFunction(callback)) {\n this.implementation.getLogs(this.filterId, function(err, res){\n if (err) {\n callback(err);\n } else {\n callback(null, res.map(function (log) {\n return self.formatter ? self.formatter(log) : log;\n }));\n }\n });\n } else {\n var logs = this.implementation.getLogs(this.filterId);\n return logs.map(function (log) {\n return self.formatter ? self.formatter(log) : log;\n });\n }\n};\n\nmodule.exports = Filter;\n\n", - "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file formatters.js\n * @author Marek Kotewicz \n * @author Fabian Vogelsteller \n * @date 2015\n */\n\nvar utils = require('../utils/utils');\nvar config = require('../utils/config');\n\n/**\n * Should the format output to a big number\n *\n * @method outputBigNumberFormatter\n * @param {String|Number|BigNumber}\n * @returns {BigNumber} object\n */\nvar outputBigNumberFormatter = function (number) {\n return utils.toBigNumber(number);\n};\n\nvar isPredefinedBlockNumber = function (blockNumber) {\n return blockNumber === 'latest' || blockNumber === 'pending' || blockNumber === 'earliest';\n};\n\nvar inputDefaultBlockNumberFormatter = function (blockNumber) {\n if (blockNumber === undefined) {\n return config.defaultBlock;\n }\n return inputBlockNumberFormatter(blockNumber);\n};\n\nvar inputBlockNumberFormatter = function (blockNumber) {\n if (blockNumber === undefined) {\n return undefined;\n } else if (isPredefinedBlockNumber(blockNumber)) {\n return blockNumber;\n }\n return utils.toHex(blockNumber);\n};\n\n/**\n * Formats the input of a transaction and converts all values to HEX\n *\n * @method inputTransactionFormatter\n * @param {Object} transaction options\n * @returns object\n*/\nvar inputTransactionFormatter = function (options){\n\n options.from = options.from || config.defaultAccount;\n\n // make code -> data\n if (options.code) {\n options.data = options.code;\n delete options.code;\n }\n\n ['gasPrice', 'gas', 'value'].filter(function (key) {\n return options[key] !== undefined;\n }).forEach(function(key){\n options[key] = utils.fromDecimal(options[key]);\n });\n\n return options; \n};\n\n/**\n * Formats the output of a transaction to its proper values\n * \n * @method outputTransactionFormatter\n * @param {Object} transaction\n * @returns {Object} transaction\n*/\nvar outputTransactionFormatter = function (tx){\n tx.blockNumber = utils.toDecimal(tx.blockNumber);\n tx.transactionIndex = utils.toDecimal(tx.transactionIndex);\n tx.nonce = utils.toDecimal(tx.nonce);\n tx.gas = utils.toDecimal(tx.gas);\n tx.gasPrice = utils.toBigNumber(tx.gasPrice);\n tx.value = utils.toBigNumber(tx.value);\n return tx;\n};\n\n/**\n * Formats the output of a block to its proper values\n *\n * @method outputBlockFormatter\n * @param {Object} block object \n * @returns {Object} block object\n*/\nvar outputBlockFormatter = function(block) {\n\n // transform to number\n block.gasLimit = utils.toDecimal(block.gasLimit);\n block.gasUsed = utils.toDecimal(block.gasUsed);\n block.size = utils.toDecimal(block.size);\n block.timestamp = utils.toDecimal(block.timestamp);\n block.number = utils.toDecimal(block.number);\n\n block.difficulty = utils.toBigNumber(block.difficulty);\n block.totalDifficulty = utils.toBigNumber(block.totalDifficulty);\n\n if (utils.isArray(block.transactions)) {\n block.transactions.forEach(function(item){\n if(!utils.isString(item))\n return outputTransactionFormatter(item);\n });\n }\n\n return block;\n};\n\n/**\n * Formats the output of a log\n * \n * @method outputLogFormatter\n * @param {Object} log object\n * @returns {Object} log\n*/\nvar outputLogFormatter = function(log) {\n if (log === null) { // 'pending' && 'latest' filters are nulls\n return null;\n }\n\n log.blockNumber = utils.toDecimal(log.blockNumber);\n log.transactionIndex = utils.toDecimal(log.transactionIndex);\n log.logIndex = utils.toDecimal(log.logIndex);\n\n return log;\n};\n\n/**\n * Formats the input of a whisper post and converts all values to HEX\n *\n * @method inputPostFormatter\n * @param {Object} transaction object\n * @returns {Object}\n*/\nvar inputPostFormatter = function(post) {\n\n post.payload = utils.toHex(post.payload);\n post.ttl = utils.fromDecimal(post.ttl);\n post.workToProve = utils.fromDecimal(post.workToProve);\n post.priority = utils.fromDecimal(post.priority);\n\n // fallback\n if (!utils.isArray(post.topics)) {\n post.topics = post.topics ? [post.topics] : [];\n }\n\n // format the following options\n post.topics = post.topics.map(function(topic){\n return utils.fromAscii(topic);\n });\n\n return post; \n};\n\n/**\n * Formats the output of a received post message\n *\n * @method outputPostFormatter\n * @param {Object}\n * @returns {Object}\n */\nvar outputPostFormatter = function(post){\n\n post.expiry = utils.toDecimal(post.expiry);\n post.sent = utils.toDecimal(post.sent);\n post.ttl = utils.toDecimal(post.ttl);\n post.workProved = utils.toDecimal(post.workProved);\n post.payloadRaw = post.payload;\n post.payload = utils.toAscii(post.payload);\n\n if (utils.isJson(post.payload)) {\n post.payload = JSON.parse(post.payload);\n }\n\n // format the following options\n if (!post.topics) {\n post.topics = [];\n }\n post.topics = post.topics.map(function(topic){\n return utils.toAscii(topic);\n });\n\n return post;\n};\n\nmodule.exports = {\n inputDefaultBlockNumberFormatter: inputDefaultBlockNumberFormatter,\n inputBlockNumberFormatter: inputBlockNumberFormatter,\n inputTransactionFormatter: inputTransactionFormatter,\n inputPostFormatter: inputPostFormatter,\n outputBigNumberFormatter: outputBigNumberFormatter,\n outputTransactionFormatter: outputTransactionFormatter,\n outputBlockFormatter: outputBlockFormatter,\n outputLogFormatter: outputLogFormatter,\n outputPostFormatter: outputPostFormatter\n};\n\n", + "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file formatters.js\n * @author Marek Kotewicz \n * @author Fabian Vogelsteller \n * @date 2015\n */\n\nvar utils = require('../utils/utils');\nvar config = require('../utils/config');\n\n/**\n * Should the format output to a big number\n *\n * @method outputBigNumberFormatter\n * @param {String|Number|BigNumber}\n * @returns {BigNumber} object\n */\nvar outputBigNumberFormatter = function (number) {\n return utils.toBigNumber(number);\n};\n\nvar isPredefinedBlockNumber = function (blockNumber) {\n return blockNumber === 'latest' || blockNumber === 'pending' || blockNumber === 'earliest';\n};\n\nvar inputDefaultBlockNumberFormatter = function (blockNumber) {\n if (blockNumber === undefined) {\n return config.defaultBlock;\n }\n return inputBlockNumberFormatter(blockNumber);\n};\n\nvar inputBlockNumberFormatter = function (blockNumber) {\n if (blockNumber === undefined) {\n return undefined;\n } else if (isPredefinedBlockNumber(blockNumber)) {\n return blockNumber;\n }\n return utils.toHex(blockNumber);\n};\n\n/**\n * Formats the input of a transaction and converts all values to HEX\n *\n * @method inputTransactionFormatter\n * @param {Object} transaction options\n * @returns object\n*/\nvar inputTransactionFormatter = function (options){\n\n options.from = options.from || config.defaultAccount;\n\n // make code -> data\n if (options.code) {\n options.data = options.code;\n delete options.code;\n }\n\n ['gasPrice', 'gas', 'value', 'nonce'].filter(function (key) {\n return options[key] !== undefined;\n }).forEach(function(key){\n options[key] = utils.fromDecimal(options[key]);\n });\n\n return options; \n};\n\n/**\n * Formats the output of a transaction to its proper values\n * \n * @method outputTransactionFormatter\n * @param {Object} transaction\n * @returns {Object} transaction\n*/\nvar outputTransactionFormatter = function (tx){\n tx.blockNumber = utils.toDecimal(tx.blockNumber);\n tx.transactionIndex = utils.toDecimal(tx.transactionIndex);\n tx.nonce = utils.toDecimal(tx.nonce);\n tx.gas = utils.toDecimal(tx.gas);\n tx.gasPrice = utils.toBigNumber(tx.gasPrice);\n tx.value = utils.toBigNumber(tx.value);\n return tx;\n};\n\n/**\n * Formats the output of a block to its proper values\n *\n * @method outputBlockFormatter\n * @param {Object} block object \n * @returns {Object} block object\n*/\nvar outputBlockFormatter = function(block) {\n\n // transform to number\n block.gasLimit = utils.toDecimal(block.gasLimit);\n block.gasUsed = utils.toDecimal(block.gasUsed);\n block.size = utils.toDecimal(block.size);\n block.timestamp = utils.toDecimal(block.timestamp);\n block.number = utils.toDecimal(block.number);\n\n block.difficulty = utils.toBigNumber(block.difficulty);\n block.totalDifficulty = utils.toBigNumber(block.totalDifficulty);\n\n if (utils.isArray(block.transactions)) {\n block.transactions.forEach(function(item){\n if(!utils.isString(item))\n return outputTransactionFormatter(item);\n });\n }\n\n return block;\n};\n\n/**\n * Formats the output of a log\n * \n * @method outputLogFormatter\n * @param {Object} log object\n * @returns {Object} log\n*/\nvar outputLogFormatter = function(log) {\n if (log === null) { // 'pending' && 'latest' filters are nulls\n return null;\n }\n\n log.blockNumber = utils.toDecimal(log.blockNumber);\n log.transactionIndex = utils.toDecimal(log.transactionIndex);\n log.logIndex = utils.toDecimal(log.logIndex);\n\n return log;\n};\n\n/**\n * Formats the input of a whisper post and converts all values to HEX\n *\n * @method inputPostFormatter\n * @param {Object} transaction object\n * @returns {Object}\n*/\nvar inputPostFormatter = function(post) {\n\n post.payload = utils.toHex(post.payload);\n post.ttl = utils.fromDecimal(post.ttl);\n post.workToProve = utils.fromDecimal(post.workToProve);\n post.priority = utils.fromDecimal(post.priority);\n\n // fallback\n if (!utils.isArray(post.topics)) {\n post.topics = post.topics ? [post.topics] : [];\n }\n\n // format the following options\n post.topics = post.topics.map(function(topic){\n return utils.fromAscii(topic);\n });\n\n return post; \n};\n\n/**\n * Formats the output of a received post message\n *\n * @method outputPostFormatter\n * @param {Object}\n * @returns {Object}\n */\nvar outputPostFormatter = function(post){\n\n post.expiry = utils.toDecimal(post.expiry);\n post.sent = utils.toDecimal(post.sent);\n post.ttl = utils.toDecimal(post.ttl);\n post.workProved = utils.toDecimal(post.workProved);\n post.payloadRaw = post.payload;\n post.payload = utils.toAscii(post.payload);\n\n if (utils.isJson(post.payload)) {\n post.payload = JSON.parse(post.payload);\n }\n\n // format the following options\n if (!post.topics) {\n post.topics = [];\n }\n post.topics = post.topics.map(function(topic){\n return utils.toAscii(topic);\n });\n\n return post;\n};\n\nmodule.exports = {\n inputDefaultBlockNumberFormatter: inputDefaultBlockNumberFormatter,\n inputBlockNumberFormatter: inputBlockNumberFormatter,\n inputTransactionFormatter: inputTransactionFormatter,\n inputPostFormatter: inputPostFormatter,\n outputBigNumberFormatter: outputBigNumberFormatter,\n outputTransactionFormatter: outputTransactionFormatter,\n outputBlockFormatter: outputBlockFormatter,\n outputLogFormatter: outputLogFormatter,\n outputPostFormatter: outputPostFormatter\n};\n\n", "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file function.js\n * @author Marek Kotewicz \n * @date 2015\n */\n\nvar web3 = require('../web3');\nvar coder = require('../solidity/coder');\nvar utils = require('../utils/utils');\n\n/**\n * This prototype should be used to call/sendTransaction to solidity functions\n */\nvar SolidityFunction = function (json, address) {\n this._inputTypes = json.inputs.map(function (i) {\n return i.type;\n });\n this._outputTypes = json.outputs.map(function (i) {\n return i.type;\n });\n this._constant = json.constant;\n this._name = utils.transformToFullName(json);\n this._address = address;\n};\n\n/**\n * Should be used to create payload from arguments\n *\n * @method toPayload\n * @param {...} solidity function params\n * @param {Object} optional payload options\n */\nSolidityFunction.prototype.toPayload = function () {\n var args = Array.prototype.slice.call(arguments);\n var options = {};\n if (args.length > this._inputTypes.length && utils.isObject(args[args.length -1])) {\n options = args.pop();\n }\n options.to = this._address;\n options.data = '0x' + this.signature() + coder.encodeParams(this._inputTypes, args);\n return options;\n};\n\n/**\n * Should be used to get function signature\n *\n * @method signature\n * @return {String} function signature\n */\nSolidityFunction.prototype.signature = function () {\n return web3.sha3(web3.fromAscii(this._name)).slice(2, 10);\n};\n\n/**\n * Should be used to call function\n * \n * @method call\n * @param {Object} options\n * @return {String} output bytes\n */\nSolidityFunction.prototype.call = function () {\n var payload = this.toPayload.apply(this, Array.prototype.slice.call(arguments));\n var output = web3.eth.call(payload);\n output = output.length >= 2 ? output.slice(2) : output;\n var result = coder.decodeParams(this._outputTypes, output);\n return result.length === 1 ? result[0] : result;\n};\n\n/**\n * Should be used to sendTransaction to solidity function\n *\n * @method sendTransaction\n * @param {Object} options\n */\nSolidityFunction.prototype.sendTransaction = function () {\n var payload = this.toPayload.apply(this, Array.prototype.slice.call(arguments));\n web3.eth.sendTransaction(payload);\n};\n\n/**\n * Should be used to get function display name\n *\n * @method displayName\n * @return {String} display name of the function\n */\nSolidityFunction.prototype.displayName = function () {\n return utils.extractDisplayName(this._name);\n};\n\n/**\n * Should be used to get function type name\n * \n * @method typeName\n * @return {String} type name of the function\n */\nSolidityFunction.prototype.typeName = function () {\n return utils.extractTypeName(this._name);\n};\n\n/**\n * Should be called to execute function\n *\n * @method execute\n */\nSolidityFunction.prototype.execute = function () {\n var transaction = !this._constant;\n \n // send transaction\n if (transaction) {\n return this.sendTransaction.apply(this, Array.prototype.slice.call(arguments));\n }\n\n // call\n return this.call.apply(this, Array.prototype.slice.call(arguments));\n};\n\n/**\n * Should be called to attach function to contract\n *\n * @method attachToContract\n * @param {Contract}\n */\nSolidityFunction.prototype.attachToContract = function (contract) {\n var execute = this.execute.bind(this);\n execute.call = this.call.bind(this);\n execute.sendTransaction = this.sendTransaction.bind(this);\n var displayName = this.displayName();\n if (!contract[displayName]) {\n contract[displayName] = execute;\n }\n contract[displayName][this.typeName()] = execute; // circular!!!!\n};\n\nmodule.exports = SolidityFunction;\n\n", - "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** @file httpprovider.js\n * @authors:\n * Marek Kotewicz \n * Marian Oancea \n * Fabian Vogelsteller \n * @date 2014\n */\n\n\"use strict\";\n\nvar XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest; // jshint ignore:line\nvar errors = require('./errors');\n\nvar HttpProvider = function (host) {\n this.host = host || 'http://localhost:8545';\n};\n\nHttpProvider.prototype.send = function (payload) {\n var request = new XMLHttpRequest();\n\n request.open('POST', this.host, false);\n \n try {\n request.send(JSON.stringify(payload));\n } catch(error) {\n throw errors.InvalidConnection(this.host);\n }\n\n\n // check request.status\n // TODO: throw an error here! it cannot silently fail!!!\n //if (request.status !== 200) {\n //return;\n //}\n return JSON.parse(request.responseText);\n};\n\nHttpProvider.prototype.sendAsync = function (payload, callback) {\n var request = new XMLHttpRequest();\n request.onreadystatechange = function() {\n if (request.readyState === 4) {\n // TODO: handle the error properly here!!!\n callback(null, JSON.parse(request.responseText));\n }\n };\n\n request.open('POST', this.host, true);\n\n try {\n request.send(JSON.stringify(payload));\n } catch(error) {\n callback(errors.InvalidConnection(this.host));\n }\n};\n\nmodule.exports = HttpProvider;\n\n", + "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** @file httpprovider.js\n * @authors:\n * Marek Kotewicz \n * Marian Oancea \n * Fabian Vogelsteller \n * @date 2014\n */\n\n\"use strict\";\n\nvar XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest; // jshint ignore:line\nvar errors = require('./errors');\n\nvar HttpProvider = function (host) {\n this.host = host || 'http://localhost:8545';\n};\n\nHttpProvider.prototype.send = function (payload) {\n var request = new XMLHttpRequest();\n\n request.open('POST', this.host, false);\n \n try {\n request.send(JSON.stringify(payload));\n } catch(error) {\n throw errors.InvalidConnection(this.host);\n }\n\n\n // check request.status\n // TODO: throw an error here! it cannot silently fail!!!\n //if (request.status !== 200) {\n //return;\n //}\n\n var result = request.responseText;\n\n try {\n result = JSON.parse(result);\n } catch(e) {\n throw errors.InvalidResponse(result); \n }\n\n return result;\n};\n\nHttpProvider.prototype.sendAsync = function (payload, callback) {\n var request = new XMLHttpRequest();\n request.onreadystatechange = function() {\n if (request.readyState === 4) {\n var result = request.responseText;\n var error = null;\n\n try {\n result = JSON.parse(result);\n } catch(e) {\n error = errors.InvalidResponse(result); \n }\n\n callback(error, result);\n }\n };\n\n request.open('POST', this.host, true);\n\n try {\n request.send(JSON.stringify(payload));\n } catch(error) {\n callback(errors.InvalidConnection(this.host));\n }\n};\n\nmodule.exports = HttpProvider;\n\n", "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** @file jsonrpc.js\n * @authors:\n * Marek Kotewicz \n * @date 2015\n */\n\nvar Jsonrpc = function () {\n // singleton pattern\n if (arguments.callee._singletonInstance) {\n return arguments.callee._singletonInstance;\n }\n arguments.callee._singletonInstance = this;\n\n this.messageId = 1;\n};\n\n/**\n * @return {Jsonrpc} singleton\n */\nJsonrpc.getInstance = function () {\n var instance = new Jsonrpc();\n return instance;\n};\n\n/**\n * Should be called to valid json create payload object\n *\n * @method toPayload\n * @param {Function} method of jsonrpc call, required\n * @param {Array} params, an array of method params, optional\n * @returns {Object} valid jsonrpc payload object\n */\nJsonrpc.prototype.toPayload = function (method, params) {\n if (!method)\n console.error('jsonrpc method should be specified!');\n\n return {\n jsonrpc: '2.0',\n method: method,\n params: params || [],\n id: this.messageId++\n };\n};\n\n/**\n * Should be called to check if jsonrpc response is valid\n *\n * @method isValidResponse\n * @param {Object}\n * @returns {Boolean} true if response is valid, otherwise false\n */\nJsonrpc.prototype.isValidResponse = function (response) {\n return !!response &&\n !response.error &&\n response.jsonrpc === '2.0' &&\n typeof response.id === 'number' &&\n response.result !== undefined; // only undefined is not valid json object\n};\n\n/**\n * Should be called to create batch payload object\n *\n * @method toBatchPayload\n * @param {Array} messages, an array of objects with method (required) and params (optional) fields\n * @returns {Array} batch payload\n */\nJsonrpc.prototype.toBatchPayload = function (messages) {\n var self = this;\n return messages.map(function (message) {\n return self.toPayload(message.method, message.params);\n });\n};\n\nmodule.exports = Jsonrpc;\n\n", "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/**\n * @file method.js\n * @author Marek Kotewicz \n * @date 2015\n */\n\nvar RequestManager = require('./requestmanager');\nvar utils = require('../utils/utils');\nvar errors = require('./errors');\n\nvar Method = function (options) {\n this.name = options.name;\n this.call = options.call;\n this.params = options.params || 0;\n this.inputFormatter = options.inputFormatter;\n this.outputFormatter = options.outputFormatter;\n};\n\n/**\n * Should be used to determine name of the jsonrpc method based on arguments\n *\n * @method getCall\n * @param {Array} arguments\n * @return {String} name of jsonrpc method\n */\nMethod.prototype.getCall = function (args) {\n return utils.isFunction(this.call) ? this.call(args) : this.call;\n};\n\n/**\n * Should be used to extract callback from array of arguments. Modifies input param\n *\n * @method extractCallback\n * @param {Array} arguments\n * @return {Function|Null} callback, if exists\n */\nMethod.prototype.extractCallback = function (args) {\n if (utils.isFunction(args[args.length - 1])) {\n return args.pop(); // modify the args array!\n }\n return null;\n};\n\n/**\n * Should be called to check if the number of arguments is correct\n * \n * @method validateArgs\n * @param {Array} arguments\n * @throws {Error} if it is not\n */\nMethod.prototype.validateArgs = function (args) {\n if (args.length !== this.params) {\n throw errors.InvalidNumberOfParams();\n }\n};\n\n/**\n * Should be called to format input args of method\n * \n * @method formatInput\n * @param {Array}\n * @return {Array}\n */\nMethod.prototype.formatInput = function (args) {\n if (!this.inputFormatter) {\n return args;\n }\n\n return this.inputFormatter.map(function (formatter, index) {\n return formatter ? formatter(args[index]) : args[index];\n });\n};\n\n/**\n * Should be called to format output(result) of method\n *\n * @method formatOutput\n * @param {Object}\n * @return {Object}\n */\nMethod.prototype.formatOutput = function (result) {\n return this.outputFormatter && result !== null ? this.outputFormatter(result) : result;\n};\n\n/**\n * Should attach function to method\n * \n * @method attachToObject\n * @param {Object}\n * @param {Function}\n */\nMethod.prototype.attachToObject = function (obj) {\n var func = this.send.bind(this);\n func.call = this.call; // that's ugly. filter.js uses it\n var name = this.name.split('.');\n if (name.length > 1) {\n obj[name[0]] = obj[name[0]] || {};\n obj[name[0]][name[1]] = func;\n } else {\n obj[name[0]] = func; \n }\n};\n\n/**\n * Should create payload from given input args\n *\n * @method toPayload\n * @param {Array} args\n * @return {Object}\n */\nMethod.prototype.toPayload = function (args) {\n var call = this.getCall(args);\n var callback = this.extractCallback(args);\n var params = this.formatInput(args);\n this.validateArgs(params);\n\n return {\n method: call,\n params: params,\n callback: callback\n };\n};\n\n/**\n * Should send request to the API\n *\n * @method send\n * @param list of params\n * @return result\n */\nMethod.prototype.send = function () {\n var payload = this.toPayload(Array.prototype.slice.call(arguments));\n if (payload.callback) {\n var self = this;\n return RequestManager.getInstance().sendAsync(payload, function (err, result) {\n payload.callback(null, self.formatOutput(result));\n });\n }\n return this.formatOutput(RequestManager.getInstance().send(payload));\n};\n\nmodule.exports = Method;\n\n", "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** @file eth.js\n * @authors:\n * Marek Kotewicz \n * @date 2015\n */\n\nvar utils = require('../utils/utils');\nvar Property = require('./property');\n\n/// @returns an array of objects describing web3.eth api methods\nvar methods = [\n];\n\n/// @returns an array of objects describing web3.eth api properties\nvar properties = [\n new Property({\n name: 'listening',\n getter: 'net_listening'\n }),\n new Property({\n name: 'peerCount',\n getter: 'net_peerCount',\n outputFormatter: utils.toDecimal\n })\n];\n\n\nmodule.exports = {\n methods: methods,\n properties: properties\n};\n\n", diff --git a/dist/web3-light.min.js b/dist/web3-light.min.js index e45033791..4c0fd2930 100644 --- a/dist/web3-light.min.js +++ b/dist/web3-light.min.js @@ -1,2 +1,2 @@ -require=function t(e,r,n){function o(a,s){if(!r[a]){if(!e[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var l=r[a]={exports:{}};e[a][0].call(l.exports,function(t){var r=e[a][1][t];return o(r?r:t)},l,l.exports,t,e,r,n)}return r[a].exports}for(var i="function"==typeof require&&require,a=0;a0&&console.warn("didn't found matching constructor, using default one"),"")};e.exports={inputParser:u,outputParser:c,formatInput:a,formatOutput:s,formatConstructorParams:l}},{"../utils/utils":8,"./coder":2,"./utils":5}],2:[function(t,e,r){var n=t("bignumber.js"),o=t("../utils/utils"),i=t("./formatters"),a=t("./param"),s=function(t){return"[]"===t.slice(-2)},u=function(t){this._name=t.name,this._match=t.match,this._mode=t.mode,this._inputFormatter=t.inputFormatter,this._outputFormatter=t.outputFormatter};u.prototype.isType=function(t){return"strict"===this._match?this._name===t||0===t.indexOf(this._name)&&"[]"===t.slice(this._name.length):"prefix"===this._match?0===t.indexOf(this._name):void 0},u.prototype.formatInput=function(t,e){if(o.isArray(t)&&e){var r=this;return t.map(function(t){return r._inputFormatter(t)}).reduce(function(t,e){return t.appendArrayElement(e),t},new a("",i.formatInputInt(t.length).value))}return this._inputFormatter(t)},u.prototype.formatOutput=function(t,e){if(e){for(var r=[],o=new n(t.prefix,16),i=0;64*o>i;i+=64)r.push(this._outputFormatter(new a(t.suffix.slice(i,i+64))));return r}return this._outputFormatter(t)},u.prototype.isVariadicType=function(t){return s(t)||"bytes"===this._mode},u.prototype.shiftParam=function(t,e){if("bytes"===this._mode)return e.shiftBytes();if(s(t)){var r=new n(e.prefix.slice(0,64),16);return e.shiftArray(r)}return e.shiftValue()};var c=function(t){this._types=t};c.prototype._requireType=function(t){var e=this._types.filter(function(e){return e.isType(t)})[0];if(!e)throw Error("invalid solidity type!: "+t);return e},c.prototype._bytesToParam=function(t,e){var r=this,n=t.reduce(function(t,e){return r._requireType(e).isVariadicType(e)?t+1:t},0),o=t.length-n,i=e.slice(0,64*n);e=e.slice(64*n);var s=e.slice(0,64*o),u=e.slice(64*o);return new a(s,i,u)},c.prototype._formatInput=function(t,e){return this._requireType(t).formatInput(e,s(t))},c.prototype.encodeParam=function(t,e){return this._formatInput(t,e).encode()},c.prototype.encodeParams=function(t,e){var r=this;return t.map(function(t,n){return r._formatInput(t,e[n])}).reduce(function(t,e){return t.append(e),t},new a).encode()},c.prototype._formatOutput=function(t,e){return this._requireType(t).formatOutput(e,s(t))},c.prototype.decodeParam=function(t,e){return this._formatOutput(t,this._bytesToParam([t],e))},c.prototype.decodeParams=function(t,e){var r=this,n=this._bytesToParam(t,e);return t.map(function(t){var e=r._requireType(t),o=e.shiftParam(t,n);return e.formatOutput(o,s(t))})};var l=new c([new u({name:"address",match:"strict",mode:"value",inputFormatter:i.formatInputInt,outputFormatter:i.formatOutputAddress}),new u({name:"bool",match:"strict",mode:"value",inputFormatter:i.formatInputBool,outputFormatter:i.formatOutputBool}),new u({name:"int",match:"prefix",mode:"value",inputFormatter:i.formatInputInt,outputFormatter:i.formatOutputInt}),new u({name:"uint",match:"prefix",mode:"value",inputFormatter:i.formatInputInt,outputFormatter:i.formatOutputUInt}),new u({name:"bytes",match:"strict",mode:"bytes",inputFormatter:i.formatInputDynamicBytes,outputFormatter:i.formatOutputDynamicBytes}),new u({name:"bytes",match:"prefix",mode:"value",inputFormatter:i.formatInputBytes,outputFormatter:i.formatOutputBytes}),new u({name:"real",match:"prefix",mode:"value",inputFormatter:i.formatInputReal,outputFormatter:i.formatOutputReal}),new u({name:"ureal",match:"prefix",mode:"value",inputFormatter:i.formatInputReal,outputFormatter:i.formatOutputUReal})]);e.exports=l},{"../utils/utils":8,"./formatters":3,"./param":4,"bignumber.js":"bignumber.js"}],3:[function(t,e,r){var n=t("bignumber.js"),o=t("../utils/utils"),i=t("../utils/config"),a=t("./param"),s=function(t){var e=2*i.ETH_PADDING;n.config(i.ETH_BIGNUMBER_ROUNDING_MODE);var r=o.padLeft(o.toTwosComplement(t).round().toString(16),e);return new a(r)},u=function(t){var e=o.fromAscii(t,i.ETH_PADDING).substr(2);return new a(e)},c=function(t){var e=o.fromAscii(t,i.ETH_PADDING).substr(2);return new a("",s(t.length).value,e)},l=function(t){var e="000000000000000000000000000000000000000000000000000000000000000"+(t?"1":"0");return new a(e)},p=function(t){return s(new n(t).times(new n(2).pow(128)))},f=function(t){return"1"===new n(t.substr(0,1),16).toString(2).substr(0,1)},m=function(t){var e=t.value||"0";return f(e)?new n(e,16).minus(new n("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16)).minus(1):new n(e,16)},h=function(t){var e=t.value||"0";return new n(e,16)},d=function(t){return m(t).dividedBy(new n(2).pow(128))},y=function(t){return h(t).dividedBy(new n(2).pow(128))},g=function(t){return"0000000000000000000000000000000000000000000000000000000000000001"===t.value?!0:!1},v=function(t){return o.toAscii(t.value)},b=function(t){return o.toAscii(t.suffix)},w=function(t){var e=t.value;return"0x"+e.slice(e.length-40,e.length)};e.exports={formatInputInt:s,formatInputBytes:u,formatInputDynamicBytes:c,formatInputBool:l,formatInputReal:p,formatOutputInt:m,formatOutputUInt:h,formatOutputReal:d,formatOutputUReal:y,formatOutputBool:g,formatOutputBytes:v,formatOutputDynamicBytes:b,formatOutputAddress:w}},{"../utils/config":7,"../utils/utils":8,"./param":4,"bignumber.js":"bignumber.js"}],4:[function(t,e,r){var n=function(t,e,r){this.prefix=e||"",this.value=t||"",this.suffix=r||""};n.prototype.append=function(t){this.prefix+=t.prefix,this.value+=t.value,this.suffix+=t.suffix},n.prototype.appendArrayElement=function(t){this.suffix+=t.value,this.prefix+=t.prefix},n.prototype.encode=function(){return this.prefix+this.value+this.suffix},n.prototype.shiftValue=function(){var t=this.value.slice(0,64);return this.value=this.value.slice(64),new n(t)},n.prototype.shiftBytes=function(){return this.shiftArray(1)},n.prototype.shiftArray=function(t){var e=this.prefix.slice(0,64);this.prefix=this.value.slice(64);var r=this.suffix.slice(0,64*t);return this.suffix=this.suffix.slice(64*t),new n("",e,r)},e.exports=n},{}],5:[function(t,e,r){var n=function(t,e){return t.filter(function(t){return"constructor"===t.type&&t.inputs.length===e})[0]};e.exports={getConstructor:n}},{}],6:[function(t,e,r){"use strict";r.XMLHttpRequest="undefined"==typeof XMLHttpRequest?{}:XMLHttpRequest},{}],7:[function(t,e,r){var n=t("bignumber.js"),o=["wei","Kwei","Mwei","Gwei","szabo","finney","ether","grand","Mether","Gether","Tether","Pether","Eether","Zether","Yether","Nether","Dether","Vether","Uether"];e.exports={ETH_PADDING:32,ETH_SIGNATURE_LENGTH:4,ETH_UNITS:o,ETH_BIGNUMBER_ROUNDING_MODE:{ROUNDING_MODE:n.ROUND_DOWN},ETH_POLLING_TIMEOUT:1e3,defaultBlock:"latest",defaultAccount:void 0}},{"bignumber.js":"bignumber.js"}],8:[function(t,e,r){var n=t("bignumber.js"),o={wei:"1",kwei:"1000",ada:"1000",mwei:"1000000",babbage:"1000000",gwei:"1000000000",shannon:"1000000000",szabo:"1000000000000",finney:"1000000000000000",ether:"1000000000000000000",kether:"1000000000000000000000",grand:"1000000000000000000000",einstein:"1000000000000000000000",mether:"1000000000000000000000000",gether:"1000000000000000000000000000",tether:"1000000000000000000000000000000"},i=function(t,e,r){return new Array(e-t.length+1).join(r?r:"0")+t},a=function(t){var e="",r=0,n=t.length;for("0x"===t.substring(0,2)&&(r=2);n>r;r+=2){var o=parseInt(t.substr(r,2),16);if(0===o)break;e+=String.fromCharCode(o)}return e},s=function(t){for(var e="",r=0;rthis._inputTypes.length&&i.isObject(t[t.length-1])&&(e=t.pop()),e.to=this._address,e.data="0x"+this.signature()+o.encodeParams(this._inputTypes,t),e},a.prototype.signature=function(){return n.sha3(n.fromAscii(this._name)).slice(2,10)},a.prototype.call=function(){var t=this.toPayload.apply(this,Array.prototype.slice.call(arguments)),e=n.eth.call(t);e=e.length>=2?e.slice(2):e;var r=o.decodeParams(this._outputTypes,e);return 1===r.length?r[0]:r},a.prototype.sendTransaction=function(){var t=this.toPayload.apply(this,Array.prototype.slice.call(arguments));n.eth.sendTransaction(t)},a.prototype.displayName=function(){return i.extractDisplayName(this._name)},a.prototype.typeName=function(){return i.extractTypeName(this._name)},a.prototype.execute=function(){var t=!this._constant;return t?this.sendTransaction.apply(this,Array.prototype.slice.call(arguments)):this.call.apply(this,Array.prototype.slice.call(arguments))},a.prototype.attachToContract=function(t){var e=this.execute.bind(this);e.call=this.call.bind(this),e.sendTransaction=this.sendTransaction.bind(this);var r=this.displayName();t[r]||(t[r]=e),t[r][this.typeName()]=e},e.exports=a},{"../solidity/coder":2,"../utils/utils":8,"../web3":10}],19:[function(t,e,r){"use strict";var n=t("xmlhttprequest").XMLHttpRequest,o=t("./errors"),i=function(t){this.host=t||"http://localhost:8545"};i.prototype.send=function(t){var e=new n;e.open("POST",this.host,!1);try{e.send(JSON.stringify(t))}catch(r){throw o.InvalidConnection(this.host)}return JSON.parse(e.responseText)},i.prototype.sendAsync=function(t,e){var r=new n;r.onreadystatechange=function(){4===r.readyState&&e(null,JSON.parse(r.responseText))},r.open("POST",this.host,!0);try{r.send(JSON.stringify(t))}catch(i){e(o.InvalidConnection(this.host))}},e.exports=i},{"./errors":13,xmlhttprequest:6}],20:[function(t,e,r){var n=function(){return arguments.callee._singletonInstance?arguments.callee._singletonInstance:(arguments.callee._singletonInstance=this,void(this.messageId=1))};n.getInstance=function(){var t=new n;return t},n.prototype.toPayload=function(t,e){return t||console.error("jsonrpc method should be specified!"),{jsonrpc:"2.0",method:t,params:e||[],id:this.messageId++}},n.prototype.isValidResponse=function(t){return!!t&&!t.error&&"2.0"===t.jsonrpc&&"number"==typeof t.id&&void 0!==t.result},n.prototype.toBatchPayload=function(t){var e=this;return t.map(function(t){return e.toPayload(t.method,t.params)})},e.exports=n},{}],21:[function(t,e,r){var n=t("./requestmanager"),o=t("../utils/utils"),i=t("./errors"),a=function(t){this.name=t.name,this.call=t.call,this.params=t.params||0,this.inputFormatter=t.inputFormatter,this.outputFormatter=t.outputFormatter};a.prototype.getCall=function(t){return o.isFunction(this.call)?this.call(t):this.call},a.prototype.extractCallback=function(t){return o.isFunction(t[t.length-1])?t.pop():null},a.prototype.validateArgs=function(t){if(t.length!==this.params)throw i.InvalidNumberOfParams()},a.prototype.formatInput=function(t){return this.inputFormatter?this.inputFormatter.map(function(e,r){return e?e(t[r]):t[r]}):t},a.prototype.formatOutput=function(t){return this.outputFormatter&&null!==t?this.outputFormatter(t):t},a.prototype.attachToObject=function(t){var e=this.send.bind(this);e.call=this.call;var r=this.name.split(".");r.length>1?(t[r[0]]=t[r[0]]||{},t[r[0]][r[1]]=e):t[r[0]]=e},a.prototype.toPayload=function(t){var e=this.getCall(t),r=this.extractCallback(t),n=this.formatInput(t);return this.validateArgs(n),{method:e,params:n,callback:r}},a.prototype.send=function(){var t=this.toPayload(Array.prototype.slice.call(arguments));if(t.callback){var e=this;return n.getInstance().sendAsync(t,function(r,n){t.callback(null,e.formatOutput(n))})}return this.formatOutput(n.getInstance().send(t))},e.exports=a},{"../utils/utils":8,"./errors":13,"./requestmanager":25}],22:[function(t,e,r){var n=t("../utils/utils"),o=t("./property"),i=[],a=[new o({name:"listening",getter:"net_listening"}),new o({name:"peerCount",getter:"net_peerCount",outputFormatter:n.toDecimal})];e.exports={methods:i,properties:a}},{"../utils/utils":8,"./property":23}],23:[function(t,e,r){var n=t("./requestmanager"),o=function(t){this.name=t.name,this.getter=t.getter,this.setter=t.setter,this.outputFormatter=t.outputFormatter,this.inputFormatter=t.inputFormatter};o.prototype.formatInput=function(t){return this.inputFormatter?this.inputFormatter(t):t},o.prototype.formatOutput=function(t){return this.outputFormatter&&null!==t?this.outputFormatter(t):t},o.prototype.attachToObject=function(t){var e={get:this.get.bind(this),set:this.set.bind(this)},r=this.name.split(".");r.length>1?(t[r[0]]=t[r[0]]||{},Object.defineProperty(t[r[0]],r[1],e)):Object.defineProperty(t,r[0],e)},o.prototype.get=function(){return this.formatOutput(n.getInstance().send({method:this.getter}))},o.prototype.set=function(t){return n.getInstance().send({method:this.setter,params:[this.formatInput(t)]})},e.exports=o},{"./requestmanager":25}],24:[function(t,e,r){var n=function(){};n.prototype.send=function(t){var e=navigator.qt.callMethod(JSON.stringify(t));return JSON.parse(e)},e.exports=n},{}],25:[function(t,e,r){var n=t("./jsonrpc"),o=t("../utils/utils"),i=t("../utils/config"),a=t("./errors"),s=function(t){return arguments.callee._singletonInstance?arguments.callee._singletonInstance:(arguments.callee._singletonInstance=this,this.provider=t,this.polls=[],this.timeout=null,void this.poll())};s.getInstance=function(){var t=new s;return t},s.prototype.send=function(t){if(!this.provider)return console.error(a.InvalidProvider()),null;var e=n.getInstance().toPayload(t.method,t.params),r=this.provider.send(e);if(!n.getInstance().isValidResponse(r))throw a.InvalidResponse(r);return r.result},s.prototype.sendAsync=function(t,e){if(!this.provider)return e(a.InvalidProvider());var r=n.getInstance().toPayload(t.method,t.params);this.provider.sendAsync(r,function(t,r){return t?e(t):n.getInstance().isValidResponse(r)?void e(null,r.result):e(a.InvalidResponse(r))})},s.prototype.setProvider=function(t){this.provider=t},s.prototype.startPolling=function(t,e,r,n){this.polls.push({data:t,id:e,callback:r,uninstall:n})},s.prototype.stopPolling=function(t){for(var e=this.polls.length;e--;){var r=this.polls[e];r.id===t&&this.polls.splice(e,1)}},s.prototype.reset=function(){this.polls.forEach(function(t){t.uninstall(t.id)}),this.polls=[],this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.poll()},s.prototype.poll=function(){if(this.timeout=setTimeout(this.poll.bind(this),i.ETH_POLLING_TIMEOUT),this.polls.length){if(!this.provider)return void console.error(a.InvalidProvider());var t=n.getInstance().toBatchPayload(this.polls.map(function(t){return t.data})),e=this;this.provider.sendAsync(t,function(t,r){if(!t){if(!o.isArray(r))throw a.InvalidResponse(r);r.map(function(t,r){return t.callback=e.polls[r].callback,t}).filter(function(t){var e=n.getInstance().isValidResponse(t);return e||t.callback(a.InvalidResponse(t)),e}).filter(function(t){return o.isArray(t.result)&&t.result.length>0}).forEach(function(t){t.callback(null,t.result)})}})}},e.exports=s},{"../utils/config":7,"../utils/utils":8,"./errors":13,"./jsonrpc":20}],26:[function(t,e,r){var n=t("./method"),o=t("./formatters"),i=new n({name:"post",call:"shh_post",params:1,inputFormatter:[o.inputPostFormatter]}),a=new n({name:"newIdentity",call:"shh_newIdentity",params:0}),s=new n({name:"hasIdentity",call:"shh_hasIdentity",params:1}),u=new n({name:"newGroup",call:"shh_newGroup",params:0}),c=new n({name:"addToGroup",call:"shh_addToGroup",params:0}),l=[i,a,s,u,c];e.exports={methods:l}},{"./formatters":17,"./method":21}],27:[function(t,e,r){var n=t("./method"),o=function(){var t=function(t){return"string"==typeof t[0]?"eth_newBlockFilter":"eth_newFilter"},e=new n({name:"newFilter",call:t,params:1}),r=new n({name:"uninstallFilter",call:"eth_uninstallFilter",params:1}),o=new n({name:"getLogs",call:"eth_getFilterLogs",params:1}),i=new n({name:"poll",call:"eth_getFilterChanges",params:1 -});return[e,r,o,i]},i=function(){var t=new n({name:"newFilter",call:"shh_newFilter",params:1}),e=new n({name:"uninstallFilter",call:"shh_uninstallFilter",params:1}),r=new n({name:"getLogs",call:"shh_getMessages",params:1}),o=new n({name:"poll",call:"shh_getFilterChanges",params:1});return[t,e,r,o]};e.exports={eth:o,shh:i}},{"./method":21}],28:[function(t,e,r){},{}],"bignumber.js":[function(t,e,r){"use strict";e.exports=BigNumber},{}],web3:[function(t,e,r){var n=t("./lib/web3");n.providers.HttpProvider=t("./lib/web3/httpprovider"),n.providers.QtSyncProvider=t("./lib/web3/qtsync"),n.eth.contract=t("./lib/web3/contract"),n.abi=t("./lib/solidity/abi"),"undefined"!=typeof window&&"undefined"==typeof window.web3&&(window.web3=n),e.exports=n},{"./lib/solidity/abi":1,"./lib/web3":10,"./lib/web3/contract":11,"./lib/web3/httpprovider":19,"./lib/web3/qtsync":24}]},{},["web3"]); \ No newline at end of file +require=function t(e,r,n){function o(a,s){if(!r[a]){if(!e[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var l=r[a]={exports:{}};e[a][0].call(l.exports,function(t){var r=e[a][1][t];return o(r?r:t)},l,l.exports,t,e,r,n)}return r[a].exports}for(var i="function"==typeof require&&require,a=0;a0&&console.warn("didn't found matching constructor, using default one"),"")};e.exports={formatConstructorParams:i}},{"./coder":2,"./utils":5}],2:[function(t,e,r){var n=t("bignumber.js"),o=t("../utils/utils"),i=t("./formatters"),a=t("./param"),s=function(t){return"[]"===t.slice(-2)},u=function(t){this._name=t.name,this._match=t.match,this._mode=t.mode,this._inputFormatter=t.inputFormatter,this._outputFormatter=t.outputFormatter};u.prototype.isType=function(t){return"strict"===this._match?this._name===t||0===t.indexOf(this._name)&&"[]"===t.slice(this._name.length):"prefix"===this._match?0===t.indexOf(this._name):void 0},u.prototype.formatInput=function(t,e){if(o.isArray(t)&&e){var r=this;return t.map(function(t){return r._inputFormatter(t)}).reduce(function(t,e){return t.combine(e)},i.formatInputInt(t.length)).withOffset(32)}return this._inputFormatter(t)},u.prototype.formatOutput=function(t,e){if(e){for(var r=[],o=new n(t.dynamicPart().slice(0,64),16),i=0;64*o>i;i+=64)r.push(this._outputFormatter(new a(t.dynamicPart().substr(i+64,64))));return r}return this._outputFormatter(t)},u.prototype.sliceParam=function(t,e,r){return"bytes"===this._mode?a.decodeBytes(t,e):s(r)?a.decodeArray(t,e):a.decodeParam(t,e)};var c=function(t){this._types=t};c.prototype._requireType=function(t){var e=this._types.filter(function(e){return e.isType(t)})[0];if(!e)throw Error("invalid solidity type!: "+t);return e},c.prototype._formatInput=function(t,e){return this._requireType(t).formatInput(e,s(t))},c.prototype.encodeParam=function(t,e){return this._formatInput(t,e).encode()},c.prototype.encodeParams=function(t,e){var r=this,n=t.map(function(t,n){return r._formatInput(t,e[n])});return a.encodeList(n)},c.prototype.decodeParam=function(t,e){return this.decodeParams([t],e)[0]},c.prototype.decodeParams=function(t,e){var r=this;return t.map(function(t,n){var o=r._requireType(t),i=o.sliceParam(e,n,t);return o.formatOutput(i,s(t))})};var l=new c([new u({name:"address",match:"strict",mode:"value",inputFormatter:i.formatInputInt,outputFormatter:i.formatOutputAddress}),new u({name:"bool",match:"strict",mode:"value",inputFormatter:i.formatInputBool,outputFormatter:i.formatOutputBool}),new u({name:"int",match:"prefix",mode:"value",inputFormatter:i.formatInputInt,outputFormatter:i.formatOutputInt}),new u({name:"uint",match:"prefix",mode:"value",inputFormatter:i.formatInputInt,outputFormatter:i.formatOutputUInt}),new u({name:"bytes",match:"strict",mode:"bytes",inputFormatter:i.formatInputDynamicBytes,outputFormatter:i.formatOutputDynamicBytes}),new u({name:"bytes",match:"prefix",mode:"value",inputFormatter:i.formatInputBytes,outputFormatter:i.formatOutputBytes}),new u({name:"real",match:"prefix",mode:"value",inputFormatter:i.formatInputReal,outputFormatter:i.formatOutputReal}),new u({name:"ureal",match:"prefix",mode:"value",inputFormatter:i.formatInputReal,outputFormatter:i.formatOutputUReal})]);e.exports=l},{"../utils/utils":8,"./formatters":3,"./param":4,"bignumber.js":"bignumber.js"}],3:[function(t,e,r){var n=t("bignumber.js"),o=t("../utils/utils"),i=t("../utils/config"),a=t("./param"),s=function(t){var e=2*i.ETH_PADDING;n.config(i.ETH_BIGNUMBER_ROUNDING_MODE);var r=o.padLeft(o.toTwosComplement(t).round().toString(16),e);return new a(r)},u=function(t){var e=o.fromAscii(t,i.ETH_PADDING).substr(2);return new a(e)},c=function(t){var e=o.fromAscii(t,i.ETH_PADDING).substr(2);return new a(s(t.length).value+e,32)},l=function(t){var e="000000000000000000000000000000000000000000000000000000000000000"+(t?"1":"0");return new a(e)},p=function(t){return s(new n(t).times(new n(2).pow(128)))},f=function(t){return"1"===new n(t.substr(0,1),16).toString(2).substr(0,1)},m=function(t){var e=t.staticPart()||"0";return f(e)?new n(e,16).minus(new n("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16)).minus(1):new n(e,16)},h=function(t){var e=t.staticPart()||"0";return new n(e,16)},d=function(t){return m(t).dividedBy(new n(2).pow(128))},y=function(t){return h(t).dividedBy(new n(2).pow(128))},g=function(t){return"0000000000000000000000000000000000000000000000000000000000000001"===t.staticPart()?!0:!1},b=function(t){return o.toAscii(t.staticPart())},v=function(t){return o.toAscii(t.dynamicPart().slice(64))},w=function(t){var e=t.staticPart();return"0x"+e.slice(e.length-40,e.length)};e.exports={formatInputInt:s,formatInputBytes:u,formatInputDynamicBytes:c,formatInputBool:l,formatInputReal:p,formatOutputInt:m,formatOutputUInt:h,formatOutputReal:d,formatOutputUReal:y,formatOutputBool:g,formatOutputBytes:b,formatOutputDynamicBytes:v,formatOutputAddress:w}},{"../utils/config":7,"../utils/utils":8,"./param":4,"bignumber.js":"bignumber.js"}],4:[function(t,e,r){var n=t("../utils/utils"),o=function(t,e){this.value=t||"",this.offset=e};o.prototype.dynamicPartLength=function(){return this.dynamicPart().length/2},o.prototype.withOffset=function(t){return new o(this.value,t)},o.prototype.combine=function(t){return new o(this.value+t.value)},o.prototype.isDynamic=function(){return this.value.length>64},o.prototype.offsetAsBytes=function(){return this.isDynamic()?n.padLeft(n.toTwosComplement(this.offset).toString(16),64):""},o.prototype.staticPart=function(){return this.isDynamic()?this.offsetAsBytes():this.value},o.prototype.dynamicPart=function(){return this.isDynamic()?this.value:""},o.prototype.encode=function(){return this.staticPart()+this.dynamicPart()},o.encodeList=function(t){var e=32*t.length,r=t.map(function(t){if(!t.isDynamic())return t;var r=e;return e+=t.dynamicPartLength(),t.withOffset(r)});return r.reduce(function(t,e){return t+e.dynamicPart()},r.reduce(function(t,e){return t+e.staticPart()},""))},o.decodeParam=function(t,e){return e=e||0,new o(t.substr(64*e,64))};var i=function(t,e){return parseInt("0x"+t.substr(64*e,64))};o.decodeBytes=function(t,e){e=e||0;var r=i(t,e);return new o(t.substr(2*r,128))},o.decodeArray=function(t,e){e=e||0;var r=i(t,e),n=parseInt("0x"+t.substr(2*r,64));return new o(t.substr(2*r,64*(n+1)))},e.exports=o},{"../utils/utils":8}],5:[function(t,e,r){var n=function(t,e){return t.filter(function(t){return"constructor"===t.type&&t.inputs.length===e})[0]};e.exports={getConstructor:n}},{}],6:[function(t,e,r){"use strict";r.XMLHttpRequest="undefined"==typeof XMLHttpRequest?{}:XMLHttpRequest},{}],7:[function(t,e,r){var n=t("bignumber.js"),o=["wei","Kwei","Mwei","Gwei","szabo","finney","ether","grand","Mether","Gether","Tether","Pether","Eether","Zether","Yether","Nether","Dether","Vether","Uether"];e.exports={ETH_PADDING:32,ETH_SIGNATURE_LENGTH:4,ETH_UNITS:o,ETH_BIGNUMBER_ROUNDING_MODE:{ROUNDING_MODE:n.ROUND_DOWN},ETH_POLLING_TIMEOUT:1e3,defaultBlock:"latest",defaultAccount:void 0}},{"bignumber.js":"bignumber.js"}],8:[function(t,e,r){var n=t("bignumber.js"),o={wei:"1",kwei:"1000",ada:"1000",mwei:"1000000",babbage:"1000000",gwei:"1000000000",shannon:"1000000000",szabo:"1000000000000",finney:"1000000000000000",ether:"1000000000000000000",kether:"1000000000000000000000",grand:"1000000000000000000000",einstein:"1000000000000000000000",mether:"1000000000000000000000000",gether:"1000000000000000000000000000",tether:"1000000000000000000000000000000"},i=function(t,e,r){return new Array(e-t.length+1).join(r?r:"0")+t},a=function(t){var e="",r=0,n=t.length;for("0x"===t.substring(0,2)&&(r=2);n>r;r+=2){var o=parseInt(t.substr(r,2),16);if(0===o)break;e+=String.fromCharCode(o)}return e},s=function(t){for(var e="",r=0;rthis._inputTypes.length&&i.isObject(t[t.length-1])&&(e=t.pop()),e.to=this._address,e.data="0x"+this.signature()+o.encodeParams(this._inputTypes,t),e},a.prototype.signature=function(){return n.sha3(n.fromAscii(this._name)).slice(2,10)},a.prototype.call=function(){var t=this.toPayload.apply(this,Array.prototype.slice.call(arguments)),e=n.eth.call(t);e=e.length>=2?e.slice(2):e;var r=o.decodeParams(this._outputTypes,e);return 1===r.length?r[0]:r},a.prototype.sendTransaction=function(){var t=this.toPayload.apply(this,Array.prototype.slice.call(arguments));n.eth.sendTransaction(t)},a.prototype.displayName=function(){return i.extractDisplayName(this._name)},a.prototype.typeName=function(){return i.extractTypeName(this._name)},a.prototype.execute=function(){var t=!this._constant;return t?this.sendTransaction.apply(this,Array.prototype.slice.call(arguments)):this.call.apply(this,Array.prototype.slice.call(arguments))},a.prototype.attachToContract=function(t){var e=this.execute.bind(this);e.call=this.call.bind(this),e.sendTransaction=this.sendTransaction.bind(this);var r=this.displayName();t[r]||(t[r]=e),t[r][this.typeName()]=e},e.exports=a},{"../solidity/coder":2,"../utils/utils":8,"../web3":10}],19:[function(t,e,r){"use strict";var n=t("xmlhttprequest").XMLHttpRequest,o=t("./errors"),i=function(t){this.host=t||"http://localhost:8545"};i.prototype.send=function(t){var e=new n;e.open("POST",this.host,!1);try{e.send(JSON.stringify(t))}catch(r){throw o.InvalidConnection(this.host)}var i=e.responseText;try{i=JSON.parse(i)}catch(a){throw o.InvalidResponse(i)}return i},i.prototype.sendAsync=function(t,e){var r=new n;r.onreadystatechange=function(){if(4===r.readyState){var t=r.responseText,n=null;try{t=JSON.parse(t)}catch(i){n=o.InvalidResponse(t)}e(n,t)}},r.open("POST",this.host,!0);try{r.send(JSON.stringify(t))}catch(i){e(o.InvalidConnection(this.host))}},e.exports=i},{"./errors":13,xmlhttprequest:6}],20:[function(t,e,r){var n=function(){return arguments.callee._singletonInstance?arguments.callee._singletonInstance:(arguments.callee._singletonInstance=this,void(this.messageId=1))};n.getInstance=function(){var t=new n;return t},n.prototype.toPayload=function(t,e){return t||console.error("jsonrpc method should be specified!"),{jsonrpc:"2.0",method:t,params:e||[],id:this.messageId++}},n.prototype.isValidResponse=function(t){return!!t&&!t.error&&"2.0"===t.jsonrpc&&"number"==typeof t.id&&void 0!==t.result},n.prototype.toBatchPayload=function(t){var e=this;return t.map(function(t){return e.toPayload(t.method,t.params)})},e.exports=n},{}],21:[function(t,e,r){var n=t("./requestmanager"),o=t("../utils/utils"),i=t("./errors"),a=function(t){this.name=t.name,this.call=t.call,this.params=t.params||0,this.inputFormatter=t.inputFormatter,this.outputFormatter=t.outputFormatter};a.prototype.getCall=function(t){return o.isFunction(this.call)?this.call(t):this.call},a.prototype.extractCallback=function(t){return o.isFunction(t[t.length-1])?t.pop():null},a.prototype.validateArgs=function(t){if(t.length!==this.params)throw i.InvalidNumberOfParams()},a.prototype.formatInput=function(t){return this.inputFormatter?this.inputFormatter.map(function(e,r){return e?e(t[r]):t[r]}):t},a.prototype.formatOutput=function(t){return this.outputFormatter&&null!==t?this.outputFormatter(t):t},a.prototype.attachToObject=function(t){var e=this.send.bind(this);e.call=this.call;var r=this.name.split(".");r.length>1?(t[r[0]]=t[r[0]]||{},t[r[0]][r[1]]=e):t[r[0]]=e},a.prototype.toPayload=function(t){var e=this.getCall(t),r=this.extractCallback(t),n=this.formatInput(t);return this.validateArgs(n),{method:e,params:n,callback:r}},a.prototype.send=function(){var t=this.toPayload(Array.prototype.slice.call(arguments));if(t.callback){var e=this;return n.getInstance().sendAsync(t,function(r,n){t.callback(null,e.formatOutput(n))})}return this.formatOutput(n.getInstance().send(t))},e.exports=a},{"../utils/utils":8,"./errors":13,"./requestmanager":25}],22:[function(t,e,r){var n=t("../utils/utils"),o=t("./property"),i=[],a=[new o({name:"listening",getter:"net_listening"}),new o({name:"peerCount",getter:"net_peerCount",outputFormatter:n.toDecimal})];e.exports={methods:i,properties:a}},{"../utils/utils":8,"./property":23}],23:[function(t,e,r){var n=t("./requestmanager"),o=function(t){this.name=t.name,this.getter=t.getter,this.setter=t.setter,this.outputFormatter=t.outputFormatter,this.inputFormatter=t.inputFormatter};o.prototype.formatInput=function(t){return this.inputFormatter?this.inputFormatter(t):t},o.prototype.formatOutput=function(t){return this.outputFormatter&&null!==t?this.outputFormatter(t):t},o.prototype.attachToObject=function(t){var e={get:this.get.bind(this),set:this.set.bind(this)},r=this.name.split(".");r.length>1?(t[r[0]]=t[r[0]]||{},Object.defineProperty(t[r[0]],r[1],e)):Object.defineProperty(t,r[0],e)},o.prototype.get=function(){return this.formatOutput(n.getInstance().send({method:this.getter}))},o.prototype.set=function(t){return n.getInstance().send({method:this.setter,params:[this.formatInput(t)]})},e.exports=o},{"./requestmanager":25}],24:[function(t,e,r){var n=function(){};n.prototype.send=function(t){var e=navigator.qt.callMethod(JSON.stringify(t));return JSON.parse(e)},e.exports=n},{}],25:[function(t,e,r){var n=t("./jsonrpc"),o=t("../utils/utils"),i=t("../utils/config"),a=t("./errors"),s=function(t){return arguments.callee._singletonInstance?arguments.callee._singletonInstance:(arguments.callee._singletonInstance=this,this.provider=t,this.polls=[],this.timeout=null,void this.poll())};s.getInstance=function(){var t=new s;return t},s.prototype.send=function(t){if(!this.provider)return console.error(a.InvalidProvider()),null;var e=n.getInstance().toPayload(t.method,t.params),r=this.provider.send(e);if(!n.getInstance().isValidResponse(r))throw a.InvalidResponse(r);return r.result},s.prototype.sendAsync=function(t,e){if(!this.provider)return e(a.InvalidProvider());var r=n.getInstance().toPayload(t.method,t.params);this.provider.sendAsync(r,function(t,r){return t?e(t):n.getInstance().isValidResponse(r)?void e(null,r.result):e(a.InvalidResponse(r))})},s.prototype.setProvider=function(t){this.provider=t},s.prototype.startPolling=function(t,e,r,n){this.polls.push({data:t,id:e,callback:r,uninstall:n})},s.prototype.stopPolling=function(t){for(var e=this.polls.length;e--;){var r=this.polls[e];r.id===t&&this.polls.splice(e,1)}},s.prototype.reset=function(){this.polls.forEach(function(t){t.uninstall(t.id)}),this.polls=[],this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.poll()},s.prototype.poll=function(){if(this.timeout=setTimeout(this.poll.bind(this),i.ETH_POLLING_TIMEOUT),this.polls.length){if(!this.provider)return void console.error(a.InvalidProvider());var t=n.getInstance().toBatchPayload(this.polls.map(function(t){return t.data})),e=this;this.provider.sendAsync(t,function(t,r){if(!t){if(!o.isArray(r))throw a.InvalidResponse(r);r.map(function(t,r){return t.callback=e.polls[r].callback,t}).filter(function(t){var e=n.getInstance().isValidResponse(t);return e||t.callback(a.InvalidResponse(t)),e}).filter(function(t){return o.isArray(t.result)&&t.result.length>0}).forEach(function(t){t.callback(null,t.result)})}})}},e.exports=s},{"../utils/config":7,"../utils/utils":8,"./errors":13,"./jsonrpc":20}],26:[function(t,e,r){var n=t("./method"),o=t("./formatters"),i=new n({name:"post",call:"shh_post",params:1,inputFormatter:[o.inputPostFormatter]}),a=new n({name:"newIdentity",call:"shh_newIdentity",params:0}),s=new n({name:"hasIdentity",call:"shh_hasIdentity",params:1}),u=new n({name:"newGroup",call:"shh_newGroup",params:0}),c=new n({name:"addToGroup",call:"shh_addToGroup",params:0}),l=[i,a,s,u,c];e.exports={methods:l}},{"./formatters":17,"./method":21}],27:[function(t,e,r){var n=t("./method"),o=function(){var t=function(t){return"string"==typeof t[0]?"eth_newBlockFilter":"eth_newFilter"},e=new n({name:"newFilter",call:t,params:1}),r=new n({name:"uninstallFilter",call:"eth_uninstallFilter",params:1}),o=new n({name:"getLogs",call:"eth_getFilterLogs",params:1}),i=new n({name:"poll",call:"eth_getFilterChanges",params:1});return[e,r,o,i]},i=function(){var t=new n({name:"newFilter",call:"shh_newFilter",params:1}),e=new n({name:"uninstallFilter",call:"shh_uninstallFilter",params:1}),r=new n({name:"getLogs",call:"shh_getMessages",params:1}),o=new n({name:"poll",call:"shh_getFilterChanges",params:1 +});return[t,e,r,o]};e.exports={eth:o,shh:i}},{"./method":21}],28:[function(t,e,r){},{}],"bignumber.js":[function(t,e,r){"use strict";e.exports=BigNumber},{}],web3:[function(t,e,r){var n=t("./lib/web3");n.providers.HttpProvider=t("./lib/web3/httpprovider"),n.providers.QtSyncProvider=t("./lib/web3/qtsync"),n.eth.contract=t("./lib/web3/contract"),n.abi=t("./lib/solidity/abi"),"undefined"!=typeof window&&"undefined"==typeof window.web3&&(window.web3=n),e.exports=n},{"./lib/solidity/abi":1,"./lib/web3":10,"./lib/web3/contract":11,"./lib/web3/httpprovider":19,"./lib/web3/qtsync":24}]},{},["web3"]); \ No newline at end of file diff --git a/dist/web3.js b/dist/web3.js index db554daea..ec66a38d8 100644 --- a/dist/web3.js +++ b/dist/web3.js @@ -22,118 +22,29 @@ require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof requ * @date 2014 */ -var utils = require('../utils/utils'); var coder = require('./coder'); -var solUtils = require('./utils'); - -/** - * Formats input params to bytes - * - * @method formatInput - * @param {Array} abi inputs of method - * @param {Array} params that will be formatted to bytes - * @returns bytes representation of input params - */ -var formatInput = function (inputs, params) { - var i = inputs.map(function (input) { - return input.type; - }); - return coder.encodeParams(i, params); -}; - -/** - * Formats output bytes back to param list - * - * @method formatOutput - * @param {Array} abi outputs of method - * @param {String} bytes represention of output - * @returns {Array} output params - */ -var formatOutput = function (outs, bytes) { - var o = outs.map(function (out) { - return out.type; - }); - - return coder.decodeParams(o, bytes); -}; - -/** - * Should be called to create input parser for contract with given abi - * - * @method inputParser - * @param {Array} contract abi - * @returns {Object} input parser object for given json abi - * TODO: refactor creating the parser, do not double logic from contract - */ -var inputParser = function (json) { - var parser = {}; - json.forEach(function (method) { - var displayName = utils.extractDisplayName(method.name); - var typeName = utils.extractTypeName(method.name); - - var impl = function () { - var params = Array.prototype.slice.call(arguments); - return formatInput(method.inputs, params); - }; - - if (parser[displayName] === undefined) { - parser[displayName] = impl; - } - - parser[displayName][typeName] = impl; - }); - - return parser; -}; - -/** - * Should be called to create output parser for contract with given abi - * - * @method outputParser - * @param {Array} contract abi - * @returns {Object} output parser for given json abi - */ -var outputParser = function (json) { - var parser = {}; - json.forEach(function (method) { - - var displayName = utils.extractDisplayName(method.name); - var typeName = utils.extractTypeName(method.name); - - var impl = function (output) { - return formatOutput(method.outputs, output); - }; - - if (parser[displayName] === undefined) { - parser[displayName] = impl; - } - - parser[displayName][typeName] = impl; - }); - - return parser; -}; +var utils = require('./utils'); var formatConstructorParams = function (abi, params) { - var constructor = solUtils.getConstructor(abi, params.length); + var constructor = utils.getConstructor(abi, params.length); if (!constructor) { if (params.length > 0) { console.warn("didn't found matching constructor, using default one"); } return ''; } - return formatInput(constructor.inputs, params); + + return coder.encodeParams(constructor.inputs.map(function (input) { + return input.type; + }), params); }; module.exports = { - inputParser: inputParser, - outputParser: outputParser, - formatInput: formatInput, - formatOutput: formatOutput, formatConstructorParams: formatConstructorParams }; -},{"../utils/utils":8,"./coder":2,"./utils":5}],2:[function(require,module,exports){ + +},{"./coder":2,"./utils":5}],2:[function(require,module,exports){ /* This file is part of ethereum.js. @@ -213,9 +124,8 @@ SolidityType.prototype.formatInput = function (param, arrayType) { return param.map(function (p) { return self._inputFormatter(p); }).reduce(function (acc, current) { - acc.appendArrayElement(current); - return acc; - }, new SolidityParam('', f.formatInputInt(param.length).value)); + return acc.combine(current); + }, f.formatInputInt(param.length)).withOffset(32); } return this._inputFormatter(param); }; @@ -232,9 +142,9 @@ SolidityType.prototype.formatOutput = function (param, arrayType) { if (arrayType) { // let's assume, that we solidity will never return long arrays :P var result = []; - var length = new BigNumber(param.prefix, 16); + var length = new BigNumber(param.dynamicPart().slice(0, 64), 16); for (var i = 0; i < length * 64; i += 64) { - result.push(this._outputFormatter(new SolidityParam(param.suffix.slice(i, i + 64)))); + result.push(this._outputFormatter(new SolidityParam(param.dynamicPart().substr(i + 64, 64)))); } return result; } @@ -242,31 +152,21 @@ SolidityType.prototype.formatOutput = function (param, arrayType) { }; /** - * Should be used to check if a type is variadic + * Should be used to slice single param from bytes * - * @method isVariadicType - * @param {String} type - * @returns {Bool} true if the type is variadic - */ -SolidityType.prototype.isVariadicType = function (type) { - return isArrayType(type) || this._mode === 'bytes'; -}; - -/** - * Should be used to shift param from params group - * - * @method shiftParam + * @method sliceParam + * @param {String} bytes + * @param {Number} index of param to slice * @param {String} type - * @returns {SolidityParam} shifted param + * @returns {SolidityParam} param */ -SolidityType.prototype.shiftParam = function (type, param) { +SolidityType.prototype.sliceParam = function (bytes, index, type) { if (this._mode === 'bytes') { - return param.shiftBytes(); + return SolidityParam.decodeBytes(bytes, index); } else if (isArrayType(type)) { - var length = new BigNumber(param.prefix.slice(0, 64), 16); - return param.shiftArray(length); + return SolidityParam.decodeArray(bytes, index); } - return param.shiftValue(); + return SolidityParam.decodeParam(bytes, index); }; /** @@ -296,28 +196,6 @@ SolidityCoder.prototype._requireType = function (type) { return solidityType; }; -/** - * Should be used to transform plain bytes to SolidityParam object - * - * @method _bytesToParam - * @param {Array} types of params - * @param {String} bytes to be transformed to SolidityParam - * @return {SolidityParam} SolidityParam for this group of params - */ -SolidityCoder.prototype._bytesToParam = function (types, bytes) { - var self = this; - var prefixTypes = types.reduce(function (acc, type) { - return self._requireType(type).isVariadicType(type) ? acc + 1 : acc; - }, 0); - var valueTypes = types.length - prefixTypes; - - var prefix = bytes.slice(0, prefixTypes * 64); - bytes = bytes.slice(prefixTypes * 64); - var value = bytes.slice(0, valueTypes * 64); - var suffix = bytes.slice(valueTypes * 64); - return new SolidityParam(value, prefix, suffix); -}; - /** * Should be used to transform plain param of given type to SolidityParam * @@ -352,24 +230,11 @@ SolidityCoder.prototype.encodeParam = function (type, param) { */ SolidityCoder.prototype.encodeParams = function (types, params) { var self = this; - return types.map(function (type, index) { + var solidityParams = types.map(function (type, index) { return self._formatInput(type, params[index]); - }).reduce(function (acc, solidityParam) { - acc.append(solidityParam); - return acc; - }, new SolidityParam()).encode(); -}; + }); -/** - * Should be used to transform SolidityParam to plain param - * - * @method _formatOutput - * @param {String} type - * @param {SolidityParam} param - * @return {Object} plain param - */ -SolidityCoder.prototype._formatOutput = function (type, param) { - return this._requireType(type).formatOutput(param, isArrayType(type)); + return SolidityParam.encodeList(solidityParams); }; /** @@ -381,7 +246,7 @@ SolidityCoder.prototype._formatOutput = function (type, param) { * @return {Object} plain param */ SolidityCoder.prototype.decodeParam = function (type, bytes) { - return this._formatOutput(type, this._bytesToParam([type], bytes)); + return this.decodeParams([type], bytes)[0]; }; /** @@ -394,10 +259,9 @@ SolidityCoder.prototype.decodeParam = function (type, bytes) { */ SolidityCoder.prototype.decodeParams = function (types, bytes) { var self = this; - var param = this._bytesToParam(types, bytes); - return types.map(function (type) { + return types.map(function (type, index) { var solidityType = self._requireType(type); - var p = solidityType.shiftParam(type, param); + var p = solidityType.sliceParam(bytes, index, type); return solidityType.formatOutput(p, isArrayType(type)); }); }; @@ -530,7 +394,7 @@ var formatInputBytes = function (value) { */ var formatInputDynamicBytes = function (value) { var result = utils.fromAscii(value, c.ETH_PADDING).substr(2); - return new SolidityParam('', formatInputInt(value.length).value, result); + return new SolidityParam(formatInputInt(value.length).value + result, 32); }; /** @@ -576,7 +440,7 @@ var signedIsNegative = function (value) { * @returns {BigNumber} right-aligned output bytes formatted to big number */ var formatOutputInt = function (param) { - var value = param.value || "0"; + var value = param.staticPart() || "0"; // check if it's negative number // it it is, return two's complement @@ -594,7 +458,7 @@ var formatOutputInt = function (param) { * @returns {BigNumeber} right-aligned output bytes formatted to uint */ var formatOutputUInt = function (param) { - var value = param.value || "0"; + var value = param.staticPart() || "0"; return new BigNumber(value, 16); }; @@ -628,7 +492,7 @@ var formatOutputUReal = function (param) { * @returns {Boolean} right-aligned input bytes formatted to bool */ var formatOutputBool = function (param) { - return param.value === '0000000000000000000000000000000000000000000000000000000000000001' ? true : false; + return param.staticPart() === '0000000000000000000000000000000000000000000000000000000000000001' ? true : false; }; /** @@ -640,7 +504,7 @@ var formatOutputBool = function (param) { */ var formatOutputBytes = function (param) { // length might also be important! - return utils.toAscii(param.value); + return utils.toAscii(param.staticPart()); }; /** @@ -652,7 +516,7 @@ var formatOutputBytes = function (param) { */ var formatOutputDynamicBytes = function (param) { // length might also be important! - return utils.toAscii(param.suffix); + return utils.toAscii(param.dynamicPart().slice(64)); }; /** @@ -663,7 +527,7 @@ var formatOutputDynamicBytes = function (param) { * @returns {String} address */ var formatOutputAddress = function (param) { - var value = param.value; + var value = param.staticPart(); return "0x" + value.slice(value.length - 40, value.length); }; @@ -707,91 +571,196 @@ module.exports = { * @date 2015 */ +var utils = require('../utils/utils'); + /** * SolidityParam object prototype. * Should be used when encoding, decoding solidity bytes */ -var SolidityParam = function (value, prefix, suffix) { - this.prefix = prefix || ''; +var SolidityParam = function (value, offset) { this.value = value || ''; - this.suffix = suffix || ''; + this.offset = offset; // offset in bytes +}; + +/** + * This method should be used to get length of params's dynamic part + * + * @method dynamicPartLength + * @returns {Number} length of dynamic part (in bytes) + */ +SolidityParam.prototype.dynamicPartLength = function () { + return this.dynamicPart().length / 2; +}; + +/** + * This method should be used to create copy of solidity param with different offset + * + * @method withOffset + * @param {Number} offset length in bytes + * @returns {SolidityParam} new solidity param with applied offset + */ +SolidityParam.prototype.withOffset = function (offset) { + return new SolidityParam(this.value, offset); }; /** - * This method should be used to encode two params one after another + * This method should be used to combine solidity params together + * eg. when appending an array * - * @method append - * @param {SolidityParam} param that it appended after this + * @method combine + * @param {SolidityParam} param with which we should combine + * @param {SolidityParam} result of combination */ -SolidityParam.prototype.append = function (param) { - this.prefix += param.prefix; - this.value += param.value; - this.suffix += param.suffix; +SolidityParam.prototype.combine = function (param) { + return new SolidityParam(this.value + param.value); }; /** - * This method should be used to encode next param in an array + * This method should be called to check if param has dynamic size. + * If it has, it returns true, otherwise false * - * @method appendArrayElement - * @param {SolidityParam} param that is appended to an array + * @method isDynamic + * @returns {Boolean} */ -SolidityParam.prototype.appendArrayElement = function (param) { - this.suffix += param.value; - this.prefix += param.prefix; - // TODO: suffix not supported = it's required for nested arrays; +SolidityParam.prototype.isDynamic = function () { + return this.value.length > 64; }; /** - * This method should be used to create bytearrays from param + * This method should be called to transform offset to bytes + * + * @method offsetAsBytes + * @returns {String} bytes representation of offset + */ +SolidityParam.prototype.offsetAsBytes = function () { + return !this.isDynamic() ? '' : utils.padLeft(utils.toTwosComplement(this.offset).toString(16), 64); +}; + +/** + * This method should be called to get static part of param + * + * @method staticPart + * @returns {String} offset if it is a dynamic param, otherwise value + */ +SolidityParam.prototype.staticPart = function () { + if (!this.isDynamic()) { + return this.value; + } + return this.offsetAsBytes(); +}; + +/** + * This method should be called to get dynamic part of param + * + * @method dynamicPart + * @returns {String} returns a value if it is a dynamic param, otherwise empty string + */ +SolidityParam.prototype.dynamicPart = function () { + return this.isDynamic() ? this.value : ''; +}; + +/** + * This method should be called to encode param * * @method encode - * @return {String} encoded param(s) + * @returns {String} */ SolidityParam.prototype.encode = function () { - return this.prefix + this.value + this.suffix; + return this.staticPart() + this.dynamicPart(); }; /** - * This method should be used to shift first param from group of params + * This method should be called to encode array of params * - * @method shiftValue - * @return {SolidityParam} first value param + * @method encodeList + * @param {Array[SolidityParam]} params + * @returns {String} */ -SolidityParam.prototype.shiftValue = function () { - var value = this.value.slice(0, 64); - this.value = this.value.slice(64); - return new SolidityParam(value); +SolidityParam.encodeList = function (params) { + + // updating offsets + var totalOffset = params.length * 32; + var offsetParams = params.map(function (param) { + if (!param.isDynamic()) { + return param; + } + var offset = totalOffset; + totalOffset += param.dynamicPartLength(); + return param.withOffset(offset); + }); + + // encode everything! + return offsetParams.reduce(function (result, param) { + return result + param.dynamicPart(); + }, offsetParams.reduce(function (result, param) { + return result + param.staticPart(); + }, '')); }; /** - * This method should be used to first bytes param from group of params + * This method should be used to decode plain (static) solidity param at given index * - * @method shiftBytes - * @return {SolidityParam} first bytes param + * @method decodeParam + * @param {String} bytes + * @param {Number} index + * @returns {SolidityParam} */ -SolidityParam.prototype.shiftBytes = function () { - return this.shiftArray(1); +SolidityParam.decodeParam = function (bytes, index) { + index = index || 0; + return new SolidityParam(bytes.substr(index * 64, 64)); }; /** - * This method should be used to shift an array from group of params - * - * @method shiftArray - * @param {Number} size of an array to shift - * @return {SolidityParam} first array param + * This method should be called to get offset value from bytes at given index + * + * @method getOffset + * @param {String} bytes + * @param {Number} index + * @returns {Number} offset as number + */ +var getOffset = function (bytes, index) { + // we can do this cause offset is rather small + return parseInt('0x' + bytes.substr(index * 64, 64)); +}; + +/** + * This method should be called to decode solidity bytes param at given index + * + * @method decodeBytes + * @param {String} bytes + * @param {Number} index + * @returns {SolidityParam} + */ +SolidityParam.decodeBytes = function (bytes, index) { + index = index || 0; + //TODO add support for strings longer than 32 bytes + //var length = parseInt('0x' + bytes.substr(offset * 64, 64)); + + var offset = getOffset(bytes, index); + + // 2 * , cause we also parse length + return new SolidityParam(bytes.substr(offset * 2, 2 * 64)); +}; + +/** + * This method should be used to decode solidity array at given index + * + * @method decodeArray + * @param {String} bytes + * @param {Number} index + * @returns {SolidityParam} */ -SolidityParam.prototype.shiftArray = function (length) { - var prefix = this.prefix.slice(0, 64); - this.prefix = this.value.slice(64); - var suffix = this.suffix.slice(0, 64 * length); - this.suffix = this.suffix.slice(64 * length); - return new SolidityParam('', prefix, suffix); +SolidityParam.decodeArray = function (bytes, index) { + index = index || 0; + var offset = getOffset(bytes, index); + var length = parseInt('0x' + bytes.substr(offset * 2, 64)); + return new SolidityParam(bytes.substr(offset * 2, (length + 1) * 64)); }; module.exports = SolidityParam; -},{}],5:[function(require,module,exports){ +},{"../utils/utils":8}],5:[function(require,module,exports){ /* This file is part of ethereum.js. @@ -828,6 +797,11 @@ var getConstructor = function (abi, numberOfArgs) { })[0]; }; +//var getSupremeType = function (type) { + //return type.substr(0, type.indexOf('[')) + ']'; +//}; + + module.exports = { getConstructor: getConstructor }; @@ -1394,7 +1368,7 @@ module.exports = { },{"bignumber.js":"bignumber.js"}],9:[function(require,module,exports){ module.exports={ - "version": "0.3.3" + "version": "0.3.6" } },{}],10:[function(require,module,exports){ @@ -1796,7 +1770,7 @@ module.exports = { /** * Web3 - * + * * @module web3 */ @@ -1850,16 +1824,16 @@ var uncleCountCall = function (args) { /// @returns an array of objects describing web3.eth api methods var getBalance = new Method({ - name: 'getBalance', - call: 'eth_getBalance', + name: 'getBalance', + call: 'eth_getBalance', params: 2, inputFormatter: [utils.toAddress, formatters.inputDefaultBlockNumberFormatter], outputFormatter: formatters.outputBigNumberFormatter }); var getStorageAt = new Method({ - name: 'getStorageAt', - call: 'eth_getStorageAt', + name: 'getStorageAt', + call: 'eth_getStorageAt', params: 3, inputFormatter: [null, utils.toHex, formatters.inputDefaultBlockNumberFormatter] }); @@ -1872,7 +1846,7 @@ var getCode = new Method({ }); var getBlock = new Method({ - name: 'getBlock', + name: 'getBlock', call: blockCall, params: 2, inputFormatter: [formatters.inputBlockNumberFormatter, function (val) { return !!val; }], @@ -1997,6 +1971,11 @@ var properties = [ name: 'mining', getter: 'eth_mining' }), + new Property({ + name: 'hashrate', + getter: 'eth_hashrate', + outputFormatter: utils.toDecimal + }), new Property({ name: 'gasPrice', getter: 'eth_gasPrice', @@ -2118,7 +2097,7 @@ SolidityEvent.prototype.encode = function (indexed, options) { ['fromBlock', 'toBlock'].filter(function (f) { return options[f] !== undefined; }).forEach(function (f) { - result[f] = utils.toHex(options[f]); + result[f] = formatters.inputBlockNumberFormatter(options[f]); }); result.topics = []; @@ -2447,7 +2426,7 @@ var inputTransactionFormatter = function (options){ delete options.code; } - ['gasPrice', 'gas', 'value'].filter(function (key) { + ['gasPrice', 'gas', 'value', 'nonce'].filter(function (key) { return options[key] !== undefined; }).forEach(function(key){ options[key] = utils.fromDecimal(options[key]); @@ -2796,15 +2775,32 @@ HttpProvider.prototype.send = function (payload) { //if (request.status !== 200) { //return; //} - return JSON.parse(request.responseText); + + var result = request.responseText; + + try { + result = JSON.parse(result); + } catch(e) { + throw errors.InvalidResponse(result); + } + + return result; }; HttpProvider.prototype.sendAsync = function (payload, callback) { var request = new XMLHttpRequest(); request.onreadystatechange = function() { if (request.readyState === 4) { - // TODO: handle the error properly here!!! - callback(null, JSON.parse(request.responseText)); + var result = request.responseText; + var error = null; + + try { + result = JSON.parse(result); + } catch(e) { + error = errors.InvalidResponse(result); + } + + callback(error, result); } }; diff --git a/dist/web3.js.map b/dist/web3.js.map index c989052e7..4efb07df1 100644 --- a/dist/web3.js.map +++ b/dist/web3.js.map @@ -34,30 +34,30 @@ "index.js" ], "names": [], - "mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzUA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1dA;AACA;AACA;AACA;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrGA;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3nFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA", + "mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1RA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1dA;AACA;AACA;AACA;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5PA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrGA;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3nFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA", "file": "generated.js", "sourceRoot": "", "sourcesContent": [ "(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o.\n*/\n/** \n * @file abi.js\n * @author Marek Kotewicz \n * @author Gav Wood \n * @date 2014\n */\n\nvar utils = require('../utils/utils');\nvar coder = require('./coder');\nvar solUtils = require('./utils');\n\n/**\n * Formats input params to bytes\n *\n * @method formatInput\n * @param {Array} abi inputs of method\n * @param {Array} params that will be formatted to bytes\n * @returns bytes representation of input params\n */\nvar formatInput = function (inputs, params) {\n var i = inputs.map(function (input) {\n return input.type;\n });\n return coder.encodeParams(i, params);\n};\n\n/** \n * Formats output bytes back to param list\n *\n * @method formatOutput\n * @param {Array} abi outputs of method\n * @param {String} bytes represention of output\n * @returns {Array} output params\n */\nvar formatOutput = function (outs, bytes) {\n var o = outs.map(function (out) {\n return out.type;\n });\n \n return coder.decodeParams(o, bytes); \n};\n\n/**\n * Should be called to create input parser for contract with given abi\n *\n * @method inputParser\n * @param {Array} contract abi\n * @returns {Object} input parser object for given json abi\n * TODO: refactor creating the parser, do not double logic from contract\n */\nvar inputParser = function (json) {\n var parser = {};\n json.forEach(function (method) {\n var displayName = utils.extractDisplayName(method.name);\n var typeName = utils.extractTypeName(method.name);\n\n var impl = function () {\n var params = Array.prototype.slice.call(arguments);\n return formatInput(method.inputs, params);\n };\n\n if (parser[displayName] === undefined) {\n parser[displayName] = impl;\n }\n\n parser[displayName][typeName] = impl;\n });\n\n return parser;\n};\n\n/**\n * Should be called to create output parser for contract with given abi\n *\n * @method outputParser\n * @param {Array} contract abi\n * @returns {Object} output parser for given json abi\n */\nvar outputParser = function (json) {\n var parser = {};\n json.forEach(function (method) {\n\n var displayName = utils.extractDisplayName(method.name);\n var typeName = utils.extractTypeName(method.name);\n\n var impl = function (output) {\n return formatOutput(method.outputs, output);\n };\n\n if (parser[displayName] === undefined) {\n parser[displayName] = impl;\n }\n\n parser[displayName][typeName] = impl;\n });\n\n return parser;\n};\n\nvar formatConstructorParams = function (abi, params) {\n var constructor = solUtils.getConstructor(abi, params.length);\n if (!constructor) {\n if (params.length > 0) {\n console.warn(\"didn't found matching constructor, using default one\");\n }\n return '';\n }\n return formatInput(constructor.inputs, params);\n};\n\nmodule.exports = {\n inputParser: inputParser,\n outputParser: outputParser,\n formatInput: formatInput,\n formatOutput: formatOutput,\n formatConstructorParams: formatConstructorParams\n};\n", - "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file coder.js\n * @author Marek Kotewicz \n * @date 2015\n */\n\nvar BigNumber = require('bignumber.js');\nvar utils = require('../utils/utils');\nvar f = require('./formatters');\nvar SolidityParam = require('./param');\n\n/**\n * Should be used to check if a type is an array type\n *\n * @method isArrayType\n * @param {String} type\n * @return {Bool} true is the type is an array, otherwise false\n */\nvar isArrayType = function (type) {\n return type.slice(-2) === '[]';\n};\n\n/**\n * SolidityType prototype is used to encode/decode solidity params of certain type\n */\nvar SolidityType = function (config) {\n this._name = config.name;\n this._match = config.match;\n this._mode = config.mode;\n this._inputFormatter = config.inputFormatter;\n this._outputFormatter = config.outputFormatter;\n};\n\n/**\n * Should be used to determine if this SolidityType do match given type\n *\n * @method isType\n * @param {String} name\n * @return {Bool} true if type match this SolidityType, otherwise false\n */\nSolidityType.prototype.isType = function (name) {\n if (this._match === 'strict') {\n return this._name === name || (name.indexOf(this._name) === 0 && name.slice(this._name.length) === '[]');\n } else if (this._match === 'prefix') {\n // TODO better type detection!\n return name.indexOf(this._name) === 0;\n }\n};\n\n/**\n * Should be used to transform plain param to SolidityParam object\n *\n * @method formatInput\n * @param {Object} param - plain object, or an array of objects\n * @param {Bool} arrayType - true if a param should be encoded as an array\n * @return {SolidityParam} encoded param wrapped in SolidityParam object \n */\nSolidityType.prototype.formatInput = function (param, arrayType) {\n if (utils.isArray(param) && arrayType) { // TODO: should fail if this two are not the same\n var self = this;\n return param.map(function (p) {\n return self._inputFormatter(p);\n }).reduce(function (acc, current) {\n acc.appendArrayElement(current);\n return acc;\n }, new SolidityParam('', f.formatInputInt(param.length).value));\n } \n return this._inputFormatter(param);\n};\n\n/**\n * Should be used to transoform SolidityParam to plain param\n *\n * @method formatOutput\n * @param {SolidityParam} byteArray\n * @param {Bool} arrayType - true if a param should be decoded as an array\n * @return {Object} plain decoded param\n */\nSolidityType.prototype.formatOutput = function (param, arrayType) {\n if (arrayType) {\n // let's assume, that we solidity will never return long arrays :P \n var result = [];\n var length = new BigNumber(param.prefix, 16);\n for (var i = 0; i < length * 64; i += 64) {\n result.push(this._outputFormatter(new SolidityParam(param.suffix.slice(i, i + 64))));\n }\n return result;\n }\n return this._outputFormatter(param);\n};\n\n/**\n * Should be used to check if a type is variadic\n *\n * @method isVariadicType\n * @param {String} type\n * @returns {Bool} true if the type is variadic\n */\nSolidityType.prototype.isVariadicType = function (type) {\n return isArrayType(type) || this._mode === 'bytes';\n};\n\n/**\n * Should be used to shift param from params group\n *\n * @method shiftParam\n * @param {String} type\n * @returns {SolidityParam} shifted param\n */\nSolidityType.prototype.shiftParam = function (type, param) {\n if (this._mode === 'bytes') {\n return param.shiftBytes();\n } else if (isArrayType(type)) {\n var length = new BigNumber(param.prefix.slice(0, 64), 16);\n return param.shiftArray(length);\n }\n return param.shiftValue();\n};\n\n/**\n * SolidityCoder prototype should be used to encode/decode solidity params of any type\n */\nvar SolidityCoder = function (types) {\n this._types = types;\n};\n\n/**\n * This method should be used to transform type to SolidityType\n *\n * @method _requireType\n * @param {String} type\n * @returns {SolidityType} \n * @throws {Error} throws if no matching type is found\n */\nSolidityCoder.prototype._requireType = function (type) {\n var solidityType = this._types.filter(function (t) {\n return t.isType(type);\n })[0];\n\n if (!solidityType) {\n throw Error('invalid solidity type!: ' + type);\n }\n\n return solidityType;\n};\n\n/**\n * Should be used to transform plain bytes to SolidityParam object\n *\n * @method _bytesToParam\n * @param {Array} types of params\n * @param {String} bytes to be transformed to SolidityParam\n * @return {SolidityParam} SolidityParam for this group of params\n */\nSolidityCoder.prototype._bytesToParam = function (types, bytes) {\n var self = this;\n var prefixTypes = types.reduce(function (acc, type) {\n return self._requireType(type).isVariadicType(type) ? acc + 1 : acc;\n }, 0);\n var valueTypes = types.length - prefixTypes;\n\n var prefix = bytes.slice(0, prefixTypes * 64);\n bytes = bytes.slice(prefixTypes * 64);\n var value = bytes.slice(0, valueTypes * 64);\n var suffix = bytes.slice(valueTypes * 64);\n return new SolidityParam(value, prefix, suffix); \n};\n\n/**\n * Should be used to transform plain param of given type to SolidityParam\n *\n * @method _formatInput\n * @param {String} type of param\n * @param {Object} plain param\n * @return {SolidityParam}\n */\nSolidityCoder.prototype._formatInput = function (type, param) {\n return this._requireType(type).formatInput(param, isArrayType(type));\n};\n\n/**\n * Should be used to encode plain param\n *\n * @method encodeParam\n * @param {String} type\n * @param {Object} plain param\n * @return {String} encoded plain param\n */\nSolidityCoder.prototype.encodeParam = function (type, param) {\n return this._formatInput(type, param).encode();\n};\n\n/**\n * Should be used to encode list of params\n *\n * @method encodeParams\n * @param {Array} types\n * @param {Array} params\n * @return {String} encoded list of params\n */\nSolidityCoder.prototype.encodeParams = function (types, params) {\n var self = this;\n return types.map(function (type, index) {\n return self._formatInput(type, params[index]);\n }).reduce(function (acc, solidityParam) {\n acc.append(solidityParam);\n return acc;\n }, new SolidityParam()).encode();\n};\n\n/**\n * Should be used to transform SolidityParam to plain param\n *\n * @method _formatOutput\n * @param {String} type\n * @param {SolidityParam} param\n * @return {Object} plain param\n */\nSolidityCoder.prototype._formatOutput = function (type, param) {\n return this._requireType(type).formatOutput(param, isArrayType(type));\n};\n\n/**\n * Should be used to decode bytes to plain param\n *\n * @method decodeParam\n * @param {String} type\n * @param {String} bytes\n * @return {Object} plain param\n */\nSolidityCoder.prototype.decodeParam = function (type, bytes) {\n return this._formatOutput(type, this._bytesToParam([type], bytes));\n};\n\n/**\n * Should be used to decode list of params\n *\n * @method decodeParam\n * @param {Array} types\n * @param {String} bytes\n * @return {Array} array of plain params\n */\nSolidityCoder.prototype.decodeParams = function (types, bytes) {\n var self = this;\n var param = this._bytesToParam(types, bytes);\n return types.map(function (type) {\n var solidityType = self._requireType(type);\n var p = solidityType.shiftParam(type, param);\n return solidityType.formatOutput(p, isArrayType(type));\n });\n};\n\nvar coder = new SolidityCoder([\n new SolidityType({\n name: 'address',\n match: 'strict',\n mode: 'value',\n inputFormatter: f.formatInputInt,\n outputFormatter: f.formatOutputAddress\n }),\n new SolidityType({\n name: 'bool',\n match: 'strict',\n mode: 'value',\n inputFormatter: f.formatInputBool,\n outputFormatter: f.formatOutputBool\n }),\n new SolidityType({\n name: 'int',\n match: 'prefix',\n mode: 'value',\n inputFormatter: f.formatInputInt,\n outputFormatter: f.formatOutputInt,\n }),\n new SolidityType({\n name: 'uint',\n match: 'prefix',\n mode: 'value',\n inputFormatter: f.formatInputInt,\n outputFormatter: f.formatOutputUInt\n }),\n new SolidityType({\n name: 'bytes',\n match: 'strict',\n mode: 'bytes',\n inputFormatter: f.formatInputDynamicBytes,\n outputFormatter: f.formatOutputDynamicBytes\n }),\n new SolidityType({\n name: 'bytes',\n match: 'prefix',\n mode: 'value',\n inputFormatter: f.formatInputBytes,\n outputFormatter: f.formatOutputBytes\n }),\n new SolidityType({\n name: 'real',\n match: 'prefix',\n mode: 'value',\n inputFormatter: f.formatInputReal,\n outputFormatter: f.formatOutputReal\n }),\n new SolidityType({\n name: 'ureal',\n match: 'prefix',\n mode: 'value',\n inputFormatter: f.formatInputReal,\n outputFormatter: f.formatOutputUReal\n })\n]);\n\nmodule.exports = coder;\n\n", - "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file formatters.js\n * @author Marek Kotewicz \n * @date 2015\n */\n\nvar BigNumber = require('bignumber.js');\nvar utils = require('../utils/utils');\nvar c = require('../utils/config');\nvar SolidityParam = require('./param');\n\n\n/**\n * Formats input value to byte representation of int\n * If value is negative, return it's two's complement\n * If the value is floating point, round it down\n *\n * @method formatInputInt\n * @param {String|Number|BigNumber} value that needs to be formatted\n * @returns {SolidityParam}\n */\nvar formatInputInt = function (value) {\n var padding = c.ETH_PADDING * 2;\n BigNumber.config(c.ETH_BIGNUMBER_ROUNDING_MODE);\n var result = utils.padLeft(utils.toTwosComplement(value).round().toString(16), padding);\n return new SolidityParam(result);\n};\n\n/**\n * Formats input value to byte representation of string\n *\n * @method formatInputBytes\n * @param {String}\n * @returns {SolidityParam}\n */\nvar formatInputBytes = function (value) {\n var result = utils.fromAscii(value, c.ETH_PADDING).substr(2);\n return new SolidityParam(result);\n};\n\n/**\n * Formats input value to byte representation of string\n *\n * @method formatInputDynamicBytes\n * @param {String}\n * @returns {SolidityParam}\n */\nvar formatInputDynamicBytes = function (value) {\n var result = utils.fromAscii(value, c.ETH_PADDING).substr(2);\n return new SolidityParam('', formatInputInt(value.length).value, result);\n};\n\n/**\n * Formats input value to byte representation of bool\n *\n * @method formatInputBool\n * @param {Boolean}\n * @returns {SolidityParam}\n */\nvar formatInputBool = function (value) {\n var result = '000000000000000000000000000000000000000000000000000000000000000' + (value ? '1' : '0');\n return new SolidityParam(result);\n};\n\n/**\n * Formats input value to byte representation of real\n * Values are multiplied by 2^m and encoded as integers\n *\n * @method formatInputReal\n * @param {String|Number|BigNumber}\n * @returns {SolidityParam}\n */\nvar formatInputReal = function (value) {\n return formatInputInt(new BigNumber(value).times(new BigNumber(2).pow(128)));\n};\n\n/**\n * Check if input value is negative\n *\n * @method signedIsNegative\n * @param {String} value is hex format\n * @returns {Boolean} true if it is negative, otherwise false\n */\nvar signedIsNegative = function (value) {\n return (new BigNumber(value.substr(0, 1), 16).toString(2).substr(0, 1)) === '1';\n};\n\n/**\n * Formats right-aligned output bytes to int\n *\n * @method formatOutputInt\n * @param {SolidityParam} param\n * @returns {BigNumber} right-aligned output bytes formatted to big number\n */\nvar formatOutputInt = function (param) {\n var value = param.value || \"0\";\n\n // check if it's negative number\n // it it is, return two's complement\n if (signedIsNegative(value)) {\n return new BigNumber(value, 16).minus(new BigNumber('ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff', 16)).minus(1);\n }\n return new BigNumber(value, 16);\n};\n\n/**\n * Formats right-aligned output bytes to uint\n *\n * @method formatOutputUInt\n * @param {SolidityParam}\n * @returns {BigNumeber} right-aligned output bytes formatted to uint\n */\nvar formatOutputUInt = function (param) {\n var value = param.value || \"0\";\n return new BigNumber(value, 16);\n};\n\n/**\n * Formats right-aligned output bytes to real\n *\n * @method formatOutputReal\n * @param {SolidityParam}\n * @returns {BigNumber} input bytes formatted to real\n */\nvar formatOutputReal = function (param) {\n return formatOutputInt(param).dividedBy(new BigNumber(2).pow(128)); \n};\n\n/**\n * Formats right-aligned output bytes to ureal\n *\n * @method formatOutputUReal\n * @param {SolidityParam}\n * @returns {BigNumber} input bytes formatted to ureal\n */\nvar formatOutputUReal = function (param) {\n return formatOutputUInt(param).dividedBy(new BigNumber(2).pow(128)); \n};\n\n/**\n * Should be used to format output bool\n *\n * @method formatOutputBool\n * @param {SolidityParam}\n * @returns {Boolean} right-aligned input bytes formatted to bool\n */\nvar formatOutputBool = function (param) {\n return param.value === '0000000000000000000000000000000000000000000000000000000000000001' ? true : false;\n};\n\n/**\n * Should be used to format output string\n *\n * @method formatOutputBytes\n * @param {SolidityParam} left-aligned hex representation of string\n * @returns {String} ascii string\n */\nvar formatOutputBytes = function (param) {\n // length might also be important!\n return utils.toAscii(param.value);\n};\n\n/**\n * Should be used to format output string\n *\n * @method formatOutputDynamicBytes\n * @param {SolidityParam} left-aligned hex representation of string\n * @returns {String} ascii string\n */\nvar formatOutputDynamicBytes = function (param) {\n // length might also be important!\n return utils.toAscii(param.suffix);\n};\n\n/**\n * Should be used to format output address\n *\n * @method formatOutputAddress\n * @param {SolidityParam} right-aligned input bytes\n * @returns {String} address\n */\nvar formatOutputAddress = function (param) {\n var value = param.value;\n return \"0x\" + value.slice(value.length - 40, value.length);\n};\n\nmodule.exports = {\n formatInputInt: formatInputInt,\n formatInputBytes: formatInputBytes,\n formatInputDynamicBytes: formatInputDynamicBytes,\n formatInputBool: formatInputBool,\n formatInputReal: formatInputReal,\n formatOutputInt: formatOutputInt,\n formatOutputUInt: formatOutputUInt,\n formatOutputReal: formatOutputReal,\n formatOutputUReal: formatOutputUReal,\n formatOutputBool: formatOutputBool,\n formatOutputBytes: formatOutputBytes,\n formatOutputDynamicBytes: formatOutputDynamicBytes,\n formatOutputAddress: formatOutputAddress\n};\n\n", - "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file param.js\n * @author Marek Kotewicz \n * @date 2015\n */\n\n/**\n * SolidityParam object prototype.\n * Should be used when encoding, decoding solidity bytes\n */\nvar SolidityParam = function (value, prefix, suffix) {\n this.prefix = prefix || '';\n this.value = value || '';\n this.suffix = suffix || '';\n};\n\n/**\n * This method should be used to encode two params one after another\n *\n * @method append\n * @param {SolidityParam} param that it appended after this\n */\nSolidityParam.prototype.append = function (param) {\n this.prefix += param.prefix;\n this.value += param.value;\n this.suffix += param.suffix;\n};\n\n/**\n * This method should be used to encode next param in an array\n *\n * @method appendArrayElement\n * @param {SolidityParam} param that is appended to an array\n */\nSolidityParam.prototype.appendArrayElement = function (param) {\n this.suffix += param.value;\n this.prefix += param.prefix;\n // TODO: suffix not supported = it's required for nested arrays;\n};\n\n/**\n * This method should be used to create bytearrays from param\n *\n * @method encode\n * @return {String} encoded param(s)\n */\nSolidityParam.prototype.encode = function () {\n return this.prefix + this.value + this.suffix;\n};\n\n/**\n * This method should be used to shift first param from group of params\n *\n * @method shiftValue\n * @return {SolidityParam} first value param\n */\nSolidityParam.prototype.shiftValue = function () {\n var value = this.value.slice(0, 64);\n this.value = this.value.slice(64);\n return new SolidityParam(value);\n};\n\n/**\n * This method should be used to first bytes param from group of params\n *\n * @method shiftBytes\n * @return {SolidityParam} first bytes param\n */\nSolidityParam.prototype.shiftBytes = function () {\n return this.shiftArray(1); \n};\n\n/**\n * This method should be used to shift an array from group of params \n * \n * @method shiftArray\n * @param {Number} size of an array to shift\n * @return {SolidityParam} first array param\n */\nSolidityParam.prototype.shiftArray = function (length) {\n var prefix = this.prefix.slice(0, 64);\n this.prefix = this.value.slice(64);\n var suffix = this.suffix.slice(0, 64 * length);\n this.suffix = this.suffix.slice(64 * length);\n return new SolidityParam('', prefix, suffix);\n};\n\nmodule.exports = SolidityParam;\n\n", - "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/**\n * @file utils.js\n * @author Marek Kotewicz \n * @date 2015\n */\n\n/**\n * Returns the contstructor with matching number of arguments\n *\n * @method getConstructor\n * @param {Array} abi\n * @param {Number} numberOfArgs\n * @returns {Object} constructor function abi\n */\nvar getConstructor = function (abi, numberOfArgs) {\n return abi.filter(function (f) {\n return f.type === 'constructor' && f.inputs.length === numberOfArgs;\n })[0];\n};\n\nmodule.exports = {\n getConstructor: getConstructor\n};\n\n", + "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file abi.js\n * @author Marek Kotewicz \n * @author Gav Wood \n * @date 2014\n */\n\nvar coder = require('./coder');\nvar utils = require('./utils');\n\nvar formatConstructorParams = function (abi, params) {\n var constructor = utils.getConstructor(abi, params.length);\n if (!constructor) {\n if (params.length > 0) {\n console.warn(\"didn't found matching constructor, using default one\");\n }\n return '';\n }\n\n return coder.encodeParams(constructor.inputs.map(function (input) {\n return input.type;\n }), params);\n};\n\nmodule.exports = {\n formatConstructorParams: formatConstructorParams\n};\n\n", + "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file coder.js\n * @author Marek Kotewicz \n * @date 2015\n */\n\nvar BigNumber = require('bignumber.js');\nvar utils = require('../utils/utils');\nvar f = require('./formatters');\nvar SolidityParam = require('./param');\n\n/**\n * Should be used to check if a type is an array type\n *\n * @method isArrayType\n * @param {String} type\n * @return {Bool} true is the type is an array, otherwise false\n */\nvar isArrayType = function (type) {\n return type.slice(-2) === '[]';\n};\n\n/**\n * SolidityType prototype is used to encode/decode solidity params of certain type\n */\nvar SolidityType = function (config) {\n this._name = config.name;\n this._match = config.match;\n this._mode = config.mode;\n this._inputFormatter = config.inputFormatter;\n this._outputFormatter = config.outputFormatter;\n};\n\n/**\n * Should be used to determine if this SolidityType do match given type\n *\n * @method isType\n * @param {String} name\n * @return {Bool} true if type match this SolidityType, otherwise false\n */\nSolidityType.prototype.isType = function (name) {\n if (this._match === 'strict') {\n return this._name === name || (name.indexOf(this._name) === 0 && name.slice(this._name.length) === '[]');\n } else if (this._match === 'prefix') {\n // TODO better type detection!\n return name.indexOf(this._name) === 0;\n }\n};\n\n/**\n * Should be used to transform plain param to SolidityParam object\n *\n * @method formatInput\n * @param {Object} param - plain object, or an array of objects\n * @param {Bool} arrayType - true if a param should be encoded as an array\n * @return {SolidityParam} encoded param wrapped in SolidityParam object \n */\nSolidityType.prototype.formatInput = function (param, arrayType) {\n if (utils.isArray(param) && arrayType) { // TODO: should fail if this two are not the same\n var self = this;\n return param.map(function (p) {\n return self._inputFormatter(p);\n }).reduce(function (acc, current) {\n return acc.combine(current);\n }, f.formatInputInt(param.length)).withOffset(32);\n } \n return this._inputFormatter(param);\n};\n\n/**\n * Should be used to transoform SolidityParam to plain param\n *\n * @method formatOutput\n * @param {SolidityParam} byteArray\n * @param {Bool} arrayType - true if a param should be decoded as an array\n * @return {Object} plain decoded param\n */\nSolidityType.prototype.formatOutput = function (param, arrayType) {\n if (arrayType) {\n // let's assume, that we solidity will never return long arrays :P \n var result = [];\n var length = new BigNumber(param.dynamicPart().slice(0, 64), 16);\n for (var i = 0; i < length * 64; i += 64) {\n result.push(this._outputFormatter(new SolidityParam(param.dynamicPart().substr(i + 64, 64))));\n }\n return result;\n }\n return this._outputFormatter(param);\n};\n\n/**\n * Should be used to slice single param from bytes\n *\n * @method sliceParam\n * @param {String} bytes\n * @param {Number} index of param to slice\n * @param {String} type\n * @returns {SolidityParam} param\n */\nSolidityType.prototype.sliceParam = function (bytes, index, type) {\n if (this._mode === 'bytes') {\n return SolidityParam.decodeBytes(bytes, index);\n } else if (isArrayType(type)) {\n return SolidityParam.decodeArray(bytes, index);\n }\n return SolidityParam.decodeParam(bytes, index);\n};\n\n/**\n * SolidityCoder prototype should be used to encode/decode solidity params of any type\n */\nvar SolidityCoder = function (types) {\n this._types = types;\n};\n\n/**\n * This method should be used to transform type to SolidityType\n *\n * @method _requireType\n * @param {String} type\n * @returns {SolidityType} \n * @throws {Error} throws if no matching type is found\n */\nSolidityCoder.prototype._requireType = function (type) {\n var solidityType = this._types.filter(function (t) {\n return t.isType(type);\n })[0];\n\n if (!solidityType) {\n throw Error('invalid solidity type!: ' + type);\n }\n\n return solidityType;\n};\n\n/**\n * Should be used to transform plain param of given type to SolidityParam\n *\n * @method _formatInput\n * @param {String} type of param\n * @param {Object} plain param\n * @return {SolidityParam}\n */\nSolidityCoder.prototype._formatInput = function (type, param) {\n return this._requireType(type).formatInput(param, isArrayType(type));\n};\n\n/**\n * Should be used to encode plain param\n *\n * @method encodeParam\n * @param {String} type\n * @param {Object} plain param\n * @return {String} encoded plain param\n */\nSolidityCoder.prototype.encodeParam = function (type, param) {\n return this._formatInput(type, param).encode();\n};\n\n/**\n * Should be used to encode list of params\n *\n * @method encodeParams\n * @param {Array} types\n * @param {Array} params\n * @return {String} encoded list of params\n */\nSolidityCoder.prototype.encodeParams = function (types, params) {\n var self = this;\n var solidityParams = types.map(function (type, index) {\n return self._formatInput(type, params[index]);\n });\n\n return SolidityParam.encodeList(solidityParams);\n};\n\n/**\n * Should be used to decode bytes to plain param\n *\n * @method decodeParam\n * @param {String} type\n * @param {String} bytes\n * @return {Object} plain param\n */\nSolidityCoder.prototype.decodeParam = function (type, bytes) {\n return this.decodeParams([type], bytes)[0];\n};\n\n/**\n * Should be used to decode list of params\n *\n * @method decodeParam\n * @param {Array} types\n * @param {String} bytes\n * @return {Array} array of plain params\n */\nSolidityCoder.prototype.decodeParams = function (types, bytes) {\n var self = this;\n return types.map(function (type, index) {\n var solidityType = self._requireType(type);\n var p = solidityType.sliceParam(bytes, index, type);\n return solidityType.formatOutput(p, isArrayType(type));\n });\n};\n\nvar coder = new SolidityCoder([\n new SolidityType({\n name: 'address',\n match: 'strict',\n mode: 'value',\n inputFormatter: f.formatInputInt,\n outputFormatter: f.formatOutputAddress\n }),\n new SolidityType({\n name: 'bool',\n match: 'strict',\n mode: 'value',\n inputFormatter: f.formatInputBool,\n outputFormatter: f.formatOutputBool\n }),\n new SolidityType({\n name: 'int',\n match: 'prefix',\n mode: 'value',\n inputFormatter: f.formatInputInt,\n outputFormatter: f.formatOutputInt,\n }),\n new SolidityType({\n name: 'uint',\n match: 'prefix',\n mode: 'value',\n inputFormatter: f.formatInputInt,\n outputFormatter: f.formatOutputUInt\n }),\n new SolidityType({\n name: 'bytes',\n match: 'strict',\n mode: 'bytes',\n inputFormatter: f.formatInputDynamicBytes,\n outputFormatter: f.formatOutputDynamicBytes\n }),\n new SolidityType({\n name: 'bytes',\n match: 'prefix',\n mode: 'value',\n inputFormatter: f.formatInputBytes,\n outputFormatter: f.formatOutputBytes\n }),\n new SolidityType({\n name: 'real',\n match: 'prefix',\n mode: 'value',\n inputFormatter: f.formatInputReal,\n outputFormatter: f.formatOutputReal\n }),\n new SolidityType({\n name: 'ureal',\n match: 'prefix',\n mode: 'value',\n inputFormatter: f.formatInputReal,\n outputFormatter: f.formatOutputUReal\n })\n]);\n\nmodule.exports = coder;\n\n", + "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file formatters.js\n * @author Marek Kotewicz \n * @date 2015\n */\n\nvar BigNumber = require('bignumber.js');\nvar utils = require('../utils/utils');\nvar c = require('../utils/config');\nvar SolidityParam = require('./param');\n\n\n/**\n * Formats input value to byte representation of int\n * If value is negative, return it's two's complement\n * If the value is floating point, round it down\n *\n * @method formatInputInt\n * @param {String|Number|BigNumber} value that needs to be formatted\n * @returns {SolidityParam}\n */\nvar formatInputInt = function (value) {\n var padding = c.ETH_PADDING * 2;\n BigNumber.config(c.ETH_BIGNUMBER_ROUNDING_MODE);\n var result = utils.padLeft(utils.toTwosComplement(value).round().toString(16), padding);\n return new SolidityParam(result);\n};\n\n/**\n * Formats input value to byte representation of string\n *\n * @method formatInputBytes\n * @param {String}\n * @returns {SolidityParam}\n */\nvar formatInputBytes = function (value) {\n var result = utils.fromAscii(value, c.ETH_PADDING).substr(2);\n return new SolidityParam(result);\n};\n\n/**\n * Formats input value to byte representation of string\n *\n * @method formatInputDynamicBytes\n * @param {String}\n * @returns {SolidityParam}\n */\nvar formatInputDynamicBytes = function (value) {\n var result = utils.fromAscii(value, c.ETH_PADDING).substr(2);\n return new SolidityParam(formatInputInt(value.length).value + result, 32);\n};\n\n/**\n * Formats input value to byte representation of bool\n *\n * @method formatInputBool\n * @param {Boolean}\n * @returns {SolidityParam}\n */\nvar formatInputBool = function (value) {\n var result = '000000000000000000000000000000000000000000000000000000000000000' + (value ? '1' : '0');\n return new SolidityParam(result);\n};\n\n/**\n * Formats input value to byte representation of real\n * Values are multiplied by 2^m and encoded as integers\n *\n * @method formatInputReal\n * @param {String|Number|BigNumber}\n * @returns {SolidityParam}\n */\nvar formatInputReal = function (value) {\n return formatInputInt(new BigNumber(value).times(new BigNumber(2).pow(128)));\n};\n\n/**\n * Check if input value is negative\n *\n * @method signedIsNegative\n * @param {String} value is hex format\n * @returns {Boolean} true if it is negative, otherwise false\n */\nvar signedIsNegative = function (value) {\n return (new BigNumber(value.substr(0, 1), 16).toString(2).substr(0, 1)) === '1';\n};\n\n/**\n * Formats right-aligned output bytes to int\n *\n * @method formatOutputInt\n * @param {SolidityParam} param\n * @returns {BigNumber} right-aligned output bytes formatted to big number\n */\nvar formatOutputInt = function (param) {\n var value = param.staticPart() || \"0\";\n\n // check if it's negative number\n // it it is, return two's complement\n if (signedIsNegative(value)) {\n return new BigNumber(value, 16).minus(new BigNumber('ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff', 16)).minus(1);\n }\n return new BigNumber(value, 16);\n};\n\n/**\n * Formats right-aligned output bytes to uint\n *\n * @method formatOutputUInt\n * @param {SolidityParam}\n * @returns {BigNumeber} right-aligned output bytes formatted to uint\n */\nvar formatOutputUInt = function (param) {\n var value = param.staticPart() || \"0\";\n return new BigNumber(value, 16);\n};\n\n/**\n * Formats right-aligned output bytes to real\n *\n * @method formatOutputReal\n * @param {SolidityParam}\n * @returns {BigNumber} input bytes formatted to real\n */\nvar formatOutputReal = function (param) {\n return formatOutputInt(param).dividedBy(new BigNumber(2).pow(128)); \n};\n\n/**\n * Formats right-aligned output bytes to ureal\n *\n * @method formatOutputUReal\n * @param {SolidityParam}\n * @returns {BigNumber} input bytes formatted to ureal\n */\nvar formatOutputUReal = function (param) {\n return formatOutputUInt(param).dividedBy(new BigNumber(2).pow(128)); \n};\n\n/**\n * Should be used to format output bool\n *\n * @method formatOutputBool\n * @param {SolidityParam}\n * @returns {Boolean} right-aligned input bytes formatted to bool\n */\nvar formatOutputBool = function (param) {\n return param.staticPart() === '0000000000000000000000000000000000000000000000000000000000000001' ? true : false;\n};\n\n/**\n * Should be used to format output string\n *\n * @method formatOutputBytes\n * @param {SolidityParam} left-aligned hex representation of string\n * @returns {String} ascii string\n */\nvar formatOutputBytes = function (param) {\n // length might also be important!\n return utils.toAscii(param.staticPart());\n};\n\n/**\n * Should be used to format output string\n *\n * @method formatOutputDynamicBytes\n * @param {SolidityParam} left-aligned hex representation of string\n * @returns {String} ascii string\n */\nvar formatOutputDynamicBytes = function (param) {\n // length might also be important!\n return utils.toAscii(param.dynamicPart().slice(64));\n};\n\n/**\n * Should be used to format output address\n *\n * @method formatOutputAddress\n * @param {SolidityParam} right-aligned input bytes\n * @returns {String} address\n */\nvar formatOutputAddress = function (param) {\n var value = param.staticPart();\n return \"0x\" + value.slice(value.length - 40, value.length);\n};\n\nmodule.exports = {\n formatInputInt: formatInputInt,\n formatInputBytes: formatInputBytes,\n formatInputDynamicBytes: formatInputDynamicBytes,\n formatInputBool: formatInputBool,\n formatInputReal: formatInputReal,\n formatOutputInt: formatOutputInt,\n formatOutputUInt: formatOutputUInt,\n formatOutputReal: formatOutputReal,\n formatOutputUReal: formatOutputUReal,\n formatOutputBool: formatOutputBool,\n formatOutputBytes: formatOutputBytes,\n formatOutputDynamicBytes: formatOutputDynamicBytes,\n formatOutputAddress: formatOutputAddress\n};\n\n", + "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file param.js\n * @author Marek Kotewicz \n * @date 2015\n */\n\nvar utils = require('../utils/utils');\n\n/**\n * SolidityParam object prototype.\n * Should be used when encoding, decoding solidity bytes\n */\nvar SolidityParam = function (value, offset) {\n this.value = value || '';\n this.offset = offset; // offset in bytes\n};\n\n/**\n * This method should be used to get length of params's dynamic part\n * \n * @method dynamicPartLength\n * @returns {Number} length of dynamic part (in bytes)\n */\nSolidityParam.prototype.dynamicPartLength = function () {\n return this.dynamicPart().length / 2;\n};\n\n/**\n * This method should be used to create copy of solidity param with different offset\n *\n * @method withOffset\n * @param {Number} offset length in bytes\n * @returns {SolidityParam} new solidity param with applied offset\n */\nSolidityParam.prototype.withOffset = function (offset) {\n return new SolidityParam(this.value, offset);\n};\n\n/**\n * This method should be used to combine solidity params together\n * eg. when appending an array\n *\n * @method combine\n * @param {SolidityParam} param with which we should combine\n * @param {SolidityParam} result of combination\n */\nSolidityParam.prototype.combine = function (param) {\n return new SolidityParam(this.value + param.value); \n};\n\n/**\n * This method should be called to check if param has dynamic size.\n * If it has, it returns true, otherwise false\n *\n * @method isDynamic\n * @returns {Boolean}\n */\nSolidityParam.prototype.isDynamic = function () {\n return this.value.length > 64;\n};\n\n/**\n * This method should be called to transform offset to bytes\n *\n * @method offsetAsBytes\n * @returns {String} bytes representation of offset\n */\nSolidityParam.prototype.offsetAsBytes = function () {\n return !this.isDynamic() ? '' : utils.padLeft(utils.toTwosComplement(this.offset).toString(16), 64);\n};\n\n/**\n * This method should be called to get static part of param\n *\n * @method staticPart\n * @returns {String} offset if it is a dynamic param, otherwise value\n */\nSolidityParam.prototype.staticPart = function () {\n if (!this.isDynamic()) {\n return this.value; \n } \n return this.offsetAsBytes();\n};\n\n/**\n * This method should be called to get dynamic part of param\n *\n * @method dynamicPart\n * @returns {String} returns a value if it is a dynamic param, otherwise empty string\n */\nSolidityParam.prototype.dynamicPart = function () {\n return this.isDynamic() ? this.value : '';\n};\n\n/**\n * This method should be called to encode param\n *\n * @method encode\n * @returns {String}\n */\nSolidityParam.prototype.encode = function () {\n return this.staticPart() + this.dynamicPart();\n};\n\n/**\n * This method should be called to encode array of params\n *\n * @method encodeList\n * @param {Array[SolidityParam]} params\n * @returns {String}\n */\nSolidityParam.encodeList = function (params) {\n \n // updating offsets\n var totalOffset = params.length * 32;\n var offsetParams = params.map(function (param) {\n if (!param.isDynamic()) {\n return param;\n }\n var offset = totalOffset;\n totalOffset += param.dynamicPartLength();\n return param.withOffset(offset);\n });\n\n // encode everything!\n return offsetParams.reduce(function (result, param) {\n return result + param.dynamicPart();\n }, offsetParams.reduce(function (result, param) {\n return result + param.staticPart();\n }, ''));\n};\n\n/**\n * This method should be used to decode plain (static) solidity param at given index\n *\n * @method decodeParam\n * @param {String} bytes\n * @param {Number} index\n * @returns {SolidityParam}\n */\nSolidityParam.decodeParam = function (bytes, index) {\n index = index || 0;\n return new SolidityParam(bytes.substr(index * 64, 64)); \n};\n\n/**\n * This method should be called to get offset value from bytes at given index\n *\n * @method getOffset\n * @param {String} bytes\n * @param {Number} index\n * @returns {Number} offset as number\n */\nvar getOffset = function (bytes, index) {\n // we can do this cause offset is rather small\n return parseInt('0x' + bytes.substr(index * 64, 64));\n};\n\n/**\n * This method should be called to decode solidity bytes param at given index\n *\n * @method decodeBytes\n * @param {String} bytes\n * @param {Number} index\n * @returns {SolidityParam}\n */\nSolidityParam.decodeBytes = function (bytes, index) {\n index = index || 0;\n //TODO add support for strings longer than 32 bytes\n //var length = parseInt('0x' + bytes.substr(offset * 64, 64));\n\n var offset = getOffset(bytes, index);\n\n // 2 * , cause we also parse length\n return new SolidityParam(bytes.substr(offset * 2, 2 * 64));\n};\n\n/**\n * This method should be used to decode solidity array at given index\n *\n * @method decodeArray\n * @param {String} bytes\n * @param {Number} index\n * @returns {SolidityParam}\n */\nSolidityParam.decodeArray = function (bytes, index) {\n index = index || 0;\n var offset = getOffset(bytes, index);\n var length = parseInt('0x' + bytes.substr(offset * 2, 64));\n return new SolidityParam(bytes.substr(offset * 2, (length + 1) * 64));\n};\n\nmodule.exports = SolidityParam;\n\n", + "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/**\n * @file utils.js\n * @author Marek Kotewicz \n * @date 2015\n */\n\n/**\n * Returns the contstructor with matching number of arguments\n *\n * @method getConstructor\n * @param {Array} abi\n * @param {Number} numberOfArgs\n * @returns {Object} constructor function abi\n */\nvar getConstructor = function (abi, numberOfArgs) {\n return abi.filter(function (f) {\n return f.type === 'constructor' && f.inputs.length === numberOfArgs;\n })[0];\n};\n\n//var getSupremeType = function (type) {\n //return type.substr(0, type.indexOf('[')) + ']';\n//};\n\n\nmodule.exports = {\n getConstructor: getConstructor\n};\n\n", "'use strict';\n\n// go env doesn't have and need XMLHttpRequest\nif (typeof XMLHttpRequest === 'undefined') {\n exports.XMLHttpRequest = {};\n} else {\n exports.XMLHttpRequest = XMLHttpRequest; // jshint ignore:line\n}\n\n", "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** @file config.js\n * @authors:\n * Marek Kotewicz \n * @date 2015\n */\n\n/**\n * Utils\n * \n * @module utils\n */\n\n/**\n * Utility functions\n * \n * @class [utils] config\n * @constructor\n */\n\n/// required to define ETH_BIGNUMBER_ROUNDING_MODE\nvar BigNumber = require('bignumber.js');\n\nvar ETH_UNITS = [ \n 'wei', \n 'Kwei', \n 'Mwei', \n 'Gwei', \n 'szabo', \n 'finney', \n 'ether', \n 'grand', \n 'Mether', \n 'Gether', \n 'Tether', \n 'Pether', \n 'Eether', \n 'Zether', \n 'Yether', \n 'Nether', \n 'Dether', \n 'Vether', \n 'Uether' \n];\n\nmodule.exports = {\n ETH_PADDING: 32,\n ETH_SIGNATURE_LENGTH: 4,\n ETH_UNITS: ETH_UNITS,\n ETH_BIGNUMBER_ROUNDING_MODE: { ROUNDING_MODE: BigNumber.ROUND_DOWN },\n ETH_POLLING_TIMEOUT: 1000,\n defaultBlock: 'latest',\n defaultAccount: undefined\n};\n\n", "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file utils.js\n * @author Marek Kotewicz \n * @date 2015\n */\n\n/**\n * Utils\n * \n * @module utils\n */\n\n/**\n * Utility functions\n * \n * @class [utils] utils\n * @constructor\n */\n\nvar BigNumber = require('bignumber.js');\n\nvar unitMap = {\n 'wei': '1',\n 'kwei': '1000',\n 'ada': '1000',\n 'mwei': '1000000',\n 'babbage': '1000000',\n 'gwei': '1000000000',\n 'shannon': '1000000000',\n 'szabo': '1000000000000',\n 'finney': '1000000000000000',\n 'ether': '1000000000000000000',\n 'kether': '1000000000000000000000',\n 'grand': '1000000000000000000000',\n 'einstein': '1000000000000000000000',\n 'mether': '1000000000000000000000000',\n 'gether': '1000000000000000000000000000',\n 'tether': '1000000000000000000000000000000'\n};\n\n/**\n * Should be called to pad string to expected length\n *\n * @method padLeft\n * @param {String} string to be padded\n * @param {Number} characters that result string should have\n * @param {String} sign, by default 0\n * @returns {String} right aligned string\n */\nvar padLeft = function (string, chars, sign) {\n return new Array(chars - string.length + 1).join(sign ? sign : \"0\") + string;\n};\n\n/** \n * Should be called to get sting from it's hex representation\n *\n * @method toAscii\n * @param {String} string in hex\n * @returns {String} ascii string representation of hex value\n */\nvar toAscii = function(hex) {\n// Find termination\n var str = \"\";\n var i = 0, l = hex.length;\n if (hex.substring(0, 2) === '0x') {\n i = 2;\n }\n for (; i < l; i+=2) {\n var code = parseInt(hex.substr(i, 2), 16);\n if (code === 0) {\n break;\n }\n\n str += String.fromCharCode(code);\n }\n\n return str;\n};\n \n/**\n * Shold be called to get hex representation (prefixed by 0x) of ascii string \n *\n * @method toHexNative\n * @param {String} string\n * @returns {String} hex representation of input string\n */\nvar toHexNative = function(str) {\n var hex = \"\";\n for(var i = 0; i < str.length; i++) {\n var n = str.charCodeAt(i).toString(16);\n hex += n.length < 2 ? '0' + n : n;\n }\n\n return hex;\n};\n\n/**\n * Shold be called to get hex representation (prefixed by 0x) of ascii string \n *\n * @method fromAscii\n * @param {String} string\n * @param {Number} optional padding\n * @returns {String} hex representation of input string\n */\nvar fromAscii = function(str, pad) {\n pad = pad === undefined ? 0 : pad;\n var hex = toHexNative(str);\n while (hex.length < pad*2)\n hex += \"00\";\n return \"0x\" + hex;\n};\n\n/**\n * Should be used to create full function/event name from json abi\n *\n * @method transformToFullName\n * @param {Object} json-abi\n * @return {String} full fnction/event name\n */\nvar transformToFullName = function (json) {\n if (json.name.indexOf('(') !== -1) {\n return json.name;\n }\n\n var typeName = json.inputs.map(function(i){return i.type; }).join();\n return json.name + '(' + typeName + ')';\n};\n\n/**\n * Should be called to get display name of contract function\n * \n * @method extractDisplayName\n * @param {String} name of function/event\n * @returns {String} display name for function/event eg. multiply(uint256) -> multiply\n */\nvar extractDisplayName = function (name) {\n var length = name.indexOf('('); \n return length !== -1 ? name.substr(0, length) : name;\n};\n\n/// @returns overloaded part of function/event name\nvar extractTypeName = function (name) {\n /// TODO: make it invulnerable\n var length = name.indexOf('(');\n return length !== -1 ? name.substr(length + 1, name.length - 1 - (length + 1)).replace(' ', '') : \"\";\n};\n\n/**\n * Converts value to it's decimal representation in string\n *\n * @method toDecimal\n * @param {String|Number|BigNumber}\n * @return {String}\n */\nvar toDecimal = function (value) {\n return toBigNumber(value).toNumber();\n};\n\n/**\n * Converts value to it's hex representation\n *\n * @method fromDecimal\n * @param {String|Number|BigNumber}\n * @return {String}\n */\nvar fromDecimal = function (value) {\n var number = toBigNumber(value);\n var result = number.toString(16);\n\n return number.lessThan(0) ? '-0x' + result.substr(1) : '0x' + result;\n};\n\n/**\n * Auto converts any given value into it's hex representation.\n *\n * And even stringifys objects before.\n *\n * @method toHex\n * @param {String|Number|BigNumber|Object}\n * @return {String}\n */\nvar toHex = function (val) {\n /*jshint maxcomplexity:7 */\n\n if (isBoolean(val))\n return fromDecimal(+val);\n\n if (isBigNumber(val))\n return fromDecimal(val);\n\n if (isObject(val))\n return fromAscii(JSON.stringify(val));\n\n // if its a negative number, pass it through fromDecimal\n if (isString(val)) {\n if (val.indexOf('-0x') === 0)\n return fromDecimal(val);\n else if (!isFinite(val))\n return fromAscii(val);\n }\n\n return fromDecimal(val);\n};\n\n/**\n * Returns value of unit in Wei\n *\n * @method getValueOfUnit\n * @param {String} unit the unit to convert to, default ether\n * @returns {BigNumber} value of the unit (in Wei)\n * @throws error if the unit is not correct:w\n */\nvar getValueOfUnit = function (unit) {\n unit = unit ? unit.toLowerCase() : 'ether';\n var unitValue = unitMap[unit];\n if (unitValue === undefined) {\n throw new Error('This unit doesn\\'t exists, please use the one of the following units' + JSON.stringify(unitMap, null, 2));\n }\n return new BigNumber(unitValue, 10);\n};\n\n/**\n * Takes a number of wei and converts it to any other ether unit.\n *\n * Possible units are:\n * - kwei/ada\n * - mwei/babbage\n * - gwei/shannon\n * - szabo\n * - finney\n * - ether\n * - kether/grand/einstein\n * - mether\n * - gether\n * - tether\n *\n * @method fromWei\n * @param {Number|String} number can be a number, number string or a HEX of a decimal\n * @param {String} unit the unit to convert to, default ether\n * @return {String|Object} When given a BigNumber object it returns one as well, otherwise a number\n*/\nvar fromWei = function(number, unit) {\n var returnValue = toBigNumber(number).dividedBy(getValueOfUnit(unit));\n\n return isBigNumber(number) ? returnValue : returnValue.toString(10); \n};\n\n/**\n * Takes a number of a unit and converts it to wei.\n *\n * Possible units are:\n * - kwei/ada\n * - mwei/babbage\n * - gwei/shannon\n * - szabo\n * - finney\n * - ether\n * - kether/grand/einstein\n * - mether\n * - gether\n * - tether\n *\n * @method toWei\n * @param {Number|String|BigNumber} number can be a number, number string or a HEX of a decimal\n * @param {String} unit the unit to convert from, default ether\n * @return {String|Object} When given a BigNumber object it returns one as well, otherwise a number\n*/\nvar toWei = function(number, unit) {\n var returnValue = toBigNumber(number).times(getValueOfUnit(unit));\n\n return isBigNumber(number) ? returnValue : returnValue.toString(10); \n};\n\n/**\n * Takes an input and transforms it into an bignumber\n *\n * @method toBigNumber\n * @param {Number|String|BigNumber} a number, string, HEX string or BigNumber\n * @return {BigNumber} BigNumber\n*/\nvar toBigNumber = function(number) {\n /*jshint maxcomplexity:5 */\n number = number || 0;\n if (isBigNumber(number))\n return number;\n\n if (isString(number) && (number.indexOf('0x') === 0 || number.indexOf('-0x') === 0)) {\n return new BigNumber(number.replace('0x',''), 16);\n }\n \n return new BigNumber(number.toString(10), 10);\n};\n\n/**\n * Takes and input transforms it into bignumber and if it is negative value, into two's complement\n *\n * @method toTwosComplement\n * @param {Number|String|BigNumber}\n * @return {BigNumber}\n */\nvar toTwosComplement = function (number) {\n var bigNumber = toBigNumber(number);\n if (bigNumber.lessThan(0)) {\n return new BigNumber(\"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\", 16).plus(bigNumber).plus(1);\n }\n return bigNumber;\n};\n\n/**\n * Checks if the given string is strictly an address\n *\n * @method isStrictAddress\n * @param {String} address the given HEX adress\n * @return {Boolean}\n*/\nvar isStrictAddress = function (address) {\n return /^0x[0-9a-f]{40}$/.test(address);\n};\n\n/**\n * Checks if the given string is an address\n *\n * @method isAddress\n * @param {String} address the given HEX adress\n * @return {Boolean}\n*/\nvar isAddress = function (address) {\n return /^(0x)?[0-9a-f]{40}$/.test(address);\n};\n\n/**\n * Transforms given string to valid 20 bytes-length addres with 0x prefix\n *\n * @method toAddress\n * @param {String} address\n * @return {String} formatted address\n */\nvar toAddress = function (address) {\n if (isStrictAddress(address)) {\n return address;\n }\n \n if (/^[0-9a-f]{40}$/.test(address)) {\n return '0x' + address;\n }\n\n return '0x' + padLeft(toHex(address).substr(2), 40);\n};\n\n/**\n * Returns true if object is BigNumber, otherwise false\n *\n * @method isBigNumber\n * @param {Object}\n * @return {Boolean} \n */\nvar isBigNumber = function (object) {\n return object instanceof BigNumber ||\n (object && object.constructor && object.constructor.name === 'BigNumber');\n};\n\n/**\n * Returns true if object is string, otherwise false\n * \n * @method isString\n * @param {Object}\n * @return {Boolean}\n */\nvar isString = function (object) {\n return typeof object === 'string' ||\n (object && object.constructor && object.constructor.name === 'String');\n};\n\n/**\n * Returns true if object is function, otherwise false\n *\n * @method isFunction\n * @param {Object}\n * @return {Boolean}\n */\nvar isFunction = function (object) {\n return typeof object === 'function';\n};\n\n/**\n * Returns true if object is Objet, otherwise false\n *\n * @method isObject\n * @param {Object}\n * @return {Boolean}\n */\nvar isObject = function (object) {\n return typeof object === 'object';\n};\n\n/**\n * Returns true if object is boolean, otherwise false\n *\n * @method isBoolean\n * @param {Object}\n * @return {Boolean}\n */\nvar isBoolean = function (object) {\n return typeof object === 'boolean';\n};\n\n/**\n * Returns true if object is array, otherwise false\n *\n * @method isArray\n * @param {Object}\n * @return {Boolean}\n */\nvar isArray = function (object) {\n return object instanceof Array; \n};\n\n/**\n * Returns true if given string is valid json object\n * \n * @method isJson\n * @param {String}\n * @return {Boolean}\n */\nvar isJson = function (str) {\n try {\n return !!JSON.parse(str);\n } catch (e) {\n return false;\n }\n};\n\nmodule.exports = {\n padLeft: padLeft,\n toHex: toHex,\n toDecimal: toDecimal,\n fromDecimal: fromDecimal,\n toAscii: toAscii,\n fromAscii: fromAscii,\n transformToFullName: transformToFullName,\n extractDisplayName: extractDisplayName,\n extractTypeName: extractTypeName,\n toWei: toWei,\n fromWei: fromWei,\n toBigNumber: toBigNumber,\n toTwosComplement: toTwosComplement,\n toAddress: toAddress,\n isBigNumber: isBigNumber,\n isStrictAddress: isStrictAddress,\n isAddress: isAddress,\n isFunction: isFunction,\n isString: isString,\n isObject: isObject,\n isBoolean: isBoolean,\n isArray: isArray,\n isJson: isJson\n};\n\n", - "module.exports={\n \"version\": \"0.3.3\"\n}\n", + "module.exports={\n \"version\": \"0.3.6\"\n}\n", "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** @file web3.js\n * @authors:\n * Jeffrey Wilcke \n * Marek Kotewicz \n * Marian Oancea \n * Fabian Vogelsteller \n * Gav Wood \n * @date 2014\n */\n\nvar version = require('./version.json');\nvar net = require('./web3/net');\nvar eth = require('./web3/eth');\nvar db = require('./web3/db');\nvar shh = require('./web3/shh');\nvar watches = require('./web3/watches');\nvar Filter = require('./web3/filter');\nvar utils = require('./utils/utils');\nvar formatters = require('./web3/formatters');\nvar RequestManager = require('./web3/requestmanager');\nvar c = require('./utils/config');\nvar Method = require('./web3/method');\nvar Property = require('./web3/property');\n\nvar web3Methods = [\n new Method({\n name: 'sha3',\n call: 'web3_sha3',\n params: 1\n })\n];\n\nvar web3Properties = [\n new Property({\n name: 'version.client',\n getter: 'web3_clientVersion'\n }),\n new Property({\n name: 'version.network',\n getter: 'net_version',\n inputFormatter: utils.toDecimal\n }),\n new Property({\n name: 'version.ethereum',\n getter: 'eth_protocolVersion',\n inputFormatter: utils.toDecimal\n }),\n new Property({\n name: 'version.whisper',\n getter: 'shh_version',\n inputFormatter: utils.toDecimal\n })\n];\n\n/// creates methods in a given object based on method description on input\n/// setups api calls for these methods\nvar setupMethods = function (obj, methods) {\n methods.forEach(function (method) {\n method.attachToObject(obj);\n });\n};\n\n/// creates properties in a given object based on properties description on input\n/// setups api calls for these properties\nvar setupProperties = function (obj, properties) {\n properties.forEach(function (property) {\n property.attachToObject(obj);\n });\n};\n\n/// setups web3 object, and it's in-browser executed methods\nvar web3 = {};\nweb3.providers = {};\nweb3.version = {};\nweb3.version.api = version.version;\nweb3.eth = {};\n\n/*jshint maxparams:4 */\nweb3.eth.filter = function (fil, eventParams, options, formatter) {\n\n // if its event, treat it differently\n // TODO: simplify and remove\n if (fil._isEvent) {\n return fil(eventParams, options);\n }\n\n // what outputLogFormatter? that's wrong\n //return new Filter(fil, watches.eth(), formatters.outputLogFormatter);\n return new Filter(fil, watches.eth(), formatter || formatters.outputLogFormatter);\n};\n/*jshint maxparams:3 */\n\nweb3.shh = {};\nweb3.shh.filter = function (fil) {\n return new Filter(fil, watches.shh(), formatters.outputPostFormatter);\n};\nweb3.net = {};\nweb3.db = {};\nweb3.setProvider = function (provider) {\n RequestManager.getInstance().setProvider(provider);\n};\nweb3.reset = function () {\n RequestManager.getInstance().reset();\n c.defaultBlock = 'latest';\n c.defaultAccount = undefined;\n};\nweb3.toHex = utils.toHex;\nweb3.toAscii = utils.toAscii;\nweb3.fromAscii = utils.fromAscii;\nweb3.toDecimal = utils.toDecimal;\nweb3.fromDecimal = utils.fromDecimal;\nweb3.toBigNumber = utils.toBigNumber;\nweb3.toWei = utils.toWei;\nweb3.fromWei = utils.fromWei;\nweb3.isAddress = utils.isAddress;\n\n// ADD defaultblock\nObject.defineProperty(web3.eth, 'defaultBlock', {\n get: function () {\n return c.defaultBlock;\n },\n set: function (val) {\n c.defaultBlock = val;\n return val;\n }\n});\n\nObject.defineProperty(web3.eth, 'defaultAccount', {\n get: function () {\n return c.defaultAccount;\n },\n set: function (val) {\n c.defaultAccount = val;\n return val;\n }\n});\n\n/// setups all api methods\nsetupMethods(web3, web3Methods);\nsetupProperties(web3, web3Properties);\nsetupMethods(web3.net, net.methods);\nsetupProperties(web3.net, net.properties);\nsetupMethods(web3.eth, eth.methods);\nsetupProperties(web3.eth, eth.properties);\nsetupMethods(web3.db, db.methods);\nsetupMethods(web3.shh, shh.methods);\n\nmodule.exports = web3;\n\n", "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file contract.js\n * @author Marek Kotewicz \n * @date 2014\n */\n\nvar web3 = require('../web3'); \nvar solAbi = require('../solidity/abi');\nvar utils = require('../utils/utils');\nvar SolidityEvent = require('./event');\nvar SolidityFunction = require('./function');\n\nvar addFunctionsToContract = function (contract, desc) {\n desc.filter(function (json) {\n return json.type === 'function';\n }).map(function (json) {\n return new SolidityFunction(json, contract.address);\n }).forEach(function (f) {\n f.attachToContract(contract);\n });\n};\n\nvar addEventsToContract = function (contract, desc) {\n desc.filter(function (json) {\n return json.type === 'event';\n }).map(function (json) {\n return new SolidityEvent(json, contract.address);\n }).forEach(function (e) {\n e.attachToContract(contract);\n });\n};\n\n/**\n * This method should be called when we want to call / transact some solidity method from javascript\n * it returns an object which has same methods available as solidity contract description\n * usage example: \n *\n * var abi = [{\n * name: 'myMethod',\n * inputs: [{ name: 'a', type: 'string' }],\n * outputs: [{name: 'd', type: 'string' }]\n * }]; // contract abi\n *\n * var MyContract = web3.eth.contract(abi); // creation of contract prototype\n *\n * var contractInstance = new MyContract('0x0123123121');\n *\n * contractInstance.myMethod('this is test string param for call'); // myMethod call (implicit, default)\n * contractInstance.call().myMethod('this is test string param for call'); // myMethod call (explicit)\n * contractInstance.sendTransaction().myMethod('this is test string param for transact'); // myMethod sendTransaction\n *\n * @param abi - abi json description of the contract, which is being created\n * @returns contract object\n */\nvar contract = function (abi) {\n\n // return prototype\n return Contract.bind(null, abi);\n};\n\nvar Contract = function (abi, options) {\n\n this.address = '';\n if (utils.isAddress(options)) {\n this.address = options;\n } else { // is an object!\n // TODO, parse the rest of the args\n options = options || {};\n var args = Array.prototype.slice.call(arguments, 2);\n var bytes = solAbi.formatConstructorParams(abi, args);\n options.data += bytes;\n this.address = web3.eth.sendTransaction(options);\n }\n\n addFunctionsToContract(this, abi);\n addEventsToContract(this, abi);\n};\n\nContract.prototype.call = function () {\n console.error('contract.call is deprecated');\n return this;\n};\n\nContract.prototype.sendTransaction = function () {\n console.error('contract.sendTransact is deprecated');\n return this;\n};\n\nmodule.exports = contract;\n\n", "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** @file db.js\n * @authors:\n * Marek Kotewicz \n * @date 2015\n */\n\nvar Method = require('./method');\n\nvar putString = new Method({\n name: 'putString',\n call: 'db_putString',\n params: 3\n});\n\n\nvar getString = new Method({\n name: 'getString',\n call: 'db_getString',\n params: 2\n});\n\nvar putHex = new Method({\n name: 'putHex',\n call: 'db_putHex',\n params: 3\n});\n\nvar getHex = new Method({\n name: 'getHex',\n call: 'db_getHex',\n params: 2\n});\n\nvar methods = [\n putString, getString, putHex, getHex\n];\n\nmodule.exports = {\n methods: methods\n};\n", "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file errors.js\n * @author Marek Kotewicz \n * @date 2015\n */\n\nmodule.exports = {\n InvalidNumberOfParams: function () {\n return new Error('Invalid number of input parameters');\n },\n InvalidConnection: function (host){\n return new Error('CONNECTION ERROR: Couldn\\'t connect to node '+ host +', is it running?');\n },\n InvalidProvider: function () {\n return new Error('Providor not set or invalid');\n },\n InvalidResponse: function (result){\n var message = !!result && !!result.error && !!result.error.message ? result.error.message : 'Invalid JSON RPC response';\n return new Error(message);\n }\n};\n\n", - "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/**\n * @file eth.js\n * @author Marek Kotewicz \n * @author Fabian Vogelsteller \n * @date 2015\n */\n\n/**\n * Web3\n * \n * @module web3\n */\n\n/**\n * Eth methods and properties\n *\n * An example method object can look as follows:\n *\n * {\n * name: 'getBlock',\n * call: blockCall,\n * params: 2,\n * outputFormatter: formatters.outputBlockFormatter,\n * inputFormatter: [ // can be a formatter funciton or an array of functions. Where each item in the array will be used for one parameter\n * utils.toHex, // formats paramter 1\n * function(param){ return !!param; } // formats paramter 2\n * ]\n * },\n *\n * @class [web3] eth\n * @constructor\n */\n\n\"use strict\";\n\nvar formatters = require('./formatters');\nvar utils = require('../utils/utils');\nvar Method = require('./method');\nvar Property = require('./property');\n\nvar blockCall = function (args) {\n return (utils.isString(args[0]) && args[0].indexOf('0x') === 0) ? \"eth_getBlockByHash\" : \"eth_getBlockByNumber\";\n};\n\nvar transactionFromBlockCall = function (args) {\n return (utils.isString(args[0]) && args[0].indexOf('0x') === 0) ? 'eth_getTransactionByBlockHashAndIndex' : 'eth_getTransactionByBlockNumberAndIndex';\n};\n\nvar uncleCall = function (args) {\n return (utils.isString(args[0]) && args[0].indexOf('0x') === 0) ? 'eth_getUncleByBlockHashAndIndex' : 'eth_getUncleByBlockNumberAndIndex';\n};\n\nvar getBlockTransactionCountCall = function (args) {\n return (utils.isString(args[0]) && args[0].indexOf('0x') === 0) ? 'eth_getBlockTransactionCountByHash' : 'eth_getBlockTransactionCountByNumber';\n};\n\nvar uncleCountCall = function (args) {\n return (utils.isString(args[0]) && args[0].indexOf('0x') === 0) ? 'eth_getUncleCountByBlockHash' : 'eth_getUncleCountByBlockNumber';\n};\n\n/// @returns an array of objects describing web3.eth api methods\n\nvar getBalance = new Method({\n name: 'getBalance', \n call: 'eth_getBalance', \n params: 2,\n inputFormatter: [utils.toAddress, formatters.inputDefaultBlockNumberFormatter],\n outputFormatter: formatters.outputBigNumberFormatter\n});\n\nvar getStorageAt = new Method({\n name: 'getStorageAt', \n call: 'eth_getStorageAt', \n params: 3,\n inputFormatter: [null, utils.toHex, formatters.inputDefaultBlockNumberFormatter]\n});\n\nvar getCode = new Method({\n name: 'getCode',\n call: 'eth_getCode',\n params: 2,\n inputFormatter: [utils.toAddress, formatters.inputDefaultBlockNumberFormatter]\n});\n\nvar getBlock = new Method({\n name: 'getBlock', \n call: blockCall,\n params: 2,\n inputFormatter: [formatters.inputBlockNumberFormatter, function (val) { return !!val; }],\n outputFormatter: formatters.outputBlockFormatter\n});\n\nvar getUncle = new Method({\n name: 'getUncle',\n call: uncleCall,\n params: 2,\n inputFormatter: [formatters.inputBlockNumberFormatter, utils.toHex],\n outputFormatter: formatters.outputBlockFormatter,\n\n});\n\nvar getCompilers = new Method({\n name: 'getCompilers',\n call: 'eth_getCompilers',\n params: 0\n});\n\nvar getBlockTransactionCount = new Method({\n name: 'getBlockTransactionCount',\n call: getBlockTransactionCountCall,\n params: 1,\n inputFormatter: [formatters.inputBlockNumberFormatter],\n outputFormatter: utils.toDecimal\n});\n\nvar getBlockUncleCount = new Method({\n name: 'getBlockUncleCount',\n call: uncleCountCall,\n params: 1,\n inputFormatter: [formatters.inputBlockNumberFormatter],\n outputFormatter: utils.toDecimal\n});\n\nvar getTransaction = new Method({\n name: 'getTransaction',\n call: 'eth_getTransactionByHash',\n params: 1,\n outputFormatter: formatters.outputTransactionFormatter\n});\n\nvar getTransactionFromBlock = new Method({\n name: 'getTransactionFromBlock',\n call: transactionFromBlockCall,\n params: 2,\n inputFormatter: [formatters.inputBlockNumberFormatter, utils.toHex],\n outputFormatter: formatters.outputTransactionFormatter\n});\n\nvar getTransactionCount = new Method({\n name: 'getTransactionCount',\n call: 'eth_getTransactionCount',\n params: 2,\n inputFormatter: [null, formatters.inputDefaultBlockNumberFormatter],\n outputFormatter: utils.toDecimal\n});\n\nvar sendTransaction = new Method({\n name: 'sendTransaction',\n call: 'eth_sendTransaction',\n params: 1,\n inputFormatter: [formatters.inputTransactionFormatter]\n});\n\nvar call = new Method({\n name: 'call',\n call: 'eth_call',\n params: 2,\n inputFormatter: [formatters.inputTransactionFormatter, formatters.inputDefaultBlockNumberFormatter]\n});\n\nvar compileSolidity = new Method({\n name: 'compile.solidity',\n call: 'eth_compileSolidity',\n params: 1\n});\n\nvar compileLLL = new Method({\n name: 'compile.lll',\n call: 'eth_compileLLL',\n params: 1\n});\n\nvar compileSerpent = new Method({\n name: 'compile.serpent',\n call: 'eth_compileSerpent',\n params: 1\n});\n\nvar methods = [\n getBalance,\n getStorageAt,\n getCode,\n getBlock,\n getUncle,\n getCompilers,\n getBlockTransactionCount,\n getBlockUncleCount,\n getTransaction,\n getTransactionFromBlock,\n getTransactionCount,\n call,\n sendTransaction,\n compileSolidity,\n compileLLL,\n compileSerpent,\n];\n\n/// @returns an array of objects describing web3.eth api properties\n\n\n\nvar properties = [\n new Property({\n name: 'coinbase',\n getter: 'eth_coinbase'\n }),\n new Property({\n name: 'mining',\n getter: 'eth_mining'\n }),\n new Property({\n name: 'gasPrice',\n getter: 'eth_gasPrice',\n outputFormatter: formatters.outputBigNumberFormatter\n }),\n new Property({\n name: 'accounts',\n getter: 'eth_accounts'\n }),\n new Property({\n name: 'blockNumber',\n getter: 'eth_blockNumber',\n outputFormatter: utils.toDecimal\n })\n];\n\nmodule.exports = {\n methods: methods,\n properties: properties\n};\n\n", - "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file event.js\n * @author Marek Kotewicz \n * @date 2014\n */\n\nvar utils = require('../utils/utils');\nvar coder = require('../solidity/coder');\nvar web3 = require('../web3');\nvar formatters = require('./formatters');\n\n/**\n * This prototype should be used to create event filters\n */\nvar SolidityEvent = function (json, address) {\n this._params = json.inputs;\n this._name = utils.transformToFullName(json);\n this._address = address;\n this._anonymous = json.anonymous;\n};\n\n/**\n * Should be used to get filtered param types\n *\n * @method types\n * @param {Bool} decide if returned typed should be indexed\n * @return {Array} array of types\n */\nSolidityEvent.prototype.types = function (indexed) {\n return this._params.filter(function (i) {\n return i.indexed === indexed;\n }).map(function (i) {\n return i.type;\n });\n};\n\n/**\n * Should be used to get event display name\n *\n * @method displayName\n * @return {String} event display name\n */\nSolidityEvent.prototype.displayName = function () {\n return utils.extractDisplayName(this._name);\n};\n\n/**\n * Should be used to get event type name\n *\n * @method typeName\n * @return {String} event type name\n */\nSolidityEvent.prototype.typeName = function () {\n return utils.extractTypeName(this._name);\n};\n\n/**\n * Should be used to get event signature\n *\n * @method signature\n * @return {String} event signature\n */\nSolidityEvent.prototype.signature = function () {\n return web3.sha3(web3.fromAscii(this._name)).slice(2);\n};\n\n/**\n * Should be used to encode indexed params and options to one final object\n * \n * @method encode\n * @param {Object} indexed\n * @param {Object} options\n * @return {Object} everything combined together and encoded\n */\nSolidityEvent.prototype.encode = function (indexed, options) {\n indexed = indexed || {};\n options = options || {};\n var result = {};\n\n ['fromBlock', 'toBlock'].filter(function (f) {\n return options[f] !== undefined;\n }).forEach(function (f) {\n result[f] = utils.toHex(options[f]);\n });\n\n result.topics = [];\n\n if (!this._anonymous) {\n result.address = this._address;\n result.topics.push('0x' + this.signature());\n }\n\n var indexedTopics = this._params.filter(function (i) {\n return i.indexed === true;\n }).map(function (i) {\n var value = indexed[i.name];\n if (value === undefined || value === null) {\n return null;\n }\n \n if (utils.isArray(value)) {\n return value.map(function (v) {\n return '0x' + coder.encodeParam(i.type, v);\n });\n }\n return '0x' + coder.encodeParam(i.type, value);\n });\n\n result.topics = result.topics.concat(indexedTopics);\n\n return result;\n};\n\n/**\n * Should be used to decode indexed params and options\n *\n * @method decode\n * @param {Object} data\n * @return {Object} result object with decoded indexed && not indexed params\n */\nSolidityEvent.prototype.decode = function (data) {\n \n data.data = data.data || '';\n data.topics = data.topics || [];\n\n var argTopics = this._anonymous ? data.topics : data.topics.slice(1);\n var indexedData = argTopics.map(function (topics) { return topics.slice(2); }).join(\"\");\n var indexedParams = coder.decodeParams(this.types(true), indexedData); \n\n var notIndexedData = data.data.slice(2);\n var notIndexedParams = coder.decodeParams(this.types(false), notIndexedData);\n \n var result = formatters.outputLogFormatter(data);\n result.event = this.displayName();\n result.address = data.address;\n\n result.args = this._params.reduce(function (acc, current) {\n acc[current.name] = current.indexed ? indexedParams.shift() : notIndexedParams.shift();\n return acc;\n }, {});\n\n delete result.data;\n delete result.topics;\n\n return result;\n};\n\n/**\n * Should be used to create new filter object from event\n *\n * @method execute\n * @param {Object} indexed\n * @param {Object} options\n * @return {Object} filter object\n */\nSolidityEvent.prototype.execute = function (indexed, options) {\n var o = this.encode(indexed, options);\n var formatter = this.decode.bind(this);\n return web3.eth.filter(o, undefined, undefined, formatter);\n};\n\n/**\n * Should be used to attach event to contract object\n *\n * @method attachToContract\n * @param {Contract}\n */\nSolidityEvent.prototype.attachToContract = function (contract) {\n var execute = this.execute.bind(this);\n var displayName = this.displayName();\n if (!contract[displayName]) {\n contract[displayName] = execute;\n }\n contract[displayName][this.typeName()] = this.execute.bind(this, contract);\n};\n\nmodule.exports = SolidityEvent;\n\n", + "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/**\n * @file eth.js\n * @author Marek Kotewicz \n * @author Fabian Vogelsteller \n * @date 2015\n */\n\n/**\n * Web3\n *\n * @module web3\n */\n\n/**\n * Eth methods and properties\n *\n * An example method object can look as follows:\n *\n * {\n * name: 'getBlock',\n * call: blockCall,\n * params: 2,\n * outputFormatter: formatters.outputBlockFormatter,\n * inputFormatter: [ // can be a formatter funciton or an array of functions. Where each item in the array will be used for one parameter\n * utils.toHex, // formats paramter 1\n * function(param){ return !!param; } // formats paramter 2\n * ]\n * },\n *\n * @class [web3] eth\n * @constructor\n */\n\n\"use strict\";\n\nvar formatters = require('./formatters');\nvar utils = require('../utils/utils');\nvar Method = require('./method');\nvar Property = require('./property');\n\nvar blockCall = function (args) {\n return (utils.isString(args[0]) && args[0].indexOf('0x') === 0) ? \"eth_getBlockByHash\" : \"eth_getBlockByNumber\";\n};\n\nvar transactionFromBlockCall = function (args) {\n return (utils.isString(args[0]) && args[0].indexOf('0x') === 0) ? 'eth_getTransactionByBlockHashAndIndex' : 'eth_getTransactionByBlockNumberAndIndex';\n};\n\nvar uncleCall = function (args) {\n return (utils.isString(args[0]) && args[0].indexOf('0x') === 0) ? 'eth_getUncleByBlockHashAndIndex' : 'eth_getUncleByBlockNumberAndIndex';\n};\n\nvar getBlockTransactionCountCall = function (args) {\n return (utils.isString(args[0]) && args[0].indexOf('0x') === 0) ? 'eth_getBlockTransactionCountByHash' : 'eth_getBlockTransactionCountByNumber';\n};\n\nvar uncleCountCall = function (args) {\n return (utils.isString(args[0]) && args[0].indexOf('0x') === 0) ? 'eth_getUncleCountByBlockHash' : 'eth_getUncleCountByBlockNumber';\n};\n\n/// @returns an array of objects describing web3.eth api methods\n\nvar getBalance = new Method({\n name: 'getBalance',\n call: 'eth_getBalance',\n params: 2,\n inputFormatter: [utils.toAddress, formatters.inputDefaultBlockNumberFormatter],\n outputFormatter: formatters.outputBigNumberFormatter\n});\n\nvar getStorageAt = new Method({\n name: 'getStorageAt',\n call: 'eth_getStorageAt',\n params: 3,\n inputFormatter: [null, utils.toHex, formatters.inputDefaultBlockNumberFormatter]\n});\n\nvar getCode = new Method({\n name: 'getCode',\n call: 'eth_getCode',\n params: 2,\n inputFormatter: [utils.toAddress, formatters.inputDefaultBlockNumberFormatter]\n});\n\nvar getBlock = new Method({\n name: 'getBlock',\n call: blockCall,\n params: 2,\n inputFormatter: [formatters.inputBlockNumberFormatter, function (val) { return !!val; }],\n outputFormatter: formatters.outputBlockFormatter\n});\n\nvar getUncle = new Method({\n name: 'getUncle',\n call: uncleCall,\n params: 2,\n inputFormatter: [formatters.inputBlockNumberFormatter, utils.toHex],\n outputFormatter: formatters.outputBlockFormatter,\n\n});\n\nvar getCompilers = new Method({\n name: 'getCompilers',\n call: 'eth_getCompilers',\n params: 0\n});\n\nvar getBlockTransactionCount = new Method({\n name: 'getBlockTransactionCount',\n call: getBlockTransactionCountCall,\n params: 1,\n inputFormatter: [formatters.inputBlockNumberFormatter],\n outputFormatter: utils.toDecimal\n});\n\nvar getBlockUncleCount = new Method({\n name: 'getBlockUncleCount',\n call: uncleCountCall,\n params: 1,\n inputFormatter: [formatters.inputBlockNumberFormatter],\n outputFormatter: utils.toDecimal\n});\n\nvar getTransaction = new Method({\n name: 'getTransaction',\n call: 'eth_getTransactionByHash',\n params: 1,\n outputFormatter: formatters.outputTransactionFormatter\n});\n\nvar getTransactionFromBlock = new Method({\n name: 'getTransactionFromBlock',\n call: transactionFromBlockCall,\n params: 2,\n inputFormatter: [formatters.inputBlockNumberFormatter, utils.toHex],\n outputFormatter: formatters.outputTransactionFormatter\n});\n\nvar getTransactionCount = new Method({\n name: 'getTransactionCount',\n call: 'eth_getTransactionCount',\n params: 2,\n inputFormatter: [null, formatters.inputDefaultBlockNumberFormatter],\n outputFormatter: utils.toDecimal\n});\n\nvar sendTransaction = new Method({\n name: 'sendTransaction',\n call: 'eth_sendTransaction',\n params: 1,\n inputFormatter: [formatters.inputTransactionFormatter]\n});\n\nvar call = new Method({\n name: 'call',\n call: 'eth_call',\n params: 2,\n inputFormatter: [formatters.inputTransactionFormatter, formatters.inputDefaultBlockNumberFormatter]\n});\n\nvar compileSolidity = new Method({\n name: 'compile.solidity',\n call: 'eth_compileSolidity',\n params: 1\n});\n\nvar compileLLL = new Method({\n name: 'compile.lll',\n call: 'eth_compileLLL',\n params: 1\n});\n\nvar compileSerpent = new Method({\n name: 'compile.serpent',\n call: 'eth_compileSerpent',\n params: 1\n});\n\nvar methods = [\n getBalance,\n getStorageAt,\n getCode,\n getBlock,\n getUncle,\n getCompilers,\n getBlockTransactionCount,\n getBlockUncleCount,\n getTransaction,\n getTransactionFromBlock,\n getTransactionCount,\n call,\n sendTransaction,\n compileSolidity,\n compileLLL,\n compileSerpent,\n];\n\n/// @returns an array of objects describing web3.eth api properties\n\n\n\nvar properties = [\n new Property({\n name: 'coinbase',\n getter: 'eth_coinbase'\n }),\n new Property({\n name: 'mining',\n getter: 'eth_mining'\n }),\n new Property({\n name: 'hashrate',\n getter: 'eth_hashrate',\n outputFormatter: utils.toDecimal\n }),\n new Property({\n name: 'gasPrice',\n getter: 'eth_gasPrice',\n outputFormatter: formatters.outputBigNumberFormatter\n }),\n new Property({\n name: 'accounts',\n getter: 'eth_accounts'\n }),\n new Property({\n name: 'blockNumber',\n getter: 'eth_blockNumber',\n outputFormatter: utils.toDecimal\n })\n];\n\nmodule.exports = {\n methods: methods,\n properties: properties\n};\n\n", + "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file event.js\n * @author Marek Kotewicz \n * @date 2014\n */\n\nvar utils = require('../utils/utils');\nvar coder = require('../solidity/coder');\nvar web3 = require('../web3');\nvar formatters = require('./formatters');\n\n/**\n * This prototype should be used to create event filters\n */\nvar SolidityEvent = function (json, address) {\n this._params = json.inputs;\n this._name = utils.transformToFullName(json);\n this._address = address;\n this._anonymous = json.anonymous;\n};\n\n/**\n * Should be used to get filtered param types\n *\n * @method types\n * @param {Bool} decide if returned typed should be indexed\n * @return {Array} array of types\n */\nSolidityEvent.prototype.types = function (indexed) {\n return this._params.filter(function (i) {\n return i.indexed === indexed;\n }).map(function (i) {\n return i.type;\n });\n};\n\n/**\n * Should be used to get event display name\n *\n * @method displayName\n * @return {String} event display name\n */\nSolidityEvent.prototype.displayName = function () {\n return utils.extractDisplayName(this._name);\n};\n\n/**\n * Should be used to get event type name\n *\n * @method typeName\n * @return {String} event type name\n */\nSolidityEvent.prototype.typeName = function () {\n return utils.extractTypeName(this._name);\n};\n\n/**\n * Should be used to get event signature\n *\n * @method signature\n * @return {String} event signature\n */\nSolidityEvent.prototype.signature = function () {\n return web3.sha3(web3.fromAscii(this._name)).slice(2);\n};\n\n/**\n * Should be used to encode indexed params and options to one final object\n * \n * @method encode\n * @param {Object} indexed\n * @param {Object} options\n * @return {Object} everything combined together and encoded\n */\nSolidityEvent.prototype.encode = function (indexed, options) {\n indexed = indexed || {};\n options = options || {};\n var result = {};\n\n ['fromBlock', 'toBlock'].filter(function (f) {\n return options[f] !== undefined;\n }).forEach(function (f) {\n result[f] = formatters.inputBlockNumberFormatter(options[f]);\n });\n\n result.topics = [];\n\n if (!this._anonymous) {\n result.address = this._address;\n result.topics.push('0x' + this.signature());\n }\n\n var indexedTopics = this._params.filter(function (i) {\n return i.indexed === true;\n }).map(function (i) {\n var value = indexed[i.name];\n if (value === undefined || value === null) {\n return null;\n }\n \n if (utils.isArray(value)) {\n return value.map(function (v) {\n return '0x' + coder.encodeParam(i.type, v);\n });\n }\n return '0x' + coder.encodeParam(i.type, value);\n });\n\n result.topics = result.topics.concat(indexedTopics);\n\n return result;\n};\n\n/**\n * Should be used to decode indexed params and options\n *\n * @method decode\n * @param {Object} data\n * @return {Object} result object with decoded indexed && not indexed params\n */\nSolidityEvent.prototype.decode = function (data) {\n \n data.data = data.data || '';\n data.topics = data.topics || [];\n\n var argTopics = this._anonymous ? data.topics : data.topics.slice(1);\n var indexedData = argTopics.map(function (topics) { return topics.slice(2); }).join(\"\");\n var indexedParams = coder.decodeParams(this.types(true), indexedData); \n\n var notIndexedData = data.data.slice(2);\n var notIndexedParams = coder.decodeParams(this.types(false), notIndexedData);\n \n var result = formatters.outputLogFormatter(data);\n result.event = this.displayName();\n result.address = data.address;\n\n result.args = this._params.reduce(function (acc, current) {\n acc[current.name] = current.indexed ? indexedParams.shift() : notIndexedParams.shift();\n return acc;\n }, {});\n\n delete result.data;\n delete result.topics;\n\n return result;\n};\n\n/**\n * Should be used to create new filter object from event\n *\n * @method execute\n * @param {Object} indexed\n * @param {Object} options\n * @return {Object} filter object\n */\nSolidityEvent.prototype.execute = function (indexed, options) {\n var o = this.encode(indexed, options);\n var formatter = this.decode.bind(this);\n return web3.eth.filter(o, undefined, undefined, formatter);\n};\n\n/**\n * Should be used to attach event to contract object\n *\n * @method attachToContract\n * @param {Contract}\n */\nSolidityEvent.prototype.attachToContract = function (contract) {\n var execute = this.execute.bind(this);\n var displayName = this.displayName();\n if (!contract[displayName]) {\n contract[displayName] = execute;\n }\n contract[displayName][this.typeName()] = this.execute.bind(this, contract);\n};\n\nmodule.exports = SolidityEvent;\n\n", "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** @file filter.js\n * @authors:\n * Jeffrey Wilcke \n * Marek Kotewicz \n * Marian Oancea \n * Fabian Vogelsteller \n * Gav Wood \n * @date 2014\n */\n\nvar RequestManager = require('./requestmanager');\nvar formatters = require('./formatters');\nvar utils = require('../utils/utils');\n\n/**\n* Converts a given topic to a hex string, but also allows null values.\n*\n* @param {Mixed} value\n* @return {String}\n*/\nvar toTopic = function(value){\n\n if(value === null || typeof value === 'undefined')\n return null;\n\n value = String(value);\n\n if(value.indexOf('0x') === 0)\n return value;\n else\n return utils.fromAscii(value);\n};\n\n/// This method should be called on options object, to verify deprecated properties && lazy load dynamic ones\n/// @param should be string or object\n/// @returns options string or object\nvar getOptions = function (options) {\n\n if (utils.isString(options)) {\n return options;\n } \n\n options = options || {};\n\n // make sure topics, get converted to hex\n options.topics = options.topics || [];\n options.topics = options.topics.map(function(topic){\n return (utils.isArray(topic)) ? topic.map(toTopic) : toTopic(topic);\n });\n\n // lazy load\n return {\n topics: options.topics,\n to: options.to,\n address: options.address,\n fromBlock: formatters.inputBlockNumberFormatter(options.fromBlock),\n toBlock: formatters.inputBlockNumberFormatter(options.toBlock) \n }; \n};\n\nvar Filter = function (options, methods, formatter) {\n var implementation = {};\n methods.forEach(function (method) {\n method.attachToObject(implementation);\n });\n this.options = getOptions(options);\n this.implementation = implementation;\n this.callbacks = [];\n this.formatter = formatter;\n this.filterId = this.implementation.newFilter(this.options);\n};\n\nFilter.prototype.watch = function (callback) {\n this.callbacks.push(callback);\n var self = this;\n\n var onMessage = function (error, messages) {\n if (error) {\n return self.callbacks.forEach(function (callback) {\n callback(error);\n });\n }\n\n messages.forEach(function (message) {\n message = self.formatter ? self.formatter(message) : message;\n self.callbacks.forEach(function (callback) {\n callback(null, message);\n });\n });\n };\n\n // call getFilterLogs on start\n if (!utils.isString(this.options)) {\n this.get(function (err, messages) {\n // don't send all the responses to all the watches again... just to this one\n if (err) {\n callback(err);\n }\n\n messages.forEach(function (message) {\n callback(null, message);\n });\n });\n }\n\n RequestManager.getInstance().startPolling({\n method: this.implementation.poll.call,\n params: [this.filterId],\n }, this.filterId, onMessage, this.stopWatching.bind(this));\n};\n\nFilter.prototype.stopWatching = function () {\n RequestManager.getInstance().stopPolling(this.filterId);\n this.implementation.uninstallFilter(this.filterId);\n this.callbacks = [];\n};\n\nFilter.prototype.get = function (callback) {\n var self = this;\n if (utils.isFunction(callback)) {\n this.implementation.getLogs(this.filterId, function(err, res){\n if (err) {\n callback(err);\n } else {\n callback(null, res.map(function (log) {\n return self.formatter ? self.formatter(log) : log;\n }));\n }\n });\n } else {\n var logs = this.implementation.getLogs(this.filterId);\n return logs.map(function (log) {\n return self.formatter ? self.formatter(log) : log;\n });\n }\n};\n\nmodule.exports = Filter;\n\n", - "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file formatters.js\n * @author Marek Kotewicz \n * @author Fabian Vogelsteller \n * @date 2015\n */\n\nvar utils = require('../utils/utils');\nvar config = require('../utils/config');\n\n/**\n * Should the format output to a big number\n *\n * @method outputBigNumberFormatter\n * @param {String|Number|BigNumber}\n * @returns {BigNumber} object\n */\nvar outputBigNumberFormatter = function (number) {\n return utils.toBigNumber(number);\n};\n\nvar isPredefinedBlockNumber = function (blockNumber) {\n return blockNumber === 'latest' || blockNumber === 'pending' || blockNumber === 'earliest';\n};\n\nvar inputDefaultBlockNumberFormatter = function (blockNumber) {\n if (blockNumber === undefined) {\n return config.defaultBlock;\n }\n return inputBlockNumberFormatter(blockNumber);\n};\n\nvar inputBlockNumberFormatter = function (blockNumber) {\n if (blockNumber === undefined) {\n return undefined;\n } else if (isPredefinedBlockNumber(blockNumber)) {\n return blockNumber;\n }\n return utils.toHex(blockNumber);\n};\n\n/**\n * Formats the input of a transaction and converts all values to HEX\n *\n * @method inputTransactionFormatter\n * @param {Object} transaction options\n * @returns object\n*/\nvar inputTransactionFormatter = function (options){\n\n options.from = options.from || config.defaultAccount;\n\n // make code -> data\n if (options.code) {\n options.data = options.code;\n delete options.code;\n }\n\n ['gasPrice', 'gas', 'value'].filter(function (key) {\n return options[key] !== undefined;\n }).forEach(function(key){\n options[key] = utils.fromDecimal(options[key]);\n });\n\n return options; \n};\n\n/**\n * Formats the output of a transaction to its proper values\n * \n * @method outputTransactionFormatter\n * @param {Object} transaction\n * @returns {Object} transaction\n*/\nvar outputTransactionFormatter = function (tx){\n tx.blockNumber = utils.toDecimal(tx.blockNumber);\n tx.transactionIndex = utils.toDecimal(tx.transactionIndex);\n tx.nonce = utils.toDecimal(tx.nonce);\n tx.gas = utils.toDecimal(tx.gas);\n tx.gasPrice = utils.toBigNumber(tx.gasPrice);\n tx.value = utils.toBigNumber(tx.value);\n return tx;\n};\n\n/**\n * Formats the output of a block to its proper values\n *\n * @method outputBlockFormatter\n * @param {Object} block object \n * @returns {Object} block object\n*/\nvar outputBlockFormatter = function(block) {\n\n // transform to number\n block.gasLimit = utils.toDecimal(block.gasLimit);\n block.gasUsed = utils.toDecimal(block.gasUsed);\n block.size = utils.toDecimal(block.size);\n block.timestamp = utils.toDecimal(block.timestamp);\n block.number = utils.toDecimal(block.number);\n\n block.difficulty = utils.toBigNumber(block.difficulty);\n block.totalDifficulty = utils.toBigNumber(block.totalDifficulty);\n\n if (utils.isArray(block.transactions)) {\n block.transactions.forEach(function(item){\n if(!utils.isString(item))\n return outputTransactionFormatter(item);\n });\n }\n\n return block;\n};\n\n/**\n * Formats the output of a log\n * \n * @method outputLogFormatter\n * @param {Object} log object\n * @returns {Object} log\n*/\nvar outputLogFormatter = function(log) {\n if (log === null) { // 'pending' && 'latest' filters are nulls\n return null;\n }\n\n log.blockNumber = utils.toDecimal(log.blockNumber);\n log.transactionIndex = utils.toDecimal(log.transactionIndex);\n log.logIndex = utils.toDecimal(log.logIndex);\n\n return log;\n};\n\n/**\n * Formats the input of a whisper post and converts all values to HEX\n *\n * @method inputPostFormatter\n * @param {Object} transaction object\n * @returns {Object}\n*/\nvar inputPostFormatter = function(post) {\n\n post.payload = utils.toHex(post.payload);\n post.ttl = utils.fromDecimal(post.ttl);\n post.workToProve = utils.fromDecimal(post.workToProve);\n post.priority = utils.fromDecimal(post.priority);\n\n // fallback\n if (!utils.isArray(post.topics)) {\n post.topics = post.topics ? [post.topics] : [];\n }\n\n // format the following options\n post.topics = post.topics.map(function(topic){\n return utils.fromAscii(topic);\n });\n\n return post; \n};\n\n/**\n * Formats the output of a received post message\n *\n * @method outputPostFormatter\n * @param {Object}\n * @returns {Object}\n */\nvar outputPostFormatter = function(post){\n\n post.expiry = utils.toDecimal(post.expiry);\n post.sent = utils.toDecimal(post.sent);\n post.ttl = utils.toDecimal(post.ttl);\n post.workProved = utils.toDecimal(post.workProved);\n post.payloadRaw = post.payload;\n post.payload = utils.toAscii(post.payload);\n\n if (utils.isJson(post.payload)) {\n post.payload = JSON.parse(post.payload);\n }\n\n // format the following options\n if (!post.topics) {\n post.topics = [];\n }\n post.topics = post.topics.map(function(topic){\n return utils.toAscii(topic);\n });\n\n return post;\n};\n\nmodule.exports = {\n inputDefaultBlockNumberFormatter: inputDefaultBlockNumberFormatter,\n inputBlockNumberFormatter: inputBlockNumberFormatter,\n inputTransactionFormatter: inputTransactionFormatter,\n inputPostFormatter: inputPostFormatter,\n outputBigNumberFormatter: outputBigNumberFormatter,\n outputTransactionFormatter: outputTransactionFormatter,\n outputBlockFormatter: outputBlockFormatter,\n outputLogFormatter: outputLogFormatter,\n outputPostFormatter: outputPostFormatter\n};\n\n", + "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file formatters.js\n * @author Marek Kotewicz \n * @author Fabian Vogelsteller \n * @date 2015\n */\n\nvar utils = require('../utils/utils');\nvar config = require('../utils/config');\n\n/**\n * Should the format output to a big number\n *\n * @method outputBigNumberFormatter\n * @param {String|Number|BigNumber}\n * @returns {BigNumber} object\n */\nvar outputBigNumberFormatter = function (number) {\n return utils.toBigNumber(number);\n};\n\nvar isPredefinedBlockNumber = function (blockNumber) {\n return blockNumber === 'latest' || blockNumber === 'pending' || blockNumber === 'earliest';\n};\n\nvar inputDefaultBlockNumberFormatter = function (blockNumber) {\n if (blockNumber === undefined) {\n return config.defaultBlock;\n }\n return inputBlockNumberFormatter(blockNumber);\n};\n\nvar inputBlockNumberFormatter = function (blockNumber) {\n if (blockNumber === undefined) {\n return undefined;\n } else if (isPredefinedBlockNumber(blockNumber)) {\n return blockNumber;\n }\n return utils.toHex(blockNumber);\n};\n\n/**\n * Formats the input of a transaction and converts all values to HEX\n *\n * @method inputTransactionFormatter\n * @param {Object} transaction options\n * @returns object\n*/\nvar inputTransactionFormatter = function (options){\n\n options.from = options.from || config.defaultAccount;\n\n // make code -> data\n if (options.code) {\n options.data = options.code;\n delete options.code;\n }\n\n ['gasPrice', 'gas', 'value', 'nonce'].filter(function (key) {\n return options[key] !== undefined;\n }).forEach(function(key){\n options[key] = utils.fromDecimal(options[key]);\n });\n\n return options; \n};\n\n/**\n * Formats the output of a transaction to its proper values\n * \n * @method outputTransactionFormatter\n * @param {Object} transaction\n * @returns {Object} transaction\n*/\nvar outputTransactionFormatter = function (tx){\n tx.blockNumber = utils.toDecimal(tx.blockNumber);\n tx.transactionIndex = utils.toDecimal(tx.transactionIndex);\n tx.nonce = utils.toDecimal(tx.nonce);\n tx.gas = utils.toDecimal(tx.gas);\n tx.gasPrice = utils.toBigNumber(tx.gasPrice);\n tx.value = utils.toBigNumber(tx.value);\n return tx;\n};\n\n/**\n * Formats the output of a block to its proper values\n *\n * @method outputBlockFormatter\n * @param {Object} block object \n * @returns {Object} block object\n*/\nvar outputBlockFormatter = function(block) {\n\n // transform to number\n block.gasLimit = utils.toDecimal(block.gasLimit);\n block.gasUsed = utils.toDecimal(block.gasUsed);\n block.size = utils.toDecimal(block.size);\n block.timestamp = utils.toDecimal(block.timestamp);\n block.number = utils.toDecimal(block.number);\n\n block.difficulty = utils.toBigNumber(block.difficulty);\n block.totalDifficulty = utils.toBigNumber(block.totalDifficulty);\n\n if (utils.isArray(block.transactions)) {\n block.transactions.forEach(function(item){\n if(!utils.isString(item))\n return outputTransactionFormatter(item);\n });\n }\n\n return block;\n};\n\n/**\n * Formats the output of a log\n * \n * @method outputLogFormatter\n * @param {Object} log object\n * @returns {Object} log\n*/\nvar outputLogFormatter = function(log) {\n if (log === null) { // 'pending' && 'latest' filters are nulls\n return null;\n }\n\n log.blockNumber = utils.toDecimal(log.blockNumber);\n log.transactionIndex = utils.toDecimal(log.transactionIndex);\n log.logIndex = utils.toDecimal(log.logIndex);\n\n return log;\n};\n\n/**\n * Formats the input of a whisper post and converts all values to HEX\n *\n * @method inputPostFormatter\n * @param {Object} transaction object\n * @returns {Object}\n*/\nvar inputPostFormatter = function(post) {\n\n post.payload = utils.toHex(post.payload);\n post.ttl = utils.fromDecimal(post.ttl);\n post.workToProve = utils.fromDecimal(post.workToProve);\n post.priority = utils.fromDecimal(post.priority);\n\n // fallback\n if (!utils.isArray(post.topics)) {\n post.topics = post.topics ? [post.topics] : [];\n }\n\n // format the following options\n post.topics = post.topics.map(function(topic){\n return utils.fromAscii(topic);\n });\n\n return post; \n};\n\n/**\n * Formats the output of a received post message\n *\n * @method outputPostFormatter\n * @param {Object}\n * @returns {Object}\n */\nvar outputPostFormatter = function(post){\n\n post.expiry = utils.toDecimal(post.expiry);\n post.sent = utils.toDecimal(post.sent);\n post.ttl = utils.toDecimal(post.ttl);\n post.workProved = utils.toDecimal(post.workProved);\n post.payloadRaw = post.payload;\n post.payload = utils.toAscii(post.payload);\n\n if (utils.isJson(post.payload)) {\n post.payload = JSON.parse(post.payload);\n }\n\n // format the following options\n if (!post.topics) {\n post.topics = [];\n }\n post.topics = post.topics.map(function(topic){\n return utils.toAscii(topic);\n });\n\n return post;\n};\n\nmodule.exports = {\n inputDefaultBlockNumberFormatter: inputDefaultBlockNumberFormatter,\n inputBlockNumberFormatter: inputBlockNumberFormatter,\n inputTransactionFormatter: inputTransactionFormatter,\n inputPostFormatter: inputPostFormatter,\n outputBigNumberFormatter: outputBigNumberFormatter,\n outputTransactionFormatter: outputTransactionFormatter,\n outputBlockFormatter: outputBlockFormatter,\n outputLogFormatter: outputLogFormatter,\n outputPostFormatter: outputPostFormatter\n};\n\n", "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file function.js\n * @author Marek Kotewicz \n * @date 2015\n */\n\nvar web3 = require('../web3');\nvar coder = require('../solidity/coder');\nvar utils = require('../utils/utils');\n\n/**\n * This prototype should be used to call/sendTransaction to solidity functions\n */\nvar SolidityFunction = function (json, address) {\n this._inputTypes = json.inputs.map(function (i) {\n return i.type;\n });\n this._outputTypes = json.outputs.map(function (i) {\n return i.type;\n });\n this._constant = json.constant;\n this._name = utils.transformToFullName(json);\n this._address = address;\n};\n\n/**\n * Should be used to create payload from arguments\n *\n * @method toPayload\n * @param {...} solidity function params\n * @param {Object} optional payload options\n */\nSolidityFunction.prototype.toPayload = function () {\n var args = Array.prototype.slice.call(arguments);\n var options = {};\n if (args.length > this._inputTypes.length && utils.isObject(args[args.length -1])) {\n options = args.pop();\n }\n options.to = this._address;\n options.data = '0x' + this.signature() + coder.encodeParams(this._inputTypes, args);\n return options;\n};\n\n/**\n * Should be used to get function signature\n *\n * @method signature\n * @return {String} function signature\n */\nSolidityFunction.prototype.signature = function () {\n return web3.sha3(web3.fromAscii(this._name)).slice(2, 10);\n};\n\n/**\n * Should be used to call function\n * \n * @method call\n * @param {Object} options\n * @return {String} output bytes\n */\nSolidityFunction.prototype.call = function () {\n var payload = this.toPayload.apply(this, Array.prototype.slice.call(arguments));\n var output = web3.eth.call(payload);\n output = output.length >= 2 ? output.slice(2) : output;\n var result = coder.decodeParams(this._outputTypes, output);\n return result.length === 1 ? result[0] : result;\n};\n\n/**\n * Should be used to sendTransaction to solidity function\n *\n * @method sendTransaction\n * @param {Object} options\n */\nSolidityFunction.prototype.sendTransaction = function () {\n var payload = this.toPayload.apply(this, Array.prototype.slice.call(arguments));\n web3.eth.sendTransaction(payload);\n};\n\n/**\n * Should be used to get function display name\n *\n * @method displayName\n * @return {String} display name of the function\n */\nSolidityFunction.prototype.displayName = function () {\n return utils.extractDisplayName(this._name);\n};\n\n/**\n * Should be used to get function type name\n * \n * @method typeName\n * @return {String} type name of the function\n */\nSolidityFunction.prototype.typeName = function () {\n return utils.extractTypeName(this._name);\n};\n\n/**\n * Should be called to execute function\n *\n * @method execute\n */\nSolidityFunction.prototype.execute = function () {\n var transaction = !this._constant;\n \n // send transaction\n if (transaction) {\n return this.sendTransaction.apply(this, Array.prototype.slice.call(arguments));\n }\n\n // call\n return this.call.apply(this, Array.prototype.slice.call(arguments));\n};\n\n/**\n * Should be called to attach function to contract\n *\n * @method attachToContract\n * @param {Contract}\n */\nSolidityFunction.prototype.attachToContract = function (contract) {\n var execute = this.execute.bind(this);\n execute.call = this.call.bind(this);\n execute.sendTransaction = this.sendTransaction.bind(this);\n var displayName = this.displayName();\n if (!contract[displayName]) {\n contract[displayName] = execute;\n }\n contract[displayName][this.typeName()] = execute; // circular!!!!\n};\n\nmodule.exports = SolidityFunction;\n\n", - "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** @file httpprovider.js\n * @authors:\n * Marek Kotewicz \n * Marian Oancea \n * Fabian Vogelsteller \n * @date 2014\n */\n\n\"use strict\";\n\nvar XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest; // jshint ignore:line\nvar errors = require('./errors');\n\nvar HttpProvider = function (host) {\n this.host = host || 'http://localhost:8545';\n};\n\nHttpProvider.prototype.send = function (payload) {\n var request = new XMLHttpRequest();\n\n request.open('POST', this.host, false);\n \n try {\n request.send(JSON.stringify(payload));\n } catch(error) {\n throw errors.InvalidConnection(this.host);\n }\n\n\n // check request.status\n // TODO: throw an error here! it cannot silently fail!!!\n //if (request.status !== 200) {\n //return;\n //}\n return JSON.parse(request.responseText);\n};\n\nHttpProvider.prototype.sendAsync = function (payload, callback) {\n var request = new XMLHttpRequest();\n request.onreadystatechange = function() {\n if (request.readyState === 4) {\n // TODO: handle the error properly here!!!\n callback(null, JSON.parse(request.responseText));\n }\n };\n\n request.open('POST', this.host, true);\n\n try {\n request.send(JSON.stringify(payload));\n } catch(error) {\n callback(errors.InvalidConnection(this.host));\n }\n};\n\nmodule.exports = HttpProvider;\n\n", + "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** @file httpprovider.js\n * @authors:\n * Marek Kotewicz \n * Marian Oancea \n * Fabian Vogelsteller \n * @date 2014\n */\n\n\"use strict\";\n\nvar XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest; // jshint ignore:line\nvar errors = require('./errors');\n\nvar HttpProvider = function (host) {\n this.host = host || 'http://localhost:8545';\n};\n\nHttpProvider.prototype.send = function (payload) {\n var request = new XMLHttpRequest();\n\n request.open('POST', this.host, false);\n \n try {\n request.send(JSON.stringify(payload));\n } catch(error) {\n throw errors.InvalidConnection(this.host);\n }\n\n\n // check request.status\n // TODO: throw an error here! it cannot silently fail!!!\n //if (request.status !== 200) {\n //return;\n //}\n\n var result = request.responseText;\n\n try {\n result = JSON.parse(result);\n } catch(e) {\n throw errors.InvalidResponse(result); \n }\n\n return result;\n};\n\nHttpProvider.prototype.sendAsync = function (payload, callback) {\n var request = new XMLHttpRequest();\n request.onreadystatechange = function() {\n if (request.readyState === 4) {\n var result = request.responseText;\n var error = null;\n\n try {\n result = JSON.parse(result);\n } catch(e) {\n error = errors.InvalidResponse(result); \n }\n\n callback(error, result);\n }\n };\n\n request.open('POST', this.host, true);\n\n try {\n request.send(JSON.stringify(payload));\n } catch(error) {\n callback(errors.InvalidConnection(this.host));\n }\n};\n\nmodule.exports = HttpProvider;\n\n", "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** @file jsonrpc.js\n * @authors:\n * Marek Kotewicz \n * @date 2015\n */\n\nvar Jsonrpc = function () {\n // singleton pattern\n if (arguments.callee._singletonInstance) {\n return arguments.callee._singletonInstance;\n }\n arguments.callee._singletonInstance = this;\n\n this.messageId = 1;\n};\n\n/**\n * @return {Jsonrpc} singleton\n */\nJsonrpc.getInstance = function () {\n var instance = new Jsonrpc();\n return instance;\n};\n\n/**\n * Should be called to valid json create payload object\n *\n * @method toPayload\n * @param {Function} method of jsonrpc call, required\n * @param {Array} params, an array of method params, optional\n * @returns {Object} valid jsonrpc payload object\n */\nJsonrpc.prototype.toPayload = function (method, params) {\n if (!method)\n console.error('jsonrpc method should be specified!');\n\n return {\n jsonrpc: '2.0',\n method: method,\n params: params || [],\n id: this.messageId++\n };\n};\n\n/**\n * Should be called to check if jsonrpc response is valid\n *\n * @method isValidResponse\n * @param {Object}\n * @returns {Boolean} true if response is valid, otherwise false\n */\nJsonrpc.prototype.isValidResponse = function (response) {\n return !!response &&\n !response.error &&\n response.jsonrpc === '2.0' &&\n typeof response.id === 'number' &&\n response.result !== undefined; // only undefined is not valid json object\n};\n\n/**\n * Should be called to create batch payload object\n *\n * @method toBatchPayload\n * @param {Array} messages, an array of objects with method (required) and params (optional) fields\n * @returns {Array} batch payload\n */\nJsonrpc.prototype.toBatchPayload = function (messages) {\n var self = this;\n return messages.map(function (message) {\n return self.toPayload(message.method, message.params);\n });\n};\n\nmodule.exports = Jsonrpc;\n\n", "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/**\n * @file method.js\n * @author Marek Kotewicz \n * @date 2015\n */\n\nvar RequestManager = require('./requestmanager');\nvar utils = require('../utils/utils');\nvar errors = require('./errors');\n\nvar Method = function (options) {\n this.name = options.name;\n this.call = options.call;\n this.params = options.params || 0;\n this.inputFormatter = options.inputFormatter;\n this.outputFormatter = options.outputFormatter;\n};\n\n/**\n * Should be used to determine name of the jsonrpc method based on arguments\n *\n * @method getCall\n * @param {Array} arguments\n * @return {String} name of jsonrpc method\n */\nMethod.prototype.getCall = function (args) {\n return utils.isFunction(this.call) ? this.call(args) : this.call;\n};\n\n/**\n * Should be used to extract callback from array of arguments. Modifies input param\n *\n * @method extractCallback\n * @param {Array} arguments\n * @return {Function|Null} callback, if exists\n */\nMethod.prototype.extractCallback = function (args) {\n if (utils.isFunction(args[args.length - 1])) {\n return args.pop(); // modify the args array!\n }\n return null;\n};\n\n/**\n * Should be called to check if the number of arguments is correct\n * \n * @method validateArgs\n * @param {Array} arguments\n * @throws {Error} if it is not\n */\nMethod.prototype.validateArgs = function (args) {\n if (args.length !== this.params) {\n throw errors.InvalidNumberOfParams();\n }\n};\n\n/**\n * Should be called to format input args of method\n * \n * @method formatInput\n * @param {Array}\n * @return {Array}\n */\nMethod.prototype.formatInput = function (args) {\n if (!this.inputFormatter) {\n return args;\n }\n\n return this.inputFormatter.map(function (formatter, index) {\n return formatter ? formatter(args[index]) : args[index];\n });\n};\n\n/**\n * Should be called to format output(result) of method\n *\n * @method formatOutput\n * @param {Object}\n * @return {Object}\n */\nMethod.prototype.formatOutput = function (result) {\n return this.outputFormatter && result !== null ? this.outputFormatter(result) : result;\n};\n\n/**\n * Should attach function to method\n * \n * @method attachToObject\n * @param {Object}\n * @param {Function}\n */\nMethod.prototype.attachToObject = function (obj) {\n var func = this.send.bind(this);\n func.call = this.call; // that's ugly. filter.js uses it\n var name = this.name.split('.');\n if (name.length > 1) {\n obj[name[0]] = obj[name[0]] || {};\n obj[name[0]][name[1]] = func;\n } else {\n obj[name[0]] = func; \n }\n};\n\n/**\n * Should create payload from given input args\n *\n * @method toPayload\n * @param {Array} args\n * @return {Object}\n */\nMethod.prototype.toPayload = function (args) {\n var call = this.getCall(args);\n var callback = this.extractCallback(args);\n var params = this.formatInput(args);\n this.validateArgs(params);\n\n return {\n method: call,\n params: params,\n callback: callback\n };\n};\n\n/**\n * Should send request to the API\n *\n * @method send\n * @param list of params\n * @return result\n */\nMethod.prototype.send = function () {\n var payload = this.toPayload(Array.prototype.slice.call(arguments));\n if (payload.callback) {\n var self = this;\n return RequestManager.getInstance().sendAsync(payload, function (err, result) {\n payload.callback(null, self.formatOutput(result));\n });\n }\n return this.formatOutput(RequestManager.getInstance().send(payload));\n};\n\nmodule.exports = Method;\n\n", "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** @file eth.js\n * @authors:\n * Marek Kotewicz \n * @date 2015\n */\n\nvar utils = require('../utils/utils');\nvar Property = require('./property');\n\n/// @returns an array of objects describing web3.eth api methods\nvar methods = [\n];\n\n/// @returns an array of objects describing web3.eth api properties\nvar properties = [\n new Property({\n name: 'listening',\n getter: 'net_listening'\n }),\n new Property({\n name: 'peerCount',\n getter: 'net_peerCount',\n outputFormatter: utils.toDecimal\n })\n];\n\n\nmodule.exports = {\n methods: methods,\n properties: properties\n};\n\n", diff --git a/dist/web3.min.js b/dist/web3.min.js index 8523f7258..b02f1f966 100644 --- a/dist/web3.min.js +++ b/dist/web3.min.js @@ -1,2 +1,2 @@ -require=function t(e,n,r){function i(a,s){if(!n[a]){if(!e[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(o)return o(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[a]={exports:{}};e[a][0].call(l.exports,function(t){var n=e[a][1][t];return i(n?n:t)},l,l.exports,t,e,n,r)}return n[a].exports}for(var o="function"==typeof require&&require,a=0;a0&&console.warn("didn't found matching constructor, using default one"),"")};e.exports={inputParser:u,outputParser:c,formatInput:a,formatOutput:s,formatConstructorParams:l}},{"../utils/utils":8,"./coder":2,"./utils":5}],2:[function(t,e,n){var r=t("bignumber.js"),i=t("../utils/utils"),o=t("./formatters"),a=t("./param"),s=function(t){return"[]"===t.slice(-2)},u=function(t){this._name=t.name,this._match=t.match,this._mode=t.mode,this._inputFormatter=t.inputFormatter,this._outputFormatter=t.outputFormatter};u.prototype.isType=function(t){return"strict"===this._match?this._name===t||0===t.indexOf(this._name)&&"[]"===t.slice(this._name.length):"prefix"===this._match?0===t.indexOf(this._name):void 0},u.prototype.formatInput=function(t,e){if(i.isArray(t)&&e){var n=this;return t.map(function(t){return n._inputFormatter(t)}).reduce(function(t,e){return t.appendArrayElement(e),t},new a("",o.formatInputInt(t.length).value))}return this._inputFormatter(t)},u.prototype.formatOutput=function(t,e){if(e){for(var n=[],i=new r(t.prefix,16),o=0;64*i>o;o+=64)n.push(this._outputFormatter(new a(t.suffix.slice(o,o+64))));return n}return this._outputFormatter(t)},u.prototype.isVariadicType=function(t){return s(t)||"bytes"===this._mode},u.prototype.shiftParam=function(t,e){if("bytes"===this._mode)return e.shiftBytes();if(s(t)){var n=new r(e.prefix.slice(0,64),16);return e.shiftArray(n)}return e.shiftValue()};var c=function(t){this._types=t};c.prototype._requireType=function(t){var e=this._types.filter(function(e){return e.isType(t)})[0];if(!e)throw Error("invalid solidity type!: "+t);return e},c.prototype._bytesToParam=function(t,e){var n=this,r=t.reduce(function(t,e){return n._requireType(e).isVariadicType(e)?t+1:t},0),i=t.length-r,o=e.slice(0,64*r);e=e.slice(64*r);var s=e.slice(0,64*i),u=e.slice(64*i);return new a(s,o,u)},c.prototype._formatInput=function(t,e){return this._requireType(t).formatInput(e,s(t))},c.prototype.encodeParam=function(t,e){return this._formatInput(t,e).encode()},c.prototype.encodeParams=function(t,e){var n=this;return t.map(function(t,r){return n._formatInput(t,e[r])}).reduce(function(t,e){return t.append(e),t},new a).encode()},c.prototype._formatOutput=function(t,e){return this._requireType(t).formatOutput(e,s(t))},c.prototype.decodeParam=function(t,e){return this._formatOutput(t,this._bytesToParam([t],e))},c.prototype.decodeParams=function(t,e){var n=this,r=this._bytesToParam(t,e);return t.map(function(t){var e=n._requireType(t),i=e.shiftParam(t,r);return e.formatOutput(i,s(t))})};var l=new c([new u({name:"address",match:"strict",mode:"value",inputFormatter:o.formatInputInt,outputFormatter:o.formatOutputAddress}),new u({name:"bool",match:"strict",mode:"value",inputFormatter:o.formatInputBool,outputFormatter:o.formatOutputBool}),new u({name:"int",match:"prefix",mode:"value",inputFormatter:o.formatInputInt,outputFormatter:o.formatOutputInt}),new u({name:"uint",match:"prefix",mode:"value",inputFormatter:o.formatInputInt,outputFormatter:o.formatOutputUInt}),new u({name:"bytes",match:"strict",mode:"bytes",inputFormatter:o.formatInputDynamicBytes,outputFormatter:o.formatOutputDynamicBytes}),new u({name:"bytes",match:"prefix",mode:"value",inputFormatter:o.formatInputBytes,outputFormatter:o.formatOutputBytes}),new u({name:"real",match:"prefix",mode:"value",inputFormatter:o.formatInputReal,outputFormatter:o.formatOutputReal}),new u({name:"ureal",match:"prefix",mode:"value",inputFormatter:o.formatInputReal,outputFormatter:o.formatOutputUReal})]);e.exports=l},{"../utils/utils":8,"./formatters":3,"./param":4,"bignumber.js":"bignumber.js"}],3:[function(t,e,n){var r=t("bignumber.js"),i=t("../utils/utils"),o=t("../utils/config"),a=t("./param"),s=function(t){var e=2*o.ETH_PADDING;r.config(o.ETH_BIGNUMBER_ROUNDING_MODE);var n=i.padLeft(i.toTwosComplement(t).round().toString(16),e);return new a(n)},u=function(t){var e=i.fromAscii(t,o.ETH_PADDING).substr(2);return new a(e)},c=function(t){var e=i.fromAscii(t,o.ETH_PADDING).substr(2);return new a("",s(t.length).value,e)},l=function(t){var e="000000000000000000000000000000000000000000000000000000000000000"+(t?"1":"0");return new a(e)},f=function(t){return s(new r(t).times(new r(2).pow(128)))},p=function(t){return"1"===new r(t.substr(0,1),16).toString(2).substr(0,1)},m=function(t){var e=t.value||"0";return p(e)?new r(e,16).minus(new r("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16)).minus(1):new r(e,16)},h=function(t){var e=t.value||"0";return new r(e,16)},d=function(t){return m(t).dividedBy(new r(2).pow(128))},g=function(t){return h(t).dividedBy(new r(2).pow(128))},y=function(t){return"0000000000000000000000000000000000000000000000000000000000000001"===t.value?!0:!1},v=function(t){return i.toAscii(t.value)},b=function(t){return i.toAscii(t.suffix)},w=function(t){var e=t.value;return"0x"+e.slice(e.length-40,e.length)};e.exports={formatInputInt:s,formatInputBytes:u,formatInputDynamicBytes:c,formatInputBool:l,formatInputReal:f,formatOutputInt:m,formatOutputUInt:h,formatOutputReal:d,formatOutputUReal:g,formatOutputBool:y,formatOutputBytes:v,formatOutputDynamicBytes:b,formatOutputAddress:w}},{"../utils/config":7,"../utils/utils":8,"./param":4,"bignumber.js":"bignumber.js"}],4:[function(t,e,n){var r=function(t,e,n){this.prefix=e||"",this.value=t||"",this.suffix=n||""};r.prototype.append=function(t){this.prefix+=t.prefix,this.value+=t.value,this.suffix+=t.suffix},r.prototype.appendArrayElement=function(t){this.suffix+=t.value,this.prefix+=t.prefix},r.prototype.encode=function(){return this.prefix+this.value+this.suffix},r.prototype.shiftValue=function(){var t=this.value.slice(0,64);return this.value=this.value.slice(64),new r(t)},r.prototype.shiftBytes=function(){return this.shiftArray(1)},r.prototype.shiftArray=function(t){var e=this.prefix.slice(0,64);this.prefix=this.value.slice(64);var n=this.suffix.slice(0,64*t);return this.suffix=this.suffix.slice(64*t),new r("",e,n)},e.exports=r},{}],5:[function(t,e,n){var r=function(t,e){return t.filter(function(t){return"constructor"===t.type&&t.inputs.length===e})[0]};e.exports={getConstructor:r}},{}],6:[function(t,e,n){"use strict";n.XMLHttpRequest="undefined"==typeof XMLHttpRequest?{}:XMLHttpRequest},{}],7:[function(t,e,n){var r=t("bignumber.js"),i=["wei","Kwei","Mwei","Gwei","szabo","finney","ether","grand","Mether","Gether","Tether","Pether","Eether","Zether","Yether","Nether","Dether","Vether","Uether"];e.exports={ETH_PADDING:32,ETH_SIGNATURE_LENGTH:4,ETH_UNITS:i,ETH_BIGNUMBER_ROUNDING_MODE:{ROUNDING_MODE:r.ROUND_DOWN},ETH_POLLING_TIMEOUT:1e3,defaultBlock:"latest",defaultAccount:void 0}},{"bignumber.js":"bignumber.js"}],8:[function(t,e,n){var r=t("bignumber.js"),i={wei:"1",kwei:"1000",ada:"1000",mwei:"1000000",babbage:"1000000",gwei:"1000000000",shannon:"1000000000",szabo:"1000000000000",finney:"1000000000000000",ether:"1000000000000000000",kether:"1000000000000000000000",grand:"1000000000000000000000",einstein:"1000000000000000000000",mether:"1000000000000000000000000",gether:"1000000000000000000000000000",tether:"1000000000000000000000000000000"},o=function(t,e,n){return new Array(e-t.length+1).join(n?n:"0")+t},a=function(t){var e="",n=0,r=t.length;for("0x"===t.substring(0,2)&&(n=2);r>n;n+=2){var i=parseInt(t.substr(n,2),16);if(0===i)break;e+=String.fromCharCode(i)}return e},s=function(t){for(var e="",n=0;nthis._inputTypes.length&&o.isObject(t[t.length-1])&&(e=t.pop()),e.to=this._address,e.data="0x"+this.signature()+i.encodeParams(this._inputTypes,t),e},a.prototype.signature=function(){return r.sha3(r.fromAscii(this._name)).slice(2,10)},a.prototype.call=function(){var t=this.toPayload.apply(this,Array.prototype.slice.call(arguments)),e=r.eth.call(t);e=e.length>=2?e.slice(2):e;var n=i.decodeParams(this._outputTypes,e);return 1===n.length?n[0]:n},a.prototype.sendTransaction=function(){var t=this.toPayload.apply(this,Array.prototype.slice.call(arguments));r.eth.sendTransaction(t)},a.prototype.displayName=function(){return o.extractDisplayName(this._name)},a.prototype.typeName=function(){return o.extractTypeName(this._name)},a.prototype.execute=function(){var t=!this._constant;return t?this.sendTransaction.apply(this,Array.prototype.slice.call(arguments)):this.call.apply(this,Array.prototype.slice.call(arguments))},a.prototype.attachToContract=function(t){var e=this.execute.bind(this);e.call=this.call.bind(this),e.sendTransaction=this.sendTransaction.bind(this);var n=this.displayName();t[n]||(t[n]=e),t[n][this.typeName()]=e},e.exports=a},{"../solidity/coder":2,"../utils/utils":8,"../web3":10}],19:[function(t,e,n){"use strict";var r=t("xmlhttprequest").XMLHttpRequest,i=t("./errors"),o=function(t){this.host=t||"http://localhost:8545"};o.prototype.send=function(t){var e=new r;e.open("POST",this.host,!1);try{e.send(JSON.stringify(t))}catch(n){throw i.InvalidConnection(this.host)}return JSON.parse(e.responseText)},o.prototype.sendAsync=function(t,e){var n=new r;n.onreadystatechange=function(){4===n.readyState&&e(null,JSON.parse(n.responseText))},n.open("POST",this.host,!0);try{n.send(JSON.stringify(t))}catch(o){e(i.InvalidConnection(this.host))}},e.exports=o},{"./errors":13,xmlhttprequest:6}],20:[function(t,e,n){var r=function(){return arguments.callee._singletonInstance?arguments.callee._singletonInstance:(arguments.callee._singletonInstance=this,void(this.messageId=1))};r.getInstance=function(){var t=new r;return t},r.prototype.toPayload=function(t,e){return t||console.error("jsonrpc method should be specified!"),{jsonrpc:"2.0",method:t,params:e||[],id:this.messageId++}},r.prototype.isValidResponse=function(t){return!!t&&!t.error&&"2.0"===t.jsonrpc&&"number"==typeof t.id&&void 0!==t.result},r.prototype.toBatchPayload=function(t){var e=this;return t.map(function(t){return e.toPayload(t.method,t.params)})},e.exports=r},{}],21:[function(t,e,n){var r=t("./requestmanager"),i=t("../utils/utils"),o=t("./errors"),a=function(t){this.name=t.name,this.call=t.call,this.params=t.params||0,this.inputFormatter=t.inputFormatter,this.outputFormatter=t.outputFormatter};a.prototype.getCall=function(t){return i.isFunction(this.call)?this.call(t):this.call},a.prototype.extractCallback=function(t){return i.isFunction(t[t.length-1])?t.pop():null},a.prototype.validateArgs=function(t){if(t.length!==this.params)throw o.InvalidNumberOfParams()},a.prototype.formatInput=function(t){return this.inputFormatter?this.inputFormatter.map(function(e,n){return e?e(t[n]):t[n]}):t},a.prototype.formatOutput=function(t){return this.outputFormatter&&null!==t?this.outputFormatter(t):t},a.prototype.attachToObject=function(t){var e=this.send.bind(this);e.call=this.call;var n=this.name.split(".");n.length>1?(t[n[0]]=t[n[0]]||{},t[n[0]][n[1]]=e):t[n[0]]=e},a.prototype.toPayload=function(t){var e=this.getCall(t),n=this.extractCallback(t),r=this.formatInput(t);return this.validateArgs(r),{method:e,params:r,callback:n}},a.prototype.send=function(){var t=this.toPayload(Array.prototype.slice.call(arguments));if(t.callback){var e=this;return r.getInstance().sendAsync(t,function(n,r){t.callback(null,e.formatOutput(r))})}return this.formatOutput(r.getInstance().send(t))},e.exports=a},{"../utils/utils":8,"./errors":13,"./requestmanager":25}],22:[function(t,e,n){var r=t("../utils/utils"),i=t("./property"),o=[],a=[new i({name:"listening",getter:"net_listening"}),new i({name:"peerCount",getter:"net_peerCount",outputFormatter:r.toDecimal})];e.exports={methods:o,properties:a}},{"../utils/utils":8,"./property":23}],23:[function(t,e,n){var r=t("./requestmanager"),i=function(t){this.name=t.name,this.getter=t.getter,this.setter=t.setter,this.outputFormatter=t.outputFormatter,this.inputFormatter=t.inputFormatter};i.prototype.formatInput=function(t){return this.inputFormatter?this.inputFormatter(t):t},i.prototype.formatOutput=function(t){return this.outputFormatter&&null!==t?this.outputFormatter(t):t},i.prototype.attachToObject=function(t){var e={get:this.get.bind(this),set:this.set.bind(this)},n=this.name.split(".");n.length>1?(t[n[0]]=t[n[0]]||{},Object.defineProperty(t[n[0]],n[1],e)):Object.defineProperty(t,n[0],e)},i.prototype.get=function(){return this.formatOutput(r.getInstance().send({method:this.getter}))},i.prototype.set=function(t){return r.getInstance().send({method:this.setter,params:[this.formatInput(t)]})},e.exports=i},{"./requestmanager":25}],24:[function(t,e,n){var r=function(){};r.prototype.send=function(t){var e=navigator.qt.callMethod(JSON.stringify(t));return JSON.parse(e)},e.exports=r},{}],25:[function(t,e,n){var r=t("./jsonrpc"),i=t("../utils/utils"),o=t("../utils/config"),a=t("./errors"),s=function(t){return arguments.callee._singletonInstance?arguments.callee._singletonInstance:(arguments.callee._singletonInstance=this,this.provider=t,this.polls=[],this.timeout=null,void this.poll())};s.getInstance=function(){var t=new s;return t},s.prototype.send=function(t){if(!this.provider)return console.error(a.InvalidProvider()),null;var e=r.getInstance().toPayload(t.method,t.params),n=this.provider.send(e);if(!r.getInstance().isValidResponse(n))throw a.InvalidResponse(n);return n.result},s.prototype.sendAsync=function(t,e){if(!this.provider)return e(a.InvalidProvider());var n=r.getInstance().toPayload(t.method,t.params);this.provider.sendAsync(n,function(t,n){return t?e(t):r.getInstance().isValidResponse(n)?void e(null,n.result):e(a.InvalidResponse(n))})},s.prototype.setProvider=function(t){this.provider=t},s.prototype.startPolling=function(t,e,n,r){this.polls.push({data:t,id:e,callback:n,uninstall:r})},s.prototype.stopPolling=function(t){for(var e=this.polls.length;e--;){var n=this.polls[e];n.id===t&&this.polls.splice(e,1)}},s.prototype.reset=function(){this.polls.forEach(function(t){t.uninstall(t.id)}),this.polls=[],this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.poll()},s.prototype.poll=function(){if(this.timeout=setTimeout(this.poll.bind(this),o.ETH_POLLING_TIMEOUT),this.polls.length){if(!this.provider)return void console.error(a.InvalidProvider());var t=r.getInstance().toBatchPayload(this.polls.map(function(t){return t.data})),e=this;this.provider.sendAsync(t,function(t,n){if(!t){if(!i.isArray(n))throw a.InvalidResponse(n);n.map(function(t,n){return t.callback=e.polls[n].callback,t}).filter(function(t){var e=r.getInstance().isValidResponse(t);return e||t.callback(a.InvalidResponse(t)),e}).filter(function(t){return i.isArray(t.result)&&t.result.length>0}).forEach(function(t){t.callback(null,t.result)})}})}},e.exports=s},{"../utils/config":7,"../utils/utils":8,"./errors":13,"./jsonrpc":20}],26:[function(t,e,n){var r=t("./method"),i=t("./formatters"),o=new r({name:"post",call:"shh_post",params:1,inputFormatter:[i.inputPostFormatter]}),a=new r({name:"newIdentity",call:"shh_newIdentity",params:0}),s=new r({name:"hasIdentity",call:"shh_hasIdentity",params:1}),u=new r({name:"newGroup",call:"shh_newGroup",params:0}),c=new r({name:"addToGroup",call:"shh_addToGroup",params:0}),l=[o,a,s,u,c];e.exports={methods:l}},{"./formatters":17,"./method":21}],27:[function(t,e,n){var r=t("./method"),i=function(){var t=function(t){return"string"==typeof t[0]?"eth_newBlockFilter":"eth_newFilter"},e=new r({name:"newFilter",call:t,params:1}),n=new r({name:"uninstallFilter",call:"eth_uninstallFilter",params:1}),i=new r({name:"getLogs",call:"eth_getFilterLogs",params:1}),o=new r({name:"poll",call:"eth_getFilterChanges",params:1 -});return[e,n,i,o]},o=function(){var t=new r({name:"newFilter",call:"shh_newFilter",params:1}),e=new r({name:"uninstallFilter",call:"shh_uninstallFilter",params:1}),n=new r({name:"getLogs",call:"shh_getMessages",params:1}),i=new r({name:"poll",call:"shh_getFilterChanges",params:1});return[t,e,n,i]};e.exports={eth:i,shh:o}},{"./method":21}],28:[function(t,e,n){},{}],"bignumber.js":[function(t,e,n){!function(n){"use strict";function r(t){function e(t,r){var i,o,a,s,u,c,l=this;if(!(l instanceof e))return V&&k(26,"constructor call without new",t),new e(t,r);if(null!=r&&J(r,2,64,R,"base")){if(r=0|r,c=t+"",10==r)return l=new e(t instanceof e?t:c),E(l,j+l.e+1,U);if((s="number"==typeof t)&&0*t!=0||!new RegExp("^-?"+(i="["+_.slice(0,r)+"]+")+"(?:\\."+i+")?$",37>r?"i":"").test(c))return d(l,c,s,r);s?(l.s=0>1/t?(c=c.slice(1),-1):1,V&&c.replace(/^0\.0*|\./,"").length>15&&k(R,x,t),s=!1):l.s=45===c.charCodeAt(0)?(c=c.slice(1),-1):1,c=n(c,10,r,l.s)}else{if(t instanceof e)return l.s=t.s,l.e=t.e,l.c=(t=t.c)?t.slice():t,void(R=0);if((s="number"==typeof t)&&0*t==0){if(l.s=0>1/t?(t=-t,-1):1,t===~~t){for(o=0,a=t;a>=10;a/=10,o++);return l.e=o,l.c=[t],void(R=0)}c=t+""}else{if(!g.test(c=t+""))return d(l,c,s);l.s=45===c.charCodeAt(0)?(c=c.slice(1),-1):1}}for((o=c.indexOf("."))>-1&&(c=c.replace(".","")),(a=c.search(/e/i))>0?(0>o&&(o=a),o+=+c.slice(a+1),c=c.substring(0,a)):0>o&&(o=c.length),a=0;48===c.charCodeAt(a);a++);for(u=c.length;48===c.charCodeAt(--u););if(c=c.slice(a,u+1))if(u=c.length,s&&V&&u>15&&k(R,x,l.s*t),o=o-a-1,o>G)l.c=l.e=null;else if(M>o)l.c=[l.e=0];else{if(l.e=o,l.c=[],a=(o+1)%N,0>o&&(a+=N),u>a){for(a&&l.c.push(+c.slice(0,a)),u-=N;u>a;)l.c.push(+c.slice(a,a+=N));c=c.slice(a),a=N-c.length}else a-=u;for(;a--;c+="0");l.c.push(+c)}else l.c=[l.e=0];R=0}function n(t,n,r,i){var a,s,u,l,p,m,h,d=t.indexOf("."),g=j,y=U;for(37>r&&(t=t.toLowerCase()),d>=0&&(u=z,z=0,t=t.replace(".",""),h=new e(r),p=h.pow(t.length-d),z=u,h.c=c(f(o(p.c),p.e),10,n),h.e=h.c.length),m=c(t,r,n),s=u=m.length;0==m[--u];m.pop());if(!m[0])return"0";if(0>d?--s:(p.c=m,p.e=s,p.s=i,p=S(p,h,g,y,n),m=p.c,l=p.r,s=p.e),a=s+g+1,d=m[a],u=n/2,l=l||0>a||null!=m[a+1],l=4>y?(null!=d||l)&&(0==y||y==(p.s<0?3:2)):d>u||d==u&&(4==y||l||6==y&&1&m[a-1]||y==(p.s<0?8:7)),1>a||!m[0])t=l?f("1",-g):"0";else{if(m.length=a,l)for(--n;++m[--a]>n;)m[a]=0,a||(++s,m.unshift(1));for(u=m.length;!m[--u];);for(d=0,t="";u>=d;t+=_.charAt(m[d++]));t=f(t,s)}return t}function m(t,n,r,i){var a,s,u,c,p;if(r=null!=r&&J(r,0,8,i,w)?0|r:U,!t.c)return t.toString();if(a=t.c[0],u=t.e,null==n)p=o(t.c),p=19==i||24==i&&H>=u?l(p,u):f(p,u);else if(t=E(new e(t),n,r),s=t.e,p=o(t.c),c=p.length,19==i||24==i&&(s>=n||H>=s)){for(;n>c;p+="0",c++);p=l(p,s)}else if(n-=u,p=f(p,s),s+1>c){if(--n>0)for(p+=".";n--;p+="0");}else if(n+=s-c,n>0)for(s+1==c&&(p+=".");n--;p+="0");return t.s<0&&a?"-"+p:p}function A(t,n){var r,i,o=0;for(u(t[0])&&(t=t[0]),r=new e(t[0]);++ot||t>n||t!=p(t))&&k(r,(i||"decimal places")+(e>t||t>n?" out of range":" not an integer"),t),!0}function P(t,e,n){for(var r=1,i=e.length;!e[--i];e.pop());for(i=e[0];i>=10;i/=10,r++);return(n=r+n*N-1)>G?t.c=t.e=null:M>n?t.c=[t.e=0]:(t.e=n,t.c=e),t}function k(t,e,n){var r=new Error(["new BigNumber","cmp","config","div","divToInt","eq","gt","gte","lt","lte","minus","mod","plus","precision","random","round","shift","times","toDigits","toExponential","toFixed","toFormat","toFraction","pow","toPrecision","toString","BigNumber"][t]+"() "+e+": "+n);throw r.name="BigNumber Error",R=0,r}function E(t,e,n,r){var i,o,a,s,u,c,l,f=t.c,p=O;if(f){t:{for(i=1,s=f[0];s>=10;s/=10,i++);if(o=e-i,0>o)o+=N,a=e,u=f[c=0],l=u/p[i-a-1]%10|0;else if(c=y((o+1)/N),c>=f.length){if(!r)break t;for(;f.length<=c;f.push(0));u=l=0,i=1,o%=N,a=o-N+1}else{for(u=s=f[c],i=1;s>=10;s/=10,i++);o%=N,a=o-N+i,l=0>a?0:u/p[i-a-1]%10|0}if(r=r||0>e||null!=f[c+1]||(0>a?u:u%p[i-a-1]),r=4>n?(l||r)&&(0==n||n==(t.s<0?3:2)):l>5||5==l&&(4==n||r||6==n&&(o>0?a>0?u/p[i-a]:0:f[c-1])%10&1||n==(t.s<0?8:7)),1>e||!f[0])return f.length=0,r?(e-=t.e+1,f[0]=p[e%N],t.e=-e||0):f[0]=t.e=0,t;if(0==o?(f.length=c,s=1,c--):(f.length=c+1,s=p[N-o],f[c]=a>0?v(u/p[i-a]%p[a])*s:0),r)for(;;){if(0==c){for(o=1,a=f[0];a>=10;a/=10,o++);for(a=f[0]+=s,s=1;a>=10;a/=10,s++);o!=s&&(t.e++,f[0]==F&&(f[0]=1));break}if(f[c]+=s,f[c]!=F)break;f[c--]=0,s=1}for(o=f.length;0===f[--o];f.pop());}t.e>G?t.c=t.e=null:t.en?null!=(t=i[n++]):void 0};return a(e="DECIMAL_PLACES")&&J(t,0,B,2,e)&&(j=0|t),r[e]=j,a(e="ROUNDING_MODE")&&J(t,0,8,2,e)&&(U=0|t),r[e]=U,a(e="EXPONENTIAL_AT")&&(u(t)?J(t[0],-B,0,2,e)&&J(t[1],0,B,2,e)&&(H=0|t[0],q=0|t[1]):J(t,-B,B,2,e)&&(H=-(q=0|(0>t?-t:t)))),r[e]=[H,q],a(e="RANGE")&&(u(t)?J(t[0],-B,-1,2,e)&&J(t[1],1,B,2,e)&&(M=0|t[0],G=0|t[1]):J(t,-B,B,2,e)&&(0|t?M=-(G=0|(0>t?-t:t)):V&&k(2,e+" cannot be zero",t))),r[e]=[M,G],a(e="ERRORS")&&(t===!!t||1===t||0===t?(R=0,J=(V=!!t)?D:s):V&&k(2,e+b,t)),r[e]=V,a(e="CRYPTO")&&(t===!!t||1===t||0===t?(W=!(!t||!h||"object"!=typeof h),t&&!W&&V&&k(2,"crypto unavailable",h)):V&&k(2,e+b,t)),r[e]=W,a(e="MODULO_MODE")&&J(t,0,9,2,e)&&($=0|t),r[e]=$,a(e="POW_PRECISION")&&J(t,0,B,2,e)&&(z=0|t),r[e]=z,a(e="FORMAT")&&("object"==typeof t?X=t:V&&k(2,e+" not an object",t)),r[e]=X,r},e.max=function(){return A(arguments,C.lt)},e.min=function(){return A(arguments,C.gt)},e.random=function(){var t=9007199254740992,n=Math.random()*t&2097151?function(){return v(Math.random()*t)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)};return function(t){var r,i,o,a,s,u=0,c=[],l=new e(L);if(t=null!=t&&J(t,0,B,14)?0|t:j,a=y(t/N),W)if(h&&h.getRandomValues){for(r=h.getRandomValues(new Uint32Array(a*=2));a>u;)s=131072*r[u]+(r[u+1]>>>11),s>=9e15?(i=h.getRandomValues(new Uint32Array(2)),r[u]=i[0],r[u+1]=i[1]):(c.push(s%1e14),u+=2);u=a/2}else if(h&&h.randomBytes){for(r=h.randomBytes(a*=7);a>u;)s=281474976710656*(31&r[u])+1099511627776*r[u+1]+4294967296*r[u+2]+16777216*r[u+3]+(r[u+4]<<16)+(r[u+5]<<8)+r[u+6],s>=9e15?h.randomBytes(7).copy(r,u):(c.push(s%1e14),u+=7);u=a/7}else V&&k(14,"crypto unavailable",h);if(!u)for(;a>u;)s=n(),9e15>s&&(c[u++]=s%1e14);for(a=c[--u],t%=N,a&&t&&(s=O[N-t],c[u]=v(a/s)*s);0===c[u];c.pop(),u--);if(0>u)c=[o=0];else{for(o=-1;0===c[0];c.shift(),o-=N);for(u=1,s=c[0];s>=10;s/=10,u++);N>u&&(o-=N-u)}return l.e=o,l.c=c,l}}(),S=function(){function t(t,e,n){var r,i,o,a,s=0,u=t.length,c=e%T,l=e/T|0;for(t=t.slice();u--;)o=t[u]%T,a=t[u]/T|0,r=l*o+a*c,i=c*o+r%T*T+s,s=(i/n|0)+(r/T|0)+l*a,t[u]=i%n;return s&&t.unshift(s),t}function n(t,e,n,r){var i,o;if(n!=r)o=n>r?1:-1;else for(i=o=0;n>i;i++)if(t[i]!=e[i]){o=t[i]>e[i]?1:-1;break}return o}function r(t,e,n,r){for(var i=0;n--;)t[n]-=i,i=t[n]1;t.shift());}return function(o,a,s,u,c){var l,f,p,m,h,d,g,y,b,w,x,_,I,O,T,B,A,D=o.s==a.s?1:-1,P=o.c,k=a.c;if(!(P&&P[0]&&k&&k[0]))return new e(o.s&&a.s&&(P?!k||P[0]!=k[0]:k)?P&&0==P[0]||!k?0*D:D/0:0/0);for(y=new e(D),b=y.c=[],f=o.e-a.e,D=s+f+1,c||(c=F,f=i(o.e/N)-i(a.e/N),D=D/N|0),p=0;k[p]==(P[p]||0);p++);if(k[p]>(P[p]||0)&&f--,0>D)b.push(1),m=!0;else{for(O=P.length,B=k.length,p=0,D+=2,h=v(c/(k[0]+1)),h>1&&(k=t(k,h,c),P=t(P,h,c),B=k.length,O=P.length),I=B,w=P.slice(0,B),x=w.length;B>x;w[x++]=0);A=k.slice(),A.unshift(0),T=k[0],k[1]>=c/2&&T++;do{if(h=0,l=n(k,w,B,x),0>l){if(_=w[0],B!=x&&(_=_*c+(w[1]||0)),h=v(_/T),h>1)for(h>=c&&(h=c-1),d=t(k,h,c),g=d.length,x=w.length;1==n(d,w,g,x);)h--,r(d,g>B?A:k,g,c),g=d.length,l=1;else 0==h&&(l=h=1),d=k.slice(),g=d.length;if(x>g&&d.unshift(0),r(w,d,x,c),x=w.length,-1==l)for(;n(k,w,B,x)<1;)h++,r(w,x>B?A:k,x,c),x=w.length}else 0===l&&(h++,w=[0]);b[p++]=h,w[0]?w[x++]=P[I]||0:(w=[P[I]],x=1)}while((I++=10;D/=10,p++);E(y,s+(y.e=p+f*N-1)+1,u,m)}else y.e=f,y.r=+m;return y}}(),d=function(){var t=/^(-?)0([xbo])/i,n=/^([^.]+)\.$/,r=/^\.([^.]+)$/,i=/^-?(Infinity|NaN)$/,o=/^\s*\+|^\s+|\s+$/g;return function(a,s,u,c){var l,f=u?s:s.replace(o,"");if(i.test(f))a.s=isNaN(f)?null:0>f?-1:1;else{if(!u&&(f=f.replace(t,function(t,e,n){return l="x"==(n=n.toLowerCase())?16:"b"==n?2:8,c&&c!=l?t:e}),c&&(l=c,f=f.replace(n,"$1").replace(r,"0.$1")),s!=f))return new e(f,l);V&&k(R,"not a"+(c?" base "+c:"")+" number",s),a.s=null}a.c=a.e=null,R=0}}(),C.absoluteValue=C.abs=function(){var t=new e(this);return t.s<0&&(t.s=1),t},C.ceil=function(){return E(new e(this),this.e+1,2)},C.comparedTo=C.cmp=function(t,n){return R=1,a(this,new e(t,n))},C.decimalPlaces=C.dp=function(){var t,e,n=this.c;if(!n)return null;if(t=((e=n.length-1)-i(this.e/N))*N,e=n[e])for(;e%10==0;e/=10,t--);return 0>t&&(t=0),t},C.dividedBy=C.div=function(t,n){return R=3,S(this,new e(t,n),j,U)},C.dividedToIntegerBy=C.divToInt=function(t,n){return R=4,S(this,new e(t,n),0,1)},C.equals=C.eq=function(t,n){return R=5,0===a(this,new e(t,n))},C.floor=function(){return E(new e(this),this.e+1,3)},C.greaterThan=C.gt=function(t,n){return R=6,a(this,new e(t,n))>0},C.greaterThanOrEqualTo=C.gte=function(t,n){return R=7,1===(n=a(this,new e(t,n)))||0===n},C.isFinite=function(){return!!this.c},C.isInteger=C.isInt=function(){return!!this.c&&i(this.e/N)>this.c.length-2},C.isNaN=function(){return!this.s},C.isNegative=C.isNeg=function(){return this.s<0},C.isZero=function(){return!!this.c&&0==this.c[0]},C.lessThan=C.lt=function(t,n){return R=8,a(this,new e(t,n))<0},C.lessThanOrEqualTo=C.lte=function(t,n){return R=9,-1===(n=a(this,new e(t,n)))||0===n},C.minus=C.sub=function(t,n){var r,o,a,s,u=this,c=u.s;if(R=10,t=new e(t,n),n=t.s,!c||!n)return new e(0/0);if(c!=n)return t.s=-n,u.plus(t);var l=u.e/N,f=t.e/N,p=u.c,m=t.c;if(!l||!f){if(!p||!m)return p?(t.s=-n,t):new e(m?u:0/0);if(!p[0]||!m[0])return m[0]?(t.s=-n,t):new e(p[0]?u:3==U?-0:0)}if(l=i(l),f=i(f),p=p.slice(),c=l-f){for((s=0>c)?(c=-c,a=p):(f=l,a=m),a.reverse(),n=c;n--;a.push(0));a.reverse()}else for(o=(s=(c=p.length)<(n=m.length))?c:n,c=n=0;o>n;n++)if(p[n]!=m[n]){s=p[n]0)for(;n--;p[r++]=0);for(n=F-1;o>c;){if(p[--o]0?(u=s,r=l):(a=-a,r=c),r.reverse();a--;r.push(0));r.reverse()}for(a=c.length,n=l.length,0>a-n&&(r=l,l=c,c=r,n=a),a=0;n;)a=(c[--n]=c[n]+l[n]+a)/F|0,c[n]%=F;return a&&(c.unshift(a),++u),P(t,c,u)},C.precision=C.sd=function(t){var e,n,r=this,i=r.c;if(null!=t&&t!==!!t&&1!==t&&0!==t&&(V&&k(13,"argument"+b,t),t!=!!t&&(t=null)),!i)return null;if(n=i.length-1,e=n*N+1,n=i[n]){for(;n%10==0;n/=10,e--);for(n=i[0];n>=10;n/=10,e++);}return t&&r.e+1>e&&(e=r.e+1),e},C.round=function(t,n){var r=new e(this);return(null==t||J(t,0,B,15))&&E(r,~~t+this.e+1,null!=n&&J(n,0,8,15,w)?0|n:U),r},C.shift=function(t){var n=this;return J(t,-I,I,16,"argument")?n.times("1e"+p(t)):new e(n.c&&n.c[0]&&(-I>t||t>I)?n.s*(0>t?0:1/0):n)},C.squareRoot=C.sqrt=function(){var t,n,r,a,s,u=this,c=u.c,l=u.s,f=u.e,p=j+4,m=new e("0.5");if(1!==l||!c||!c[0])return new e(!l||0>l&&(!c||c[0])?0/0:c?u:1/0);if(l=Math.sqrt(+u),0==l||l==1/0?(n=o(c),(n.length+f)%2==0&&(n+="0"),l=Math.sqrt(n),f=i((f+1)/2)-(0>f||f%2),l==1/0?n="1e"+f:(n=l.toExponential(),n=n.slice(0,n.indexOf("e")+1)+f),r=new e(n)):r=new e(l+""),r.c[0])for(f=r.e,l=f+p,3>l&&(l=0);;)if(s=r,r=m.times(s.plus(S(u,s,p,1))),o(s.c).slice(0,l)===(n=o(r.c)).slice(0,l)){if(r.el&&(g=w,w=x,x=g,a=l,l=m,m=a),a=l+m,g=[];a--;g.push(0));for(y=F,v=T,a=m;--a>=0;){for(r=0,h=x[a]%v,d=x[a]/v|0,u=l,s=a+u;s>a;)f=w[--u]%v,p=w[u]/v|0,c=d*f+p*h,f=h*f+c%v*v+g[s]+r,r=(f/y|0)+(c/v|0)+d*p,g[s--]=f%y;g[s]=r}return r?++o:g.shift(),P(t,g,o)},C.toDigits=function(t,n){var r=new e(this);return t=null!=t&&J(t,1,B,18,"precision")?0|t:null,n=null!=n&&J(n,0,8,18,w)?0|n:U,t?E(r,t,n):r},C.toExponential=function(t,e){return m(this,null!=t&&J(t,0,B,19)?~~t+1:null,e,19)},C.toFixed=function(t,e){return m(this,null!=t&&J(t,0,B,20)?~~t+this.e+1:null,e,20)},C.toFormat=function(t,e){var n=m(this,null!=t&&J(t,0,B,21)?~~t+this.e+1:null,e,21);if(this.c){var r,i=n.split("."),o=+X.groupSize,a=+X.secondaryGroupSize,s=X.groupSeparator,u=i[0],c=i[1],l=this.s<0,f=l?u.slice(1):u,p=f.length;if(a&&(r=o,o=a,a=r,p-=r),o>0&&p>0){for(r=p%o||o,u=f.substr(0,r);p>r;r+=o)u+=s+f.substr(r,o);a>0&&(u+=s+f.slice(r)),l&&(u="-"+u)}n=c?u+X.decimalSeparator+((a=+X.fractionGroupSize)?c.replace(new RegExp("\\d{"+a+"}\\B","g"),"$&"+X.fractionGroupSeparator):c):u}return n},C.toFraction=function(t){var n,r,i,a,s,u,c,l,f,p=V,m=this,h=m.c,d=new e(L),g=r=new e(L),y=c=new e(L);if(null!=t&&(V=!1,u=new e(t),V=p,(!(p=u.isInt())||u.lt(L))&&(V&&k(22,"max denominator "+(p?"out of range":"not an integer"),t),t=!p&&u.c&&E(u,u.e+1,1).gte(L)?u:null)),!h)return m.toString();for(f=o(h),a=d.e=f.length-m.e-1,d.c[0]=O[(s=a%N)<0?N+s:s],t=!t||u.cmp(d)>0?a>0?d:g:u,s=G,G=1/0,u=new e(f),c.c[0]=0;l=S(u,d,0,1),i=r.plus(l.times(y)),1!=i.cmp(t);)r=y,y=i,g=c.plus(l.times(i=g)),c=i,d=u.minus(l.times(i=d)),u=i;return i=S(t.minus(r),y,0,1),c=c.plus(i.times(g)),r=r.plus(i.times(y)),c.s=g.s=m.s,a*=2,n=S(g,y,a,U).minus(m).abs().cmp(S(c,r,a,U).minus(m).abs())<1?[g.toString(),y.toString()]:[c.toString(),r.toString()],G=s,n},C.toNumber=function(){var t=this;return+t||(t.s?0*t.s:0/0)},C.toPower=C.pow=function(t){var n,r,i=v(0>t?-t:+t),o=this;if(!J(t,-I,I,23,"exponent")&&(!isFinite(t)||i>I&&(t/=0)||parseFloat(t)!=t&&!(t=0/0)))return new e(Math.pow(+o,t));for(n=z?y(z/N+2):0,r=new e(L);;){if(i%2){if(r=r.times(o),!r.c)break;n&&r.c.length>n&&(r.c.length=n)}if(i=v(i/2),!i)break;o=o.times(o),n&&o.c&&o.c.length>n&&(o.c.length=n)}return 0>t&&(r=L.div(r)),n?E(r,z,U):r},C.toPrecision=function(t,e){return m(this,null!=t&&J(t,1,B,24,"precision")?0|t:null,e,24)},C.toString=function(t){var e,r=this,i=r.s,a=r.e;return null===a?i?(e="Infinity",0>i&&(e="-"+e)):e="NaN":(e=o(r.c),e=null!=t&&J(t,2,64,25,"base")?n(f(e,a),0|t,10,i):H>=a||a>=q?l(e,a):f(e,a),0>i&&r.c[0]&&(e="-"+e)),e},C.truncated=C.trunc=function(){return E(new e(this),this.e+1,1)},C.valueOf=C.toJSON=function(){return this.toString()},null!=t&&e.config(t),e}function i(t){var e=0|t;return t>0||t===e?e:e-1}function o(t){for(var e,n,r=1,i=t.length,o=t[0]+"";i>r;){for(e=t[r++]+"",n=N-e.length;n--;e="0"+e);o+=e}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function a(t,e){var n,r,i=t.c,o=e.c,a=t.s,s=e.s,u=t.e,c=e.e;if(!a||!s)return null;if(n=i&&!i[0],r=o&&!o[0],n||r)return n?r?0:-s:a;if(a!=s)return a;if(n=0>a,r=u==c,!i||!o)return r?0:!i^n?1:-1;if(!r)return u>c^n?1:-1;for(s=(u=i.length)<(c=o.length)?u:c,a=0;s>a;a++)if(i[a]!=o[a])return i[a]>o[a]^n?1:-1;return u==c?0:u>c^n?1:-1}function s(t,e,n){return(t=p(t))>=e&&n>=t}function u(t){return"[object Array]"==Object.prototype.toString.call(t)}function c(t,e,n){for(var r,i,o=[0],a=0,s=t.length;s>a;){for(i=o.length;i--;o[i]*=e);for(o[r=0]+=_.indexOf(t.charAt(a++));rn-1&&(null==o[r+1]&&(o[r+1]=0),o[r+1]+=o[r]/n|0,o[r]%=n)}return o.reverse()}function l(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(0>e?"e":"e+")+e}function f(t,e){var n,r;if(0>e){for(r="0.";++e;r+="0");t=r+t}else if(n=t.length,++e>n){for(r="0",e-=n;--e;r+="0");t+=r}else n>e&&(t=t.slice(0,e)+"."+t.slice(e));return t}function p(t){return t=parseFloat(t),0>t?y(t):v(t)}var m,h,d,g=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,y=Math.ceil,v=Math.floor,b=" not a boolean or binary digit",w="rounding mode",x="number type has more than 15 significant digits",_="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_",F=1e14,N=14,I=9007199254740991,O=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],T=1e7,B=1e9;if(m=r(),"function"==typeof define&&define.amd)define(function(){return m});else if("undefined"!=typeof e&&e.exports){if(e.exports=m,!h)try{h=t("crypto")}catch(A){}}else n.BigNumber=m}(this)},{crypto:28}],web3:[function(t,e,n){var r=t("./lib/web3");r.providers.HttpProvider=t("./lib/web3/httpprovider"),r.providers.QtSyncProvider=t("./lib/web3/qtsync"),r.eth.contract=t("./lib/web3/contract"),r.abi=t("./lib/solidity/abi"),"undefined"!=typeof window&&"undefined"==typeof window.web3&&(window.web3=r),e.exports=r},{"./lib/solidity/abi":1,"./lib/web3":10,"./lib/web3/contract":11,"./lib/web3/httpprovider":19,"./lib/web3/qtsync":24}]},{},["web3"]); \ No newline at end of file +require=function t(e,n,r){function o(a,s){if(!n[a]){if(!e[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[a]={exports:{}};e[a][0].call(l.exports,function(t){var n=e[a][1][t];return o(n?n:t)},l,l.exports,t,e,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a0&&console.warn("didn't found matching constructor, using default one"),"")};e.exports={formatConstructorParams:i}},{"./coder":2,"./utils":5}],2:[function(t,e,n){var r=t("bignumber.js"),o=t("../utils/utils"),i=t("./formatters"),a=t("./param"),s=function(t){return"[]"===t.slice(-2)},u=function(t){this._name=t.name,this._match=t.match,this._mode=t.mode,this._inputFormatter=t.inputFormatter,this._outputFormatter=t.outputFormatter};u.prototype.isType=function(t){return"strict"===this._match?this._name===t||0===t.indexOf(this._name)&&"[]"===t.slice(this._name.length):"prefix"===this._match?0===t.indexOf(this._name):void 0},u.prototype.formatInput=function(t,e){if(o.isArray(t)&&e){var n=this;return t.map(function(t){return n._inputFormatter(t)}).reduce(function(t,e){return t.combine(e)},i.formatInputInt(t.length)).withOffset(32)}return this._inputFormatter(t)},u.prototype.formatOutput=function(t,e){if(e){for(var n=[],o=new r(t.dynamicPart().slice(0,64),16),i=0;64*o>i;i+=64)n.push(this._outputFormatter(new a(t.dynamicPart().substr(i+64,64))));return n}return this._outputFormatter(t)},u.prototype.sliceParam=function(t,e,n){return"bytes"===this._mode?a.decodeBytes(t,e):s(n)?a.decodeArray(t,e):a.decodeParam(t,e)};var c=function(t){this._types=t};c.prototype._requireType=function(t){var e=this._types.filter(function(e){return e.isType(t)})[0];if(!e)throw Error("invalid solidity type!: "+t);return e},c.prototype._formatInput=function(t,e){return this._requireType(t).formatInput(e,s(t))},c.prototype.encodeParam=function(t,e){return this._formatInput(t,e).encode()},c.prototype.encodeParams=function(t,e){var n=this,r=t.map(function(t,r){return n._formatInput(t,e[r])});return a.encodeList(r)},c.prototype.decodeParam=function(t,e){return this.decodeParams([t],e)[0]},c.prototype.decodeParams=function(t,e){var n=this;return t.map(function(t,r){var o=n._requireType(t),i=o.sliceParam(e,r,t);return o.formatOutput(i,s(t))})};var l=new c([new u({name:"address",match:"strict",mode:"value",inputFormatter:i.formatInputInt,outputFormatter:i.formatOutputAddress}),new u({name:"bool",match:"strict",mode:"value",inputFormatter:i.formatInputBool,outputFormatter:i.formatOutputBool}),new u({name:"int",match:"prefix",mode:"value",inputFormatter:i.formatInputInt,outputFormatter:i.formatOutputInt}),new u({name:"uint",match:"prefix",mode:"value",inputFormatter:i.formatInputInt,outputFormatter:i.formatOutputUInt}),new u({name:"bytes",match:"strict",mode:"bytes",inputFormatter:i.formatInputDynamicBytes,outputFormatter:i.formatOutputDynamicBytes}),new u({name:"bytes",match:"prefix",mode:"value",inputFormatter:i.formatInputBytes,outputFormatter:i.formatOutputBytes}),new u({name:"real",match:"prefix",mode:"value",inputFormatter:i.formatInputReal,outputFormatter:i.formatOutputReal}),new u({name:"ureal",match:"prefix",mode:"value",inputFormatter:i.formatInputReal,outputFormatter:i.formatOutputUReal})]);e.exports=l},{"../utils/utils":8,"./formatters":3,"./param":4,"bignumber.js":"bignumber.js"}],3:[function(t,e,n){var r=t("bignumber.js"),o=t("../utils/utils"),i=t("../utils/config"),a=t("./param"),s=function(t){var e=2*i.ETH_PADDING;r.config(i.ETH_BIGNUMBER_ROUNDING_MODE);var n=o.padLeft(o.toTwosComplement(t).round().toString(16),e);return new a(n)},u=function(t){var e=o.fromAscii(t,i.ETH_PADDING).substr(2);return new a(e)},c=function(t){var e=o.fromAscii(t,i.ETH_PADDING).substr(2);return new a(s(t.length).value+e,32)},l=function(t){var e="000000000000000000000000000000000000000000000000000000000000000"+(t?"1":"0");return new a(e)},f=function(t){return s(new r(t).times(new r(2).pow(128)))},p=function(t){return"1"===new r(t.substr(0,1),16).toString(2).substr(0,1)},m=function(t){var e=t.staticPart()||"0";return p(e)?new r(e,16).minus(new r("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16)).minus(1):new r(e,16)},h=function(t){var e=t.staticPart()||"0";return new r(e,16)},d=function(t){return m(t).dividedBy(new r(2).pow(128))},g=function(t){return h(t).dividedBy(new r(2).pow(128))},y=function(t){return"0000000000000000000000000000000000000000000000000000000000000001"===t.staticPart()?!0:!1},v=function(t){return o.toAscii(t.staticPart())},b=function(t){return o.toAscii(t.dynamicPart().slice(64))},w=function(t){var e=t.staticPart();return"0x"+e.slice(e.length-40,e.length)};e.exports={formatInputInt:s,formatInputBytes:u,formatInputDynamicBytes:c,formatInputBool:l,formatInputReal:f,formatOutputInt:m,formatOutputUInt:h,formatOutputReal:d,formatOutputUReal:g,formatOutputBool:y,formatOutputBytes:v,formatOutputDynamicBytes:b,formatOutputAddress:w}},{"../utils/config":7,"../utils/utils":8,"./param":4,"bignumber.js":"bignumber.js"}],4:[function(t,e,n){var r=t("../utils/utils"),o=function(t,e){this.value=t||"",this.offset=e};o.prototype.dynamicPartLength=function(){return this.dynamicPart().length/2},o.prototype.withOffset=function(t){return new o(this.value,t)},o.prototype.combine=function(t){return new o(this.value+t.value)},o.prototype.isDynamic=function(){return this.value.length>64},o.prototype.offsetAsBytes=function(){return this.isDynamic()?r.padLeft(r.toTwosComplement(this.offset).toString(16),64):""},o.prototype.staticPart=function(){return this.isDynamic()?this.offsetAsBytes():this.value},o.prototype.dynamicPart=function(){return this.isDynamic()?this.value:""},o.prototype.encode=function(){return this.staticPart()+this.dynamicPart()},o.encodeList=function(t){var e=32*t.length,n=t.map(function(t){if(!t.isDynamic())return t;var n=e;return e+=t.dynamicPartLength(),t.withOffset(n)});return n.reduce(function(t,e){return t+e.dynamicPart()},n.reduce(function(t,e){return t+e.staticPart()},""))},o.decodeParam=function(t,e){return e=e||0,new o(t.substr(64*e,64))};var i=function(t,e){return parseInt("0x"+t.substr(64*e,64))};o.decodeBytes=function(t,e){e=e||0;var n=i(t,e);return new o(t.substr(2*n,128))},o.decodeArray=function(t,e){e=e||0;var n=i(t,e),r=parseInt("0x"+t.substr(2*n,64));return new o(t.substr(2*n,64*(r+1)))},e.exports=o},{"../utils/utils":8}],5:[function(t,e,n){var r=function(t,e){return t.filter(function(t){return"constructor"===t.type&&t.inputs.length===e})[0]};e.exports={getConstructor:r}},{}],6:[function(t,e,n){"use strict";n.XMLHttpRequest="undefined"==typeof XMLHttpRequest?{}:XMLHttpRequest},{}],7:[function(t,e,n){var r=t("bignumber.js"),o=["wei","Kwei","Mwei","Gwei","szabo","finney","ether","grand","Mether","Gether","Tether","Pether","Eether","Zether","Yether","Nether","Dether","Vether","Uether"];e.exports={ETH_PADDING:32,ETH_SIGNATURE_LENGTH:4,ETH_UNITS:o,ETH_BIGNUMBER_ROUNDING_MODE:{ROUNDING_MODE:r.ROUND_DOWN},ETH_POLLING_TIMEOUT:1e3,defaultBlock:"latest",defaultAccount:void 0}},{"bignumber.js":"bignumber.js"}],8:[function(t,e,n){var r=t("bignumber.js"),o={wei:"1",kwei:"1000",ada:"1000",mwei:"1000000",babbage:"1000000",gwei:"1000000000",shannon:"1000000000",szabo:"1000000000000",finney:"1000000000000000",ether:"1000000000000000000",kether:"1000000000000000000000",grand:"1000000000000000000000",einstein:"1000000000000000000000",mether:"1000000000000000000000000",gether:"1000000000000000000000000000",tether:"1000000000000000000000000000000"},i=function(t,e,n){return new Array(e-t.length+1).join(n?n:"0")+t},a=function(t){var e="",n=0,r=t.length;for("0x"===t.substring(0,2)&&(n=2);r>n;n+=2){var o=parseInt(t.substr(n,2),16);if(0===o)break;e+=String.fromCharCode(o)}return e},s=function(t){for(var e="",n=0;nthis._inputTypes.length&&i.isObject(t[t.length-1])&&(e=t.pop()),e.to=this._address,e.data="0x"+this.signature()+o.encodeParams(this._inputTypes,t),e},a.prototype.signature=function(){return r.sha3(r.fromAscii(this._name)).slice(2,10)},a.prototype.call=function(){var t=this.toPayload.apply(this,Array.prototype.slice.call(arguments)),e=r.eth.call(t);e=e.length>=2?e.slice(2):e;var n=o.decodeParams(this._outputTypes,e);return 1===n.length?n[0]:n},a.prototype.sendTransaction=function(){var t=this.toPayload.apply(this,Array.prototype.slice.call(arguments));r.eth.sendTransaction(t)},a.prototype.displayName=function(){return i.extractDisplayName(this._name)},a.prototype.typeName=function(){return i.extractTypeName(this._name)},a.prototype.execute=function(){var t=!this._constant;return t?this.sendTransaction.apply(this,Array.prototype.slice.call(arguments)):this.call.apply(this,Array.prototype.slice.call(arguments))},a.prototype.attachToContract=function(t){var e=this.execute.bind(this);e.call=this.call.bind(this),e.sendTransaction=this.sendTransaction.bind(this);var n=this.displayName();t[n]||(t[n]=e),t[n][this.typeName()]=e},e.exports=a},{"../solidity/coder":2,"../utils/utils":8,"../web3":10}],19:[function(t,e,n){"use strict";var r=t("xmlhttprequest").XMLHttpRequest,o=t("./errors"),i=function(t){this.host=t||"http://localhost:8545"};i.prototype.send=function(t){var e=new r;e.open("POST",this.host,!1);try{e.send(JSON.stringify(t))}catch(n){throw o.InvalidConnection(this.host)}var i=e.responseText;try{i=JSON.parse(i)}catch(a){throw o.InvalidResponse(i)}return i},i.prototype.sendAsync=function(t,e){var n=new r;n.onreadystatechange=function(){if(4===n.readyState){var t=n.responseText,r=null;try{t=JSON.parse(t)}catch(i){r=o.InvalidResponse(t)}e(r,t)}},n.open("POST",this.host,!0);try{n.send(JSON.stringify(t))}catch(i){e(o.InvalidConnection(this.host))}},e.exports=i},{"./errors":13,xmlhttprequest:6}],20:[function(t,e,n){var r=function(){return arguments.callee._singletonInstance?arguments.callee._singletonInstance:(arguments.callee._singletonInstance=this,void(this.messageId=1))};r.getInstance=function(){var t=new r;return t},r.prototype.toPayload=function(t,e){return t||console.error("jsonrpc method should be specified!"),{jsonrpc:"2.0",method:t,params:e||[],id:this.messageId++}},r.prototype.isValidResponse=function(t){return!!t&&!t.error&&"2.0"===t.jsonrpc&&"number"==typeof t.id&&void 0!==t.result},r.prototype.toBatchPayload=function(t){var e=this;return t.map(function(t){return e.toPayload(t.method,t.params)})},e.exports=r},{}],21:[function(t,e,n){var r=t("./requestmanager"),o=t("../utils/utils"),i=t("./errors"),a=function(t){this.name=t.name,this.call=t.call,this.params=t.params||0,this.inputFormatter=t.inputFormatter,this.outputFormatter=t.outputFormatter};a.prototype.getCall=function(t){return o.isFunction(this.call)?this.call(t):this.call},a.prototype.extractCallback=function(t){return o.isFunction(t[t.length-1])?t.pop():null},a.prototype.validateArgs=function(t){if(t.length!==this.params)throw i.InvalidNumberOfParams()},a.prototype.formatInput=function(t){return this.inputFormatter?this.inputFormatter.map(function(e,n){return e?e(t[n]):t[n]}):t},a.prototype.formatOutput=function(t){return this.outputFormatter&&null!==t?this.outputFormatter(t):t},a.prototype.attachToObject=function(t){var e=this.send.bind(this);e.call=this.call;var n=this.name.split(".");n.length>1?(t[n[0]]=t[n[0]]||{},t[n[0]][n[1]]=e):t[n[0]]=e},a.prototype.toPayload=function(t){var e=this.getCall(t),n=this.extractCallback(t),r=this.formatInput(t);return this.validateArgs(r),{method:e,params:r,callback:n}},a.prototype.send=function(){var t=this.toPayload(Array.prototype.slice.call(arguments));if(t.callback){var e=this;return r.getInstance().sendAsync(t,function(n,r){t.callback(null,e.formatOutput(r))})}return this.formatOutput(r.getInstance().send(t))},e.exports=a},{"../utils/utils":8,"./errors":13,"./requestmanager":25}],22:[function(t,e,n){var r=t("../utils/utils"),o=t("./property"),i=[],a=[new o({name:"listening",getter:"net_listening"}),new o({name:"peerCount",getter:"net_peerCount",outputFormatter:r.toDecimal})];e.exports={methods:i,properties:a}},{"../utils/utils":8,"./property":23}],23:[function(t,e,n){var r=t("./requestmanager"),o=function(t){this.name=t.name,this.getter=t.getter,this.setter=t.setter,this.outputFormatter=t.outputFormatter,this.inputFormatter=t.inputFormatter};o.prototype.formatInput=function(t){return this.inputFormatter?this.inputFormatter(t):t},o.prototype.formatOutput=function(t){return this.outputFormatter&&null!==t?this.outputFormatter(t):t},o.prototype.attachToObject=function(t){var e={get:this.get.bind(this),set:this.set.bind(this)},n=this.name.split(".");n.length>1?(t[n[0]]=t[n[0]]||{},Object.defineProperty(t[n[0]],n[1],e)):Object.defineProperty(t,n[0],e)},o.prototype.get=function(){return this.formatOutput(r.getInstance().send({method:this.getter}))},o.prototype.set=function(t){return r.getInstance().send({method:this.setter,params:[this.formatInput(t)]})},e.exports=o},{"./requestmanager":25}],24:[function(t,e,n){var r=function(){};r.prototype.send=function(t){var e=navigator.qt.callMethod(JSON.stringify(t));return JSON.parse(e)},e.exports=r},{}],25:[function(t,e,n){var r=t("./jsonrpc"),o=t("../utils/utils"),i=t("../utils/config"),a=t("./errors"),s=function(t){return arguments.callee._singletonInstance?arguments.callee._singletonInstance:(arguments.callee._singletonInstance=this,this.provider=t,this.polls=[],this.timeout=null,void this.poll())};s.getInstance=function(){var t=new s;return t},s.prototype.send=function(t){if(!this.provider)return console.error(a.InvalidProvider()),null;var e=r.getInstance().toPayload(t.method,t.params),n=this.provider.send(e);if(!r.getInstance().isValidResponse(n))throw a.InvalidResponse(n);return n.result},s.prototype.sendAsync=function(t,e){if(!this.provider)return e(a.InvalidProvider());var n=r.getInstance().toPayload(t.method,t.params);this.provider.sendAsync(n,function(t,n){return t?e(t):r.getInstance().isValidResponse(n)?void e(null,n.result):e(a.InvalidResponse(n))})},s.prototype.setProvider=function(t){this.provider=t},s.prototype.startPolling=function(t,e,n,r){this.polls.push({data:t,id:e,callback:n,uninstall:r})},s.prototype.stopPolling=function(t){for(var e=this.polls.length;e--;){var n=this.polls[e];n.id===t&&this.polls.splice(e,1)}},s.prototype.reset=function(){this.polls.forEach(function(t){t.uninstall(t.id)}),this.polls=[],this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.poll()},s.prototype.poll=function(){if(this.timeout=setTimeout(this.poll.bind(this),i.ETH_POLLING_TIMEOUT),this.polls.length){if(!this.provider)return void console.error(a.InvalidProvider());var t=r.getInstance().toBatchPayload(this.polls.map(function(t){return t.data})),e=this;this.provider.sendAsync(t,function(t,n){if(!t){if(!o.isArray(n))throw a.InvalidResponse(n);n.map(function(t,n){return t.callback=e.polls[n].callback,t}).filter(function(t){var e=r.getInstance().isValidResponse(t);return e||t.callback(a.InvalidResponse(t)),e}).filter(function(t){return o.isArray(t.result)&&t.result.length>0}).forEach(function(t){t.callback(null,t.result)})}})}},e.exports=s},{"../utils/config":7,"../utils/utils":8,"./errors":13,"./jsonrpc":20}],26:[function(t,e,n){var r=t("./method"),o=t("./formatters"),i=new r({name:"post",call:"shh_post",params:1,inputFormatter:[o.inputPostFormatter]}),a=new r({name:"newIdentity",call:"shh_newIdentity",params:0}),s=new r({name:"hasIdentity",call:"shh_hasIdentity",params:1}),u=new r({name:"newGroup",call:"shh_newGroup",params:0}),c=new r({name:"addToGroup",call:"shh_addToGroup",params:0}),l=[i,a,s,u,c];e.exports={methods:l}},{"./formatters":17,"./method":21}],27:[function(t,e,n){var r=t("./method"),o=function(){var t=function(t){return"string"==typeof t[0]?"eth_newBlockFilter":"eth_newFilter"},e=new r({name:"newFilter",call:t,params:1}),n=new r({name:"uninstallFilter",call:"eth_uninstallFilter",params:1}),o=new r({name:"getLogs",call:"eth_getFilterLogs",params:1}),i=new r({name:"poll",call:"eth_getFilterChanges",params:1});return[e,n,o,i]},i=function(){var t=new r({name:"newFilter",call:"shh_newFilter",params:1}),e=new r({name:"uninstallFilter",call:"shh_uninstallFilter",params:1}),n=new r({name:"getLogs",call:"shh_getMessages",params:1}),o=new r({name:"poll",call:"shh_getFilterChanges",params:1 +});return[t,e,n,o]};e.exports={eth:o,shh:i}},{"./method":21}],28:[function(t,e,n){},{}],"bignumber.js":[function(t,e,n){!function(n){"use strict";function r(t){function e(t,r){var o,i,a,s,u,c,l=this;if(!(l instanceof e))return J&&k(26,"constructor call without new",t),new e(t,r);if(null!=r&&V(r,2,64,R,"base")){if(r=0|r,c=t+"",10==r)return l=new e(t instanceof e?t:c),S(l,j+l.e+1,U);if((s="number"==typeof t)&&0*t!=0||!new RegExp("^-?"+(o="["+F.slice(0,r)+"]+")+"(?:\\."+o+")?$",37>r?"i":"").test(c))return d(l,c,s,r);s?(l.s=0>1/t?(c=c.slice(1),-1):1,J&&c.replace(/^0\.0*|\./,"").length>15&&k(R,_,t),s=!1):l.s=45===c.charCodeAt(0)?(c=c.slice(1),-1):1,c=n(c,10,r,l.s)}else{if(t instanceof e)return l.s=t.s,l.e=t.e,l.c=(t=t.c)?t.slice():t,void(R=0);if((s="number"==typeof t)&&0*t==0){if(l.s=0>1/t?(t=-t,-1):1,t===~~t){for(i=0,a=t;a>=10;a/=10,i++);return l.e=i,l.c=[t],void(R=0)}c=t+""}else{if(!g.test(c=t+""))return d(l,c,s);l.s=45===c.charCodeAt(0)?(c=c.slice(1),-1):1}}for((i=c.indexOf("."))>-1&&(c=c.replace(".","")),(a=c.search(/e/i))>0?(0>i&&(i=a),i+=+c.slice(a+1),c=c.substring(0,a)):0>i&&(i=c.length),a=0;48===c.charCodeAt(a);a++);for(u=c.length;48===c.charCodeAt(--u););if(c=c.slice(a,u+1))if(u=c.length,s&&J&&u>15&&k(R,_,l.s*t),i=i-a-1,i>G)l.c=l.e=null;else if(M>i)l.c=[l.e=0];else{if(l.e=i,l.c=[],a=(i+1)%I,0>i&&(a+=I),u>a){for(a&&l.c.push(+c.slice(0,a)),u-=I;u>a;)l.c.push(+c.slice(a,a+=I));c=c.slice(a),a=I-c.length}else a-=u;for(;a--;c+="0");l.c.push(+c)}else l.c=[l.e=0];R=0}function n(t,n,r,o){var a,s,u,l,p,m,h,d=t.indexOf("."),g=j,y=U;for(37>r&&(t=t.toLowerCase()),d>=0&&(u=z,z=0,t=t.replace(".",""),h=new e(r),p=h.pow(t.length-d),z=u,h.c=c(f(i(p.c),p.e),10,n),h.e=h.c.length),m=c(t,r,n),s=u=m.length;0==m[--u];m.pop());if(!m[0])return"0";if(0>d?--s:(p.c=m,p.e=s,p.s=o,p=E(p,h,g,y,n),m=p.c,l=p.r,s=p.e),a=s+g+1,d=m[a],u=n/2,l=l||0>a||null!=m[a+1],l=4>y?(null!=d||l)&&(0==y||y==(p.s<0?3:2)):d>u||d==u&&(4==y||l||6==y&&1&m[a-1]||y==(p.s<0?8:7)),1>a||!m[0])t=l?f("1",-g):"0";else{if(m.length=a,l)for(--n;++m[--a]>n;)m[a]=0,a||(++s,m.unshift(1));for(u=m.length;!m[--u];);for(d=0,t="";u>=d;t+=F.charAt(m[d++]));t=f(t,s)}return t}function m(t,n,r,o){var a,s,u,c,p;if(r=null!=r&&V(r,0,8,o,w)?0|r:U,!t.c)return t.toString();if(a=t.c[0],u=t.e,null==n)p=i(t.c),p=19==o||24==o&&H>=u?l(p,u):f(p,u);else if(t=S(new e(t),n,r),s=t.e,p=i(t.c),c=p.length,19==o||24==o&&(s>=n||H>=s)){for(;n>c;p+="0",c++);p=l(p,s)}else if(n-=u,p=f(p,s),s+1>c){if(--n>0)for(p+=".";n--;p+="0");}else if(n+=s-c,n>0)for(s+1==c&&(p+=".");n--;p+="0");return t.s<0&&a?"-"+p:p}function T(t,n){var r,o,i=0;for(u(t[0])&&(t=t[0]),r=new e(t[0]);++it||t>n||t!=p(t))&&k(r,(o||"decimal places")+(e>t||t>n?" out of range":" not an integer"),t),!0}function D(t,e,n){for(var r=1,o=e.length;!e[--o];e.pop());for(o=e[0];o>=10;o/=10,r++);return(n=r+n*I-1)>G?t.c=t.e=null:M>n?t.c=[t.e=0]:(t.e=n,t.c=e),t}function k(t,e,n){var r=new Error(["new BigNumber","cmp","config","div","divToInt","eq","gt","gte","lt","lte","minus","mod","plus","precision","random","round","shift","times","toDigits","toExponential","toFixed","toFormat","toFraction","pow","toPrecision","toString","BigNumber"][t]+"() "+e+": "+n);throw r.name="BigNumber Error",R=0,r}function S(t,e,n,r){var o,i,a,s,u,c,l,f=t.c,p=O;if(f){t:{for(o=1,s=f[0];s>=10;s/=10,o++);if(i=e-o,0>i)i+=I,a=e,u=f[c=0],l=u/p[o-a-1]%10|0;else if(c=y((i+1)/I),c>=f.length){if(!r)break t;for(;f.length<=c;f.push(0));u=l=0,o=1,i%=I,a=i-I+1}else{for(u=s=f[c],o=1;s>=10;s/=10,o++);i%=I,a=i-I+o,l=0>a?0:u/p[o-a-1]%10|0}if(r=r||0>e||null!=f[c+1]||(0>a?u:u%p[o-a-1]),r=4>n?(l||r)&&(0==n||n==(t.s<0?3:2)):l>5||5==l&&(4==n||r||6==n&&(i>0?a>0?u/p[o-a]:0:f[c-1])%10&1||n==(t.s<0?8:7)),1>e||!f[0])return f.length=0,r?(e-=t.e+1,f[0]=p[e%I],t.e=-e||0):f[0]=t.e=0,t;if(0==i?(f.length=c,s=1,c--):(f.length=c+1,s=p[I-i],f[c]=a>0?v(u/p[o-a]%p[a])*s:0),r)for(;;){if(0==c){for(i=1,a=f[0];a>=10;a/=10,i++);for(a=f[0]+=s,s=1;a>=10;a/=10,s++);i!=s&&(t.e++,f[0]==x&&(f[0]=1));break}if(f[c]+=s,f[c]!=x)break;f[c--]=0,s=1}for(i=f.length;0===f[--i];f.pop());}t.e>G?t.c=t.e=null:t.en?null!=(t=o[n++]):void 0};return a(e="DECIMAL_PLACES")&&V(t,0,P,2,e)&&(j=0|t),r[e]=j,a(e="ROUNDING_MODE")&&V(t,0,8,2,e)&&(U=0|t),r[e]=U,a(e="EXPONENTIAL_AT")&&(u(t)?V(t[0],-P,0,2,e)&&V(t[1],0,P,2,e)&&(H=0|t[0],q=0|t[1]):V(t,-P,P,2,e)&&(H=-(q=0|(0>t?-t:t)))),r[e]=[H,q],a(e="RANGE")&&(u(t)?V(t[0],-P,-1,2,e)&&V(t[1],1,P,2,e)&&(M=0|t[0],G=0|t[1]):V(t,-P,P,2,e)&&(0|t?M=-(G=0|(0>t?-t:t)):J&&k(2,e+" cannot be zero",t))),r[e]=[M,G],a(e="ERRORS")&&(t===!!t||1===t||0===t?(R=0,V=(J=!!t)?A:s):J&&k(2,e+b,t)),r[e]=J,a(e="CRYPTO")&&(t===!!t||1===t||0===t?(W=!(!t||!h||"object"!=typeof h),t&&!W&&J&&k(2,"crypto unavailable",h)):J&&k(2,e+b,t)),r[e]=W,a(e="MODULO_MODE")&&V(t,0,9,2,e)&&($=0|t),r[e]=$,a(e="POW_PRECISION")&&V(t,0,P,2,e)&&(z=0|t),r[e]=z,a(e="FORMAT")&&("object"==typeof t?X=t:J&&k(2,e+" not an object",t)),r[e]=X,r},e.max=function(){return T(arguments,C.lt)},e.min=function(){return T(arguments,C.gt)},e.random=function(){var t=9007199254740992,n=Math.random()*t&2097151?function(){return v(Math.random()*t)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)};return function(t){var r,o,i,a,s,u=0,c=[],l=new e(L);if(t=null!=t&&V(t,0,P,14)?0|t:j,a=y(t/I),W)if(h&&h.getRandomValues){for(r=h.getRandomValues(new Uint32Array(a*=2));a>u;)s=131072*r[u]+(r[u+1]>>>11),s>=9e15?(o=h.getRandomValues(new Uint32Array(2)),r[u]=o[0],r[u+1]=o[1]):(c.push(s%1e14),u+=2);u=a/2}else if(h&&h.randomBytes){for(r=h.randomBytes(a*=7);a>u;)s=281474976710656*(31&r[u])+1099511627776*r[u+1]+4294967296*r[u+2]+16777216*r[u+3]+(r[u+4]<<16)+(r[u+5]<<8)+r[u+6],s>=9e15?h.randomBytes(7).copy(r,u):(c.push(s%1e14),u+=7);u=a/7}else J&&k(14,"crypto unavailable",h);if(!u)for(;a>u;)s=n(),9e15>s&&(c[u++]=s%1e14);for(a=c[--u],t%=I,a&&t&&(s=O[I-t],c[u]=v(a/s)*s);0===c[u];c.pop(),u--);if(0>u)c=[i=0];else{for(i=-1;0===c[0];c.shift(),i-=I);for(u=1,s=c[0];s>=10;s/=10,u++);I>u&&(i-=I-u)}return l.e=i,l.c=c,l}}(),E=function(){function t(t,e,n){var r,o,i,a,s=0,u=t.length,c=e%B,l=e/B|0;for(t=t.slice();u--;)i=t[u]%B,a=t[u]/B|0,r=l*i+a*c,o=c*i+r%B*B+s,s=(o/n|0)+(r/B|0)+l*a,t[u]=o%n;return s&&t.unshift(s),t}function n(t,e,n,r){var o,i;if(n!=r)i=n>r?1:-1;else for(o=i=0;n>o;o++)if(t[o]!=e[o]){i=t[o]>e[o]?1:-1;break}return i}function r(t,e,n,r){for(var o=0;n--;)t[n]-=o,o=t[n]1;t.shift());}return function(i,a,s,u,c){var l,f,p,m,h,d,g,y,b,w,_,F,N,O,B,P,T,A=i.s==a.s?1:-1,D=i.c,k=a.c;if(!(D&&D[0]&&k&&k[0]))return new e(i.s&&a.s&&(D?!k||D[0]!=k[0]:k)?D&&0==D[0]||!k?0*A:A/0:0/0);for(y=new e(A),b=y.c=[],f=i.e-a.e,A=s+f+1,c||(c=x,f=o(i.e/I)-o(a.e/I),A=A/I|0),p=0;k[p]==(D[p]||0);p++);if(k[p]>(D[p]||0)&&f--,0>A)b.push(1),m=!0;else{for(O=D.length,P=k.length,p=0,A+=2,h=v(c/(k[0]+1)),h>1&&(k=t(k,h,c),D=t(D,h,c),P=k.length,O=D.length),N=P,w=D.slice(0,P),_=w.length;P>_;w[_++]=0);T=k.slice(),T.unshift(0),B=k[0],k[1]>=c/2&&B++;do{if(h=0,l=n(k,w,P,_),0>l){if(F=w[0],P!=_&&(F=F*c+(w[1]||0)),h=v(F/B),h>1)for(h>=c&&(h=c-1),d=t(k,h,c),g=d.length,_=w.length;1==n(d,w,g,_);)h--,r(d,g>P?T:k,g,c),g=d.length,l=1;else 0==h&&(l=h=1),d=k.slice(),g=d.length;if(_>g&&d.unshift(0),r(w,d,_,c),_=w.length,-1==l)for(;n(k,w,P,_)<1;)h++,r(w,_>P?T:k,_,c),_=w.length}else 0===l&&(h++,w=[0]);b[p++]=h,w[0]?w[_++]=D[N]||0:(w=[D[N]],_=1)}while((N++=10;A/=10,p++);S(y,s+(y.e=p+f*I-1)+1,u,m)}else y.e=f,y.r=+m;return y}}(),d=function(){var t=/^(-?)0([xbo])/i,n=/^([^.]+)\.$/,r=/^\.([^.]+)$/,o=/^-?(Infinity|NaN)$/,i=/^\s*\+|^\s+|\s+$/g;return function(a,s,u,c){var l,f=u?s:s.replace(i,"");if(o.test(f))a.s=isNaN(f)?null:0>f?-1:1;else{if(!u&&(f=f.replace(t,function(t,e,n){return l="x"==(n=n.toLowerCase())?16:"b"==n?2:8,c&&c!=l?t:e}),c&&(l=c,f=f.replace(n,"$1").replace(r,"0.$1")),s!=f))return new e(f,l);J&&k(R,"not a"+(c?" base "+c:"")+" number",s),a.s=null}a.c=a.e=null,R=0}}(),C.absoluteValue=C.abs=function(){var t=new e(this);return t.s<0&&(t.s=1),t},C.ceil=function(){return S(new e(this),this.e+1,2)},C.comparedTo=C.cmp=function(t,n){return R=1,a(this,new e(t,n))},C.decimalPlaces=C.dp=function(){var t,e,n=this.c;if(!n)return null;if(t=((e=n.length-1)-o(this.e/I))*I,e=n[e])for(;e%10==0;e/=10,t--);return 0>t&&(t=0),t},C.dividedBy=C.div=function(t,n){return R=3,E(this,new e(t,n),j,U)},C.dividedToIntegerBy=C.divToInt=function(t,n){return R=4,E(this,new e(t,n),0,1)},C.equals=C.eq=function(t,n){return R=5,0===a(this,new e(t,n))},C.floor=function(){return S(new e(this),this.e+1,3)},C.greaterThan=C.gt=function(t,n){return R=6,a(this,new e(t,n))>0},C.greaterThanOrEqualTo=C.gte=function(t,n){return R=7,1===(n=a(this,new e(t,n)))||0===n},C.isFinite=function(){return!!this.c},C.isInteger=C.isInt=function(){return!!this.c&&o(this.e/I)>this.c.length-2},C.isNaN=function(){return!this.s},C.isNegative=C.isNeg=function(){return this.s<0},C.isZero=function(){return!!this.c&&0==this.c[0]},C.lessThan=C.lt=function(t,n){return R=8,a(this,new e(t,n))<0},C.lessThanOrEqualTo=C.lte=function(t,n){return R=9,-1===(n=a(this,new e(t,n)))||0===n},C.minus=C.sub=function(t,n){var r,i,a,s,u=this,c=u.s;if(R=10,t=new e(t,n),n=t.s,!c||!n)return new e(0/0);if(c!=n)return t.s=-n,u.plus(t);var l=u.e/I,f=t.e/I,p=u.c,m=t.c;if(!l||!f){if(!p||!m)return p?(t.s=-n,t):new e(m?u:0/0);if(!p[0]||!m[0])return m[0]?(t.s=-n,t):new e(p[0]?u:3==U?-0:0)}if(l=o(l),f=o(f),p=p.slice(),c=l-f){for((s=0>c)?(c=-c,a=p):(f=l,a=m),a.reverse(),n=c;n--;a.push(0));a.reverse()}else for(i=(s=(c=p.length)<(n=m.length))?c:n,c=n=0;i>n;n++)if(p[n]!=m[n]){s=p[n]0)for(;n--;p[r++]=0);for(n=x-1;i>c;){if(p[--i]0?(u=s,r=l):(a=-a,r=c),r.reverse();a--;r.push(0));r.reverse()}for(a=c.length,n=l.length,0>a-n&&(r=l,l=c,c=r,n=a),a=0;n;)a=(c[--n]=c[n]+l[n]+a)/x|0,c[n]%=x;return a&&(c.unshift(a),++u),D(t,c,u)},C.precision=C.sd=function(t){var e,n,r=this,o=r.c;if(null!=t&&t!==!!t&&1!==t&&0!==t&&(J&&k(13,"argument"+b,t),t!=!!t&&(t=null)),!o)return null;if(n=o.length-1,e=n*I+1,n=o[n]){for(;n%10==0;n/=10,e--);for(n=o[0];n>=10;n/=10,e++);}return t&&r.e+1>e&&(e=r.e+1),e},C.round=function(t,n){var r=new e(this);return(null==t||V(t,0,P,15))&&S(r,~~t+this.e+1,null!=n&&V(n,0,8,15,w)?0|n:U),r},C.shift=function(t){var n=this;return V(t,-N,N,16,"argument")?n.times("1e"+p(t)):new e(n.c&&n.c[0]&&(-N>t||t>N)?n.s*(0>t?0:1/0):n)},C.squareRoot=C.sqrt=function(){var t,n,r,a,s,u=this,c=u.c,l=u.s,f=u.e,p=j+4,m=new e("0.5");if(1!==l||!c||!c[0])return new e(!l||0>l&&(!c||c[0])?0/0:c?u:1/0);if(l=Math.sqrt(+u),0==l||l==1/0?(n=i(c),(n.length+f)%2==0&&(n+="0"),l=Math.sqrt(n),f=o((f+1)/2)-(0>f||f%2),l==1/0?n="1e"+f:(n=l.toExponential(),n=n.slice(0,n.indexOf("e")+1)+f),r=new e(n)):r=new e(l+""),r.c[0])for(f=r.e,l=f+p,3>l&&(l=0);;)if(s=r,r=m.times(s.plus(E(u,s,p,1))),i(s.c).slice(0,l)===(n=i(r.c)).slice(0,l)){if(r.el&&(g=w,w=_,_=g,a=l,l=m,m=a),a=l+m,g=[];a--;g.push(0));for(y=x,v=B,a=m;--a>=0;){for(r=0,h=_[a]%v,d=_[a]/v|0,u=l,s=a+u;s>a;)f=w[--u]%v,p=w[u]/v|0,c=d*f+p*h,f=h*f+c%v*v+g[s]+r,r=(f/y|0)+(c/v|0)+d*p,g[s--]=f%y;g[s]=r}return r?++i:g.shift(),D(t,g,i)},C.toDigits=function(t,n){var r=new e(this);return t=null!=t&&V(t,1,P,18,"precision")?0|t:null,n=null!=n&&V(n,0,8,18,w)?0|n:U,t?S(r,t,n):r},C.toExponential=function(t,e){return m(this,null!=t&&V(t,0,P,19)?~~t+1:null,e,19)},C.toFixed=function(t,e){return m(this,null!=t&&V(t,0,P,20)?~~t+this.e+1:null,e,20)},C.toFormat=function(t,e){var n=m(this,null!=t&&V(t,0,P,21)?~~t+this.e+1:null,e,21);if(this.c){var r,o=n.split("."),i=+X.groupSize,a=+X.secondaryGroupSize,s=X.groupSeparator,u=o[0],c=o[1],l=this.s<0,f=l?u.slice(1):u,p=f.length;if(a&&(r=i,i=a,a=r,p-=r),i>0&&p>0){for(r=p%i||i,u=f.substr(0,r);p>r;r+=i)u+=s+f.substr(r,i);a>0&&(u+=s+f.slice(r)),l&&(u="-"+u)}n=c?u+X.decimalSeparator+((a=+X.fractionGroupSize)?c.replace(new RegExp("\\d{"+a+"}\\B","g"),"$&"+X.fractionGroupSeparator):c):u}return n},C.toFraction=function(t){var n,r,o,a,s,u,c,l,f,p=J,m=this,h=m.c,d=new e(L),g=r=new e(L),y=c=new e(L);if(null!=t&&(J=!1,u=new e(t),J=p,(!(p=u.isInt())||u.lt(L))&&(J&&k(22,"max denominator "+(p?"out of range":"not an integer"),t),t=!p&&u.c&&S(u,u.e+1,1).gte(L)?u:null)),!h)return m.toString();for(f=i(h),a=d.e=f.length-m.e-1,d.c[0]=O[(s=a%I)<0?I+s:s],t=!t||u.cmp(d)>0?a>0?d:g:u,s=G,G=1/0,u=new e(f),c.c[0]=0;l=E(u,d,0,1),o=r.plus(l.times(y)),1!=o.cmp(t);)r=y,y=o,g=c.plus(l.times(o=g)),c=o,d=u.minus(l.times(o=d)),u=o;return o=E(t.minus(r),y,0,1),c=c.plus(o.times(g)),r=r.plus(o.times(y)),c.s=g.s=m.s,a*=2,n=E(g,y,a,U).minus(m).abs().cmp(E(c,r,a,U).minus(m).abs())<1?[g.toString(),y.toString()]:[c.toString(),r.toString()],G=s,n},C.toNumber=function(){var t=this;return+t||(t.s?0*t.s:0/0)},C.toPower=C.pow=function(t){var n,r,o=v(0>t?-t:+t),i=this;if(!V(t,-N,N,23,"exponent")&&(!isFinite(t)||o>N&&(t/=0)||parseFloat(t)!=t&&!(t=0/0)))return new e(Math.pow(+i,t));for(n=z?y(z/I+2):0,r=new e(L);;){if(o%2){if(r=r.times(i),!r.c)break;n&&r.c.length>n&&(r.c.length=n)}if(o=v(o/2),!o)break;i=i.times(i),n&&i.c&&i.c.length>n&&(i.c.length=n)}return 0>t&&(r=L.div(r)),n?S(r,z,U):r},C.toPrecision=function(t,e){return m(this,null!=t&&V(t,1,P,24,"precision")?0|t:null,e,24)},C.toString=function(t){var e,r=this,o=r.s,a=r.e;return null===a?o?(e="Infinity",0>o&&(e="-"+e)):e="NaN":(e=i(r.c),e=null!=t&&V(t,2,64,25,"base")?n(f(e,a),0|t,10,o):H>=a||a>=q?l(e,a):f(e,a),0>o&&r.c[0]&&(e="-"+e)),e},C.truncated=C.trunc=function(){return S(new e(this),this.e+1,1)},C.valueOf=C.toJSON=function(){return this.toString()},null!=t&&e.config(t),e}function o(t){var e=0|t;return t>0||t===e?e:e-1}function i(t){for(var e,n,r=1,o=t.length,i=t[0]+"";o>r;){for(e=t[r++]+"",n=I-e.length;n--;e="0"+e);i+=e}for(o=i.length;48===i.charCodeAt(--o););return i.slice(0,o+1||1)}function a(t,e){var n,r,o=t.c,i=e.c,a=t.s,s=e.s,u=t.e,c=e.e;if(!a||!s)return null;if(n=o&&!o[0],r=i&&!i[0],n||r)return n?r?0:-s:a;if(a!=s)return a;if(n=0>a,r=u==c,!o||!i)return r?0:!o^n?1:-1;if(!r)return u>c^n?1:-1;for(s=(u=o.length)<(c=i.length)?u:c,a=0;s>a;a++)if(o[a]!=i[a])return o[a]>i[a]^n?1:-1;return u==c?0:u>c^n?1:-1}function s(t,e,n){return(t=p(t))>=e&&n>=t}function u(t){return"[object Array]"==Object.prototype.toString.call(t)}function c(t,e,n){for(var r,o,i=[0],a=0,s=t.length;s>a;){for(o=i.length;o--;i[o]*=e);for(i[r=0]+=F.indexOf(t.charAt(a++));rn-1&&(null==i[r+1]&&(i[r+1]=0),i[r+1]+=i[r]/n|0,i[r]%=n)}return i.reverse()}function l(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(0>e?"e":"e+")+e}function f(t,e){var n,r;if(0>e){for(r="0.";++e;r+="0");t=r+t}else if(n=t.length,++e>n){for(r="0",e-=n;--e;r+="0");t+=r}else n>e&&(t=t.slice(0,e)+"."+t.slice(e));return t}function p(t){return t=parseFloat(t),0>t?y(t):v(t)}var m,h,d,g=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,y=Math.ceil,v=Math.floor,b=" not a boolean or binary digit",w="rounding mode",_="number type has more than 15 significant digits",F="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_",x=1e14,I=14,N=9007199254740991,O=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],B=1e7,P=1e9;if(m=r(),"function"==typeof define&&define.amd)define(function(){return m});else if("undefined"!=typeof e&&e.exports){if(e.exports=m,!h)try{h=t("crypto")}catch(T){}}else n.BigNumber=m}(this)},{crypto:28}],web3:[function(t,e,n){var r=t("./lib/web3");r.providers.HttpProvider=t("./lib/web3/httpprovider"),r.providers.QtSyncProvider=t("./lib/web3/qtsync"),r.eth.contract=t("./lib/web3/contract"),r.abi=t("./lib/solidity/abi"),"undefined"!=typeof window&&"undefined"==typeof window.web3&&(window.web3=r),e.exports=r},{"./lib/solidity/abi":1,"./lib/web3":10,"./lib/web3/contract":11,"./lib/web3/httpprovider":19,"./lib/web3/qtsync":24}]},{},["web3"]); \ No newline at end of file diff --git a/example/event_inc.html b/example/event_inc.html index 74bcb9c4b..ac12c6447 100644 --- a/example/event_inc.html +++ b/example/event_inc.html @@ -45,7 +45,7 @@ var contract; var update = function (err, x) { - document.getElementById('result').innerText = JSON.stringify(x, null, 2); + document.getElementById('result').textContent = JSON.stringify(x, null, 2); }; var createContract = function () { diff --git a/lib/solidity/abi.js b/lib/solidity/abi.js index e9299c386..feb139ed4 100644 --- a/lib/solidity/abi.js +++ b/lib/solidity/abi.js @@ -21,113 +21,24 @@ * @date 2014 */ -var utils = require('../utils/utils'); var coder = require('./coder'); -var solUtils = require('./utils'); - -/** - * Formats input params to bytes - * - * @method formatInput - * @param {Array} abi inputs of method - * @param {Array} params that will be formatted to bytes - * @returns bytes representation of input params - */ -var formatInput = function (inputs, params) { - var i = inputs.map(function (input) { - return input.type; - }); - return coder.encodeParams(i, params); -}; - -/** - * Formats output bytes back to param list - * - * @method formatOutput - * @param {Array} abi outputs of method - * @param {String} bytes represention of output - * @returns {Array} output params - */ -var formatOutput = function (outs, bytes) { - var o = outs.map(function (out) { - return out.type; - }); - - return coder.decodeParams(o, bytes); -}; - -/** - * Should be called to create input parser for contract with given abi - * - * @method inputParser - * @param {Array} contract abi - * @returns {Object} input parser object for given json abi - * TODO: refactor creating the parser, do not double logic from contract - */ -var inputParser = function (json) { - var parser = {}; - json.forEach(function (method) { - var displayName = utils.extractDisplayName(method.name); - var typeName = utils.extractTypeName(method.name); - - var impl = function () { - var params = Array.prototype.slice.call(arguments); - return formatInput(method.inputs, params); - }; - - if (parser[displayName] === undefined) { - parser[displayName] = impl; - } - - parser[displayName][typeName] = impl; - }); - - return parser; -}; - -/** - * Should be called to create output parser for contract with given abi - * - * @method outputParser - * @param {Array} contract abi - * @returns {Object} output parser for given json abi - */ -var outputParser = function (json) { - var parser = {}; - json.forEach(function (method) { - - var displayName = utils.extractDisplayName(method.name); - var typeName = utils.extractTypeName(method.name); - - var impl = function (output) { - return formatOutput(method.outputs, output); - }; - - if (parser[displayName] === undefined) { - parser[displayName] = impl; - } - - parser[displayName][typeName] = impl; - }); - - return parser; -}; +var utils = require('./utils'); var formatConstructorParams = function (abi, params) { - var constructor = solUtils.getConstructor(abi, params.length); + var constructor = utils.getConstructor(abi, params.length); if (!constructor) { if (params.length > 0) { console.warn("didn't found matching constructor, using default one"); } return ''; } - return formatInput(constructor.inputs, params); + + return coder.encodeParams(constructor.inputs.map(function (input) { + return input.type; + }), params); }; module.exports = { - inputParser: inputParser, - outputParser: outputParser, - formatInput: formatInput, - formatOutput: formatOutput, formatConstructorParams: formatConstructorParams }; + diff --git a/lib/solidity/coder.js b/lib/solidity/coder.js index 76de8d426..b46a38b0b 100644 --- a/lib/solidity/coder.js +++ b/lib/solidity/coder.js @@ -77,9 +77,8 @@ SolidityType.prototype.formatInput = function (param, arrayType) { return param.map(function (p) { return self._inputFormatter(p); }).reduce(function (acc, current) { - acc.appendArrayElement(current); - return acc; - }, new SolidityParam('', f.formatInputInt(param.length).value)); + return acc.combine(current); + }, f.formatInputInt(param.length)).withOffset(32); } return this._inputFormatter(param); }; @@ -96,9 +95,9 @@ SolidityType.prototype.formatOutput = function (param, arrayType) { if (arrayType) { // let's assume, that we solidity will never return long arrays :P var result = []; - var length = new BigNumber(param.prefix, 16); + var length = new BigNumber(param.dynamicPart().slice(0, 64), 16); for (var i = 0; i < length * 64; i += 64) { - result.push(this._outputFormatter(new SolidityParam(param.suffix.slice(i, i + 64)))); + result.push(this._outputFormatter(new SolidityParam(param.dynamicPart().substr(i + 64, 64)))); } return result; } @@ -106,31 +105,21 @@ SolidityType.prototype.formatOutput = function (param, arrayType) { }; /** - * Should be used to check if a type is variadic + * Should be used to slice single param from bytes * - * @method isVariadicType - * @param {String} type - * @returns {Bool} true if the type is variadic - */ -SolidityType.prototype.isVariadicType = function (type) { - return isArrayType(type) || this._mode === 'bytes'; -}; - -/** - * Should be used to shift param from params group - * - * @method shiftParam + * @method sliceParam + * @param {String} bytes + * @param {Number} index of param to slice * @param {String} type - * @returns {SolidityParam} shifted param + * @returns {SolidityParam} param */ -SolidityType.prototype.shiftParam = function (type, param) { +SolidityType.prototype.sliceParam = function (bytes, index, type) { if (this._mode === 'bytes') { - return param.shiftBytes(); + return SolidityParam.decodeBytes(bytes, index); } else if (isArrayType(type)) { - var length = new BigNumber(param.prefix.slice(0, 64), 16); - return param.shiftArray(length); + return SolidityParam.decodeArray(bytes, index); } - return param.shiftValue(); + return SolidityParam.decodeParam(bytes, index); }; /** @@ -160,28 +149,6 @@ SolidityCoder.prototype._requireType = function (type) { return solidityType; }; -/** - * Should be used to transform plain bytes to SolidityParam object - * - * @method _bytesToParam - * @param {Array} types of params - * @param {String} bytes to be transformed to SolidityParam - * @return {SolidityParam} SolidityParam for this group of params - */ -SolidityCoder.prototype._bytesToParam = function (types, bytes) { - var self = this; - var prefixTypes = types.reduce(function (acc, type) { - return self._requireType(type).isVariadicType(type) ? acc + 1 : acc; - }, 0); - var valueTypes = types.length - prefixTypes; - - var prefix = bytes.slice(0, prefixTypes * 64); - bytes = bytes.slice(prefixTypes * 64); - var value = bytes.slice(0, valueTypes * 64); - var suffix = bytes.slice(valueTypes * 64); - return new SolidityParam(value, prefix, suffix); -}; - /** * Should be used to transform plain param of given type to SolidityParam * @@ -216,24 +183,11 @@ SolidityCoder.prototype.encodeParam = function (type, param) { */ SolidityCoder.prototype.encodeParams = function (types, params) { var self = this; - return types.map(function (type, index) { + var solidityParams = types.map(function (type, index) { return self._formatInput(type, params[index]); - }).reduce(function (acc, solidityParam) { - acc.append(solidityParam); - return acc; - }, new SolidityParam()).encode(); -}; + }); -/** - * Should be used to transform SolidityParam to plain param - * - * @method _formatOutput - * @param {String} type - * @param {SolidityParam} param - * @return {Object} plain param - */ -SolidityCoder.prototype._formatOutput = function (type, param) { - return this._requireType(type).formatOutput(param, isArrayType(type)); + return SolidityParam.encodeList(solidityParams); }; /** @@ -245,7 +199,7 @@ SolidityCoder.prototype._formatOutput = function (type, param) { * @return {Object} plain param */ SolidityCoder.prototype.decodeParam = function (type, bytes) { - return this._formatOutput(type, this._bytesToParam([type], bytes)); + return this.decodeParams([type], bytes)[0]; }; /** @@ -258,10 +212,9 @@ SolidityCoder.prototype.decodeParam = function (type, bytes) { */ SolidityCoder.prototype.decodeParams = function (types, bytes) { var self = this; - var param = this._bytesToParam(types, bytes); - return types.map(function (type) { + return types.map(function (type, index) { var solidityType = self._requireType(type); - var p = solidityType.shiftParam(type, param); + var p = solidityType.sliceParam(bytes, index, type); return solidityType.formatOutput(p, isArrayType(type)); }); }; diff --git a/lib/solidity/formatters.js b/lib/solidity/formatters.js index a4ff3406c..3db936528 100644 --- a/lib/solidity/formatters.js +++ b/lib/solidity/formatters.js @@ -63,7 +63,7 @@ var formatInputBytes = function (value) { */ var formatInputDynamicBytes = function (value) { var result = utils.fromAscii(value, c.ETH_PADDING).substr(2); - return new SolidityParam('', formatInputInt(value.length).value, result); + return new SolidityParam(formatInputInt(value.length).value + result, 32); }; /** @@ -109,7 +109,7 @@ var signedIsNegative = function (value) { * @returns {BigNumber} right-aligned output bytes formatted to big number */ var formatOutputInt = function (param) { - var value = param.value || "0"; + var value = param.staticPart() || "0"; // check if it's negative number // it it is, return two's complement @@ -127,7 +127,7 @@ var formatOutputInt = function (param) { * @returns {BigNumeber} right-aligned output bytes formatted to uint */ var formatOutputUInt = function (param) { - var value = param.value || "0"; + var value = param.staticPart() || "0"; return new BigNumber(value, 16); }; @@ -161,7 +161,7 @@ var formatOutputUReal = function (param) { * @returns {Boolean} right-aligned input bytes formatted to bool */ var formatOutputBool = function (param) { - return param.value === '0000000000000000000000000000000000000000000000000000000000000001' ? true : false; + return param.staticPart() === '0000000000000000000000000000000000000000000000000000000000000001' ? true : false; }; /** @@ -173,7 +173,7 @@ var formatOutputBool = function (param) { */ var formatOutputBytes = function (param) { // length might also be important! - return utils.toAscii(param.value); + return utils.toAscii(param.staticPart()); }; /** @@ -185,7 +185,7 @@ var formatOutputBytes = function (param) { */ var formatOutputDynamicBytes = function (param) { // length might also be important! - return utils.toAscii(param.suffix); + return utils.toAscii(param.dynamicPart().slice(64)); }; /** @@ -196,7 +196,7 @@ var formatOutputDynamicBytes = function (param) { * @returns {String} address */ var formatOutputAddress = function (param) { - var value = param.value; + var value = param.staticPart(); return "0x" + value.slice(value.length - 40, value.length); }; diff --git a/lib/solidity/param.js b/lib/solidity/param.js index 15ba0c61f..7c3254659 100644 --- a/lib/solidity/param.js +++ b/lib/solidity/param.js @@ -20,85 +20,190 @@ * @date 2015 */ +var utils = require('../utils/utils'); + /** * SolidityParam object prototype. * Should be used when encoding, decoding solidity bytes */ -var SolidityParam = function (value, prefix, suffix) { - this.prefix = prefix || ''; +var SolidityParam = function (value, offset) { this.value = value || ''; - this.suffix = suffix || ''; + this.offset = offset; // offset in bytes +}; + +/** + * This method should be used to get length of params's dynamic part + * + * @method dynamicPartLength + * @returns {Number} length of dynamic part (in bytes) + */ +SolidityParam.prototype.dynamicPartLength = function () { + return this.dynamicPart().length / 2; +}; + +/** + * This method should be used to create copy of solidity param with different offset + * + * @method withOffset + * @param {Number} offset length in bytes + * @returns {SolidityParam} new solidity param with applied offset + */ +SolidityParam.prototype.withOffset = function (offset) { + return new SolidityParam(this.value, offset); +}; + +/** + * This method should be used to combine solidity params together + * eg. when appending an array + * + * @method combine + * @param {SolidityParam} param with which we should combine + * @param {SolidityParam} result of combination + */ +SolidityParam.prototype.combine = function (param) { + return new SolidityParam(this.value + param.value); +}; + +/** + * This method should be called to check if param has dynamic size. + * If it has, it returns true, otherwise false + * + * @method isDynamic + * @returns {Boolean} + */ +SolidityParam.prototype.isDynamic = function () { + return this.value.length > 64; }; /** - * This method should be used to encode two params one after another + * This method should be called to transform offset to bytes * - * @method append - * @param {SolidityParam} param that it appended after this + * @method offsetAsBytes + * @returns {String} bytes representation of offset */ -SolidityParam.prototype.append = function (param) { - this.prefix += param.prefix; - this.value += param.value; - this.suffix += param.suffix; +SolidityParam.prototype.offsetAsBytes = function () { + return !this.isDynamic() ? '' : utils.padLeft(utils.toTwosComplement(this.offset).toString(16), 64); }; /** - * This method should be used to encode next param in an array + * This method should be called to get static part of param * - * @method appendArrayElement - * @param {SolidityParam} param that is appended to an array + * @method staticPart + * @returns {String} offset if it is a dynamic param, otherwise value */ -SolidityParam.prototype.appendArrayElement = function (param) { - this.suffix += param.value; - this.prefix += param.prefix; - // TODO: suffix not supported = it's required for nested arrays; +SolidityParam.prototype.staticPart = function () { + if (!this.isDynamic()) { + return this.value; + } + return this.offsetAsBytes(); }; /** - * This method should be used to create bytearrays from param + * This method should be called to get dynamic part of param + * + * @method dynamicPart + * @returns {String} returns a value if it is a dynamic param, otherwise empty string + */ +SolidityParam.prototype.dynamicPart = function () { + return this.isDynamic() ? this.value : ''; +}; + +/** + * This method should be called to encode param * * @method encode - * @return {String} encoded param(s) + * @returns {String} */ SolidityParam.prototype.encode = function () { - return this.prefix + this.value + this.suffix; + return this.staticPart() + this.dynamicPart(); }; /** - * This method should be used to shift first param from group of params + * This method should be called to encode array of params * - * @method shiftValue - * @return {SolidityParam} first value param + * @method encodeList + * @param {Array[SolidityParam]} params + * @returns {String} */ -SolidityParam.prototype.shiftValue = function () { - var value = this.value.slice(0, 64); - this.value = this.value.slice(64); - return new SolidityParam(value); +SolidityParam.encodeList = function (params) { + + // updating offsets + var totalOffset = params.length * 32; + var offsetParams = params.map(function (param) { + if (!param.isDynamic()) { + return param; + } + var offset = totalOffset; + totalOffset += param.dynamicPartLength(); + return param.withOffset(offset); + }); + + // encode everything! + return offsetParams.reduce(function (result, param) { + return result + param.dynamicPart(); + }, offsetParams.reduce(function (result, param) { + return result + param.staticPart(); + }, '')); }; /** - * This method should be used to first bytes param from group of params + * This method should be used to decode plain (static) solidity param at given index * - * @method shiftBytes - * @return {SolidityParam} first bytes param + * @method decodeParam + * @param {String} bytes + * @param {Number} index + * @returns {SolidityParam} */ -SolidityParam.prototype.shiftBytes = function () { - return this.shiftArray(1); +SolidityParam.decodeParam = function (bytes, index) { + index = index || 0; + return new SolidityParam(bytes.substr(index * 64, 64)); }; /** - * This method should be used to shift an array from group of params - * - * @method shiftArray - * @param {Number} size of an array to shift - * @return {SolidityParam} first array param + * This method should be called to get offset value from bytes at given index + * + * @method getOffset + * @param {String} bytes + * @param {Number} index + * @returns {Number} offset as number + */ +var getOffset = function (bytes, index) { + // we can do this cause offset is rather small + return parseInt('0x' + bytes.substr(index * 64, 64)); +}; + +/** + * This method should be called to decode solidity bytes param at given index + * + * @method decodeBytes + * @param {String} bytes + * @param {Number} index + * @returns {SolidityParam} + */ +SolidityParam.decodeBytes = function (bytes, index) { + index = index || 0; + //TODO add support for strings longer than 32 bytes + //var length = parseInt('0x' + bytes.substr(offset * 64, 64)); + + var offset = getOffset(bytes, index); + + // 2 * , cause we also parse length + return new SolidityParam(bytes.substr(offset * 2, 2 * 64)); +}; + +/** + * This method should be used to decode solidity array at given index + * + * @method decodeArray + * @param {String} bytes + * @param {Number} index + * @returns {SolidityParam} */ -SolidityParam.prototype.shiftArray = function (length) { - var prefix = this.prefix.slice(0, 64); - this.prefix = this.value.slice(64); - var suffix = this.suffix.slice(0, 64 * length); - this.suffix = this.suffix.slice(64 * length); - return new SolidityParam('', prefix, suffix); +SolidityParam.decodeArray = function (bytes, index) { + index = index || 0; + var offset = getOffset(bytes, index); + var length = parseInt('0x' + bytes.substr(offset * 2, 64)); + return new SolidityParam(bytes.substr(offset * 2, (length + 1) * 64)); }; module.exports = SolidityParam; diff --git a/lib/solidity/utils.js b/lib/solidity/utils.js index 9ea416d8b..23566f74a 100644 --- a/lib/solidity/utils.js +++ b/lib/solidity/utils.js @@ -34,6 +34,11 @@ var getConstructor = function (abi, numberOfArgs) { })[0]; }; +//var getSupremeType = function (type) { + //return type.substr(0, type.indexOf('[')) + ']'; +//}; + + module.exports = { getConstructor: getConstructor }; diff --git a/lib/version.json b/lib/version.json index 536695767..e5c97ebab 100644 --- a/lib/version.json +++ b/lib/version.json @@ -1,3 +1,3 @@ { - "version": "0.3.3" + "version": "0.3.6" } diff --git a/lib/web3/eth.js b/lib/web3/eth.js index 625f5c02d..b955a45ac 100644 --- a/lib/web3/eth.js +++ b/lib/web3/eth.js @@ -23,7 +23,7 @@ /** * Web3 - * + * * @module web3 */ @@ -77,16 +77,16 @@ var uncleCountCall = function (args) { /// @returns an array of objects describing web3.eth api methods var getBalance = new Method({ - name: 'getBalance', - call: 'eth_getBalance', + name: 'getBalance', + call: 'eth_getBalance', params: 2, inputFormatter: [utils.toAddress, formatters.inputDefaultBlockNumberFormatter], outputFormatter: formatters.outputBigNumberFormatter }); var getStorageAt = new Method({ - name: 'getStorageAt', - call: 'eth_getStorageAt', + name: 'getStorageAt', + call: 'eth_getStorageAt', params: 3, inputFormatter: [null, utils.toHex, formatters.inputDefaultBlockNumberFormatter] }); @@ -99,7 +99,7 @@ var getCode = new Method({ }); var getBlock = new Method({ - name: 'getBlock', + name: 'getBlock', call: blockCall, params: 2, inputFormatter: [formatters.inputBlockNumberFormatter, function (val) { return !!val; }], @@ -224,6 +224,11 @@ var properties = [ name: 'mining', getter: 'eth_mining' }), + new Property({ + name: 'hashrate', + getter: 'eth_hashrate', + outputFormatter: utils.toDecimal + }), new Property({ name: 'gasPrice', getter: 'eth_gasPrice', diff --git a/lib/web3/event.js b/lib/web3/event.js index eeffa0cdd..f9305f8b8 100644 --- a/lib/web3/event.js +++ b/lib/web3/event.js @@ -96,7 +96,7 @@ SolidityEvent.prototype.encode = function (indexed, options) { ['fromBlock', 'toBlock'].filter(function (f) { return options[f] !== undefined; }).forEach(function (f) { - result[f] = utils.toHex(options[f]); + result[f] = formatters.inputBlockNumberFormatter(options[f]); }); result.topics = []; diff --git a/lib/web3/formatters.js b/lib/web3/formatters.js index 73fd907da..d45353649 100644 --- a/lib/web3/formatters.js +++ b/lib/web3/formatters.js @@ -72,7 +72,7 @@ var inputTransactionFormatter = function (options){ delete options.code; } - ['gasPrice', 'gas', 'value'].filter(function (key) { + ['gasPrice', 'gas', 'value', 'nonce'].filter(function (key) { return options[key] !== undefined; }).forEach(function(key){ options[key] = utils.fromDecimal(options[key]); diff --git a/lib/web3/httpprovider.js b/lib/web3/httpprovider.js index 83ab4bb5d..fd972c05a 100644 --- a/lib/web3/httpprovider.js +++ b/lib/web3/httpprovider.js @@ -48,15 +48,32 @@ HttpProvider.prototype.send = function (payload) { //if (request.status !== 200) { //return; //} - return JSON.parse(request.responseText); + + var result = request.responseText; + + try { + result = JSON.parse(result); + } catch(e) { + throw errors.InvalidResponse(result); + } + + return result; }; HttpProvider.prototype.sendAsync = function (payload, callback) { var request = new XMLHttpRequest(); request.onreadystatechange = function() { if (request.readyState === 4) { - // TODO: handle the error properly here!!! - callback(null, JSON.parse(request.responseText)); + var result = request.responseText; + var error = null; + + try { + result = JSON.parse(result); + } catch(e) { + error = errors.InvalidResponse(result); + } + + callback(error, result); } }; diff --git a/package.js b/package.js index 40b274bd7..bfb8d0556 100644 --- a/package.js +++ b/package.js @@ -1,7 +1,7 @@ /* jshint ignore:start */ Package.describe({ name: 'ethereum:web3', - version: '0.3.3', + version: '0.3.6', summary: 'Ethereum JavaScript API, middleware to talk to a ethreum node over RPC', git: 'https://github.com/ethereum/ethereum.js', // By default, Meteor will default to using README.md for documentation. diff --git a/package.json b/package.json index f6756cab1..4c7c81445 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "web3", "namespace": "ethereum", - "version": "0.3.3", + "version": "0.3.6", "description": "Ethereum JavaScript API, middleware to talk to a ethereum node over RPC", "main": "./index.js", "directories": { diff --git a/test/abi.inputParser.js b/test/abi.inputParser.js deleted file mode 100644 index 6700acd72..000000000 --- a/test/abi.inputParser.js +++ /dev/null @@ -1,515 +0,0 @@ -var chai = require('chai'); -var assert = chai.assert; -var BigNumber = require('bignumber.js'); -var abi = require('../lib/solidity/abi'); -var clone = function (object) { return JSON.parse(JSON.stringify(object)); }; - -var description = [{ - "name": "test", - "type": "function", - "inputs": [{ - "name": "a", - "type": "uint256" - } - ], - "outputs": [ - { - "name": "d", - "type": "uint256" - } - ] -}]; - -describe('lib/solidity/abi', function () { - describe('inputParser', function () { - it('should parse input uint', function () { - - // given - var d = clone(description); - - d[0].inputs = [ - { type: "uint" } - ]; - - // when - var parser = abi.inputParser(d); - - // then - assert.equal(parser.test(1), "0000000000000000000000000000000000000000000000000000000000000001"); - assert.equal(parser.test(10), "000000000000000000000000000000000000000000000000000000000000000a"); - assert.equal( - parser.test("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"), - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" - ); - assert.equal( - parser.test(new BigNumber("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", 16)), - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" - ); - assert.equal(parser.test(0.1), "0000000000000000000000000000000000000000000000000000000000000000"); - assert.equal(parser.test(3.9), "0000000000000000000000000000000000000000000000000000000000000003"); - assert.equal(parser.test('0.1'), "0000000000000000000000000000000000000000000000000000000000000000"); - assert.equal(parser.test('3.9'), "0000000000000000000000000000000000000000000000000000000000000003"); - - }); - - it('should parse input uint128', function() { - - // given - var d = clone(description); - - d[0].inputs = [ - { type: "uint128" } - ]; - - // when - var parser = abi.inputParser(d); - - // then - assert.equal(parser.test(1), "0000000000000000000000000000000000000000000000000000000000000001"); - assert.equal(parser.test(10), "000000000000000000000000000000000000000000000000000000000000000a"); - assert.equal( - parser.test("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"), - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" - ); - assert.equal( - parser.test(new BigNumber("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", 16)), - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" - ); - assert.equal(parser.test(0.1), "0000000000000000000000000000000000000000000000000000000000000000"); - assert.equal(parser.test(3.9), "0000000000000000000000000000000000000000000000000000000000000003"); - assert.equal(parser.test('0.1'), "0000000000000000000000000000000000000000000000000000000000000000"); - assert.equal(parser.test('3.9'), "0000000000000000000000000000000000000000000000000000000000000003"); - - }); - - it('should parse input uint256', function() { - - // given - var d = clone(description); - - d[0].inputs = [ - { type: "uint256" } - ]; - - // when - var parser = abi.inputParser(d); - - // then - assert.equal(parser.test(1), "0000000000000000000000000000000000000000000000000000000000000001"); - assert.equal(parser.test(10), "000000000000000000000000000000000000000000000000000000000000000a"); - assert.equal( - parser.test("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"), - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" - ); - assert.equal( - parser.test(new BigNumber("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", 16)), - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" - ); - assert.equal(parser.test(0.1), "0000000000000000000000000000000000000000000000000000000000000000"); - assert.equal(parser.test(3.9), "0000000000000000000000000000000000000000000000000000000000000003"); - assert.equal(parser.test('0.1'), "0000000000000000000000000000000000000000000000000000000000000000"); - assert.equal(parser.test('3.9'), "0000000000000000000000000000000000000000000000000000000000000003"); - - }); - - it('should parse input int', function() { - - // given - var d = clone(description); - - d[0].inputs = [ - { type: "int" } - ]; - - // when - var parser = abi.inputParser(d); - - // then - assert.equal(parser.test(1), "0000000000000000000000000000000000000000000000000000000000000001"); - assert.equal(parser.test(10), "000000000000000000000000000000000000000000000000000000000000000a"); - assert.equal(parser.test(-1), "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); - assert.equal(parser.test(-2), "fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe"); - assert.equal(parser.test(-16), "fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0"); - assert.equal( - parser.test("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"), - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" - ); - assert.equal( - parser.test(new BigNumber("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", 16)), - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" - ); - assert.equal(parser.test(0.1), "0000000000000000000000000000000000000000000000000000000000000000"); - assert.equal(parser.test(3.9), "0000000000000000000000000000000000000000000000000000000000000003"); - assert.equal(parser.test('0.1'), "0000000000000000000000000000000000000000000000000000000000000000"); - assert.equal(parser.test('3.9'), "0000000000000000000000000000000000000000000000000000000000000003"); - }); - - it('should parse input int128', function() { - - // given - var d = clone(description); - - d[0].inputs = [ - { type: "int128" } - ]; - - // when - var parser = abi.inputParser(d); - - // then - assert.equal(parser.test(1), "0000000000000000000000000000000000000000000000000000000000000001"); - assert.equal(parser.test(10), "000000000000000000000000000000000000000000000000000000000000000a"); - assert.equal(parser.test(-1), "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); - assert.equal(parser.test(-2), "fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe"); - assert.equal(parser.test(-16), "fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0"); - assert.equal( - parser.test("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"), - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" - ); - assert.equal( - parser.test(new BigNumber("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", 16)), - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" - ); - assert.equal(parser.test(0.1), "0000000000000000000000000000000000000000000000000000000000000000"); - assert.equal(parser.test(3.9), "0000000000000000000000000000000000000000000000000000000000000003"); - assert.equal(parser.test('0.1'), "0000000000000000000000000000000000000000000000000000000000000000"); - assert.equal(parser.test('3.9'), "0000000000000000000000000000000000000000000000000000000000000003"); - - }); - - it('should parse input int256', function() { - - // given - var d = clone(description); - - d[0].inputs = [ - { type: "int256" } - ]; - - // when - var parser = abi.inputParser(d); - - // then - assert.equal(parser.test(1), "0000000000000000000000000000000000000000000000000000000000000001"); - assert.equal(parser.test(10), "000000000000000000000000000000000000000000000000000000000000000a"); - assert.equal(parser.test(-1), "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"); - assert.equal(parser.test(-2), "fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe"); - assert.equal(parser.test(-16), "fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0"); - assert.equal( - parser.test("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"), - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" - ); - assert.equal( - parser.test(new BigNumber("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", 16)), - "ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" - ); - assert.equal(parser.test(0.1), "0000000000000000000000000000000000000000000000000000000000000000"); - assert.equal(parser.test(3.9), "0000000000000000000000000000000000000000000000000000000000000003"); - assert.equal(parser.test('0.1'), "0000000000000000000000000000000000000000000000000000000000000000"); - assert.equal(parser.test('3.9'), "0000000000000000000000000000000000000000000000000000000000000003"); - - }); - - it('should parse input bool', function() { - - // given - var d = clone(description); - - d[0].inputs = [ - { type: 'bool' } - ]; - - // when - var parser = abi.inputParser(d); - - // then - assert.equal(parser.test(true), "0000000000000000000000000000000000000000000000000000000000000001"); - assert.equal(parser.test(false), "0000000000000000000000000000000000000000000000000000000000000000"); - - }); - - it('should parse input address', function () { - - // given - var d = clone(description); - - d[0].inputs = [ - { type: "address" } - ]; - - // when - var parser = abi.inputParser(d) - - // then - assert.equal(parser.test("0x407d73d8a49eeb85d32cf465507dd71d507100c1"), "000000000000000000000000407d73d8a49eeb85d32cf465507dd71d507100c1"); - - }); - - it('should parse input fixed bytes type', function () { - - // given - var d = clone(description); - - d[0].inputs = [ - { type: "bytes" } - ]; - - // when - var parser = abi.inputParser(d); - - // then - assert.equal( - parser.test('hello'), - "0000000000000000000000000000000000000000000000000000000000000005" + - "68656c6c6f000000000000000000000000000000000000000000000000000000" - ); - assert.equal( - parser.test('world'), - "0000000000000000000000000000000000000000000000000000000000000005776f726c64000000000000000000000000000000000000000000000000000000" - ); - }); - - it('should parse input int followed by a fixed bytes type', function () { - - // given - var d = clone(description); - - d[0].inputs = [ - { type: "int" }, - { type: "bytes" } - ]; - - // when - var parser = abi.inputParser(d); - - // then - assert.equal( - parser.test(9, 'hello'), - "0000000000000000000000000000000000000000000000000000000000000005" + - "0000000000000000000000000000000000000000000000000000000000000009" + - "68656c6c6f000000000000000000000000000000000000000000000000000000" - ); - }); - - it('should parse input fixed bytes type followed by an int', function () { - - // given - var d = clone(description); - - d[0].inputs = [ - { type: "bytes" }, - { type: "int" } - ]; - - // when - var parser = abi.inputParser(d); - - // then - assert.equal( - parser.test('hello', 9), - "0000000000000000000000000000000000000000000000000000000000000005" + - "0000000000000000000000000000000000000000000000000000000000000009" + - "68656c6c6f000000000000000000000000000000000000000000000000000000" - ); - }); - - it('should use proper method name', function () { - - // given - var d = clone(description); - d[0].name = 'helloworld(int)'; - d[0].inputs = [ - { type: "int" } - ]; - - // when - var parser = abi.inputParser(d); - - // then - assert.equal(parser.helloworld(1), "0000000000000000000000000000000000000000000000000000000000000001"); - assert.equal(parser.helloworld['int'](1), "0000000000000000000000000000000000000000000000000000000000000001"); - - }); - - it('should parse multiple methods', function () { - - // given - var d = [{ - name: "test", - type: "function", - inputs: [{ type: "int" }], - outputs: [{ type: "int" }] - },{ - name: "test2", - type: "function", - inputs: [{ type: "bytes" }], - outputs: [{ type: "bytes" }] - }]; - - // when - var parser = abi.inputParser(d); - - //then - assert.equal(parser.test(1), "0000000000000000000000000000000000000000000000000000000000000001"); - assert.equal( - parser.test2('hello'), - "000000000000000000000000000000000000000000000000000000000000000568656c6c6f000000000000000000000000000000000000000000000000000000" - ); - - }); - - it('should parse input array of ints', function () { - - // given - var d = clone(description); - - d[0].inputs = [ - { type: "int[]" } - ]; - - // when - var parser = abi.inputParser(d); - - // then - assert.equal( - parser.test([5, 6]), - "0000000000000000000000000000000000000000000000000000000000000002" + - "0000000000000000000000000000000000000000000000000000000000000005" + - "0000000000000000000000000000000000000000000000000000000000000006" - ); - }); - - it('should parse an array followed by an int', function () { - - // given - var d = clone(description); - - d[0].inputs = [ - { type: "int[]" }, - { type: "int" } - ]; - - // when - var parser = abi.inputParser(d); - - // then - assert.equal( - parser.test([5, 6], 3), - "0000000000000000000000000000000000000000000000000000000000000002" + - "0000000000000000000000000000000000000000000000000000000000000003" + - "0000000000000000000000000000000000000000000000000000000000000005" + - "0000000000000000000000000000000000000000000000000000000000000006" - ); - }); - - it('should parse an int followed by an array', function () { - - // given - var d = clone(description); - - d[0].inputs = [ - { type: "int" }, - { type: "int[]" } - ]; - - // when - var parser = abi.inputParser(d); - - // then - assert.equal( - parser.test(3, [5, 6]), - "0000000000000000000000000000000000000000000000000000000000000002" + - "0000000000000000000000000000000000000000000000000000000000000003" + - "0000000000000000000000000000000000000000000000000000000000000005" + - "0000000000000000000000000000000000000000000000000000000000000006" - ); - }); - - it('should parse mixture of arrays and ints', function () { - - // given - var d = clone(description); - - d[0].inputs = [ - { type: "int" }, - { type: "int[]" }, - { type: "int" }, - { type: "int[]" } - ]; - - // when - var parser = abi.inputParser(d); - - // then - assert.equal( - parser.test(3, [5, 6, 1, 2], 7, [8, 9]), - "0000000000000000000000000000000000000000000000000000000000000004" + - "0000000000000000000000000000000000000000000000000000000000000002" + - "0000000000000000000000000000000000000000000000000000000000000003" + - "0000000000000000000000000000000000000000000000000000000000000007" + - "0000000000000000000000000000000000000000000000000000000000000005" + - "0000000000000000000000000000000000000000000000000000000000000006" + - "0000000000000000000000000000000000000000000000000000000000000001" + - "0000000000000000000000000000000000000000000000000000000000000002" + - "0000000000000000000000000000000000000000000000000000000000000008" + - "0000000000000000000000000000000000000000000000000000000000000009" - ); - }); - - it('should parse input real', function () { - - // given - var d = clone(description); - - d[0].inputs = [ - { type: 'real' } - ]; - - // when - var parser = abi.inputParser(d); - - // then - assert.equal(parser.test(1), "0000000000000000000000000000000100000000000000000000000000000000"); - assert.equal(parser.test(2.125), "0000000000000000000000000000000220000000000000000000000000000000"); - assert.equal(parser.test(8.5), "0000000000000000000000000000000880000000000000000000000000000000"); - assert.equal(parser.test(-1), "ffffffffffffffffffffffffffffffff00000000000000000000000000000000"); - - }); - - it('should parse input ureal', function () { - - // given - var d = clone(description); - - d[0].inputs = [ - { type: 'ureal' } - ]; - - // when - var parser = abi.inputParser(d); - - // then - assert.equal(parser.test(1), "0000000000000000000000000000000100000000000000000000000000000000"); - assert.equal(parser.test(2.125), "0000000000000000000000000000000220000000000000000000000000000000"); - assert.equal(parser.test(8.5), "0000000000000000000000000000000880000000000000000000000000000000"); - - }); - - it('should throw an incorrect type error', function () { - - // given - var d = clone(description); - d[0].inputs = [ - { type: 'uin' } - ] - - // when - var parser = abi.inputParser(d); - - // then - assert.throws(function () {parser.test('0x')}, Error); - - }); - - }); -}); diff --git a/test/abi.outputParser.js b/test/abi.outputParser.js deleted file mode 100644 index 5fe23e28a..000000000 --- a/test/abi.outputParser.js +++ /dev/null @@ -1,419 +0,0 @@ -var assert = require('assert'); -var BigNumber = require('bignumber.js'); -var abi = require('../lib/solidity/abi.js'); -var clone = function (object) { return JSON.parse(JSON.stringify(object)); }; - -var description = [{ - "name": "test", - "type": "function", - "inputs": [{ - "name": "a", - "type": "uint256" - } - ], - "outputs": [ - { - "name": "d", - "type": "uint256" - } - ] -}]; - -describe('lib/solidity/abi', function() { - describe('outputParser', function() { - it('should parse output fixed bytes type', function() { - - // given - var d = clone(description); - - d[0].outputs = [ - { type: "bytes" } - ]; - - // when - var parser = abi.outputParser(d); - - // then - assert.equal( - parser.test( - "0000000000000000000000000000000000000000000000000000000000000005" + - "68656c6c6f000000000000000000000000000000000000000000000000000000")[0], - 'hello' - ); - assert.equal( - parser.test( - "0000000000000000000000000000000000000000000000000000000000000005" + - "776f726c64000000000000000000000000000000000000000000000000000000")[0], - 'world' - ); - - }); - - it('should parse output uint', function() { - - // given - var d = clone(description); - - d[0].outputs = [ - { type: 'uint' } - ]; - - // when - var parser = abi.outputParser(d); - - // then - assert.equal(parser.test("0000000000000000000000000000000000000000000000000000000000000001")[0], 1); - assert.equal(parser.test("000000000000000000000000000000000000000000000000000000000000000a")[0], 10); - assert.equal( - parser.test("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")[0].toString(10), - new BigNumber("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", 16).toString(10) - ); - assert.equal( - parser.test("fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0")[0].toString(10), - new BigNumber("fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0", 16).toString(10) - ); - }); - - it('should parse output uint256', function() { - - // given - var d = clone(description); - - d[0].outputs = [ - { type: 'uint256' } - ]; - - // when - var parser = abi.outputParser(d); - - // then - assert.equal(parser.test("0000000000000000000000000000000000000000000000000000000000000001")[0], 1); - assert.equal(parser.test("000000000000000000000000000000000000000000000000000000000000000a")[0], 10); - assert.equal( - parser.test("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")[0].toString(10), - new BigNumber("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", 16).toString(10) - ); - assert.equal( - parser.test("fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0")[0].toString(10), - new BigNumber("fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0", 16).toString(10) - ); - }); - - it('should parse output uint128', function() { - - // given - var d = clone(description); - - d[0].outputs = [ - { type: 'uint128' } - ]; - - // when - var parser = abi.outputParser(d); - - // then - assert.equal(parser.test("0000000000000000000000000000000000000000000000000000000000000001")[0], 1); - assert.equal(parser.test("000000000000000000000000000000000000000000000000000000000000000a")[0], 10); - assert.equal( - parser.test("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")[0].toString(10), - new BigNumber("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", 16).toString(10) - ); - assert.equal( - parser.test("fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0")[0].toString(10), - new BigNumber("fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0", 16).toString(10) - ); - }); - - it('should parse output int', function() { - - // given - var d = clone(description); - - d[0].outputs = [ - { type: 'int' } - ]; - - // when - var parser = abi.outputParser(d); - - // then - assert.equal(parser.test("0000000000000000000000000000000000000000000000000000000000000001")[0], 1); - assert.equal(parser.test("000000000000000000000000000000000000000000000000000000000000000a")[0], 10); - assert.equal(parser.test("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")[0], -1); - assert.equal(parser.test("fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0")[0], -16); - }); - - it('should parse output int256', function() { - - // given - var d = clone(description); - - d[0].outputs = [ - { type: 'int256' } - ]; - - // when - var parser = abi.outputParser(d); - - // then - assert.equal(parser.test("0000000000000000000000000000000000000000000000000000000000000001")[0], 1); - assert.equal(parser.test("000000000000000000000000000000000000000000000000000000000000000a")[0], 10); - assert.equal(parser.test("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")[0], -1); - assert.equal(parser.test("fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0")[0], -16); - }); - - it('should parse output int128', function() { - - // given - var d = clone(description); - - d[0].outputs = [ - { type: 'int128' } - ]; - - // when - var parser = abi.outputParser(d); - - // then - assert.equal(parser.test("0000000000000000000000000000000000000000000000000000000000000001")[0], 1); - assert.equal(parser.test("000000000000000000000000000000000000000000000000000000000000000a")[0], 10); - assert.equal(parser.test("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")[0], -1); - assert.equal(parser.test("fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0")[0], -16); - }); - - it('should parse output address', function() { - - // given - var d = clone(description); - - d[0].outputs = [ - { type: 'address' } - ]; - - // when - var parser = abi.outputParser(d); - - // then - assert.equal( - parser.test("000000000000000000000000407d73d8a49eeb85d32cf465507dd71d507100c1")[0], - "0x407d73d8a49eeb85d32cf465507dd71d507100c1" - ); - }); - - it('should parse output bool', function() { - - // given - var d = clone(description); - - d[0].outputs = [ - { type: 'bool' } - ]; - - // when - var parser = abi.outputParser(d); - - // then - assert.equal(parser.test("0000000000000000000000000000000000000000000000000000000000000001")[0], true); - assert.equal(parser.test("0000000000000000000000000000000000000000000000000000000000000000")[0], false); - - - }); - - it('should parse output real', function() { - - // given - var d = clone(description); - - d[0].outputs = [ - { type: 'real' } - ]; - - // when - var parser = abi.outputParser(d); - - // then - assert.equal(parser.test("0000000000000000000000000000000100000000000000000000000000000000")[0], 1); - assert.equal(parser.test("0000000000000000000000000000000220000000000000000000000000000000")[0], 2.125); - assert.equal(parser.test("0000000000000000000000000000000880000000000000000000000000000000")[0], 8.5); - assert.equal(parser.test("ffffffffffffffffffffffffffffffff00000000000000000000000000000000")[0], -1); - - }); - - it('should parse output ureal', function() { - - // given - var d = clone(description); - - d[0].outputs = [ - { type: 'ureal' } - ]; - - // when - var parser = abi.outputParser(d); - - // then - assert.equal(parser.test("0000000000000000000000000000000100000000000000000000000000000000")[0], 1); - assert.equal(parser.test("0000000000000000000000000000000220000000000000000000000000000000")[0], 2.125); - assert.equal(parser.test("0000000000000000000000000000000880000000000000000000000000000000")[0], 8.5); - - }); - - - it('should parse multiple output fixed bytes type', function() { - - // given - var d = clone(description); - - d[0].outputs = [ - { type: "bytes" }, - { type: "bytes" } - ]; - - // when - var parser = abi.outputParser(d); - - // then - assert.equal( - parser.test( - "0000000000000000000000000000000000000000000000000000000000000005" + - "0000000000000000000000000000000000000000000000000000000000000005" + - "68656c6c6f000000000000000000000000000000000000000000000000000000" + - "776f726c64000000000000000000000000000000000000000000000000000000")[0], - 'hello' - ); - assert.equal( - parser.test( - "0000000000000000000000000000000000000000000000000000000000000005" + - "0000000000000000000000000000000000000000000000000000000000000005" + - "68656c6c6f000000000000000000000000000000000000000000000000000000" + - "776f726c64000000000000000000000000000000000000000000000000000000")[1], - 'world' - ); - - }); - - it('should use proper method name', function () { - - // given - var d = clone(description); - d[0].name = 'helloworld(int)'; - d[0].outputs = [ - { type: "int" } - ]; - - // when - var parser = abi.outputParser(d); - - // then - assert.equal(parser.helloworld("0000000000000000000000000000000000000000000000000000000000000001")[0], 1); - assert.equal(parser.helloworld['int']("0000000000000000000000000000000000000000000000000000000000000001")[0], 1); - - }); - - - it('should parse multiple methods', function () { - - // given - var d = [{ - name: "test", - type: "function", - inputs: [{ type: "int" }], - outputs: [{ type: "int" }] - },{ - name: "test2", - type: "function", - inputs: [{ type: "bytes" }], - outputs: [{ type: "bytes" }] - }]; - - // when - var parser = abi.outputParser(d); - - //then - assert.equal(parser.test("00000000000000000000000000000000000000000000000000000000000001")[0], 1); - assert.equal(parser.test2( - "0000000000000000000000000000000000000000000000000000000000000005" + - "68656c6c6f000000000000000000000000000000000000000000000000000000")[0], - "hello" - ); - - }); - - it('should parse output array', function () { - - // given - var d = clone(description); - d[0].outputs = [ - { type: 'int[]' } - ]; - - // when - var parser = abi.outputParser(d); - - // then - assert.equal(parser.test( - "0000000000000000000000000000000000000000000000000000000000000002" + - "0000000000000000000000000000000000000000000000000000000000000005" + - "0000000000000000000000000000000000000000000000000000000000000006")[0][0], - 5 - ); - assert.equal(parser.test( - "0000000000000000000000000000000000000000000000000000000000000002" + - "0000000000000000000000000000000000000000000000000000000000000005" + - "0000000000000000000000000000000000000000000000000000000000000006")[0][1], - 6 - ); - - }); - - it('should parse 0x0 value', function () { - - // given - var d = clone(description); - d[0].outputs = [ - { type: 'int' } - ]; - - // when - var parser = abi.outputParser(d); - - // then - assert.equal(parser.test("0x0")[0], 0); - - }); - - it('should parse 0x0 value', function () { - - // given - var d = clone(description); - d[0].outputs = [ - { type: 'uint' } - ]; - - // when - var parser = abi.outputParser(d); - - // then - assert.equal(parser.test("0x0")[0], 0); - - }); - - it('should throw an incorrect type error', function () { - - // given - var d = clone(description); - d[0].outputs = [ - { type: 'uin' } - ] - - // when - var parser = abi.outputParser(d); - - // then - assert.throws(function () {parser.test('0x')}, Error); - - }); - - }); -}); - diff --git a/test/coder.decodeParam.js b/test/coder.decodeParam.js index 3eea9dd6f..23b0228eb 100644 --- a/test/coder.decodeParam.js +++ b/test/coder.decodeParam.js @@ -21,17 +21,32 @@ describe('lib/solidity/coder', function () { test({ type: 'int256', expected: new bn(16), value: '0000000000000000000000000000000000000000000000000000000000000010'}); test({ type: 'int256', expected: new bn(-1), value: 'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'}); test({ type: 'bytes32', expected: 'gavofyork', value: '6761766f66796f726b0000000000000000000000000000000000000000000000'}); - test({ type: 'bytes', expected: 'gavofyork', value: '0000000000000000000000000000000000000000000000000000000000000009' + + test({ type: 'bytes', expected: 'gavofyork', value: '0000000000000000000000000000000000000000000000000000000000000020' + + '0000000000000000000000000000000000000000000000000000000000000009' + '6761766f66796f726b0000000000000000000000000000000000000000000000'}); - test({ type: 'int[]', expected: [new bn(3)], value: '0000000000000000000000000000000000000000000000000000000000000001' + + test({ type: 'int[]', expected: [new bn(3)], value: '0000000000000000000000000000000000000000000000000000000000000020' + + '0000000000000000000000000000000000000000000000000000000000000001' + '0000000000000000000000000000000000000000000000000000000000000003'}); - test({ type: 'int256[]', expected: [new bn(3)], value: '0000000000000000000000000000000000000000000000000000000000000001' + + test({ type: 'int256[]', expected: [new bn(3)], value: '0000000000000000000000000000000000000000000000000000000000000020' + + '0000000000000000000000000000000000000000000000000000000000000001' + '0000000000000000000000000000000000000000000000000000000000000003'}); test({ type: 'int[]', expected: [new bn(1), new bn(2), new bn(3)], - value: '0000000000000000000000000000000000000000000000000000000000000003' + + value: '0000000000000000000000000000000000000000000000000000000000000020' + + '0000000000000000000000000000000000000000000000000000000000000003' + '0000000000000000000000000000000000000000000000000000000000000001' + '0000000000000000000000000000000000000000000000000000000000000002' + '0000000000000000000000000000000000000000000000000000000000000003'}); + test({ type: 'bool', expected: true, value: '0000000000000000000000000000000000000000000000000000000000000001'}); + test({ type: 'bool', expected: false, value: '0000000000000000000000000000000000000000000000000000000000000000'}); + test({ type: 'real', expected: new bn(1), value: '0000000000000000000000000000000100000000000000000000000000000000'}); + test({ type: 'real', expected: new bn(2.125), value: '0000000000000000000000000000000220000000000000000000000000000000'}); + test({ type: 'real', expected: new bn(8.5), value: '0000000000000000000000000000000880000000000000000000000000000000'}); + test({ type: 'real', expected: new bn(-1), value: 'ffffffffffffffffffffffffffffffff00000000000000000000000000000000'}); + test({ type: 'ureal', expected: new bn(1), value: '0000000000000000000000000000000100000000000000000000000000000000'}); + test({ type: 'ureal', expected: new bn(2.125), value: '0000000000000000000000000000000220000000000000000000000000000000'}); + test({ type: 'ureal', expected: new bn(8.5), value: '0000000000000000000000000000000880000000000000000000000000000000'}); + test({ type: 'address', expected: '0x407d73d8a49eeb85d32cf465507dd71d507100c1', + value: '000000000000000000000000407d73d8a49eeb85d32cf465507dd71d507100c1'}); }); }); @@ -53,16 +68,18 @@ describe('lib/solidity/coder', function () { '6761766f66796f726b0000000000000000000000000000000000000000000000'}); test({ types: ['int', 'bytes', 'int', 'int', 'int', 'int[]'], expected: [new bn(1), 'gavofyork', new bn(2), new bn(3), new bn(4), [new bn(5), new bn(6), new bn(7)]], - values: '0000000000000000000000000000000000000000000000000000000000000009' + - '0000000000000000000000000000000000000000000000000000000000000003' + - '0000000000000000000000000000000000000000000000000000000000000001' + - '0000000000000000000000000000000000000000000000000000000000000002' + - '0000000000000000000000000000000000000000000000000000000000000003' + - '0000000000000000000000000000000000000000000000000000000000000004' + - '6761766f66796f726b0000000000000000000000000000000000000000000000' + - '0000000000000000000000000000000000000000000000000000000000000005' + - '0000000000000000000000000000000000000000000000000000000000000006' + - '0000000000000000000000000000000000000000000000000000000000000007'}); + values: '0000000000000000000000000000000000000000000000000000000000000001' + + '00000000000000000000000000000000000000000000000000000000000000c0' + + '0000000000000000000000000000000000000000000000000000000000000002' + + '0000000000000000000000000000000000000000000000000000000000000003' + + '0000000000000000000000000000000000000000000000000000000000000004' + + '0000000000000000000000000000000000000000000000000000000000000100' + + '0000000000000000000000000000000000000000000000000000000000000009' + + '6761766f66796f726b0000000000000000000000000000000000000000000000' + + '0000000000000000000000000000000000000000000000000000000000000003' + + '0000000000000000000000000000000000000000000000000000000000000005' + + '0000000000000000000000000000000000000000000000000000000000000006' + + '0000000000000000000000000000000000000000000000000000000000000007'}); }); }); diff --git a/test/coder.encodeParam.js b/test/coder.encodeParam.js index a9e11ab9e..60d1c618e 100644 --- a/test/coder.encodeParam.js +++ b/test/coder.encodeParam.js @@ -15,20 +15,37 @@ describe('lib/solidity/coder', function () { test({ type: 'int', value: 1, expected: '0000000000000000000000000000000000000000000000000000000000000001'}); test({ type: 'int', value: 16, expected: '0000000000000000000000000000000000000000000000000000000000000010'}); test({ type: 'int', value: -1, expected: 'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'}); + test({ type: 'int', value: 0.1, expected: '0000000000000000000000000000000000000000000000000000000000000000'}); + test({ type: 'int', value: 3.9, expected: '0000000000000000000000000000000000000000000000000000000000000003'}); test({ type: 'int256', value: 1, expected: '0000000000000000000000000000000000000000000000000000000000000001'}); test({ type: 'int256', value: 16, expected: '0000000000000000000000000000000000000000000000000000000000000010'}); test({ type: 'int256', value: -1, expected: 'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'}); test({ type: 'bytes32', value: 'gavofyork', expected: '6761766f66796f726b0000000000000000000000000000000000000000000000'}); - test({ type: 'bytes', value: 'gavofyork', expected: '0000000000000000000000000000000000000000000000000000000000000009' + + test({ type: 'bytes', value: 'gavofyork', expected: '0000000000000000000000000000000000000000000000000000000000000020' + + '0000000000000000000000000000000000000000000000000000000000000009' + '6761766f66796f726b0000000000000000000000000000000000000000000000'}); - test({ type: 'int[]', value: [3], expected: '0000000000000000000000000000000000000000000000000000000000000001' + + test({ type: 'int[]', value: [3], expected: '0000000000000000000000000000000000000000000000000000000000000020' + + '0000000000000000000000000000000000000000000000000000000000000001' + '0000000000000000000000000000000000000000000000000000000000000003'}); - test({ type: 'int256[]', value: [3], expected: '0000000000000000000000000000000000000000000000000000000000000001' + + test({ type: 'int256[]', value: [3], expected: '0000000000000000000000000000000000000000000000000000000000000020' + + '0000000000000000000000000000000000000000000000000000000000000001' + '0000000000000000000000000000000000000000000000000000000000000003'}); - test({ type: 'int[]', value: [1,2,3], expected: '0000000000000000000000000000000000000000000000000000000000000003' + + test({ type: 'int[]', value: [1,2,3], expected: '0000000000000000000000000000000000000000000000000000000000000020' + + '0000000000000000000000000000000000000000000000000000000000000003' + '0000000000000000000000000000000000000000000000000000000000000001' + '0000000000000000000000000000000000000000000000000000000000000002' + '0000000000000000000000000000000000000000000000000000000000000003'}); + test({ type: 'bool', value: true, expected: '0000000000000000000000000000000000000000000000000000000000000001'}); + test({ type: 'bool', value: false, expected: '0000000000000000000000000000000000000000000000000000000000000000'}); + test({ type: 'address', value: '0x407d73d8a49eeb85d32cf465507dd71d507100c1', + expected: '000000000000000000000000407d73d8a49eeb85d32cf465507dd71d507100c1'}); + test({ type: 'real', value: 1, expected: '0000000000000000000000000000000100000000000000000000000000000000'}); + test({ type: 'real', value: 2.125, expected: '0000000000000000000000000000000220000000000000000000000000000000'}); + test({ type: 'real', value: 8.5, expected: '0000000000000000000000000000000880000000000000000000000000000000'}); + test({ type: 'real', value: -1, expected: 'ffffffffffffffffffffffffffffffff00000000000000000000000000000000'}); + test({ type: 'ureal', value: 1, expected: '0000000000000000000000000000000100000000000000000000000000000000'}); + test({ type: 'ureal', value: 2.125, expected: '0000000000000000000000000000000220000000000000000000000000000000'}); + test({ type: 'ureal', value: 8.5, expected: '0000000000000000000000000000000880000000000000000000000000000000'}); }); }); @@ -49,16 +66,29 @@ describe('lib/solidity/coder', function () { test({ types: ['int256'], values: [16], expected: '0000000000000000000000000000000000000000000000000000000000000010'}); test({ types: ['int256'], values: [-1], expected: 'ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff'}); test({ types: ['bytes32'], values: ['gavofyork'], expected: '6761766f66796f726b0000000000000000000000000000000000000000000000'}); - test({ types: ['bytes'], values: ['gavofyork'], expected: '0000000000000000000000000000000000000000000000000000000000000009' + + test({ types: ['bytes'], values: ['gavofyork'], expected: '0000000000000000000000000000000000000000000000000000000000000020' + + '0000000000000000000000000000000000000000000000000000000000000009' + '6761766f66796f726b0000000000000000000000000000000000000000000000'}); - test({ types: ['int[]'], values: [[3]], expected: '0000000000000000000000000000000000000000000000000000000000000001' + + test({ types: ['int[]'], values: [[3]], expected: '0000000000000000000000000000000000000000000000000000000000000020' + + '0000000000000000000000000000000000000000000000000000000000000001' + '0000000000000000000000000000000000000000000000000000000000000003'}); - test({ types: ['int256[]'], values: [[3]], expected: '0000000000000000000000000000000000000000000000000000000000000001' + + test({ types: ['int256[]'], values: [[3]], expected: '0000000000000000000000000000000000000000000000000000000000000020' + + '0000000000000000000000000000000000000000000000000000000000000001' + '0000000000000000000000000000000000000000000000000000000000000003'}); - test({ types: ['int256[]'], values: [[1,2,3]], expected: '0000000000000000000000000000000000000000000000000000000000000003' + + test({ types: ['int256[]'], values: [[1,2,3]], expected: '0000000000000000000000000000000000000000000000000000000000000020' + + '0000000000000000000000000000000000000000000000000000000000000003' + '0000000000000000000000000000000000000000000000000000000000000001' + '0000000000000000000000000000000000000000000000000000000000000002' + '0000000000000000000000000000000000000000000000000000000000000003'}); + test({ types: ['int[]', 'int[]'], values: [[1,2], [3,4]], + expected: '0000000000000000000000000000000000000000000000000000000000000040' + + '00000000000000000000000000000000000000000000000000000000000000a0' + + '0000000000000000000000000000000000000000000000000000000000000002' + + '0000000000000000000000000000000000000000000000000000000000000001' + + '0000000000000000000000000000000000000000000000000000000000000002' + + '0000000000000000000000000000000000000000000000000000000000000002' + + '0000000000000000000000000000000000000000000000000000000000000003' + + '0000000000000000000000000000000000000000000000000000000000000004'}); test({ types: ['bytes32', 'int'], values: ['gavofyork', 5], expected: '6761766f66796f726b0000000000000000000000000000000000000000000000' + '0000000000000000000000000000000000000000000000000000000000000005'}); @@ -66,25 +96,47 @@ describe('lib/solidity/coder', function () { expected: '0000000000000000000000000000000000000000000000000000000000000005' + '6761766f66796f726b0000000000000000000000000000000000000000000000'}); test({ types: ['bytes', 'int'], values: ['gavofyork', 5], - expected: '0000000000000000000000000000000000000000000000000000000000000009' + + expected: '0000000000000000000000000000000000000000000000000000000000000040' + '0000000000000000000000000000000000000000000000000000000000000005' + + '0000000000000000000000000000000000000000000000000000000000000009' + '6761766f66796f726b0000000000000000000000000000000000000000000000'}); + test({ types: ['bytes', 'bool', 'int[]'], values: ['gavofyork', true, [1, 2, 3]], + expected: '0000000000000000000000000000000000000000000000000000000000000060' + + '0000000000000000000000000000000000000000000000000000000000000001' + + '00000000000000000000000000000000000000000000000000000000000000a0' + + '0000000000000000000000000000000000000000000000000000000000000009' + + '6761766f66796f726b0000000000000000000000000000000000000000000000' + + '0000000000000000000000000000000000000000000000000000000000000003' + + '0000000000000000000000000000000000000000000000000000000000000001' + + '0000000000000000000000000000000000000000000000000000000000000002' + + '0000000000000000000000000000000000000000000000000000000000000003'}); + test({ types: ['bytes', 'int[]'], values: ['gavofyork', [1, 2, 3]], + expected: '0000000000000000000000000000000000000000000000000000000000000040' + + '0000000000000000000000000000000000000000000000000000000000000080' + + '0000000000000000000000000000000000000000000000000000000000000009' + + '6761766f66796f726b0000000000000000000000000000000000000000000000' + + '0000000000000000000000000000000000000000000000000000000000000003' + + '0000000000000000000000000000000000000000000000000000000000000001' + + '0000000000000000000000000000000000000000000000000000000000000002' + + '0000000000000000000000000000000000000000000000000000000000000003'}); test({ types: ['int', 'bytes'], values: [5, 'gavofyork'], - expected: '0000000000000000000000000000000000000000000000000000000000000009' + - '0000000000000000000000000000000000000000000000000000000000000005' + + expected: '0000000000000000000000000000000000000000000000000000000000000005' + + '0000000000000000000000000000000000000000000000000000000000000040' + + '0000000000000000000000000000000000000000000000000000000000000009' + '6761766f66796f726b0000000000000000000000000000000000000000000000'}); test({ types: ['int', 'bytes', 'int', 'int', 'int', 'int[]'], values: [1, 'gavofyork', 2, 3, 4, [5, 6, 7]], - expected: '0000000000000000000000000000000000000000000000000000000000000009' + - '0000000000000000000000000000000000000000000000000000000000000003' + - '0000000000000000000000000000000000000000000000000000000000000001' + + expected: '0000000000000000000000000000000000000000000000000000000000000001' + + '00000000000000000000000000000000000000000000000000000000000000c0' + '0000000000000000000000000000000000000000000000000000000000000002' + '0000000000000000000000000000000000000000000000000000000000000003' + '0000000000000000000000000000000000000000000000000000000000000004' + + '0000000000000000000000000000000000000000000000000000000000000100' + + '0000000000000000000000000000000000000000000000000000000000000009' + '6761766f66796f726b0000000000000000000000000000000000000000000000' + + '0000000000000000000000000000000000000000000000000000000000000003' + '0000000000000000000000000000000000000000000000000000000000000005' + '0000000000000000000000000000000000000000000000000000000000000006' + '0000000000000000000000000000000000000000000000000000000000000007'}); - }); }); diff --git a/test/contract.js b/test/contract.js index 8a2ea109d..0dcaa1003 100644 --- a/test/contract.js +++ b/test/contract.js @@ -345,6 +345,7 @@ describe('web3.eth.contract', function () { assert.equal(payload.method, 'eth_call'); assert.deepEqual(payload.params, [{ data: sha3.slice(0, 10) + + '0000000000000000000000000000000000000000000000000000000000000020' + '0000000000000000000000000000000000000000000000000000000000000001' + '0000000000000000000000000000000000000000000000000000000000000003', to: address diff --git a/test/event.encode.js b/test/event.encode.js index c28588c2e..6d9850c00 100644 --- a/test/event.encode.js +++ b/test/event.encode.js @@ -119,6 +119,32 @@ var tests = [{ ] } }, { + abi: { + name: 'event1', + inputs: [{ + type: 'int', + name: 'a', + indexed: true + }] + }, + indexed: { + a: 1 + }, + options: { + fromBlock: 'latest', + toBlock: 'pending' + }, + expected: { + address: address, + fromBlock: 'latest', + toBlock: 'pending', + topics: [ + signature, + '0x0000000000000000000000000000000000000000000000000000000000000001' + ] + } +}, +{ abi: { name: 'event1', inputs: [{ diff --git a/test/formatters.inputTransactionFormatter.js b/test/formatters.inputTransactionFormatter.js index 2f7f8c2e5..44c3534d3 100644 --- a/test/formatters.inputTransactionFormatter.js +++ b/test/formatters.inputTransactionFormatter.js @@ -3,24 +3,62 @@ var assert = chai.assert; var formatters = require('../lib/web3/formatters.js'); var BigNumber = require('bignumber.js'); +var tests = [{ + input: { + data: '0x34234bf23bf4234', + value: new BigNumber(100), + from: '0x00000', + to: '0x00000', + nonce: 1000, + gas: 1000, + gasPrice: new BigNumber(1000) + }, + result: { + data: '0x34234bf23bf4234', + value: '0x64', + from: '0x00000', + to: '0x00000', + nonce: '0x3e8', + gas: '0x3e8', + gasPrice: '0x3e8' + } +},{ + input: { + data: '0x34234bf23bf4234', + value: new BigNumber(100), + from: '0x00000', + to: '0x00000', + }, + result: { + data: '0x34234bf23bf4234', + value: '0x64', + from: '0x00000', + to: '0x00000', + } +},{ + input: { + data: '0x34234bf23bf4234', + value: new BigNumber(100), + from: '0x00000', + to: '0x00000', + gas: '1000', + gasPrice: new BigNumber(1000) + }, + result: { + data: '0x34234bf23bf4234', + value: '0x64', + from: '0x00000', + to: '0x00000', + gas: '0x3e8', + gasPrice: '0x3e8' + } +}]; + describe('formatters', function () { describe('inputTransactionFormatter', function () { - it('should return the correct value', function () { - - assert.deepEqual(formatters.inputTransactionFormatter({ - data: '0x34234bf23bf4234', - value: new BigNumber(100), - from: '0x00000', - to: '0x00000', - gas: 1000, - gasPrice: new BigNumber(1000) - }), { - data: '0x34234bf23bf4234', - value: '0x64', - from: '0x00000', - to: '0x00000', - gas: '0x3e8', - gasPrice: '0x3e8' + tests.forEach(function(test){ + it('should return the correct value', function () { + assert.deepEqual(formatters.inputTransactionFormatter(test.input), test.result); }); }); }); diff --git a/test/web3.eth.filter.js b/test/web3.eth.filter.js index d8b37311a..7a355b50c 100644 --- a/test/web3.eth.filter.js +++ b/test/web3.eth.filter.js @@ -21,6 +21,21 @@ var tests = [{ result: '0xf', formattedResult: '0xf', call: 'eth_newFilter' +},{ + args: [{ + fromBlock: 'latest', + toBlock: 'latest', + address: '0x47d33b27bb249a2dbab4c0612bf9caf4c1950855' + }], + formattedArgs: [{ + fromBlock: 'latest', + toBlock: 'latest', + address: '0x47d33b27bb249a2dbab4c0612bf9caf4c1950855', + topics: [] + }], + result: '0xf', + formattedResult: '0xf', + call: 'eth_newFilter' },{ args: ['pending'], formattedArgs: ['pending'], diff --git a/test/web3.eth.hashRate.js b/test/web3.eth.hashRate.js new file mode 100644 index 000000000..ec01bfad1 --- /dev/null +++ b/test/web3.eth.hashRate.js @@ -0,0 +1,38 @@ +var chai = require('chai'); +var assert = chai.assert; +var web3 = require('../index'); +var FakeHttpProvider = require('./helpers/FakeHttpProvider'); + +var method = 'hashrate'; + +var tests = [{ + result: '0x788a8', + formattedResult: 493736, + call: 'eth_'+ method +}]; + +describe('web3.eth', function () { + describe(method, function () { + tests.forEach(function (test, index) { + it('property test: ' + index, function () { + + // given + var provider = new FakeHttpProvider(); + web3.setProvider(provider); + provider.injectResult(test.result); + provider.injectValidation(function (payload) { + assert.equal(payload.jsonrpc, '2.0'); + assert.equal(payload.method, test.call); + assert.deepEqual(payload.params, []); + }); + + // when + var result = web3.eth[method]; + + // then + assert.strictEqual(test.formattedResult, result); + }); + }); + }); +}); + From 7ca3e392988e0521ad131729505bfab002ba1113 Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Mon, 11 May 2015 09:42:32 +0200 Subject: [PATCH 102/461] fix BlockGasLimit verification --- libethcore/BlockInfo.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libethcore/BlockInfo.cpp b/libethcore/BlockInfo.cpp index e20e88a91..083ade9a4 100644 --- a/libethcore/BlockInfo.cpp +++ b/libethcore/BlockInfo.cpp @@ -246,9 +246,9 @@ void BlockInfo::verifyParent(BlockInfo const& _parent) const BOOST_THROW_EXCEPTION(InvalidDifficulty() << RequirementError((bigint)calculateDifficulty(_parent), (bigint)difficulty)); if (gasLimit < c_minGasLimit || - gasLimit < _parent.gasLimit * (c_gasLimitBoundDivisor - 1) / c_gasLimitBoundDivisor || - gasLimit > _parent.gasLimit * (c_gasLimitBoundDivisor + 1) / c_gasLimitBoundDivisor) - BOOST_THROW_EXCEPTION(InvalidGasLimit() << errinfo_min((bigint)_parent.gasLimit * (c_gasLimitBoundDivisor - 1) / c_gasLimitBoundDivisor) << errinfo_got((bigint)gasLimit) << errinfo_max((bigint)_parent.gasLimit * (c_gasLimitBoundDivisor + 1) / c_gasLimitBoundDivisor)); + gasLimit < _parent.gasLimit - _parent.gasLimit / c_gasLimitBoundDivisor || + gasLimit > _parent.gasLimit + _parent.gasLimit / c_gasLimitBoundDivisor) + BOOST_THROW_EXCEPTION(InvalidGasLimit() << errinfo_min((bigint)_parent.gasLimit - _parent.gasLimit / c_gasLimitBoundDivisor) << errinfo_got((bigint)gasLimit) << errinfo_max((bigint)_parent.gasLimit + _parent.gasLimit / c_gasLimitBoundDivisor)); // Check timestamp is after previous timestamp. if (parentHash) From de64afac2bd46d1a48484472fc46f2320fb2a90e Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Mon, 11 May 2015 09:48:53 +0200 Subject: [PATCH 103/461] fix --- libethcore/BlockInfo.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libethcore/BlockInfo.cpp b/libethcore/BlockInfo.cpp index 083ade9a4..f6ecb5472 100644 --- a/libethcore/BlockInfo.cpp +++ b/libethcore/BlockInfo.cpp @@ -246,8 +246,8 @@ void BlockInfo::verifyParent(BlockInfo const& _parent) const BOOST_THROW_EXCEPTION(InvalidDifficulty() << RequirementError((bigint)calculateDifficulty(_parent), (bigint)difficulty)); if (gasLimit < c_minGasLimit || - gasLimit < _parent.gasLimit - _parent.gasLimit / c_gasLimitBoundDivisor || - gasLimit > _parent.gasLimit + _parent.gasLimit / c_gasLimitBoundDivisor) + gasLimit <= _parent.gasLimit - _parent.gasLimit / c_gasLimitBoundDivisor || + gasLimit >= _parent.gasLimit + _parent.gasLimit / c_gasLimitBoundDivisor) BOOST_THROW_EXCEPTION(InvalidGasLimit() << errinfo_min((bigint)_parent.gasLimit - _parent.gasLimit / c_gasLimitBoundDivisor) << errinfo_got((bigint)gasLimit) << errinfo_max((bigint)_parent.gasLimit + _parent.gasLimit / c_gasLimitBoundDivisor)); // Check timestamp is after previous timestamp. From 438d2b44edd22348a0233c49884a45239454f4bd Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 11 May 2015 09:56:17 +0200 Subject: [PATCH 104/461] small changes --- mix/ClientModel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mix/ClientModel.cpp b/mix/ClientModel.cpp index 8067f62c4..519b7ddf3 100644 --- a/mix/ClientModel.cpp +++ b/mix/ClientModel.cpp @@ -390,7 +390,7 @@ void ClientModel::executeSequence(vector const& _sequence, emit runStateChanged(); return; } - callAddress(Address(address.toStdString()), encoder.encodedData(), transaction); + callAddress(contractAddressIter->second, encoder.encodedData(), transaction); } m_gasCosts.append(m_client->lastExecution().gasUsed); } From 4b3fd578f818d5b502299f103f1e44c7d5715bf5 Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Mon, 11 May 2015 09:58:00 +0200 Subject: [PATCH 105/461] fix selecting gasLimit --- libethcore/BlockInfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libethcore/BlockInfo.cpp b/libethcore/BlockInfo.cpp index f6ecb5472..eb64593af 100644 --- a/libethcore/BlockInfo.cpp +++ b/libethcore/BlockInfo.cpp @@ -228,7 +228,7 @@ u256 BlockInfo::selectGasLimit(BlockInfo const& _parent) const return c_genesisGasLimit; else // target minimum of 3141592 - return max(max(c_minGasLimit, 3141592), (_parent.gasLimit * (c_gasLimitBoundDivisor - 1) + (_parent.gasUsed * 6 / 5)) / c_gasLimitBoundDivisor); + return max(max(c_minGasLimit, 3141592), _parent.gasLimit - _parent.gasLimit / c_gasLimitBoundDivisor + 1 + (_parent.gasUsed * 6 / 5) / c_gasLimitBoundDivisor); } u256 BlockInfo::calculateDifficulty(BlockInfo const& _parent) const From fa69d6a5298fc1c53dc83c8036463c7e4d02d1b1 Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Mon, 11 May 2015 10:11:36 +0200 Subject: [PATCH 106/461] optional wallet blockChain tests, beacuse it takes a while --- test/TestHelper.cpp | 3 +++ test/TestHelper.h | 1 + test/libethereum/blockchain.cpp | 3 ++- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/test/TestHelper.cpp b/test/TestHelper.cpp index 96e11e02c..79fdaa158 100644 --- a/test/TestHelper.cpp +++ b/test/TestHelper.cpp @@ -732,6 +732,8 @@ Options::Options() bigData = true; else if (arg == "--checkstate") checkState = true; + else if (arg == "--wallet") + wallet = true; else if (arg == "--all") { performance = true; @@ -739,6 +741,7 @@ Options::Options() memory = true; inputLimits = true; bigData = true; + wallet= true; } else if (arg == "--singletest" && i + 1 < argc) { diff --git a/test/TestHelper.h b/test/TestHelper.h index 02f509e4c..e63634053 100644 --- a/test/TestHelper.h +++ b/test/TestHelper.h @@ -195,6 +195,7 @@ public: bool memory = false; bool inputLimits = false; bool bigData = false; + bool wallet = false; /// @} /// Get reference to options diff --git a/test/libethereum/blockchain.cpp b/test/libethereum/blockchain.cpp index c5ac936fe..585a741b9 100644 --- a/test/libethereum/blockchain.cpp +++ b/test/libethereum/blockchain.cpp @@ -787,7 +787,8 @@ BOOST_AUTO_TEST_CASE(bcGasPricerTest) BOOST_AUTO_TEST_CASE(bcWalletTest) { - dev::test::executeTests("bcWalletTest", "/BlockTests",dev::test::getFolder(__FILE__) + "/BlockTestsFiller", dev::test::doBlockchainTests); + if (test::Options::get().wallet) + dev::test::executeTests("bcWalletTest", "/BlockTests",dev::test::getFolder(__FILE__) + "/BlockTestsFiller", dev::test::doBlockchainTests); } BOOST_AUTO_TEST_CASE(userDefinedFile) From 33d7e42866566d9fe225a4ab67eae05f7f52df5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Mon, 11 May 2015 11:38:11 +0200 Subject: [PATCH 107/461] CMake: set default RUNTIME_OUTPUT_DIRECTORY property to "bin" This commit changes output directory for runtime components (executables and DLLs) to "bin" directory. That allows running executables on Windows without need of install step. Closes ethereum/cpp-ethereum#1821 --- CMakeLists.txt | 1 + cmake/EthExecutableHelper.cmake | 33 +++++++++++++++++---------------- cmake/scripts/copydlls.cmake | 3 +-- libevmasm/CMakeLists.txt | 7 +------ 4 files changed, 20 insertions(+), 24 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9ba214cce..4e7003692 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -295,6 +295,7 @@ message("-- EVMJIT Build LLVM-based JIT EVM (experimental!) ${EVMJIT}" message("------------------------------------------------------------------------") message("") +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin") set(CMAKE_THREAD_LIBS_INIT pthread) include(EthCompilerSettings) diff --git a/cmake/EthExecutableHelper.cmake b/cmake/EthExecutableHelper.cmake index 1d1cb887b..d971a5f92 100644 --- a/cmake/EthExecutableHelper.cmake +++ b/cmake/EthExecutableHelper.cmake @@ -45,25 +45,26 @@ endmacro() macro(eth_copy_dlls EXECUTABLE DLLS) # dlls must be unsubstitud list variable (without ${}) in format - # optimized;path_to_dll.dll;debug;path_to_dlld.dll + # optimized;path_to_dll.dll;debug;path_to_dlld.dll list(GET ${DLLS} 1 DLL_RELEASE) list(GET ${DLLS} 3 DLL_DEBUG) + get_target_property(TARGET_RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE} RUNTIME_OUTPUT_DIRECTORY) add_custom_command(TARGET ${EXECUTABLE} - POST_BUILD - COMMAND ${CMAKE_COMMAND} ARGS - -DDLL_RELEASE="${DLL_RELEASE}" - -DDLL_DEBUG="${DLL_DEBUG}" + POST_BUILD + COMMAND ${CMAKE_COMMAND} ARGS + -DDLL_RELEASE="${DLL_RELEASE}" + -DDLL_DEBUG="${DLL_DEBUG}" -DCONF="$" - -DDESTINATION="${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}" + -DDESTINATION="${TARGET_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}" -P "${ETH_SCRIPTS_DIR}/copydlls.cmake" ) endmacro() -# +# # this function requires the following variables to be specified: # ETH_DEPENDENCY_INSTALL_DIR # -# params: +# params: # QMLDIR # @@ -74,7 +75,7 @@ macro(eth_install_executable EXECUTABLE) set (one_value_args QMLDIR) set (multi_value_args DLLS) cmake_parse_arguments (ETH_INSTALL_EXECUTABLE "${options}" "${one_value_args}" "${multi_value_args}" "${extra_macro_args}") - + if (ETH_INSTALL_EXECUTABLE_QMLDIR) if (APPLE) set(eth_qml_dir "-qmldir=${ETH_INSTALL_EXECUTABLE_QMLDIR}") @@ -91,13 +92,14 @@ macro(eth_install_executable EXECUTABLE) WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} COMMAND sh ${CMAKE_SOURCE_DIR}/macdeployfix.sh ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${EXECUTABLE}.app/Contents ) - + + get_target_property(TARGET_RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE} RUNTIME_OUTPUT_DIRECTORY) # This tool and next will inspect linked libraries in order to determine which dependencies are required if (${CMAKE_CFG_INTDIR} STREQUAL ".") # TODO: This should only happen for GUI application - set(APP_BUNDLE_PATH "${CMAKE_CURRENT_BINARY_DIR}/${EXECUTABLE}.app") + set(APP_BUNDLE_PATH "${TARGET_RUNTIME_OUTPUT_DIRECTORY}/${EXECUTABLE}.app") else () - set(APP_BUNDLE_PATH "${CMAKE_CURRENT_BINARY_DIR}/\$ENV{CONFIGURATION}/${EXECUTABLE}.app") + set(APP_BUNDLE_PATH "${TARGET_RUNTIME_OUTPUT_DIRECTORY}/\$ENV{CONFIGURATION}/${EXECUTABLE}.app") endif () install(CODE " @@ -111,14 +113,15 @@ macro(eth_install_executable EXECUTABLE) get_target_property(TARGET_LIBS ${EXECUTABLE} INTERFACE_LINK_LIBRARIES) string(REGEX MATCH "Qt5::Core" HAVE_QT ${TARGET_LIBS}) if ("${HAVE_QT}" STREQUAL "Qt5::Core") + get_target_property(TARGET_RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE} RUNTIME_OUTPUT_DIRECTORY) add_custom_command(TARGET ${EXECUTABLE} POST_BUILD - COMMAND cmd /C "set PATH=${Qt5Core_DIR}/../../../bin;%PATH% && ${WINDEPLOYQT_APP} ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${EXECUTABLE}.exe ${eth_qml_dir}" + COMMAND cmd /C "set PATH=${Qt5Core_DIR}/../../../bin;%PATH% && ${WINDEPLOYQT_APP} ${TARGET_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${EXECUTABLE}.exe ${eth_qml_dir}" WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ) #workaround for https://bugreports.qt.io/browse/QTBUG-42083 add_custom_command(TARGET ${EXECUTABLE} POST_BUILD COMMAND cmd /C "(echo [Paths] & echo.Prefix=.)" > "qt.conf" - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR} VERBATIM + WORKING_DIRECTORY ${TARGET_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR} VERBATIM ) endif() @@ -144,5 +147,3 @@ macro(eth_install_executable EXECUTABLE) endif () endmacro() - - diff --git a/cmake/scripts/copydlls.cmake b/cmake/scripts/copydlls.cmake index 6d86b8e4e..57eb0ffd4 100644 --- a/cmake/scripts/copydlls.cmake +++ b/cmake/scripts/copydlls.cmake @@ -14,5 +14,4 @@ else () # Debug set(DLL ${DLL_DEBUG}) endif() -execute_process(COMMAND ${CMAKE_COMMAND} -E copy "${DLL}" "${DESTINATION}") - +execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${DLL}" "${DESTINATION}") diff --git a/libevmasm/CMakeLists.txt b/libevmasm/CMakeLists.txt index f8150806f..eb8fea95c 100644 --- a/libevmasm/CMakeLists.txt +++ b/libevmasm/CMakeLists.txt @@ -19,15 +19,10 @@ set(EXECUTABLE evmasm) file(GLOB HEADERS "*.h") -if (ETH_STATIC) - add_library(${EXECUTABLE} STATIC ${SRC_LIST} ${HEADERS}) -else() - add_library(${EXECUTABLE} SHARED ${SRC_LIST} ${HEADERS}) -endif() +add_library(${EXECUTABLE} ${SRC_LIST} ${HEADERS}) target_link_libraries(${EXECUTABLE} evmcore) target_link_libraries(${EXECUTABLE} devcrypto) install( TARGETS ${EXECUTABLE} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) install( FILES ${HEADERS} DESTINATION include/${EXECUTABLE} ) - From 0470ff66497753220c74ccdda7d7075ff402ac1a Mon Sep 17 00:00:00 2001 From: Marek Kotewicz Date: Mon, 11 May 2015 12:30:47 +0200 Subject: [PATCH 108/461] cmake target for building osx .dmg file --- CMakeLists.txt | 16 +++++++++++++++- appdmg.json.in | 13 +++++++++++++ bg.png | Bin 0 -> 175517 bytes cmake/EthDependencies.cmake | 5 +++++ cmake/scripts/appdmg.cmake | 17 +++++++++++++++++ 5 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 appdmg.json.in create mode 100644 bg.png create mode 100644 cmake/scripts/appdmg.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 9ba214cce..1f2877c10 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -396,8 +396,22 @@ if (GUI) endif() +if (APPLE) -#unset(TARGET_PLATFORM CACHE) + add_custom_target(appdmg + WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} + COMMAND ${CMAKE_COMMAND} + -DAPP_DMG_EXE=${ETH_APP_DMG} + -DAPP_DMG_FILE=appdmg.json.in + -DAPP_DMG_ICON="alethzero/alethzero.icns" + -DAPP_DMG_BACKGROUND="bg.png" + -DETH_BUILD_DIR="${CMAKE_BINARY_DIR}" + -DETH_MIX_APP="$" + -DETH_ALETHZERO_APP="$" + -P "${ETH_SCRIPTS_DIR}/appdmg.cmake" + ) + +endif () if (WIN32) # packaging stuff diff --git a/appdmg.json.in b/appdmg.json.in new file mode 100644 index 000000000..4fb9a6e33 --- /dev/null +++ b/appdmg.json.in @@ -0,0 +1,13 @@ +{ + "title": "Ethereum", + "icon": "appdmg_icon.icns", + "background": "appdmg_background.png", + "icon-size": 80, + "contents": [ + { "x": 600, "y": 170, "type": "link", "path": "/Applications" }, + { "x": 150, "y": 90, "type": "file", "path": "${ETH_ALETHZERO_APP}" }, + { "x": 150, "y": 260, "type": "file", "path": "${ETH_MIX_APP}" } + ] +} + + diff --git a/bg.png b/bg.png new file mode 100644 index 0000000000000000000000000000000000000000..869290c2b861dd148e1ae500770f3bc47879761e GIT binary patch literal 175517 zcmZU(WmsHGvo<`qYjAf7?#_@va19Otg1fuByF>8c?(Pmj1_>72-5mz_$bQayo_(%w z>c_0L+N!Hdy6*09MR^GnL;^$r0DvMTDfSfrfO>y~Fo%bH|0@VxGynkbl+8s&6{SQ) z$rK%IP0X!~0RRnzN=;K0Y`MgkM z9}`r>5GVq|=*SQeDKNznC@2t@ar>W7vsZlu_Q%IL=H|Fm=jN1kga8*a@st#wS!Dr1 zAzze<#*u@+t*!*a+X7HFV2DHr&_~ylFktWQ<~QC1yHEi^e;&TYd^~!4x2Xaq zF`%!0i`#x9O_RNQVn~#|dyDj4g7oaeC4>|I5)^lDEe!V6{VZyb+s%!p?^cMEn!Bp7rJfp@4E9vCr5rba3$E*KMd@y;RT-THxN+E+rZPGU6jY zgexS@MnAk5>^*5OzkH+tMFm+=tK52~0c7;%FEHo1M|x4TwtkBR@SQ zkq#zVQ0{y>{G3nrCn+|Uj99KA)yOPnymSi}a;9%k?LIS1pVLw!Wy0!C7Py9M*-b6`y0spKf$ zKEhV`W3a-0CWFn^B_o3N@5x?z(tNlnAH<4-fO&w@BfHPIDh?epk-_UY16*!=fDaT@ z@_oj)X?hCKkbHYgeJZaex>&Y~UOmA;7VhB*GH|bH)3C1K>Nx6GMkx261J5diUB+g+ zedu6YBeIQHzY2xy$eSm>DDdlf3pRmS_R4d{azlAG?C-v^BeetBo!h;%D6OE|!JhLJ zf}4I*vL;_i1a>D__s}KXjWKjh8R~z3LPJx7w5W{W8aNVp$ve|PWkieXFB6eLuJM@S zR+W6&7Al)(^L2h+Nc9E3hQ^jPPWdiAWK5Dxtesp9H4h%xFDuE8#wyas2Uf$(K_BYn#r>oj<&JXY?0I1m>am`?_I$#4f`20lPn0 zGT?tLAy6C!4EZ+Le&dV+e#auIjm115MQ1VsboX_A#?fEXHV#h0!cqm~`plLJ0=!%n z!D^I53U7r<1Q3fwP}{DLdOv8<09;D|*3eg(52Bl#Utx0(Yh974?@|RBZ$ko?0x%|# zZO8y({#XrC2qh5KxoEO})HP5sJt!ysx@dqr#p6yghyp*SIE1=h1UrJHfa?v!7Fe4A z4?A2z0NN+q1DKZ$uBd2)3k*iT>hCC@&>=s^)=;d3kx|5qkV%KZ{)|i`n-7E93UQ-& zmBhmgq#}chm!-nxi%ufn9YHC;aQAbf0L76TA*YL{#GT_|iH7R;Ul>xcUg4ocK@1^o zhb={44vQIVv6-hCrYWa6rj@7hk3-4g7Ljs9JcenCLr6zDTR}h@uo6D?ZE<5{AnSnCL4QR)0UPv0mI?WIKU$ zA(n{U?jPM~u*2b1&ji}AFcYi$wFi|CHukr2_&-MsZ}VLwxHEgLlXxO`^$#W6nsELP)C>u67GZEB#cj?lT@Mjfw>y4KcHd&Q5)bE zyC{)KRTZBmxkbg4Ks*}S5bKob5v0SWr=)A9W2c{{iKf@5F{BBk7i+*XVlvV&3NxBB?rUmk4rwZ>DXCGa z+0F-6;A$*u(k@foT3Ga0#97o_R9(zk+Fp!Y%vhA*Q$$5TMT$X>*(T!Q zgXQgVymBP4dvYMztk^o){0;S;gS)&;RO*Ykx^kY zVHROe;d_xyVa#C&5ldmzVX6_Gn6%-RVQ^tNSm)?^@o`CZ@w`+@ENs-H)aK;)ESmIu zj9*v^X|d^@<&Oq&z&O!Nz1ovjhsi^d<cO7>Gb{4Qzus>rl({-pBDK)6bs&-Vi6i`*} zRH_u*d`{P0QsI+o{p7CnMSM`bP;9sGV|iKh5&0a>T#m(&1y#|N{YGa&jC~VeiyJ@XtQ~SNt#=WO*B4W}abk4lo zb$(_Z>v)+Pk5DEbt!@9_v#VoJ3hMFpjWYeIDqt!`7(@xF~*7se*EyZ}nbetG(s-84% zSnqhxJm<%DDRhAvs$*=c&I@v4^s3gAx?_B^-<m?*-CZEe2Py|g4v8L2))HK=oU$k79Vz6TzV&unb#nV#Y(y1lMC`tZ4D+w{gV(T^(8lHz=aioZG!vCOKjKHJyKKBmR9{B zdHD-Jhr^rtiCVP~T$oT9 zIwYN2c7>JSIy*W7s<+&zi`a`Co{p-@I~Ss=xl~3~lT{s6Om*QF468sZ7aeSNvqvT} z(c*G*Oqbe&jTMdf&XTKLZNX1|Pt&l?A*RtO(M-*awhL=Z9{X21o9$oZPUMEqr&na! zo2QA^JG_8fuP0D%aNA5IOx4;t+IkJvw#Vkp7QQ!AH~N;LpCqm+vm{&v8uoF!F!em3ysN9wkzvZ6&4jPUapVAtxflEo5Q6!+CFQ#&03^u@T-eq zWXdBMmJluc06ZWNkirZlat;fyWC3s@cUx4+p|%W&kf9A|v}h>;&dAV^`@dxeMd@d< zik1Lz2IseaUT8t{_c7Y1{g#{kyez)(=`BbUsN_|(3;Y^pqs%qY$iU#*Rn<+F}G!n(3Pb!}Q2LL{CR zWt(j7jpFd7>{nV;3RsI$mY@Uw%$Ux1$lGA(g%1ipPAtSZkx%9lJg0ozh+H%nPOw ze)r?w<$ci<@do)EI|)#Q#gl7v$Ab5F;Hxh))Y)U~>J7h`K7RYySskLcte%WW$^9mN zIf2AA(JXGEewueG#zTG$_cl~n4@^M-{{;-2SOgoM zET;*ATuXx>zN zd~qCcBy~83Pe<^PfF5rwVorVjebt~%@yfNU$?22ny}wW`$!0c$5gLoBEg`9)9upA8R|=1C{FB*~!-dg^qM5pe zvYV=yxe+%t^+)y}MBC_=4eI1EzNF^s>Ug9e%pYhf)G1WNGV=0y1y3YS3XV_1Ox_^! z>V6-I0QS%9{dIk@;v|v$Bw556^(;JWEL?9>;S~Yfw2lh9xY@iqicWP8ztj5?e$H^1 zR;M=R5DEgF^>;D%*iW%j9I6nzr1Q#uE)HfBb=SUcF@@2qDm0 zCuzMtJNqNlWYYRfgXYpG)tY8Hg$8PArx&K_o7lAw2k9-)%Md!?kM2uDH6Wnb&j&Sa1tOikPR$;~D?& zpyh9@9VO0Er*(glt#?hZZIUt6IjU9Fgi5p9d+n5)hOScdPJ7#Co&-=>2)oxdTgumV zyw6px6X7Hy9m-voFYiJ^DT$A>z_E>OF0Oj#o1Pv8_m(-J>n@)_e?pcoAy<0aq1$U= zF-INO?!I^ZznmTzw^uHS)S`ee4yYb@ zO9f9401+3&UIOV#!VHAu%3b$kAj*6iO-)f0%$oeWKs_%(W$eqxxBXoaHY0c-m-l&x5~;k0AD1N%33?BrXFzHyx~ zWh2=7#SZE9#-eK=s0DFqXjfuzg+GV6h7nR3e#I%x5l^Fu+GA!Cs^mEp<;QO$YE$)K zNh{>UXXbEVB{BGBjHpjw=wf_kT>IVJc+RvFWYRPL%Vub;e{J;)KE1Ef4pL?AV{GPV_{N$9 zOZKgv+Mp5Ik8#)&Nju4{su%A&@toglrQN>|roBq$3Ut~}e@uQ^#q3Oc;)6{OK@f)+ znxru)`eP!!SBEo`Ql}O%uf<)|B=7Qihp>E2WOH`l2tFF$H#j2Lb?JTCWiDDx@kI3$ zq?q+s@+^K>xyX7~mcrGUdc??_VDZ~-L_$U z&eyCm($)tk<_B>BEwzEX!iEP6#2_DlM-Z!vKbB;vgFp6k9+#KJ+@q-2#8t9UAw>~$ z+>{@OW8`ol#9p- zI)&F<9iK__6JNl}%)HX0ZZP-YvNTU}b*W1Ee95YkZQ#;z^!y5UZhsj=VR8An6}nBD zfz$7nk)0ohQ1z*MIr?W`Yg}rUEVT_5^t%swn*00MCQJJsD;ZKV@;%okUsnY^M@X=< z$8=%W5QLq(#$Jygr2JQV1ITOhK>f*-^5Rtzj}pMh+f@3t}FAJF@Wpdf#xVd3}BNde-}z z7r#I%j0%TfPEu7Ph&E^$8D{{@X)c8^XY=Rc>GaS(D%Ss7#qgX@C zi6*6j$M_8I8g?VbUK>9kA3=lC=N%{0P|;v+S4^2{^J6Xal{gT$AKDOo8&esQBmR*p z5^GFnUdKwK>EoRa5i(I_Cc?KL-^y3y1kF2Kyu7>|!IhB3F!@1NL4}({*%+r7AMQ2ur@G<@(@x^qm?eJ+z9Nrn64^B!hS%M;S3bA{>oERE1MF7CJ z0>I--iy8vWwU^g|-;7Y9?0`E9Z$uwCZh=bgs1u-}Skd>FlKhMwtGK*000Et_}?F`jh*z#+^nr^9QoaZDE_Iz|Ni{< zGYbXTKUJJ8g(x)S6v;$w9gNAim^qnQDTEQp$jAg8j7<2yii!VE^Y=F)3Nt4sJAM`x zS65eNR}N-d2U8X{K0ZDcR(2M4cBc0lOpfk0PWo<4Hjb44>E!?QBWCPq=wNQ=WNvFi z_P1Ys16yY&q4yJw_X_{}`wySSZsz|T$;R=2ru9BSmcJz|Y|N}I|J(O_Q^CJq`4!FG zjIA`p%&m=W9N)(f=HccQ{HOl^ujIcY{;Q?te_L{Jv;Di}ze@h6r69}S3H)n9|B==| zU*E+gj3~(RzoLIHGJ>iE07L*%VxLspAWk~(>#c{K*WItZ@5$Nx3dmR?pz#1Em_N;6 z!_z6Ow0>IgnORv3DL1LQ%*iHOmYKXpJ?a-(2y$glOA^H6&_^gyQO6faMnF)plZ0n} zhz|=*waEtUw|nF`o_Qa3K?`cF-mi2DROnjX{&~K6%064`EVgZV4JjpQgZVdQTO!FS z$l1zU+t^rDRaREo+EmzD+3D)&XfKm>waRB!l%`LVmO8%{7f-wLOHgEF7&VF%8Sg}0 zeP6xeW?<(*zjtgF`4{y#>O)M+Cbri?TtFOER94$o%-cJAI|s5hLU8`bURn%tF)=ZT zvW}^;2dHYGoecYxLgnT!SEf24{g*O7A+fHBq8D9&{3Z}fLP0}A7B!$UNqD@5TG%^# zGqc3$jH%dAN7RKXShpR9BYg6lh*ijz>WcJBYu#<=Ep20DZyh#S`H##8aUZ!w^}8-fm5R(cSpHl7@uyfK9pyYEkYe@#(MIFS!2htoFx|0NDv2-8|j zXzq%$rIqhPme$Fe+0MA&IH%iKBtP~WWlAxXbSY|yNch-|&}aUU_l#r0BL{y9Nm-lO7xu-C zD36d{T)Mr7uiki6DobgpNs<)ek4aqi3C_X)k{dT;j|J(l*F5np#7Tv%EQE)~Wqn(3 z(n1uxIl%^H1i}Hv9@d{rrCK&fg7S~6bZKdlF;}6Ia3X=!Pp$teq+IO{WbK~K^h0x; zryUGe)6Q@A<3Xv0BJys05PML1$5Hne`xmIbTvgkAPt*!(K~ixX7^IT4%N$B8#XU4A zv)ikX|0UA_$o?`?5u^>cg6&0x7=K|#_iPH&e6@3c;~!*PR&g??&mR%IQOlKBEe!T5 zsv-Ev^If+7D{32mVvX;ZfksNGp_#=i>r~$U~~)&x%x8+M5r+z6HPQ|U5p7L z^FGU5A~HGhY&FlXK>QK=KQO=b*K1UBATv0XV_pBPOg~@()Ctb~J^*0p>iJ-X>^ozj zfHnuR2|B(#A^>7n?>*2co4NpD*u+y>Dm*-EW4bYLXRLI{HTMGy*OOm{k{~0QCF^)% z0j6Ws6oev&7|{9Oy|=+YgNze}_VS=cm2t8qMiVLi&sm9BKW^b>FZ=|5fs@?3_lTy{4lW#Gn0wNc8H?8bxffNqh;_a zK+MTZL~CLvuc>pQZ~}1ZN0FTVTLzj)(1tA-^#{XDD611o>gjd!w1jVAUYYTb&%9{Z zK@`HZL#&d@fTCVJ9CT|Ge-2e8$!*11I^=2CaGG3nDx53QL)Cn!-1uFOf`2PK9u6Ma zkUmua0qHiu6q;SAIg8%TB$OW4F*SlOx)Nc~PL1q_jJV043uHce7Km*&LVEmxCB)D& z{(>Zkk^ycg5CTjh(@w-yf4>p>U#<)PFV_(;korwY{vQ|HYak~Wj ze8;yQDmSf?^xtkf#?-&EMods?stDFkc z7W7Y6_d*C2_O&wkKn|w*%Vlx)DL0Zbg#fBLZHG3f+{&io(*I+BT4Z=I1(1Ir9$6O} z`yz5s;CvDg0Fa@6CRbwWiYQU!`x=sT{lZWdO95_-Kx8OuB_szsOc6TSCM=Y2?g~yS ziG$%NRKFpU!`gp$o23nK>n}mG<#e7vgC9u-c1$D{uj{~_8lH7cbl$DvM_&M3Ext^$ z`N@>p@xl_MTybJE@I~FE@!`9M9pdFd-!1 zN2XQ~H2GeBzv!vs;sOPtu6cj=_n@Jd?AAc?qXqOrZF~)*f;YizA=2!rbwq-N*@@Cf zS4S|mP8SxysrOgagK}bIxUKu|q`UKR(!{V}Sco1V%qtWwy#ydmIHF$DDyTu4PW|Yh zlkss`i)h7P@e?im`WfNV`Th#g@VgqClt!G2yfjX3dnFAD{?W42|HpDEk!1Zokhp?o zPkJ&t79;aWC45s-z3WRAS_M9-vC?zsHQvw~iVXXaspgGlK!2merlEjw8!z!Eoso9J zSG+8hM7fB{MVpbZFO%miWeLb;wTX3k_hy+dIJwP*>x8hiARq7ckX6VxXAQsNrN;)> zA9eMP7qPZZ`%q=*;j$CxSy{Ww^n0ZeongO~FWiw&4vN0JoE`*kC-{|qRtdJEBgiA& z%FospGu&%=O>rZI_`xdspAlAZHfZ-`*D@tjd5#VzZIatvRw27<-pvp}k7xdY^>ols zcha2?erJYs1GOa7HO0fB_gZ!eWF>AE@~dHOYdeIPJQvoIpy#uh!De(^_;33`sVRu5 znDO7?f0u9)7HMj5&Eq+6KfC^TOV4L>DOX`3PkWbgp;@dCb9U`P$*^PX*pL_wv`W&!)+ZuGu)Uk@sH5I6Ss2ozD zzs`>LnX$)KZpi1X<+>LL9-mOofO{?WecQYSEl2;Loj%U;jy@)EM#^-?0lctwZA+WN z`oMS1MPiWk#Dco(a-lX-5;BX%}VnG)mzcq#Qhoj+k zHx3z{qPCM`9hiOnV`2ceCbaGM2bc+XhL2sRZf>vKi4b;8 zl$jVX)S;<-6b-i=Ki8!SpmMV`N@xG>!vs@tN_wwt!4pief=#cUZ#U|~PhATuFFjYM zu7Z-yW3kiwU+bCMwKs6rAvH(0!%)vpw_tF}$L-|gYNz0)>g(#7I_lawnq1&l`VY`9 zOhTxIC%xG2w&Rcufr6w%&varGM%4&-7v7b5q8?$_3c~>E3!Wd7K~jkN zz-MOYEwLSFsHo%Fqu}FsH)scXimwdp_`t7O`FqX)CzaWofWM1T-wWwJWAp-ixpYl+ znRq)|)_bfU&UrnoMC*E1*K2y~8N%&yvDWsqNVWD8li%DtP1JQDPMn0J7V#m`?@EdiNxb92}tXk%WOi~H%RZ5%WMgk5;Y z>7#ZacpX1w0+XdbzcC=
-}(^^%U{?aEd&ywctJ6UG!;Dl93o`sky#cNym8>V^d zadKH!n%{a%yX>~HQ-N>pxQq~fID30IxF+YG8?`dJuN_E}InRL#FLv(k!KfXff5k|w zky{fZ@hR3&Sa|pBXipV~m*ceYsLyo9<{k>j4Ribl0XxVYB6lo-)H!_D?+ivk!WA z4soN^>6TTUFMBy>FB_hEqadX=Q`pr~0gE>3}eeyKPBDZ~3Y$81Di854RxB8+s*TfLvOK#6RLeMVcChG*g>b z>w1b7(7WiEXzo13jupPU0YiGT0VRY)YAhGP+1jLT3j%u1ukJ`WZ@(IE#hq~} zB5nNle?$JnCXeLM%>33o?qCw)KEIHD#NW`-x4)5R9P^zF9o^E0%<{tIhqaH1DX%pfl=9!e~9j z#BE#3X+G6=wH>K}&YrdnOt}fMsrYhdafD|1H%3``IYg2&M{P_E(f0`X6I{I7$wG$r zV3fVSbN$Av%^FF3Ni)dJ6vVZkTivXM%9Vn;b9>KXdmL^3wVoWGv(Q$-v!=pe%hXKI zGYZeQ@hefM1Ij~|L&U=gT-^Qh*7MqHkah<+!SU@#+qL!^f299I__Ano&$>Gjv^p{+ zS1+~oAQ}s&a|tcTqj7MOOKfLWSMYcj6*TFCahs9C+DD;JWr80{F?#QqP$3pGN@MW5 zCLuO{F7Y-Hk0V(#2iAj%cnUO~Hv#>eB`yH?Q(DNc^OwK+@BRc&MZT}IAid{+{RzFt zwn&@q?akmX>nu7t?uV=dWO`aZx;OXQ*I!~}P)W4jW)^HVYEzVO!Hj0hU*02qG!DA@ zgX#Bg!)!TndrcZ!%An@!Oo0Q5lYR!~Z|5gqy!x>XlKr&RqgIh*$$oNh5|2QsvB&=Nh z`kd~kNpJPe-NC3{;N!I^j@!*@j^DDUN*G2DusrX)^W1blQ{Z_F_w>p4?K<}ER6s;2 zIlBh7^K)|#OE%0lC4 zyAe&hKz!c4B#8~QVa`X$Gx$TI(Skv3`cLZC9i}TuBLaCl@dXWPiwUQnZd{T+3bp@} zt86Sa0n9>3oByI=c!NHoI<{raG*0DdQS5`PVj7gsw)k(E=(kSkzDBa`NhC32HkAj)7xvYB8?+mZILRlZq}w*C=L zSK~xbV0cz{2|E&$0Z=l`LEu>I|> zf?#c|jfaa%%vnU&EuI#eFeeYs{mt4-tl-n{=QZ!qb@0aK7<1=Eoeay*`RTR|L%ZWI z@B2hL9J=x85a}!G&2~jf{^YHF=-F?=7pmJp)F(gol@F3wiXSwP!O$U77I{(xXglP) zz|jkS>I}L{yimDl27IBRdyjywQ4$OuVup-?l3Wb&Q*Msoiy8DEI2qr`w8al7MFOq= zK}0rM>jB=3ofP%z>kpIO)n12NUszfA(z2B z>8`905!Wop?7~B+w2NfFE%cV{2=YlENg^E)vDFA3{mfO)hj~MNVq5 zK=lW&2;1xfVzLdNV-3otEW*>WBzt(l=#J_vcJfC8=5#6nz(?&n!+*l`cZes)smaxQ zVTYIO9A7YH>ZPO0c~_uJJI)dLYNBFTL_5y@dFOp?r0?Nlb>~Td!rP;Bb=%FC{T$b` zrC|SGNClM5JTVe=wc_G=nbRp1N=q!#MuZWKQp=gEEYdPDrTa}LB#Czq!7G@{cw1$o zQs`x@g~`F=f{bSgrrDPJ!MX~-`nOuz91ng&pjYYSQm0d|I|E3-*LY$hz11nFctL`h2kJM=Cc$>EbkG+`oOpWB(135E8K>}l4xN@0T z|EL~&@>ptkj*yD;l*El8B@MCw& zZZIgP{b(Zfo9~zq*g?qr2CCViMn(o{Vb$pzZtb}(XYKAl4?L&vc4^x+k+9D>P@5Yl z7enZ9D~@$XzEhM5l#3pE+(?jDGxX}yS8d+SY~%a+ic?hx)=!8{RT6CasB%AaX^~C5 z+XuJ20kdonTY0pLy7xC38L@(sj*j*s`xboI3UaCJ|1EWk$U5fS&kJ+nxf>7^amB8Av0a$5Ga zvUAp~rc0pawQf04=(6XV!Qhv-g|#H>g>j}9$MNXbKFBAn*H z`rV~cNJ*U^b%^R0j0h1I*YEpZp-ZgB+vI`3H`K60+YytSRnjJ}IWpl&v; z+R0L6RV#&9H1bTxbWFiE3GKnk;v_YtA!g|aBT+ZPG-RJ2vMLC%{bi@K&ed94JkL}a8nTZnnAVMs?%r-IA7dm#)JuDY7K zx|{y4YnRFDUUJq%ybbK#HRB~94!D#h8E=0kY7^7_{r&KLf4dYwJ7yYouh`;FoF|8) z>`_2&m@$vi-4`pfd>yj$!hWo^HNTW9q{BbQm9BGBU4HQ&BRlX|dn&kAa91_@{!mjS zn0k%O?6}Dnt`PgX&|jK2qc@7q7H3h6U6rExHE9(U|KlQwkq(}Vi%ER94sCt*{k!ky zBj0uYVxvEn<8d%nOQ10k6)b{dCdFi zRZ2dJ5H7@g`6a)`COES@!7)*P%5ZWrem2>)WRM)5^BCN^y3bfCH*w)n-TLUB0z4P0 z>1b+$G`O5DZe0p??}GNrYaP@f68rp_qHd99c(|XNug!*+Axw!fQF_@Xqn~9HPJ2`%;y1y~I5dZo zwrJ9^@^|g%8RdUscLGe=@;h|#x&gl4TYrpEU-bs%M@C*do#mgMP~A$J(tQwkIn20Q zx%YSNJ_5dsM&~@$pZi|rbY@5dgsxptE#*ja`N(aztfUUEx;q=VbA4dJ|NaoFw*wYy zK5nvf#nS^O!H4GYuw1%aneTI36Uo>4vm&EKiY{&pK;xD+%`qFSPS2xjepwNR%|$m3 zt84mTTS;*Ff%5}}w#uGedTxBbTGjTD7Qz!o#*8V$ZTz3Yrsa|*1`mrvyw^oW>HB_! z-X3h4Br7%YoX@7Mc;Wg?^$PXZcP{p5Qv)MqEY8)@BzT*x8y${*y!+YhU2PDTSj%r0 zWQ%#b$$_CM3k#aKoC5n7AjYsz2y!3tanQsh2*D3$K)n9Co&(7d(mt2>qT~*3Crx`g zhXJAROwF?Cn0>MWf}p%Wt%~gQdf8ex1`CDNtVJg==XtH2)V^_R*y=n!+Kcvg-#(R= zx)RPU?dKruH#3iS{!Mv+uGw7bglGxwd#3EwL;=GEr6siUE% zt%_&i9GvvKl#C3gi&$W7>R{e^+Y$BpYj6Jj%JTt(?yHPj;;3^{@s}0U^xOo1nYH&9 z(x#MEO)pi5EP;;`6_wb4077QCH&L?;hy$dV_3g{(<4^FRqjH*=LPR$_0rV8SmGSz8 z^ydy5&ev$B$E>QK5h<~X6CI)6anl)WID(9vt)dSLp_@Gss$QxX+M2W}WX4X(qhT&3 z+wM_5k|Xt{>{5Y|%kxnVF^QboTVLS;cKcHKzNYBgh*mJS-mzZ2-VNUpiqAHul)ZoDjw{I z)86@Z;h_que8m;*HVzqGwJI~ z=;646wv2olh6bc94D6O^d&V_C){X$;{NaH!BOi|XrGgwp826T@><|YPHn4U#t6Ggz z5H?WmbtV`y6(AuJ1x)X+`xNPKd6@!lAYO`0U1LDR(STKrLkeAF5vwGl-{_#YNj1r~ z&@2VR7o6IrNdGZ9y&ok(jj2LfA1{eycLcMTzbMg6M)4sfuI*t}N{i|vpA%(DGSQqW z(z4Ve)o=|VMpnoO)ir`kn7mZD#Iuqebl67cHvG>que28}y@}(tOpNU^hfUWBCT3;> z3OiJeN{-`<+5NM%MqhJxdwc(65vqIQ?^$t_k{M$w$mJt@K6d!%tRvII=IBZrlTiRk zDrk})`-W5(@KjXZiWsvd9sX%;YmP^#Ntc+Op%Yl*(@w&vg=FU^X$e0=>ZMHfqNC7* z8MWN$;am9%6b6%arXr~EL&c3J@-^IYE0^oPg7o!ROJ+fTeUk4!W6fi0^)~?^&&%um zH=lP@ZoAmTXE)o2VFTt++_rPOSHbH9n!whEA z-D0naV5aISG166dXg5S6h)nSpVRPaj-67HBL(ChxUJ{%GonONb{rrZ4Ggz&obf#^W zakRdrg+bCL)D_{sE2Zu6aGpivAhnq^TMI`Lj3_i=_ONp<*{mcAux71T6%Xmpe#X-J6$U;9mYljcHkRcJ2bZ-)eSx?`fLL# zJVYZAjzRNR@u(j0C^Y|2_PilT65IZhh7s)RE-a`yTHI_mvc$?N&)Ty^jZXr22;b!x zL(`h7p4ckA#y|5}qY(qFn@bM2|4D8`Ivd z$^MN~SGzV`Wyn@wPv!<8>I25WfbC9hAR8^oAZ&P$AY4Tnr_I+g==ubF3mG{sX^FG~ zklwC<9Tq_h{(+SDhf0HoV$G}S@n3{nOup#b>57HcgOa*&-A?|@+@NH3o{z3AWMg@RHYt#cxyfT=oKLUON?R7Ry{Cu^%p+)m zge)H)C&?5}%Ogv#5xUuH1I?8K32EBAJpAe_>Ut+XeSxII0A+rMR~%eah(=&y<~3_T zDrsbGjvT3i$u`t5;F}h7gQsfX17)SQCn80MvN}?GK#+4G z{p)k`PU99U(UyIc#qX8WM=(lH$s)Fb6ea@$Cu*j2cpjZmen+jaD#M}mJ?wxyIL~^N zz#{;&nTdX+C>_dpVPkTdXX4fQB-PdmF za&By|{Z#a#KtB?b&VivlyHGOben$La{jX&rEQ%qgq-IyhT+E2bhYlvOhlZ*ym4o75k2$!nsc966X1YE!}+H% zLlM?GnB8SMzV9 z<%1|1rkrDuRj9|g`9pXH9+(|yV z$#PoV%1RHPDr0G_fcMUxsHnZ_zJ5QCeii!&4DV`+=}R*uAbP~0TxxK}S5Wwdihh-M zlwm>wo25{&Tgw}hRShy(LvegXo(^mNd~Fv&(AUFW!|0XaLM~}eS?Si1d%I2M>;)Cw zm;5{1$qu`14AFsQv7Mk^*B5;9kkNca}5A@y%vI-qPh=mj` z>UKfnD?>zQCXOc7-XC@a%8hCf^hE*MB%htS~^goaNCQOIR-cnD!9OgEs!NMalY zg7MU88?>^D%!e-4}I`S}wt6zV2YS3?Fv0Y1|bhHWjs@qQ8RT#JJ8);#b-~)PZQHhO^N!K6JGN~*>Daby+v?c1lm7BP=bY~^ z>@n8bb5_+=s|dMV*?TLez<~I!t*aYcd4ZW^^V~40SyF_g-QDzFxm~mdEHm3kHmWas z{cqGmCq`fZ7PfYlTcFMAXCjd_UsD}ZW8Ln-3&Q}0)X|&kO|+(Tigr~zX+es$A;<_W zW#|+tw;PZ%$;x@te>bCbfOD0q-}{^OuXov#-tT729p4jCxNJe#Q%D~NIjDllZim_K z8_&^V!S=6+S)ZeKzo(t96F}!IDx0{=&bM>PFY^@Y&Sm*(`nunLAMrMqs~a%FBe?m_ zj%fr(*2lpKTNy}Duy=_MA|9bW&p20og1LG`qyiX@IvtmSir`QRY+p~LOPyJfWBf3 z(q!jI*?$50HS+Z6YLJp%EXSDc31ZLVa4QbqQQ(5npeT6&U}1FueI~;KH*mQ^{MPUw z$_6q*ekmpZ^ri9|*x4*Jc8KlPHPzFO*zahiM%mJ0D z8mzxku{o>Gj&cbmsa_dXykLNgcolB?}#FN0MrOqxk`4*`NQYXba zi2r{YVgAG*q0kP^i28Oozw? zVBq6%)pmRArLhc4w9sa4sEB182L~lqaX`!R!6IOg?prn>FAfcZH$#b&jmDPFkGe#^ zT}@ehlDaV??}}bS5O&V_a+)aUl!d|~#rRrXwmbj^uiT&;h6WH)A_){ux5{nTK^bTu zxpc8?wjD)BbrA^GG>0?-*^TYJf&X+5mrde7q{Svyt~7M)fhkVp9;%m93Wn(sn+>^! z9lFKN`*OJSs82Mfo~woIWiH z;@P^HgerlwFPX~5@)^mQ|8+Z8^Y-SHhJlT@(QSRLtBybq6VxZsxrSk53jq?ETz1q7 zp$_*;+@>b`Jf4QXU<#V>CkJbo^aS(Y5i|kjvGzq4c)Ug3dD|Pj@i-aA?AiU)vF*;K zl%&Y+hi2x3HtNFoA_u*p>-636+O{8;CH!}pX4|&U&S*+JEN#!bPSb(fVGjf%cyou| z7WPSl**P`yUbth5K9m75$@sf#a_JZcT^Hl3)(gLuAk??l7kspT_-t2vNGP(<@T{M85NlPIH0~6Be-a#bGMurO}W@(h~8^lkk=x83#h7iXwk9GnO zuV$@Sk(6v|O!j+UP4SzI__hk6VX^2QuPrkz-h1n*tV*0ZT0$Lhl73WKFT}FH%_(hE z2sfiWp^6s}#z0PLWKDq;5q>Bpp6yzLu_S~)ANvmi2r4SO@t(Fl_RixC-2I!|V>l6) zJ4!q-cZjrrZ<<~uAOi|Uio_x+&nh5NPX0~~!`>)hw7-O(f%)Muc_e?e>yisA1`rs0j=8rLk!Z;r^3}E#uHD5}|K>UWK$^ zV-4X%K|!%zR5bcBLJS<5GUr9ukjNAG0v#D18GXIXC>XamBKqbfP#Jbn?tdAzVDQtO zvyk4e)>gjn!wtWGop!$WCm#p|y1+o$&|0HM(rKd$laho!=lfCmuX``Qp3`@@NfQYjjswS9uAp-yGwQ~P`!MT=(q<8p46adk*x3G#K+->Vy zw%JheE$w)4A6jV~eHd#uAy?UVR>YtJNalGdiEx*pX~Hh=>q zFCyeEd>;wh5Brjj1lD^+mUV5PJ}x?CMUR_Jbe~_0I~0pcfs#M{ZyQzh;Rd1qFYe>-`!gJ7X%oCHSYUz zyw>j`XI0O2`^PIbn7u-*)6sUBDAn6iz#{QnT^NAp{Oj^0x$XNG9`XBR_SXyH_usHv z5Z-dH3AXnTX*VvTaO(;8o+MCUq5OSdvsIruR>n74K4@o)5Kga7wqT=B&_}WN6y;Hc zy|t$0@lH+b>o@jaraZ*w=fG2CauF`*!z#Z*++g9kWr$B%oV9_GvgkM%Yl@m_&+HS! zzz*FXZOWun4(EhUx@ht&3Ndj^gQ?l^!79#;Xba@S#X`)uGUPV|)hYp5-62}JTNTRU zDTlcQOSsHZ30c}iiJ|f6teQi=#DdlFD03ZRFz}DUbkKP_k^*op%>Tv_`2*)^pGAW) zgoAP+6FnO0c|#up)31!OW*@Rw$nM|ni7f)rI}U31=!8_*?=dKIZ}x@VA*DmrV1F8r zL}-;&Ns-QMvX+=3_SyYA&R0w07akE1j$T+|C%k5MuKUu4RP))3%m-6CT>1?%Oa`4O zkthGGKiz1I;f|}V78oCxV*!LFqc@J{z>#=NySJYo{m3LUv{GV#AL^GyRH>N5h-)^7 zN4}qQM@)pgL$K;&F3ny|*{3H<+zLumy(9XcMN}u$9$4$+gb1tkJ#MGxvZ;qC&)~_A ziV`=OloO{AZ~HdNx%Cw1_b~l$^xwmQov+ty*!GJ==f28I8=XQn5d*vf6usGyL*e7S z7GeLaqXUv)g2VEgFkjS3)=>si6Xh;tnZ(6RfsZu$KZPQJWnM1hsPidwvz6^+1vn5_3>`vk#&6zZqto3u<`Gz1z-3TDRB z&b?|ka2k!;6cls&R&gXt!b*Il^K^US&uTr-$*jBx)j;flkI#n$tSFDU{CW)ZDCCP@l_QC^L1` z?i>C?V`TIY{x9XG&v`^@LI8mD88+zyB8^6vj;706gpY-%|g&w3Z z`pwsNrC<&VzIJH*a=v5ym3~K~_csIPPX77o`98MzR2>gwUJ(oHex8xp{pMMS4@|FJ z4%vooO0inbqiM%Xp3Ms)MRlOvV(v8&1hr@v`zBH3Z?W_}ys2L-Q$?2Rl4yZ63+{CU zZ9~JPKk^#QSh?EBRRYb*DRbfi&QYN_(|lY7*y#QZbvYad7|qz$Y+ec#R8RiUN8D~g zLlV8Hpjv>c1f`~S;KNcyXhB3HY=+oUi#jk7MiHRFQAf9gp41$fy1HyZLX}BYZQ(r+ zG;#zc-)D)n_N!h967Aw?V2SJ+P}bX>&bWuv67pOcVN-C{W7N-rU%7 zJyM#fFhDBdCyjYO9N~E&UaVW9OXOSv- zT^u{)`+xJ4*%*0~15u5um*&0hgBQPi=5c@hYp|~Eb@Bx^U+-vNq`nk$SL2Kl6)=Ap zU|-$7>;L7qI4$@y^z?L`?0i+e%njy3m78BMSHovx#mouMBZ!9d68r9CKV;y|}CHherxEFMfV0*WuK5ngUEx2QQTo0R1m zQ{h}ht6vcxDRy+N!mrOEw;Nw!6=)q|x|VC}dK;O^eskL~*ggB|zbV>X$K03>SzI0?&&M=I!zDP0Wc$-%@-9N5i=kq>ULeUdyH&6pK8~ z!PV@jd*hanIh~LbH8by?*k&&XD<~v=a~9Ig#^SIx%H0=uoTX;(Q!(K@K$&bt|G`*U z1h8|f^*3XF-&^dom5V?2u&izOmvF163r*2`<09!1T3g-MPs*}CWz*L0v{k_MDEIU2 z_fGF|teftW)sk(_J(?zAua)NqS0J=D{9y05&@2akXWO2IRu>#9>BWN$;k0(1Qh(o7 z;A3Dk)^5oy%V~|v0oFd={&q{cmn=z+GaVr}#zoOCicE1ZkpdKBMbd^!A_&?@@wpjg zcA`54-e5p_lY43PbW6aVrnjtiY^KiW>}P%}tba1*fk%{x%D!b|8l5Ov@`EHENIKF}M{a ziB3y^5Vrhpx_ZXBO9l!0$^3Iczi=7!@m>c$oWWmDD&gT@zm`=jqbu-oZIa>tK4 z%GKinJZNFrIER9`bOM5W-8NXmsq52}(euEX@pXUoS@*6ZYL@o}?>=trUrt3=#JeX) z$Lr%xN=z7)JydM}Cf9adefyXzeH*W9bNj_~ccN zS!ndYH@sK7yF-hF5<~cFw2OTZQoVmdeWuInBLYkJ4v)lAiozpr4V{Xa8utbwNYQnl zX4yKR$x+mKPaH^g+{qz!qkv(8#*;x&19$-|I(VW?rUI1$WM5|sy6G5^1`?DSn&jq% zE%zn+Y^1^1D$<@?j}s5#^!tsqwN^im^|X+3Uc3{n#+ld%@7#8q4W)x3Q}V1OgYI3K zCP0-xL)&)gmzuHh2yhk5VV`z05st`t#+((K#Xd)a2lTQ@fw*xB8CO4DYxr3EwVZ1w z!ygg8n+`jP2t2%VQlWZN!T&K7Spu+glT2?tR91*6UI=_iNtoqth?$x_(4UA(ub4k2<^C7yKn&K({v5`Vd&Z927Af zYEk*YoynT{R(qeKq%TX4>Yw~m2K%*ox4F&@f?^jdEB8t zZwLloFGYXOX2PrYWg4UQv)tpr(lH1!= zKl0iP68=t!rs-arO8bp$qZ4SJRIa8&=JbANNfG0&dD$Rr_Pny z0>6{;q}lm?PmxFmuHoN&Tp7Ko~!hN z?f>NM+LE^k?Ho3SW3UD?uhVv={r;MqVF&O%K5HVKpHUO+73+l6uxR3SvNVqb-NC{9 z)Ckk;&ogl#n&n#f#WtF_WTOi!ge6$XL6#pC(iCfu@w?*E;|i;(SaJzT>#9d+Nw;oK z$ZIEx-bbH>aTyC+6iVP}R*FU)ajP(f5ZwR9L4pkjlsPv= zu%hvbG7bvh4CC{wsm7ix7*xmUD;dQ4)H9PO3ymddW61G=k$^D6cyK6LU8a~tW{4#c z=LS?RK9ccgb*3vC#iG}la>qCA>tQav5&n7wTwDzaUZo*#u0 z(^LpYo`Si9&pBX)8XdAgfFf+9ABo@f`B*XSj99q}4-QPR#VK{)emY?%qxdUcZEkT5 z-4lwbB+N@+Phe9HaI7^aNEAlnafiAw7|4n{sL@wy=C;84ZjccBqg%P3vB3sJiq_Gu z@EX;{Boz}=jPl8eP;)!NB4?O1i5XuMZ(PRp6V7+=H|qL{0{_1*fS;`QZV{c*+}`#F z;oCJk;;*M;OnUn1otHV|%Z&tv>msh4J(4rmn00i&dh zU0R`P(_HW$LyraEO9BjPJzGqXHej4^xGgJ{<|}*wso~g`+146(i70+dcE?XfCqhOt!T-3#Cn?0gWYcG!%HTpnd)2@c`@GNJ6swNkv;Di=dOBV^h9VrzLK+@NE3i-eWr9S_%V0 zJJfICt$F9&!7gDpQuSYCkV42VIhM7;l-O;+R{Vye9Ds@wk3-(`WPMvwr-DqCDR!Nt&MdA@!H+fRF0foyV3R>UW|)qZn)y`Uz@W9S z?p212@=z(h0LgWHk5*D&|F&cjqp*?E5`R|x1}OJhu1g&AF7E6JK^*HVEyL1t$dRl$ z*5KbaLozV6kD{E2L}GDNp)`>p&VWk@%&bTsr~-j;5F42QNo0CSr=e~hdsolY%sNb2 z9ov)e=#%Ri*s>)m;?tP%FNAO6xf%}N3U5aTmsDV-wlgtg(EaG~%Eh6o*hP<@;rnj? zVW7hHo)yHS&JP5H)COUAp_7~=@slHmkU?>HgL@F?3?h90BTd9%=UNxizNX#mJYMIU zcfP7Q`EL7ACnqbTU`y=|a%v%o-S4y$EsG`+!4IfLppmP9(s*N z)1khg3HS(N*id8vTv_7MjyN{+CIjisj|gWkb2mFA{WB8k{G=#ciFSYERNfa{cHfFW%Cej!XG*g7DN(gMg{pEn&bD2?5LmH7 z{mA$Kv{-PV!_Ilk)AGM9vHHDLckX~fgp?{c@^ddY%$snE%`jII8|>ymSZ zdPeAWqu=&D;wA9B*Sg(wGT-}p!OP&cJbYF-ntghP#C}^A+LWx<`fp-T8yeKGK_`&n zU`P`^d7Ce`Nk+G)BNFv~Sb?Von*iHs6k}^02bLd?Z_MuTo_D!myimXlYC7s%XpEka zg#kWnt@w*;)pLF`Q7MdT>mW`W{%>|h9bj#YbDrWt5-^V#DaDGRTUCq;NzMa%bSoOd z6y;e0X@o6a<{>fqNPK|g!_9dLA{;+#03<8qjx+q;CqpZP)=o_uz0nXyKD8p6fS*@}g?68Bjj`ldN1v9J@gD6(OrF zv$uSlV)O3|4Xi_z0YoJ*jHY5arsVb_W58KCh(VcZ=7{0fCRuOPg&t_!@8*5&WmvQ& z;ze6%B^B|NPnKnc89Wisv?~V4V-@~~6e_HMJaRZ2`F&;(;&HWo&-#5-yZ!xWTv5xW z8zfyST%3wZdKPd3>T&@KR2^IBtg7LEn96tSerUM)zRh1=HfQL4OjGnjEiiPMWuh#Y zoqJhRyC{QmkVGRFjGa=@aU?8`I4Go=nFf8@Q(jhuVV34AQSh&@`KKZD0dxS3jm(_aom(bhj`Gpe52Z z>B10wru&PHC>p4Wm_wM+;*qFF$_f%^9vyas!t>olw##W6$B&X|=C>Sgr0j+?^QJZ! z;#v~=?Mb%#FxD}&7C=lPuzV13P_~CaNF{Qs`vrhBT+WgRYQIv4nTidtDCbU;e(#-S@sq+HLvSd+Y=R$-=^3t1fh8CYcLpE&8^6U1m=S zz&r4K=|w#t^4|{?*Lsh8Z9B~WWMXnEw;k7EbNmS8ai8)_g`@G=DFSH!I&~OcHWoA1 z7MQV*Lpd}>{Fzns*ftunKpF&*(A%6i;I^I$9JaF{dM1_<=v00;n5SXPS-2Wr$Czc} z;0JrH#BtFvbDoPxV};HZPuU4SH{l;6lcqLDwT#Lbk^tY6up*%(8|4-YWNXnp4$4ba zv&^<{u7wJ1(X0;0uA3g=L(=o0?MxGzik!?|Qi z5DW7lTJvuS!2mt${7sx>2tNL+o2#FvQIKMnT08_2sn3>+x(>&uzV!(fuyu@$&?0eVv=%&FAM99xh*+OTWTpSM+ikWEj}iM zxIskJA_vQD-=htPvnFjqdcu@Ekq!2`0_tUjU{#Gk=p4}HLoMLCAevx;Oj>eQiXgRv z006aYn{#Agpj7cu*aBaGziP5FkbENM^$3uNzE(4yt>BE3B^!ePV`LPD?cwPsmiW*; z8#dpDsl21h-!n@n_d}ml{A?c#8&liZRo{B--7Vcsaw!bC%mGwwd)9I8^9ZXfl);M5 zG*?TTgpsMGo*-4Yj6nGXb&0S(Yaps~3@{W3Q>Vf${fcVp0>R8RzU37mX8a>dKlG*& z=nx~)968ho)7weWZVE;hs#Sp;qcUlZ2u>{~Td)Kj$Di^hgPZ>|VNk>Fs-EHZzOQmJ z*4lV~7TS59&X+EbXQR~`YgE+GjgH%1ucauIp+VNW?F4k*yscB#^z6q8I8DCPw14s6 zc;mz4d0wI#xtbVx?IlNN=Dmmo3J#u)BOe)yC2&3db$}=$b%r)#qq%iF#dGr{Sy{!VPGl6*OW&yo;AkAsP8uR zhYNP%c2R8@qorZx)8U}fz@Xap5N?UQ5shFHrzUhw#9D5F)C`Ddx_M&(I&@yN${nM6^U%ic1GON^NEu!WO#Y(joxVyj&Cu|?6}bNN z1VcoP)g}@W%T7}e!q*~>1{t&kf2A#o-_&fo!EP0-V+VD+BU4sF)5OBEBWR#`;L-{- zAQoV(+a}38YlrYWti9I0d*COzvkhKpXLws%x_iy22;Au2aQKT2ch^R~S3G6P@oK+k|pi z8iltk_5wc8Fx}VxO1JD)F!DePMmygqUw-JQB*K5E7pG6Y-w$6=Jx?Tpp9+yD%Cu^| zDWrOPbL;pipJXt*;}k-I-Cw}^iJnK+46o;$*T)I3{|ikd8Muh3EqG}3{#L|ya~FeX zn|F`K(?q(`90ef&(P%#ZU~)%v>ww?mTP^3`wJb6Wnx>yt}-O z_KPhQNxR25%GhUB3cozoBO&TJ45x`@sZNSwpI~NTQVy+_UQCK;t-LFz5LiZ;&Bya* z(w5;1=64)n-)EWTsJzsikj=@X12V^G1IUt>J!2B0A{dPIA+byH>5Zd~#ET2)g399j z+e?nX;m)HFDp-!IGJ-cOmSCS!=EOBD@eCOo-oB3zUakbQ`+xx?8V5)E91S$brEBFO z{NZYRA@ZVr|4e0^*u|Qn%|U%Nu||aFF4zLoo25HO@gQ6!0^jM>KfEHl*{}ZROz(0js>c8J=w;cODoHV+h692qx@p8_R zu9*XU<^6g}IAb|eRaDqJSP5iB*zLf*?syli-Eq3u@xH6%{M;7wi_?1*6ZF)j7$uHR z%kC96HygcDe7gLIUR^jU$&lPN_Qlh=49In0m-01o8tOf59pLOe{DWB}Z$mCBUxx(A z5T8Rr5lw6uILm2_v^kSCmMkIUU#LpT3dyr536shRO|3AzRH>;6kI6j6^?E0GfTz7G_{I4>ai zyGvdZh3q^6k9*!2-RlwXKdUsB-X9Yj$md#CP*XqqEA8JQeVo9%(|f^sd!Z{Q zubDSM!oq@W!q`TnDF~a!{FW@h^TUngK5%ihwq+Q4G zinI!87Pjjgr3{D0%i4|ekKm=t~dmQh&WCWS2~4iW+;!FO!C(Tl&tXXkAkNjPHyWa^~rXu6f>!tgMpj*KOo z1DsV>d6o4Sqxs6!%QK}^8`z?`u-bA2U8v+ItKq0r{GStz)15>-Lgc3JbA)pp3hR5! zQnCr}!!0`H_T)0WP0dW|LC_4lh}ZO0oW;@45@wZ|ZO+U+D( zL}AUt5EntzhVQ1Mq-mBSSxhCq1Zk`qt7(T~Da-LK?87Ah6FwuQPwTFR>g~OAyN<#bA6&qeuleJ$5a&Xf$n7sqz%n!P=UuC3D15q3e2RKnn{sVe~=B zz(=Yo{#ioN79?pg*=I4LaQ#7g%PL`HHo)#R2?zNltOxH0KC~{D3{5$T6um}M>Za;qh>53j;A=5 z>xAi}j}^|`q*(F$_ePi0DX*~g_J75j3R57<@Ow}_k54)bTyF1QH|<8V)i1NNA4!UC zOy|Oi(HD1RmA_`@zwe{L(>L=Ks((3MUH!ZLv9@>q*!4WXK@F?;E}+Gp zompy`UUmh@aZM@A!e$DEE4aK>{;gEnj=>TzFpl9r_D*S={B_G_@WZ|?HBEYesW+V4 zsxmT|MS0Vhunp{-cxEPi#Z^>-Z^0VNEQn9lFI(w4;y6T0fDUUyvtg~$%yQ;S6vB!p zjL(k1{UgmEFMYd*BAjNgh^uD8AjM&bgD$TaE1jNVI+0~AB+{e>vKT=wRNqM&H?b%^ z94%R)CY2DBHk9`x}rrwU3=B)=k+Z zE|QCDx4V|ian{T+=lLtVp9saZ&__6;i6Zo_*+`RQ6EjgcqdeLJO!gFxN%$%-l8Ew# zgBjtT9a@bGOvX{`QaG{HIAtNuW%qYy)9b)3oe8{ror1_OSNU80!?Pvx-q z=lkE-3twA5^T8Z_ohs~H%3QV231ln(_tHl1`-zvEIWER{vVb(0xkid$`<1_N1}>eoFi68>MrjZFsSu_HU~wk|#F^GVgI}MHed9 zyOX!4t?=j+m6q=~?7^0TgvOxm8qc?sdy$5=DOF7F=sP?_#G|xlJeSdDu)-*iX=i#O ze0wS(x17Gm`q+{EhV;wIYta?x?Ak7qD4W31iA;B-Mzgz9VFZ=#(Z!*IKbOiJ3T(6Y zSBQ9}g;t@Y$*EB>;J`mhf)nKV_?=i}@GKKPe#HVxScF*mQ=zDR!epB%aJ5X zG(B8bWzdAiA(n+H5%*C|Y+8!pu3Fu6T-0#`m73;ndcwi7O*#S!HU>#18kUw!EZ1tN zEaaBf>=rh9*#zhI%Sd5ZoP~qT*fdH%Lz{XPS<9l@n$0;WPNI|*xDsHMsxaB)bq|R} zrrR2jBzm6NB<#u^NTC%U+~|VTk7C382ePMy0kOic0}M$gp#Fa|i#! zX&8O4R(|O(}Auw|6YF4VBdjmJkO-icM2N$)Z+P{x^!1q(Y&pfN?M z*`|Lp836E{sz@IlP{sn_E%9adjZ)sTaAkHYu!Ft1O}6B$DD<6Q9BR{FI+D?j@pf z=a%r_?dZ+u=@?@uI_7;*+5%O7xx; zB>K<*Uu^{PbXE4$dO`+mj`jq6C@PCUDXPPf(H6;~)q0GRi7@^&e08!V+{XR;?oaTF zdn8o$00H|T=&ONI-a{4b!?M({uq|Fu4m@KdG1Nr?%Uvb8y>wz`j1#KjBTE8m$jlBa zj8LIal|P9Js-B(pasyACQ{up^@gS<&dBgM?^oGXn$}u+%4!1c$?w*ULpFt!_N0aeR zEbLh#Mb9)Q*r^*E#0IpZdlJAKI0+(%fJ~!@3kx7HJuO2?=UzP_q8?Kp7#ou&g0uhC zv-N!c?67O(_&b9OyB$#4gcm`W++ z(5u`cp&8>?ACdB6XB_p;Bd0G)m|7IK8gW~Grs6eOG^^3d0T5BNP##1is=_OzR5T&4 zsc)zGtaAHz)ZHJn7jh zg6KRQ0B`wsVIJO(W>##Rk7>*8aObZdrRU|ZhWAO>i}%|_>-Qf;{V^O_Uh9v2($K;q zOoycs>}9ZYvBd5sWLZi;M;&P}&ARe93Gs zYcFxWA#;x;)CYq)g9f0JK*3e>lnUmLvSwwEWE^pbY+#o;&QhCl9Ebaz6ru>22PhX| zZc5XUF>hTX+3GEN(pRJ!5FEPDD^R@{4)=)kQKB+x3f<#@!qWD? zBjL?>!jSXq3!uE1r=h?iiTusbtW>(W_cu&2jepniuPhyBQZh3CV<@`&WzhGaZbXVA zqcSNb_l}9sVKlMAvMFO2%wooN#ff((i`rhb}av6^}iy)SZm;S>yFP^-#y7HwzpTwo!dT9#RhEt zMf%ZdcTcE_n`wuJQ9k~uxPg%C8PK;^23!sVe@1;8 z?bX7rdqBvXPd&J`Dr)90ao`5l`}C_wV&;##rv&JvkWLEETk6oT&o#N0WIv{%HUkmSIC>hx(E+QqYM3u^_UM0ZfFolk&D8Uu~o>J6D5Z_>9mPExGDW)dlo^(U7Ti9FCMfV)Mvnegx+D=TVXzp_^?*=Yxf_QkWn4wXmw&#G+SUJd(0hJ_lq;zu9N7ZBr3Xz0V3`Hrm?2kJVsVvNLoA6YSd*R!R)5Q;u zq0Wvf|65X9DxF0t!`-o3-10UzWJEPiv%>whg^ruWVy`ZGVkeP)rc#J?i>D!(#Tt(_ zpDwd9l{#;lP2~6Cs(V2QJFU{vMn5%-HkF7X{*lbiP+vs4Yd=AgV0Ihq>D{k8$bGaz$I6zO-KP8sNJk?{Zhm6F1p1$)6JYHyQ zJ@my1JelwOTh09h;;_`S!d+g~dYum{H-)-oo)X>D%`0|uO(xHF+RE|i<$o_L5QTZ( z<*P>Rcw8G*iDmitsCKTS9Zj*xLY_UXhasmcJ@%jvJ%F!@$k9qC-D$`AdxytrD$GZh z4uRILGVlg2N%g3RjohHjRy5?WMdOBqTf9(_Z#fWf1)Q^4DVx}}Lh=}X1SyD@S4RB+ z?Lf`SrJEcSFcO#AF2uAnq8l!($KYQUf-$^}B4&H3K79bQ;GH%nA%iv0$e@=lnV3q| zvJ{hidf+b^kwU}QhV5<|Vao+~x8mK#er)dUy-+Uk&D5M1f?ePIgg%8BgY@(KH13@C?4#ZrGld0-NhR)9M607k2Q?bIKkGFA3WM~5|?ql833u^CWx#PXh_{T@WfnOQUH!;*Y+j~ng3+g&fBUubTdhDTJ zE~J^9>nK;c=3M^uV4O&QbnjuI(gvpqV-3w^Sk!^81NC!!Ee*~}dm~gtMTXR7LgkR7KP(KAw;NPz~@BVFfu%fghF6GK(z{*}KU2|sOI4+g|~3?bNp z7t{V%!a;S4A-etmde3$+T0cU!;aM-AY!zk2+UH?qpOhL$=smmhLJ38+N(#-1RL5&P z`_c-8apVYnnuM}9KsaYh_KD(cmpwh@yErQuRI-_#dz|{CEU{=$BjK(-rKpaqr2%=e zg8vqadS|R^hf~C6gyX}Xynv?x;#xDiF zx%m`+Rr1F?KIG@Zi|e-cK|8PM;uF8U${%cRSoY-j_zvvs;_8MOz^^w@>$d9pO1f>E zRo}>+DueBqW}Am^z|@WMAj#o>sn(ZmggQ;a|&FJBr24Ww~GV=gz%N>jc` zMg){~9I@8ukV>Sk%*CP`8nVafC(;DlhtW<{B^g%h=t6y*n) z-3EJS>d3c%1=f*jU-D;C*V*Gl!3vVFwk`o}%gL{LwNXhx+RO%4+gN3tXQ&!&EWqw> z=-0|Bahd?{u!LmD4zxRqg{>sClP4?1_WK(d;aXe);Sj^99kJu3z@R;orM$%!g@_58 z#MLCJ8}7Kfa&>D}{8 zoy)4~2ae0;82HFFc*S2Ss}Q#m3+KCM4dOy={QNcBfgpNe*M5hvi9RY}M&y)TH40tu z2D?B=CxOdjG-+~oT$<6c5eI#>$%}>)qYjYPlJaORSKg2OD1U;GZtyA-@#byp{Fli2 zwb9s`8Y+{MYkH^$m}m%5L-No&-=Z^`E2J|4kLuDTw~Yacxtk=MLpJ`RLv8?Z8LmQl zo<^K7GeAO@d5NYZLWZ9jH;i>aFx&X?Xdg$qyN?mjfdm*veT2V;U^Ug9B56sc63Mp? zAD&TCV4|6j6npsAB#K3v6r6F@+0eMO0F*54!ytD_NdGfZ$#JEIC7~|4-k1}6q2M%A zYkj54Fh)sBeQFZ1@mTS$A}Cn#keJVkzm3vhtz|B-pOvRm*|XzE|1?+taYlXoSk-kqF;=Yl{=VrxNC?a2bGOLY%jIwskoGJ& zSdKe#ceisd2^q|-aapZt4P{d^gkJ+`RAyYEe_>uQn^2cpxrYye4hoYaVNblf3K1`V);fC zbfO<$k&}~4<3g4h&9nDBx3T?cB`Q=%(i#heJ5;+39Mx6;-i-x@e=3>s|HQ`7e7Bv% zaZzgFNgo}0Nx_q-&;Wcz_1)PrNtB8uknM7{%az*i2KG>oU_HhE2tj(3dmgc=A2J`N zgaT6y<+B@%Xu*Vq56N4VL@qJVSL)r$xCVfxqc==l?S4cb2jQNwD=D&nHVjHmX9R_*`)kA=(`##LbdAC zeY>?=X(4YBr$w^fn#zPi``=R;asNG)vG&uNLh3nAndALV>*w?G=a=8!Lr$yn1AScM z6)`@|+q3$t8I>jX!U6y0!te5&@ZYty?boq!KBvF`9ogM{KJ>nx^}Zc~%gV~WVtZ=w z*giXI>6wDlf(qioLDAP%1qPhnWAhok21uh+FwXFn2<6I?o+d@?VRD%T8wNpMYz^#u zI`6n%{(k_OKxV%aJ@;WIkF!0-Wl)ZaTT%ZYwld86U>JqY({U-8q0_J9Ksn$#S6s1# z7OKc&VtP_qxbEXfq6($*(xqanlYygp^3hGgXQU|Ewqz7S3J=F%$kaPIIzUZLAuInd z8HGuclwyRCti|nT1??7MBvd^`*$^3pnc7koUOBa7W!i#-a7z^rj1?hM5o(g4rUrQs zs#e9JnoLqdYfBzGX#C2kvn;CyG^4*|amL7|$_(Kh@CN@-)uu@?xNatPRod_n2xbjVJ&6yw$JF7$0L{K;Utc^B`RWlo74*!X7WzqrAR(teR zw?MbRVHWuOU);ER*Yroe)LSM>+5VYcxZWTWo4ar#Da%nuxXb8%}y=M z%^sRx)xBmshBnbzJJmAH_z)uv({pPZ3+tQ27dK`X=0!yi#M@7F;$DFYJ}(v*m1Of- z0Sf~~9D!IxmyjTOFv3BdXyk>bUj%k$T@ly~;M@l{hlh!5T7xGOC)b zlr&jYW?VZYMZzXK_R=!pfE0uX6Dx$791_&Ec)(@En%enGi5EM!rzyuI#*`E#k#j*4 z+b*X%`R$T~!zfs6jzN}*i(L{_GHZP(qAm?~jLDd)R%6JpNfMCn!XS}wR&-H|rAy>M z*(7Ii60|aGEsRv}6}0fbf|0f?Eb0#V47^0o5aytc(Om^|AsM1__f0}b2Zol90?I-$ zN=`;>NEHUdH8#2W%Ce&62rYHZNa-XKWOV?v#UMS=Ezm76vH(sFH}E&#+jIB*%fIy- zmmgYQedd`1i}lL)5z(_7X@2+F6?(X|UAq=;z5T&UUjC9_dCQA`eB+b9^42FVy6DAB zcJYH7u*0Mm13yd@9$HyHc*sdG3iRDfgJlNFrO+-_i4%_(w=bTZWopc6GUmwU*~58e z_pSxT+IZ9swT#4qb4k-aFm?$9*@qm+P4Vcx@tcV&= znFu-%Dk6o7vM7EvBAQ%5ahlFBEiNSoA(c~FJxXe{hNz^~k*uK@sdd>SxO<;dkS-(V;Ln7P=lL1OID6ZCjUVPWO7E6dwH^Rx)ri9L!QDe-c^sm2SjQ}&N<(b zcMw(@Q>uaGpb-Mss53-cWd;Rm{P~R%pn*k3wUGrz78tew{%(GL@jw3QOZT5X_?bse zKl8$Ctj_TJav0_Vt+VLDEmXYCGd^zESALLU=sM$3pZM;Ne(!faf9Bld|KyLp^}qh( z-*F)+J1W*T*2#L7*VdO-`K&Py#17~LfOV#GGWTOF;e#f8tnxqGa+3g&@vO2UHAe5WJoGO#l!c`zHJamaB&hKK_P~*USJJN1JVN#QyilJPX!{~5!wMN zE`H_1(D=XzcOoOSwCHYtol_8>PybW2nDT(e1^ z2W=7mb#US~q9I})vswznwcWOwvsi!w-}d4MeYm7y{u z1jv5G*LZeGER{NVBwO)n;AB(@kEAtVde*^Vs}L&7hRtnp0-1a%ddlee=+UdP?HElp z4!vFuCN9)%OOjsgRz}Q#wvp_%(t3(vfYT$C)ii?6@%8^8W(5*=rNHn+SNEVqMk7ud3Qfe}8Owjo$&qmPlF z7(lR1@dvTtn_HQf-q^!#Au_#jW{+x4$fl8bjLk!P_i_-ZP^cZ)zYpJUD#09$s~!nO zgaw_xkr>#-hBBX_qeUwd9)^rVlgv1=K1b9Sig^aUDhG0tY^*IH0hclOrw16G$>)>q z!iBu7{fwX&m%_OcF`$@M^TP1!;h*M>ay528F4N zEoll9GdKhR{vm6x5uIukU>SDiqQj6G`2{JPS?Oyuz@v0ueY>kT)=C5GM>;wVXQ!^I z10Mx&c8FfY4E09dGpJPdQB+mEtk7q7dN@5fS=!Rm6(VgkEv+(arnKz?zRsGfu)?^M zrje6ha$P&W8KQ9DI+v@gys@!6i4hVN6jY{F0E+BL>7PLAUP)&C5jUz7h!{ZUY?;TD zsKIa43ZUx|#-1{TNz*pKb4_Y=%c(n3Jp`Hr~p#r54JQEfRg^kFLWVXyfdooiIhs9>K+~ZXJ)OQ%oqcn-LcL=f8r6(EO*HKfi0Oqg3$1+wOx^CLL)0jA*|f|-~Zyt6US!0`1$*I>xDo1^=iY8^8+_ldA1ypq&)5iE`$t=H8LQ@ zx4-+N-~P=Rm zoUweI_heKYb_HqA3K@wrKNc$F0lapWWQaVeb&?ygOu4+`)}o1tnVA_v7JxIgbY_G$ zk!9)1>;@Km61D40HUmZt;!pv5q77$ccuw6|hT817Yvr<}$`@8@Ey{uEX3Rn^2{L|u^=i;G`WPE5d3I{1Sl}s%og)@Gb zn=74%hRQf9`=_GdN)M{gXz>nOKlN62n=*4#dPLd`*W?j@hw)BM|$=kF9 zGFk|p!SvT6n$=2-9I=2Q!H^f(N)a@Q2Gw3mqiu|@yunCHvg9+8wJ_2aacL?^ay6ExTeRB;3|oxjwXr! zbYP|Q7`9WoJS+lbxyrO7P*lucrPj8~gV9L)Z7ZYcqnWHHnTb|~rO1Ae!ZVmhKU8)K zHWx7CTfDKO3Obtha6$Oo2d^ZFqqp}^V`& z6s9Wysmnw0VlKxD#LEeYA^3&|jm`}Alto4fP_xeHYh;0u1+V~aiy-vc8|S|E?eo9> z<$Kt2d*-c6zDhHpYnvnbXxmG_tOd4aXC}Y*%&Wik*B`z6cHMyN=fO%gfYvQ2>tq*+yaZjNYj}oUX{wF z!3BblTa!RftaJOk(?8}p<`xQ1;i%-P`jQP}4Q+@U=*b3DpbFBcgK~hvY!-P&jfq5e zjYaqBu{+c%?=j95g9J%M3BLJ?xS0n^2BLN(KXhRPbby_flqyQ)RD!C3DcV~`%|L!f z5_${3W9^p85O~Ju3gY#Rkkyp7csYhj%}xPU^!W}-Bh6Q)sWJ#jO3JRthxz z#J=iCQ8jn)RQgvV5nPgt+S6$onmO2`&?G6+NrIv|Ib~)lZQ)F8O420Zox_x%aJ)ig zW6B%|He@_J28*d7fT6~oA$}4lQmz0h&J!shSB-Z>$}~@;qE8-PDvFbYDJ+}**2^l& zVF9n5IHidCbPfZ_wLrT{Q)9FVy6iGKjw~>;02aVg;39Bg|Mowlr#*v=TYid$yNWqEn!si$B4?Z5HJAO6!PpMUm^hkQQ<`Hwqr zz%V>|NbKn-#Hky*s+32r=#pq@TmdCn1>q$7Y;^1V&UQ8kNbg9``yyC`A_Yl;Wd=YR zk)(%J3_nZ)(X)4Ea?#z>++fdB7G2*kXEFgX%p^t2xi?Tce?yKy?y^Zp+mIkzk!0@g zWdXvSr3*$~H`$!<*M8+0$$lUxSu!W@-jB3FB<7jeNh5KKSs9;79Zdm1q=7ZG1?B^o zxF!N%b@Z!BxBwFXfQ{0QKrogy&>J{aEtSZHi2##rmC%wCg zXH;Ypvnz5BxrE`OM@NEx$?Rw$R1GE7B4RVcVuND%4+)_geZJ~L4@#xgAL&aHPy$%T zLxSUrcWy9Y}wi#7N7Wime0JlR_{11Qf%vWF4jq1H=Fl8Zf;J~e+JneS9p{Vx-d0+? zv9H&${CZG~i;np-oJj{>mXT(D!%N9~l7XoZ5YRoFlbM~+Oy)Pd`khIj@%fo0k|DAm z*2cKIo@|JTJu1_A&`>g=%!MEy=sX{YMK9)%5^D%qgg_>K5*xQz{32*^_Ya$)vjM~y zh91aojN~5$ahW~Jr{boQCOka45+#*YHco6ZB=a{?E;F(!444KKLyu*@$`R7i4#u;3 zI8EqP4`?m-gh#Au)J-8mCs&jJ`0$H0HLsurES7_<-TFC~3RLQ4$ZN7DNuo=G7qN&M zwUw9I4dw6p5x^NUs3oj(gl%C2(W+ybCx-|iS^nox<243Z_Rth@j0ed|^{`}83RNls zoS#mzt|R11x~6^yqfEI9L7|?hJ~Hp5tH_`_@RyFmWyOeW^2}v`f=uji5kwVkw=zSf zAe{4}xoUDdo)5{&Bq!2xJDC@f?11t1!%Q~8iI3vTR>4e%pj5_Sv`Q(?H5O|``fh0O z4Nix^_b34xSY}ikS>U5=0o)4V;PRzw|LJQ#{=%cj@4frzlh3?LjQmAqKXG$$vE}k` zy1W*9ee?P}j~HCVx$;`|&bNQi=dHxjk?O9Ibc-#bKluI|4}a!?AHRO(`RC3(_LY5( zc1~D$fH=l;^IgUM`1IE7>SgoVBH@tk-gr~T>Iq8L2plIp61kXe$T*o7VPwx14MB6L$p zn%7&7QL{jSIG8h-B!z^O88y7xLA^K;b)9a=+>7%Qm_Tf$DLLEbp2jIs6{$`@nQB*_ z4q2iqSXj%4NRK3@IH*s&E*$|8N691xC#8{&h>U0q$Ew+h9F>HUpXr~4y2k7kbcla; z36@H9fgssKS;{340fgZyO4a4`mlA{OlW$F=Uiu3 zHLDqLp5T6HHgzz$z?ztmbDi7#*C(e)dL+k#7*cBvV7g zOy8%F@Tp3CQh@Tso?_)-hLZ7`W-!`OAnhgDtdA;W9*AU5`dDAX9PB-z)3ahV7ltuA z64jKCF}yQlSCP0XR0NIHXy%)PybSlPq$%G7b-|PcqEc`JvXee)+@aV~1Uf)t1qnel z33$lO%lcUW06+jqL_t&{?c^*CJkS99MCzR1^amQ#m6?@a?o#8@Q15K+R&TXHl*X|U z?MxUIgsChwQYad-|j}>QP=fG>{%F zG6r}w0~9li4kHVEv@L+wAu2rnogbXPH1-ev;9;D`#mm>25x~oQkcQEt=?`_O_%$a5 z#`di63XX*(->J3c)CNm9#*3}7`2}wO9$#IXBnL7cTblR(fMizEunk{!9l!PFh0`Cu z_pWH!^&_0sqe9(6E~uGh`SyJc6pz-x(k# zs&H1QrKl7r+K!l>y3`N|^-OgngHY76f)jC?RWnv>yA!hAf~rJX`z?81g-P{(0DCi2%_y zH0kG0z{waI#*BTEbd~8B?~Yp zJ)gAt19%!=%Hp(AD5E8?&K{%hkp(`o7AVJb_3Hc||N9?&{QjelJbc&F&%MTG*>X}J zq*?M)l3+#r+ryOj%JSO03tsM~(M20u>((QM!s8N!d0a9tDPz)NYRY9DJe~2Qb9Xj> zZbg6Xe_gKvrg`>_^LO8O^xT=NufKTd^doonAQ=@D9h4}N>C34a1@i?V?}7nSw629qe~#E_(vQeJ+i2y7`t77*K13a1xfj}1`_ zbr2nOLW#f`d_-*_74xSnJ=!j2gh=3X*>L4>SwX<>h=B#Pvj3^cAS`IX(Wq&^B{B#t zOuAbS$hj~x*#Y5v~FGRCjJFKQ=-+X5#?qJbo!^!a@lefTXaro5xY6&`Z_` zQ$H2NLn|_o>{~XQfQpK`c9hGY03ch}P`*7eV9LvZvKBoGpa^{NZQ*FsWlv=B0fuzM zq^bi(z@QVsP2l7$`cTmbQVxBFI^*;bBtMcMB)QUf72fg;bB(NcuT8A*3&>6Pkxl6_ z2j|>#nc@H+ij2b}4cS-;-&E?5-fZh1>Ks)^78qIJqi6wq+`syFPcxD7Km4~}Vm~hv z&%X7dxsIQsLEu|lI8t|)#vb3MzP!AC?b;$!KCErw;uwmn#@^KS_HO*=CqJB1!U1>86vN`e((Lu+hd+Dj=_k%FT)sYgc#aAENG%Z3qi{*4 z^bu4AqZ!&MGeIP}QEwWCerE$4MkKKvPt0kMbi~~oXIhfbfdS1>MnjH+P%=}ZG?>pp z2^1mHhB80-x5zLd#RuZ7iZLg|LfP!h?B0EQr+M}?8-;R;l3ytXV1`mAK-i|m8^#7w zs(lrSXFdV4kggR>5-D1dsL~@~p`?U`M-WethSf%9M2PgHU*31k2S6{EyrmWXpctl; z@pxU4%b5z4go;P0h#c+Y!9PxC280WUtq9wOuusv5k(@GuC4y&Tvub;ZiU}oimLkb) zS&<<#Bw52iT%%UPr><(&(}YozVCMin8)_VA)B-VdAQyqZT;Ywf6Yft3x`Aj2RRVy6 z^3h?R4ciukmxX*St=G{4_DHGoP-YRIOx_#!B=2>r>5|+hxuq>mQOuF?q_EWolGj=6 z9mdqMVw!UqBQo@A4Vg-KqnyyLWZA^ zg~_&{(=!P`->M4q64q>ij)YnXNTW*Th?F+lj!lG&IBdmOTUlFNS{)mk2MhSUv$K4# z^^D79lT5;Smp!MGF((NWh*BJ=*x$NfLAqnU#r_|!1g0-sV^b0ZXrS=*ItVw_kXGhP zl!*9C@OEZl%ty`m_{qARh>JqLJ_^9es?h2pJWQjrimJQX<-Dl7NsNmdf ziKm`>g)sI3n4|n1{*Aqrh(X44<>~@!UPLgw7Vfo|q4$z~&yGqDK$K&M5V)|ov9ij> zUV|Ur(_hJIYSAZl?l>Lq^Po@VlME|$Q!OPSNNjFgIe+=yPn^8?%{R{d_{yCR9L4bx z?efd`-Pq~8_58w=oCV#SdK&bn8Bb0v>ImPB7L97<=mE#y0rq`X5Ljy4Ifg-_rBSxt|KE}L{BS}7e8?p#%|$CQba zE;s(?Wcei{MnHlDO)$f`t>`52qysH{_+DnNeAOCkA(-3$IXdwm1zuo;Bz`ghmi$7x)#7={`>#@?3Jr4 z|M2hs`s;7Ly|}RKgMW5-te=B<@V~Xub$)*N+Wg`=uZ_qq2WC)o>hX#1m#yBH--!!r z>m)$zl%92VqT&JBiL(y6@Sm!b5BEnm-jw7@pQ_KbpF7Ey7MG`&m+$@f!Sk=LFJHMf zId`DDiv`}d%3PmbrTgxi#!Oim8+Q~s8iyT>V%43%NQ2aU7-_X0%3z|v6=el<9suqY zv6!aAtOi|os2YUVS5}u+R!l+0_smXD@83H;J3Gsq9NVcWK9rjIgRp}rFa%<7p#}|b zsF6|v<7pyRC+54V#T8*rY>9OeGPjR0iDhGp100j z`rfne{MKJRedO@mOE160FZiE#_7m5r_qlqN4KvL7tosX%pSZb|x|~-X-``2m@y6p; zNMKHh56-im`zIGQET8=TIEV$l{FslgBUr2GZy4PkixtMDvP-V zxr4D0`e6)5(v(Pg);WY$p#$dJIRVK4+@_m{jng>^`+IV zrL|S>4vXYPCz^I7!S|m|fSDv{o1?i~D<+i}C*^~f>yAZ6hmi$F7WgHyK)lV^%G&Dx z@rPeOd2H_2zWmS+UVM`s6$7{PvlTYpuzuXJPb2qst*x%DH}4!@Tq6DSZ1rtjF;1k( z14UL=)(O9CQDISx0F2{&e;kXvj?`lKtV(#|kYz|bSYKOPymIZX`;NT){H2R$E+4(; z2!5S#2bhkTBZm^MbM@fXP$#}{^mOC;`hIBFN&`Rw0SEMKb-23_$#5cv%Bhv$yYh0V zFThZuzJbVlbl9UB9TO9|o`}LpQ`R?@R~C4%I1d_Ph$M(756$@CMep4sDXMgZE2Ow0 zy8rx%Z`3U_w8!Tado0h?5b5*!T9OiisnaL54@v2p_)TER#r#G>WG>SZTuruUg5d$0 zknfSH+s>h>=^0OssFnOr)+ZIhc0eJ_u5j2P0BHumU{f!v(&~wK716vf+G1b3EX517 z%oDT)>*xg6g+urxu?~eyvCzROaH9+&QIY{fwul|GcbS`si7cC)$E z*uG6l5h^t%a`EZ0dn%1^(M)EeEsGI$RB3dKeY&sWKEf9|qCw_K@z}dtZ@f(q+y87_Fd0w2g%K8-j6)Asq%yyv^uWCQa;tW^T z*16T26&jYr+^I6}U7lZ_-n$nt zhJkpgH?Au!aFRhy2SXuVigl*Zh}xT%EB;CK_3##&xRWkNk^ z$J+RwWmYw2W=)FN;+o&~Zin}ILwPS)i5-DF_}Ifz&-WzwZ)=06GCI#eU}MfFQ%aNY zCQd4H*&xP=Fd(NZ@iM7SRCY~7fmJX`LvJrCULG-yhh#qk18OfuGvYCgv>l;GLi7{U zm7g9UtjH+`zDr2K`d)^*%fens2RzNRb}je%G{K-- zrJesyQvO6VXg3N>2N_|y{s4u5=PI9$Wt|T@6}z&9*hC8v{zXv0z;|@`Mt+7o@$wW1 zQK~6?$Cz?FS6!XZStQ7_3N%Zo53 zAM!R!-bTmjBp18CXiC2b+xSbAUPm$8FH<8be%+Xv1Y_sH#O>XU)79cjhmx+;R8Zn?IUg zy0Wv{0%2M^>dIUFZ9w1Mx{NLqCGEf%LdAyTSJed>uP{ePt0qlGZ!a1G5%p7Sk#JIzqe2BGCCWJUM{4XG*Cfvw={KfCv z5jI&58FMw$okXmB@deE&E{ooV(YtIAv(-6O)?^Ph(^dUtSkJM1DIw_jZcWumQ7fwQ z=@qOIjsbUu&q}BzFJVN+`D&G}5jq_g0XhY?XFNTD2GR>w6_3TcI|a&?zqsOuI)T&! zgmr_18?~sGq(qdas9=sn&tzMi0auWkkeHp zHAWWr2v`80jGy|}cYb*0t(AZ9-+Y$MF&8ggbMLbY6+e~!<#Y@~yxd@Y{R;0^V3B@} zw`q%PsTjUbru86x(#p)nQ70(^nNq zw%M)__2HA_>nwyFnLBuNeBtW&-h->-(|hU9ghWShH$6-&;>3qe$~G1~QrRLqV;9;AkQ_VC#6 zRVH^5kU7u;q$wj?bjQX?son6*gAn&@d3Q9!;}gEhl`XO^cQk}Zkqa)C@Lb6^(*)t` zX&Xo^B&}pC8qa^-33Xc&4Y2H_@EzO2izy{q4oDB>su?JW@o~B;Gls!!L;$U3I}W%7 zHPkW$+lI0YeyGt%4G1cS<4WAPNFG9!`qV{bD`kk(aJ8(?%xT{-!{ zZ2c0(9mglvvB2%3l#5T)>N~ap&`UcMjAR8gd_;18;|`T3YRL3K!4Q-%Gz9pQReLc8 zXmBc-dck6(W~vUZ3`Z-*LLP0#0I9PsX5n}U zH*ZcMQNi@<%}n*#Sp(3(h^8p9ogr%#);`Oyqloz5sx5a=i_i79`m z2lnsfQ9;@h+^`Uj-O)x-QWEy zFTZ-81qFUS<2mSmfBK7$gRzu0=hrXRNoO>Or%S{hLxwHpz_hl@kttkor{3#}4A%fK;( zCP=pDA5cz(B z9F4vm7<%zH&P1t`bDN|>4q*F@apryZumzpp59;Nquqa}ywy)}sIm0M&Rx_Ns@$NfH zwno)E6KydKG`D|xY-~TdF+p4hiO$&&LwGLZ>ijyhK}-d?C6_sVwto`WlJ!tGIF&7iRFneh+5;6KXt@N! zPvnKgslx|m_FlhwaboYGRqjAzLc>{p!2z{kIF5E{v;6nam#){2*ci+j+y+LM-9@R! z?U6dIh8VWpU=iL)q#NDsTWO0;9bq3@jryX)6{Rx*6WT+Z`z)CG*I7YLRSTP3TDxvZ?9C`f? zC@8s5I#~Hf@`$Zoh?I+@VH6R0p?durW~BCfIyo8@Nft}EM~W~X92_so98(6(Kn(~s zB&C+q@agi>2q(3P6vdYm$96^;;glt_tFyy^vn`weoIuvX*z~qJ?){H3Vc0Y-(#-ko zj9AL3l>Dj;OVst<(T z&`k_H>K<9(_ObxZ5yynf_<#PtXYRY_&}TpM!1sUn#>A~{dkd?K?!2IR zX>nzKVOd9?n?N`MDOfALck4QS>Ay>K+$R6X?buhq4_c;zc)H%?6z`%p*3t>sKuz>j z(N0;uLj@whNeY{=5Vo*%@Z`azm#n3lE>Prc-X zMo_1Jn4IJ3-m^1oeD>yfu=&T%TOu)QVnF4e5_J`@)0Au|b@IjzFj2r9lNQ;s}~nV`}3f=U6}SonGjNg^5lN6=Jjj3T|aUAX~&Mj}tvWLebbdu?uATi9G) z!)Bc7SZ`p8$Pf8Uc#qx%He}RMb!36t*#i2z@jd_Y-+Xs>ROII$ZT@I%F5d2%;vFE`>vedbM4agxg!USaiBMgH9AE@Gdh%*J7iMN zW5==M=6Apwbo#eZgH8|`Y5kpqf&Ix3Qt5Ia>N`a$X^1~Wqam}TTGL(;Bl4Q(!~_Im zUbd>J-KtUa)`DT-o}bA*Tho){&dfReGdVrU4201iTv-wRc+-YxVE7#hIWM#_Nz-&S zQ;BsW2%W(i7@}_uh)6*V_-7s?juas4S27i8@<~S4Q)omhjVMimTm7PU+|i3(bok4}YEYps{d(>vqW$#*vJ z0=$ma1PBmTj#&r;j(T0h16ewPjZ)X#@hzj97Y8Bk9|D5=&9|5MMt%H9-R z*?Sdm^%S_Xu`!Rp1pqI%(y>t{MIpZDG`R$Pqw{GgXvh_EgrwnA9S{u-xJ6XnTuuMpPzj;@vdb_fu} zGpR$vQ;uR%@T0KG3my0vZt3AuNu7WLVj4lgN-0tDpQbWMC%cl;yA5ra2%t@~7&bCA zVbrD5ny!?L_YA9Va2#;y;2nd;U|;~etrk8ap)_3AnMNW5;!(|eeBOnlJfxs9T@^0e z8>!OM#z6jzr>&5}^0C^$22Q zfe*C>@R|J0udc2BtAG2#%;ef{{pKS-dikxmo`Dm27X?Xi2tZ3qtFEoDdKa?3#y%al zq;L1qt7z=o+RFBVO)?=eNMKT|6$4aeZ<5$f<)@uUx!*{_4@Y zj=I9bKsyzp^Z_Gw&57D>VPxn%`1TQ6#Z>2hV<}n%apUODp77Y&S#5KGlmzu6yA!fm zt%ZF?MKK`f+ON~l080RFKT#-fk7DcFjzCyFLa}xWZfT{qLWtSre{*a)M!SIh;#3>T( zNKr4E>gj+=@u_{nVp8n2Kop${B>mOhjsbEI82N)2Mj*jjc{)0UK$j<=FGaU+-lQVJ zyPW+FOPSf6zOl8&>qIv63FGS~8}-2ml>-$|j(vL85zq#*O1pIFhi<)s)b?^w=hEuHc339DTPUU7crq-wtaBqYp(B8}gylF*36gXk%=H zseW#I;pIdLu37EU*T=2L-EE3>!@D|0YrUEp=NG7_6F^AQ^Ue~%JwmC0i%TS2N*n5#2A4#X;f$3bM*4X^cMn-){0 z{R0vwTojYPST|?ik8obF#CynilVN#u$Xp?Nxou%?-!zX0=g;Hno@=@l1?D)Jv>4DY0b&(-mCAgvQ$x`rUXF%Q+L``w z?kB+Nq>;572aaCqq$8XV49{+Adh3iSo3*Sl6+b#cvy+DJc6O|#iWVaIMM-BJ8z|FG z)!(vLnRGPNrcWB^RXj`e7u85BQqP3Z{9y_OY4j|t@Sz%D^_5Zk6ht}$kkloe3TJ;E z^WA`N^3|h)LGjoLkd8Xw2%4TDTw-jjZ?26qH_UltUX%qfA6L1-dZnqVa!}ODMzyM| z8%xVvtAVC{^MjC0v<3uT#|1`Pye@+~1-G{Lvo#FJYYR(tZf@ey z$jAb>fdz0nlz;xm-#c`0>hJx*S6+GT0{eJ&+53$1&||yqK+3bSvV7e=&OF)7*DrT| zc)Rnu4XkrZD(GkpH!0%pKW-)z%k5N7-^9s&31r+UOeoF`wL-k!nThoZ2tEELwu#i zsdoH5OG0*_qLejNrW6Z~+&*WM?a9uNBooq#{_DjSr!1&GUT8dUfQ`(+pq{sMDX2*d zG+5J00_5&m4J-hBh;Km0R=KB%ZAJ3q%^KJ+cZG#AoBb6>dUZZ*DTqB)gRQk1==3Ua zm7hZJlt%h$W`z!?UX;a07uL@Ta03Y?OHA5Mzqo4MO5;c;9dfWgOj<2p0hT?q5I%Baw~!nGNu!^)JdE_y|}=X54FXGy~Kbb@V;5z-?y%0x+@S>yLl`!o|(M_xqn% zSXw@R;nGwd{L|}-a{(qP(b(d`^3uxc0xuWb@TCOx5NCbvkn8LbKROkiW-QQ~p`whP z&H2}zM>y4uwH06Jz`aQc(;5k2{H{hc>PU;ozB<3S|BfR^j*nk@du#u}C2r|vT+f~m zKus`@9gCPdFd^w!h_}F!;T$SF4BFMXqumo4LJxQ4Gps~_9x0MkNNk}HWooqKtvWK> zYsP~m+$#pLSTDc~W;j}j5m8ao2{6qS^{J;nl8IsRp|Y_Jhkz+#Ng9^MO#z^gU~TG2 zs^AOgw6={hFCcDdw<8jG2nCx}$sh;86y5>9YzE25DPc+2;rXR6r?w%`Yrn!Mwz{Qj z=RrcbJS0^*LHs7bJu+&BqXHSya}!)iR}u!YI7Z5nvm|a~3cjO6-pCPCt3YHbu%^H+ zc(8B}7B7ll-;i!=+0`k(ZM*N`MA78`VY@xScG(0tC}J%PTAY?oVER?9<0S{m8vf z=gu$x?&Hi+Hrpxou$P6mwXZC%EiN)Ww3Zi3649H(8gi+(lX-4k7YqS#;>&h7-1};} z%dMNU@OU^jnh<<_N}Ew2@l10j2-q?}Y>x2&r9&qUUc2(ng){5-K4b!AW z0HjSr#q7>n$rNfTML#2fiA~xt;?o}hZ|=7w6S6lUbzlvtgI}shsnzWd-=fv1g_3fI z5jtt#&I0M)?NI4f*}bHZPHa5Dr3S6)?TDmBM%K08n^h0FYlVCw*Ymh92;)_5+?Thu zG3CBPmoj-s5Pt$J4Hxb%5qmQ$}v=ag+eX0Np?$zmlWF$O5;W1#m`q=70LnpTJ%J?r%SK_N|Lct1Hu!xTd&< z1RkQ){QS!G`K2{h$Txk4J@1u_f5Ewwm$~ii@)IhA6|h)^mYZ3mJTaqMO`yc)+^1uB zpo7Tk#Dl++@z21FPmXP@uB9)>!!Ux~tU1w;!sY z-8To7O3#d|mL9CHZ0nB#U5s(0uTyC{rZY`+kt|2&Boc{>T8=fCYUK!4fma}u!W5Rw z{cy-MiPSXF(B-F^Q56_g!7$7~@xUpGCyC3MRXidv`)`x_sH_YbhPuqdJr%~pYF&W| z5juo~hfOMhAwhAXCG9%oX)}(=)fK3u0eOy585SL)Qndg~5jpgw>m@&^{tM zH;D1LhZyvh=&u%}^N8_sW19icG zE7wj_RftU2B(XC|z#fJxF2I@z0U-t4 z&#!4x3}p zS^bsTg+@@|0jQ~uq>7-xIs5iR4xy+tnLDKz%{UhZ_$n-yCQk-$a*%#B2y}q5K-eaL z==C>`C#xqA>H5~7qJn}Bfaw{aF}l53V>hE#bfL!^g;gXcio3%$);38+H+WM#PR8jN zhRSjSNp7)*A))`Cz?z%F(G!PZ{O0mv0%&gE4BZH^xVXk8Fu%0AzO^|@fZo%jBY=?w zK4ca!UhWyYeC7Hd{qgfhk4%2$OAnC=;S0D)i90ivmR1%Qmlu{+bVtOB{4xgqR{YC{ z%n(1dxL8O>T7L8vs8#GKFANf1+uxZQ8Y+Hot+V9{FDxLI-`ZGTU06JP;=q-QS1z2L zzx#nHy|szWwxSdFWYJj;KD2Gb(+9Q&glG#s;hOQ1N+K;jv>?=)5Cf|VFo@ZhNVZAB z7x_k+ftbzEsCc~Ddu$!W;3-lbD@?2i2|l9 zD}4#FX&Z2yBgKg}sAkcwW&S|qP}DhE@n87WRZC!ShhvH71wsP{l?tXypsR@*IM#wKZ?Q^6g*~zAgg*7Qzaquzs@RZhUW` z5c7B!^XFgxA+KKe z@BiyxxpHM;esPJOYu6TdpTpAf3Vy=8C!V>vwp;QqAAY<1q#7i=BtpF(0}-AoWPpsl ziL5$jpV_jJi8!}MZ17m1*{M5E@4t9%YvIcEy@w7O)DlhtZJm-%i6w*(YIN*K*UllW zib4VIz=feykOi>?h7Qtj(Is2LNWOw`Av)Ga*!;AoMdUY=h+=Xr7Cjq(V=JO-4 zP$HPenDiv`7F}fwx1!PJ%SfK0vPvm6uoPUO$Tt9SS`4VRf+UQ_sU)OmN>GUvgmKYG z50h`TJ{c8@Vkq}uh*wo5;-4o^xi}{EX?dV%0M>yqWz0cdR2|w;0_{&eT?<1iwEofB+^_@D;ul>m8k5paM}Fut;cKW2HX8D&zr~!N{OiFmQy0 zY*R2V_F3oFG`MPQe`1mOXm!5f6Ja`unvn1P1;RGY1EmJIow%hJ{c=gB9vH8e{d;Go zS?1>@a@=rub#asc4Xih+jVy2*SO71CuldnSXTSUG<*)wg>4OJmpL+ha)s;0KX1KDt z>g^EStdIWcHcJEANL8qhQ3K!v9(A)-*SQSVQNI}p_B?&}n9DG+aTw5v| z2uvwe7@$8;)y)w-<ReaD_@LvN){+B^Q`m}zaW|q;&H`RmIHs6 zwU8nVo33C)2&UMeG0v0&5auhnPs-P3s5|KQ# zK%kR+!`cp+NFh{${55aaN@6q<4LT@5U${JQvHQFrOyI4Hlb|liU$VN)!uCwL}(b z@6K*OI<;Z?-B7I1HM;L19df+|QPu)*(d^;Yu<`NzGm&FrlmK;h8-0%~a9daa2e-bq z{)hkUi6ci2{>`sGa^~#SGiTnx0nN-#QSg9hxtlk+EtLP6DiM$Gw9QXpu3>i^v*VNv zHkAo+G=+Nn)0*l9FJ*^C=t#oL+$1-h6G4w;hO_B5JXHq6akc9qbnDJNZ$siEqIG`YX!to z32+lI{-jZ7sMKf?43nX;p{ionSyP^vazJh|1f4im!QBI0J-oRSJHX zl4x#NFYV2KOml>5szNxOgUkc^C56hQ*hI|g2R@5u(2*EMHVq3+TN2*2>^5K@|AQSd zptwB;+LhGqogD*2DE+ML4x0WOM2!x+V06@cRS0*4@h(zdALtAa84+TubpN>t!yCFg zA#WIXUmdyNm<60WFgx*&|EGWazG#e)Miv-Z;Fr__#FsCA_P!Ix_CNFdTaSPD&Gq%w zFMsi4r%v86zp!-W>O66%evbc=O8>565m)fAJhbRtp?(H~xb}pE9Nr(j78woM1`571 z58;<_U~Fpd%z-0^C#ELPpIyB4HZM8fyyw1y`wsDHFtl`iLIQP27j=>be?q5pxd3Ag zw)){!R`O}MbfE#IQVDSV&`&3+M~g&6QdVS~QZP&{SXa|?=L>VfQ?#mD< z1*;OZD{rVO-A>qWQ6(>_{Kg>8r*?g35JpV@kbKC^(`S)nR7}k?Q$1-qS5<|IXp+Qc z$-v6W9l*|Sp+k84KoL|e7MNT=ZK;$pE3w71>uIXicKmHE%^mTvXLk;3o~%wpfE7YY z9d)WD*HFhcs(m8>n7u4xwksF?&iF)LWuiTXIQ59TR&GI`UGaJ&_7%Zk3qh3S5*jUm z?P|DD=g0ydatrJk|JeV>@=qTtM57{XkVZLZxZ=E4}GYnMtubYVFr%OdKkLB2tOnRX_-!c`<<&lwYPjX zg&|IO$#3lUZ<%1m%~oxbx5sa?>vCfMzKNO1#p~RM7?2X` z5=V{oc%~=nRc2cP5%^j$Y?wD>m3(;6xwNxr>Rn|gE7r34xW?pE zkQxCSQ5pBWAMaj(1jw{B^NduiOX5a66QFGcURjA{+k4;ulOyO3r z>x#KfD+X|?h#Ijts8FdI1GIMK3JjAr2w4T>vPRJ8QxGUcOsdUp&I4J@W%x9OTNJu<$XiU6B40^|P=o^S!06B5?hjSDtB7rsWV9&UVaWzZjq!j;#2vLm%hPzNE zePxH?kusk+0T>(xK-;MmiKsRJ5nV8pt4cT2;54TCcoD!6`;fu9BdeV>XYCprzO-U# zznyhQR9X#O=p7#@?I_}PP~!1vU6L6kKxK~6ab$tp&;sQP;&r!<9GUyoFFm+_@79yg zzV*cS&Tnn5J^JZ;PTza%>Xk*F2!>z4CH?Z70F6-RXP*Ei0-=6+__%EN+^Rh~Y-0c} zRv%tInkfr@p|5Yw9GpFH;t*>9Z@)3Wc!jON>&Nb%JaFv5`1lk&18lU2gKi!g-mO1U z=(=qW`EMcofZtWx4co%lkj?`+fEoY>S^QSvi)s@u z5+^^gmZugny`X$OwZ0;LN*OIoBw7-xtZHqs{ds1_C$~6>)IC?Gn*p+mPpC_Hz(zVI zDkdGpC5edi>C^}^bgUUfY+<>;%qnbJ2SzXxn7}(wrAZh$okNKn2o@O{n26?DCMse{ zsfLucFR)P8(x$`;>%ONTNglvvXA<<*y$j5pK%MwSup`lvR=-_J2`NtSY?eL)*dmqT zCUYZI0|UVAHOO>2IskA4kUC_N0FnLpYA%e%450?=ijZ2p@I>FGwBda1GQ6#;Sv7qy z;TzixLyYzS4O?SWA6eiwu>kI|JPZ1id%-K=K-mWL=%?=a#uG37$=6=~i^pI7JAeC; zul}`1&z!sX{PV9bF0W2ayG^wV8Mlck-b0NW;zI?zVJALJ;Rf(FX#cifz;)S zxf64|73r;4uPj_0+gM*ae(&_;{zG|n1OAz~%FIR)F+yY_ptaL$@G0Ldhm07O3xlHw zt;MK;7SX#ds}jh6QNZtrXQ0R=&JUBUZt=iOWbV;g-*B?*1=i87z?MsnMV5l*}>_c&Bvgg4`>t#RwW6j$xqmFbx3%(B3(~nz5^gi zCzN=>j2JbUBz)-FC!zpBAJC9cMy>29#Z06^&#;}K+gqjV*|mng3w@{qBner%??KB) zP`dt$kycp+US-Oem&W@v2XlW*qn9g%p zqZy!qtwyzx1#TM)RQAIkJl>_0stQhXdTQ#y`|ten7f)Zkdj0E9y#AfmoF~8^4!JMrS-$dr;gosaF4H>b-ti}`WnkyqL7o-a-5LOxq~3G zZ99v^2trTe3gs$??_!YYl) zkdzxU(e~MAdiv=izswsJ^?e-;Q zPftnSQjw4pT7@%Vvm0u6DM4cJ8AxhvxM0!<(&w#Q9XXZ0B|gq3`D4~cFGI(K*y)V$m zZH*CB9{u#`M?P`Q&YXC)=*J3QK@%wnnH>TQOq~p6A?{x8t zIx(fCK@|}b4vqRreTL)}N)m%Ed%6(U>PZnrB3IJZ=6GsO#;{Ta zOBi6J*S@S$s*CT~pmFJF7C_Lz3L@9w>@^ zV|JTBG)8>obh}0cKpBw1RB9+#9inJmDbv8QB5AZ$h-S_tKroV;rzDIUZpqpa8vd53 z?Fblq$6{s30)&uBl@Dto0SdbY9W3*_pP)3`@x`?^%tjj3TN2#@%`$GU+(2WsLQ+O# zmkWY#Qy(*CDkLN_=Qn{sxm*hv!)uX7)4uK#D!>l7yqARLpq^M|D1N~hB|z_GxY78? z0v|RD@TT`a{Ab^K!Y2SN-FNyJE{4B){`xthiY_2&1n%I_!Tq2A%-zS1OnmR@H@^MU z`Ae6t{?)HMe9t{cuUuWceti*O)*s@=e_2eRbdWped~?YnVF4`J$lF7@j1d(ezezlFj1)R zm0zPg0dal);+40~tgf#v&mB3SG?he@bRBo|9+QVmRVb~J>emZE1q~WI!(bbBRC-(p zeBh9eVo0Ft93H9|V~<53<+82M$SSxW7rU}uKNBwi>mWM(BrN~sv3Z2}W=IX02Dr!T>hb2t`GvL9yo zy#GtWDGZe@nv@N(VaTZgbUmdST7aj>*j;l*`VIz^NIWF)V5k$m?EabH}tAs%Fsyju${v!w;4Och6PDDBDtB}KXdOxr;Z#w_}a@?e)!y#&5iX3K5^*2 zPoHE15DAMR3%uGN635K}@g~N%<}WXu`|;avog<>H-}|v6<5TR6j>9)c0)t1#u>4~j zXV*$rX-r_Gq-Xb>D0O*x1sWE%+Ucoyhwo1%Xr)MccA6xLYd(T`>QWjMgeMmvbdks< zDKVneMWt8~VgTLMN>sJ#*de%s)l3ZJAokW4p^@BYFI%9o5jU}!xH;oO0tB<3S4Uf# zAy&*yVmiu=iF}I{U(mv08R^8KnfbY-LBZ}wg4M_so-$@0p-I74Tk4a6MEvv_N{`&j z+Eto7U9)|cy>qN;^&z-C^Z4ZfPxCuX;H9)BUqjfQ@!Xk7!l7?$T#N90YySg zcn61phw2a#GG!OC^m~o%Ec9R(5cxsowIg{S)sel>v0&`TfdSi|AgeUwl4=+iNHn*~ zfaM1Ds#^@uO>aGGm1ei0Q3BKqG5Q)=;P$Wpf9*KPQzwsHc<1f6FD~t!-Fou*%P+os z{_azAtccYpnwHn7Bk)un`q*8MK5}AdY3Gp-w77Ne{revI++7Eb%n_(6Vi^q+5uucv0{6dXV`1t18}kd-HfLuy zxi#kQ`wq+;VEV^bR+Z=Hfh~UEA#6vM5cquz=|I|3b3g0>Qay?XuZo>S zTKi`G4wqOSRYX?lY3ysXk=g#mP<51Hw-2T@bS>E~Nu7deh@3%Y4GYl+J9!D2g3;sI z&G~LR<(FGAQY7IDaY(gJo+7yGkw3Z+4tnD}x($9;Q;j-D7Wgn*pxnfxkKFscr(ZpK z?9ku+olidb>>FQu{PjzhubjT;NVb%kB%sdD{OHAV-+B7&7hihw z3!lC3kx$%BK)!g1CkAa!@(kDB`E*X?gE3V(XnY^x<)#Tx`PrQU4LQo4Lw#Fij4>@d zmTucM44HxZ<&lhQ1h}zdci(Z}Cr_;`Z$A0W*DqdJKYn8Ru`k_y?BpTtUt&8@Mg448 zWfF*R8WvDlTfg-B1 zQ3abauK!eIRh>CWT>pj1Bb(~HIbT6nSOH9wHc?PGzg1k`>4Ru<6bEuO_4FL_;hq^T{ zSzhKJw{>rCm;gaxK%{Ev;#_E?;w|5r)yt|FEeS;!8Fh6ow`%3cNShn#nG|rb?2m=+ z)T!XL-qzdF!O;v*>^VA&EO2{S03V5izVpQXuRn3&;M|^n`1gNpb7ST4zkL1AzWE|A zX};&wVcran#yCj*cM28#<(~1whYoz@OCLLOaQufaz4MLlymf7U;j^E<=f3;yTv%Mb zdTkLHHUB$cg~l5}@WL6=SGcQr*z8yRbwi<06!Uz#&m?7&wN~R9efYQ4{43 z9zSsJ!>8Dy`@&P_&%CxacW}=qA3J*bp*wl7q(Lx2*R?U?mHRea%#!~4+SPN5SI@DN zb>qa{Q%CPPbnf+Qn;R3yPaoVezjWmx84oNItQA8Eo0K_WO;80kHS#N>3kn75cH7Fa zOk?~lV2=z0MWsT#f%b$NX8ZC-I*}@IpG<&gNh>|#g@{xQGqe>b|3aBs`Wb3W2DBBG zo8lT?L7)IrJemGs|BrDQd-6qrqY03ykjjNgY6_v~<}Oh51UP6jYDV>zk#I^Xdr79^ znc_cioG1~MKLR#k8Lv_qf)fc8xmv2#UR;8qAomPFN zP9Iqh7gVk(#iSHUVO39ccLZoPHHJp5%0PRnf@jk+Fbt`FL1|Y~HOsd2ZwD^GAz7Ko zX{Xeo0o|?!cTXWynBMCWpn5oB1M%-bOogfwO+^m;Z^j8%4|Yk;&u|Gw*)r2VnK&E< z7$rc%))>`C7Pw6;fMdZ6A3J(*Vw{`2&fR%@`ZJH*^T@*|W@l%<@$IvJ`MsC+@0~n( z;t+luFmx_=R>yLkygc<+K7aba{)s>P`b*z_@(mUue)Y?rICkvdl`9Ji^GgYR!@tQs zFuS?IVsU9XuCOsxfkD~c>iX&3;T*dWDCsAwq;mjht>|^Jfe5#;vCezD?*7=xL&xS` zdExwv-@m%Hy!^?}9ewaqch2mc4m@dP&F3R+7A+E1iLmqMuU&X;etBX2@Tu7&M<-Z2 zo4>fQcy0X7`}a-nV}a5gskm}dAB4*NTsnJ2V8+f^pv~(98EKn%l_=S4=TVLL6hQhp z_#-$V6;-<+l2GIT;2n+?OKZ18r&1uYpIY)V3FypHu?ez6BfG34Yq3TQNnt-ysl>$$-4RBBkKYYldUH{_# zujJI8{-(@!%G-H)Z48OI4K(VggdYwt8;D7xN#Mns^sXN)#kbKa)Kaq>?!E;aQp8r} zUD%8PE~IR1&&h3zo1tAYdEI!~YyHSqWOH!^tik$KT>9RaNPB?d1fFWfY8}KV0qQI< z`W{)}_Obwf^UOWmfBM)fue|Z(b8mm{u~Toqef7cn?)a6@-hJlW^}l@PooAkZ`Q!=S zM?M!wom+Vpjud=2zrOE1b;p;#aL@JYOW%3=!q*@F{zDHQ|J-Npl6DAk?!oD7+c$1*%+T5zwpM|!DD;&ADv4mF!gb-kN6((*lswf)FnD8Rf_8u&5Gex z-ruk=$cLhy*%U>Zjj)m-V*8jFMdHkIHRAP^9^((|P;PcML{%2BBl{_E7(}Gj%9rMA z28lG(TY#rOf+9F#OY=VA%yc>^O8@9G-_BL7PdOwBWD`bmFmq8 z18^7!7Dj%Duya4m9Lmk25W{5CwS%}+6jutvu=I#ezTucB)zN5X57m6C9>k%GPWvw-$Mo| zed|&OtmuLwYA5_C0qQI<`W{)}cC-M0_#c1Z_@8|JrL$)*{k32F#4|6v&RYq;{Q3Lt zy?g(Y&zybY$qR3tyYSEhC+e-JxbEKjP$>^GJ2Ug?NAAA=^#1ebuRs3Xw_kkq9QTMl z@W6@HwRL8LaP~}G_rSMkLY>%9>HX1AU-@T`L!(v+S2w&0V+dp$iCr2ySmR6qLenTa z7=$fK(Z;RfXxZtEcRqga9ru3XuI1&e?|t*krFS+?-aY%+m+wAt&(ToOHS1){A!9uP za-!qv(%O%ne*5jWHm3KE-SxoUnY|P1^Gh4c8`DSjoq6fn{<)bW_Z?)n5PWp(`sc_K z$)pB*`&wxXy6mSUZgQLI!PwDY!HnkQM*kSdt{vz;44PKxpX2l>9)J z-8pQcVALV9t+Ra%4OpdDaS^r2UYVeFF318vrf5|XQ>9tvu0J0-Fm*_n;uNhANOK^e zbOabK#R3_I210*u&4|=E?HMIN!^RucM;5rPEWn>Szeid2y65En|Mayt_w60~;$!!} z^7^@J^UH@1?)$4>`S{HA)_0#i`)A*Hh1=$j-m#ZQ&c(GhC#d5{8iWJ8lPL{URo&$6v zpzzh(JHQ=4eSZ&0rG*r+E0(Bu>b$(d{X2(_&pq&|Q@qdm``8NHX#4495Ke&BL)u9?5tP=GFD-#|B5Gj-iX8~c6vH#U z4#3c5N~fNr$#jO)f+kkSrjhQ2c(+PP21ZV+nnOtyxJ3C|cHNZX)N5g~8S1qK2gc2=(4 zvx$(6j@Abt=Rx$~D0)@wY5${8QY(`@`!!S*fURzg5};;~(bvcVx1|N}3%JS?#}8h3 z`@-XYdEv27-+5r)4BMF(msT%doxkt&(XV{rUflR!e9L!Y96C6~Gl9yL;GmjM;S0A# zb9|i9uYB=7ZejZ7w_p9n6R*zAO@HNA9y)RC2>H7I z+*9Y-9UV9=>IOn0!O{{>f;Lp>>xRkzf2eaubr_{Yf)D`(umqB58%b-qVei4c_k7~6 z!^aQ4_QOj*cmoCj7J~c79e@16a1ZbLeNrTNMtQ4E|l+0e02QM}-R^}r@ z#Vp~|Wkq0{`2cKKmxlc)?r5N^M+CDU0*&$BlbV2J_>XaNhJlK?3P%bcagl_0HA7!w z+e+*;=#&>YDpJLW%Qok|>;Rh1`j-H$z@L|382l{7&FdkzM5RO38nEq%piD_3ijXp9 zK$iZOkoiQ(kRCdf(+tqR0&JQHZHH4p6xCPPPy^My$;nA1Xldk%Lv_9PQ4t364|LJi zTW-DQjaroeg%+UwSr{g+Y`ZbW(wHs`hRmconG-=V21N!?5;qn((i;*tjz;NVLNPMz zLZwaz$X3F-2yuNi+j5qNwnHmvV_Oq9qKcRE!)ORfqdIp}yf_HaY${Q893?=VX-3~8 z3*62Y*z?H4r+)b2nQuPv%HR6xr>@N}@$-vc(pRr8uC8yKK6UsDkDhw#!u3D<#_P|$ z@cOB{=8hcR%dadPIzFYWQWbi*#fevmedYgW@4cQZNwPD)N_kVu$`V;xcD2@Grbp}y zW^9)R7`Y(1#s|V++%-HbX#8jR!WX{qfo8O&(E!@cVu=ATjghUptF^8!Ewd`MzA5^g{MtHa%?Hs ztMxi$3#`JT@~kOkXO@q%tF^<7!osCx7&)u#OS$2&w7im!N{HVohcFtwJo*tD;8P*2 zQLVnZ#){?xr}pkSIKta~K78%!)MWkiqr(qBb--_G_F!+HTZpU}im`cf02~`RNKq*8}bx~OuR3HT+Tg~j{ZbqlmeOCpbO5!S({6*5Ck3?}-KE5m>3y)^_;7z^iXvSzK8B*0ZOs-k9WCnrH@>I=`^O)$6yO zJ$~xg=oc3zUw!M^wHvp0kM<1or%#C$&Ll|TelQ>Z(Nu~YrL3q`07Vr-yf z5nVnPztAv869!X}5&;>Vv;~Xi|(MX zi|7Y^qB{XD{UR6%HRHggv>eTy)F%%>WAr1_z)K?9B-(1i3DzpfQxtkFw`g&j(a}#x z!J*5f45`r+QFhnu-GR|as`2`ty1sy_BwZxCsu5>EsOc;7H&1dArrOZca?|5sVj~JJ#3R@$#$ZUwiw~+S>BrgChh3@jA=n3Vh_-!bI|!|I78maa^(ZbEU0QSZYn4Ut9yv1h!U6Ax_AJ-12LeV zRJFv2#rv`Wig7cV!(p5WC{QT)J3LUhqcZ-8bf6#6k3v}T5-UoB-E`&s=)2ioFu$h{G$(`N^%KrO+nj=sk*x* zHB^R|X@TP(9X+R|hLNsrPQVI686_B(M}i2Tl&LoDHW?~SQ>|0;A_+{>F9({q4$law zoFpktpQ8{#omSzI^e}D|n|P58VH=pbs>)*SlFYbt8 z9}NZGnxLYhvE2jTfAQ4D`s&NCUuK4Bc(C^P!-w?7pqYh*g{8P?mYXY$+u#hd%g*}% zt3a1{Vyq+90Nt&=0r(yV;7bubSpyVt4_DXygFS>k1H-)+KA-&JgGJu%bNbQ22c8`7 z?5Z)%gQlbykiq7;E#jWlHNIZDeDlK8=Wk8TO)u{`+O_*=&&I;)%Ji}xkJd%3M+x>k z=HAh<(bhV7xjwkBrEQ=~RuILAV+5xB7MUeuj$Kk!iiZHM8Ua9~d*5hF7a>9V1taTE zjZCU3AFuX_!H_0XLbe$51*M1dgP&rY;zVoG$eV`ijg$^ z!#7w&&;byJlC2=8aD>Z!9i>RX?I87= z;q@qvePWb#aTw6S7ji*7p2sq!)O4a{LnJxwvJ>mf_MXv?$nm3>DgdIJCPe~URaFil zNws8a9x($YH4+B#8zz~0;S6_!7brnZ4ddhn2QB(&1K$EgZC@UgxvXnhl5+v>g>$kA zdg(kxE&16zVX?) zYeW4Vqa%D#RZFVzQYIyb;|py@%eIrp_CNW^UY2S8>eVZ6oIQVF|IiE1oaRkJlT&jm zt93m&%<>rf?TR;)Q>`2pzAN0~PR${XdJ3!oYbU__l!-$c4p~^*(baMA#Ms!;-8Zk! zz4Pj|#ksYkXL=ucX1sTVFLP_1*j&GoH%PNig7B-MP zeM47J0#30G+n~!fa#3v%O`=ffIUBNydkmu;6e$s1DXsflNqwZpBGN&-kWoaG0$l_} zLNbVE($P3p?VcO8e*=KgrHCbpjoKf6ihh`H)EtnQ8%+`w_{QR>Ea4#F3jGA!fRqj` zuN0&U2nGaWs(sY~6Td`T92&S7LpUnUEK}iqc0nibY)ZQ$+gj_*WA;>SAjSMoLzp832Vjo7<)Z{va%XC*?yHhxYgV^0n)$ zt8>pjdGgwgI}A3Z^4x=HEw_ORK~^xL}O}nHMT= zu5ES>cHO?dvc9@Lc6zXQIzddxNl7! zpG7kb)ZpfnF0~o;^>CHOdFZCm-cZoWqo2q+4;grwe{geFGKYXw{sEY`!B(i`^zXPL z(0xQ1??3GB>U8v@&?ijk(Or@eNh5{B4s|)?ag_u^7TYD+MD`<|l zXZ1LNBZO4b#GQg*n^4OZbsG%9+)aY1%`2I}L`>nUfl~Y6hkUJ-92&Jz1(f=VlQd0i zn`?l=B+YHp0)H45;M8XT7#Znr+qLr2uP^fX_ujtlndt@YJKzcn8vsTa#GR(;nWet| zt`}c8KG56o+FMs%e&gci=IWk3z1*U}@jwd41D4#f-UufL%}S%EpEy1`)c)nAnOEMt zJ~=u0z^Q%5kB!eSEb-DH1}(cJdoX+R?28KKWOgcxdd+wI_KTq9mVV=+DD>tT}&f*SpTgQ5Uyk5bxuTxWdI=pN5`#UP@pf-2Y= zAWeiqi|1O;MY-KY-Lf^vZs2X30+JdHYhooq;Gw%bylt|L0I1eg!~T?cNYsXZG1Pq# zUEE6!B~yt#`4k<9scJ}ykTmj1e!w_#2?qixltKa$v^9{*2oj7~%f)0AF6ZXKo_ufv z%8<%Jh+B)sZmAd6u|doynMUHIlmy;hkpZk72d1lw4XuFoH&_r~+GIdTBr4F9LTb58 z*QS+{{8GR`rD_AhRD@@RrE8jjEa{t1rk9xpfgMWkRZ&5%W);9di67F~#z`Jef8v5@ z3AKseL{%WF;i~+liF&COaVK`~36-QiwGr5562fq5&H!agH1|yl{9#xCzknM(a%lI* zpI&+G?6nu3Il{oRyu6CLu@jQx3`;N&;DUH#(B$O&p@YNUe*P$q=ohbCeC^FIySrNs zj*sA5;-l2^qY$;bWoY0^b!_+GGfy7u>|Fo#D_@>{|Hk_I>bIUhH9R~pH@mnvzpOFF z(>HTE!XRd%PWLF%XQv;U7xxzef{Hw<@x%^(e}{;ox7I# zv?-6IZ89+-uWIqEjoDFxxSegAoo&-sc6AS}*G79NNER;Kuw_#rB~+J5;}yeyF(k<} z25_c;(~;c0YN3*T~#|W5U!VGFzjW4?Eq}Fh&Q^j2a5i3ZWT|`k)hIoPnqCrv< zui_OH3@n0TOp<;Dkgj z5U4Ej3Rx6MVa*~L)1pWwjkLB!OdDuxA+w++CCZL|M2jSvS*HNBJc+Voq_kk@jHZyb z6qNv~P=i@J>E_v1PAFy{xxkQK4ZwspQRHH=Y9#H3Y7nVJk6c7eMHgs5zl)p!Q-RDv zP*f@1%4w%#fm?LNVaAn($zppw3{M{={&AR2bwC6Yz$z&Y3?f2`l663Fz?o(ek9=5` zXYZS9fGS38W}6oHgRp>HLW{$}^cl=pM7pxP+SAkZ z?H3<8bac-rpWb@?<*W1atA|hYKmOh0-TmG8Lv%oL2AhTD<@qJv}Sf9JK zaP9r+rJ2_LJ*}gs`r6jl>r*St4z+5vu05({wL%*t91>cc0v`K6*X zeUgSQ0h0i)&g+EYCEd^*1K52>ZEVwU>cI-iBCa+tC)X9mgo{Ra5A+yBtB|5dA}F86 zg(`LBDHl01g5!Ex^b4x4QJpK(k#|CJacE}@%Oz$3C`y{D*<9iAxs{da=^6UY;NSqa zCPSK&Wl>u(5lcRwW0qK*F4gQ78jQ2RaHYp+=!qPJxaM;*f_NOcbK) z(2Rs3d?n%1;YC?l)dNMd*o1~>6SWdn)g=|Rb18<9%LJ6FZ4&J?ko(>%EAHuoV%mV~ zcHlfKs4G_-m~N6!#C%+CEQDmqTDo%x(CuhSA?Q}jBxFgd$Qh|P+98wdRjCO9Q-Osc z519ICT92i;)RB-Rte_T1$)dJH>Tem;W+aw%v3mp8HzJ}lWmoeS*miR^OPUt=1F!)8 zn|lp|{VjantG~D9%*pW^6Vprr?dYBH9#r9ec~l;^!CMe_4|jg@`K{N^-ne%2_VJ@5 z1WEWT-l<3}8IlGJu8ud>S#tEisr|=}3|zlC`@zT4=P%woesuTgQwO+VF+Dxc(gwXT z$b%hz7c_e~M%NuYotj1TziI#^5(FS#7(?{Nmo=Yx`hjPjJ;S?;e)_i`-M+oCcf9k_ z=MRh?8sYv0_cd7Eyv!1xl@+3&1r}N};lr@Qb@%-0SrubI(ml!N0VhFF|_09HyuF0Frt@YaOlQj)B^2M6_A_JI`vuPM8Xe2uzzlm$f zubH@9Q4JI*@lSNbRgl5D01g}qV=UJ&KoG%j;?NTe9pqFpaE?(vN~%MYcttcLvE9xI zEpQ}K5h;MEpT1!Zq(TM;aFU8s453o`fTrcv)|hEqSy}Ds?iv{x)aYlDumeFuzb9q_ zKZqy>QBJX@#x@CrRdf`#0f1!YE_1o+g%%dG(QE)LsC?Ks>)${6Itob(2kb5-jQ1 zM;7%B$|PrC$VV8*8^Rgc%1CTf6)mW9)VEEGcA-{@ZSy@qWm7bBO$+=XSpau{Ki$7? znwq^ZwOe zzVan+PTse7kT(W#g$mg)r2LUx6#i^*pzn#t4vvj(UBjK-$sP}N#|DyUEbRt^|+=-`2j7QDlY zjb`-(sR2qUw$6G3b5*5U6$Rx8K`fd=2T~PA;SoQ*P@rDN^gZ2O%m8(E)-*O};t-aW zUY8>_yo)DwGwYV%*imVwD$zeOYGoQ(%PvC*gd{|g0-hA=DEd*WDgmJNZO(}lDfH4- z_j+YI>E|lLgD5P4vMuv2aG}Dp9a1VxY%G~&lPK7q*vD@Gf^#OHh(OMb7>DBMZe`va zB!ViBROZsLx`c?LX2g40;Y=wBlL@d-GHfMPFxa`G5T-&YWkCq@nOC$2To7JCPbAK^ zwiaBI+6Q1{uqCU!)Vbq0od7b0fJI)-9Bl##NC!_YN1C_5wl_$#q-lZQUkk{0B<<`l zxDmGRo%b(&`02zCUpzfCx5R`8uCUM_a3}dvjgHK>`<6VAQ?pCs`-dNWXn$v|{k6Al zy#3CF?(WvTdj^R;@XHJn@<4Jxc%ir@&-Ydbo_y?ZSLenXZ(V-vt;?OAtxr6DZ1?U# z7Dw}84ZA5njv^U_nI$d6Q4yltH2|`9MwD`lk%Te_4vc>PyN`|U9sI>B=l=2M#4;H!$ey+KmWAb&B`rMhDjy~vxYLFHq4UPBxoeBpKAKrw+8jOHKDfWOxw5`K%Nv|G zxlBe5$>sqNPGV-PKt)2;Qrgvd=kj`2&sz6bAHx?)#lXm?rHpSN;Djc^R*xF}C{i+l z5D5SP%ZFyCS+{_4mC@6&c9y|{S~^xzXmyk0TUcoj*DXuQ3DtGQ30h-9!#N@mE0~f; zFu`l)Lq9cuWw8vIAMeIijVrYiM1WklGnPrxa%Qu zn);9wva-j&j4IYDmQ|BXfCOibNeWgVZOJT-rKQ9+)}Wt~nj=wHiP~3oq0~%7K(Btr zX6o3;lgee-q-E*>TDl}`MU25(GLqAea{VTrqfnAchI=Jf2TbNyQc&N+Vl)ih zK(ElC=km%ju9FNav=r!&^_in0X0#GVL)qL`i9=0%DuB|p7L&nU9UXjbt{DI&do_1W z3;dy2p!7Bh5r}6FjrYC$#u+Cw>+F{! zBR!8j%4AY)c5aagAx&JHIAY4D*(Z9R4&Z*b04N45m~z{S&}VqC_gl|C_`vA{?|pRn zuYU63ojVH$PIiu-?A+{XBk19N%Oc|~vkuHX=q?P#kWXc_TAf^;_-t-vwsl~Go&|g}GHIt+q_!#%S+1}SRd3A~Rw~QPc0Md%E^Av+D>7f&FqjIFA zA(9lMxN4wpiBuRrmDu6?P|zgRd5jfKkfPKV&=L}p%B;E~HpL{2Q3FH5m>p%_!@_0A z=^DW*s{}=j@S;`x6nPX%h=f1^5r7X|WNN@UFfnD}h?pjvxZ%hvqqyBetH6T0u6z#6 zVGNJAX^2kU33!G_%R^ysP2qv4sU$)lv9nl$;b&>d%ZB>5fS$|K$Y|rhBAd<7>JBOL zV@Dqe*+VC`qASWuK-wlI3w3c-5~C>7KFZRzL@tYsg@9fFMC4PCPhcpV6S2y#!n;Hd zn19xPEl6<|1gBs+pP= z_ye(kJzP~+F0h9N`v&{le*W^M!w38J?;W1FJt6+S{Ml8|9qJbYq@SW0R-o zse9t_Lq`tue|~QA!_Q`~Ub{Iq+TGjRjT^;l%X^tGJILY4ySi&f4(~pFVrXJw?!!-} zKlr^uR$}-P9BdgVGy=zzTU`n*_H=)c}a9xOpatGiO3Y zD<_NEhZ`gSDM%diac&QzWY$LHAW0JDW~+>1t~7+GTBCx8dglcY$$K9H#eoBwM6Uvo zphYHunX3U4bVFYKr%Yh$AQRD{SgBEoEx7kcFv_hhUKyomV|`6eCThi0ygEU$5}ru9 zl8i@64n3n4F#_~6OEQrMMc86yGHe}+>X3*(5;fRHp^#vNB3Ttq5uQa*rFkHiSqWJ; zwW^O3lTa}eF{R)hBB-FSLc$9mZN=Ggda0QEDknt5U0Z?6W3@tgR8rfL3jw?>+YK1? z3H_AZCJn@*XO^UdUnl@Zkq1Nu&yc`XQvp^0RBMZT<_1~JPP_7+3gvAT=7juJ+AzDD z$1=+aAbRv{8k8m_Tq45hY;Py-scF84uN!yrj`1#TuXeQas&Q(Y0Z?J~W~OO@-){@Z zQEYKNI#dv|v2Wk-l`Gd@d;7)<&m6+R>k}4jdaMQygBQc60U53>D1sQXd{Vp$BTw-#l_>`D0vGJU`!VYvIq(>e;xNlGGkglLrs%US6tC&&*r26x)Oh9&R*rC;-Zu*vV=-f&wkxS>HT*cJxgWvx66jucShftdf!pMKNNq^ry3Jt)+GL#^&IjmexL==ysjV=LYZ%3Uu*L zl_qYYDMAWLvb<2u!L(C}*i@2?X+g+XIFAD!#o^~+joWspYx|iG*kMezRw5|^x@&!L2uzLNgmjM{+>h!re$FgOEaZJ#-gDJwdSv zVGCRpkXQyuuZ(QK&pnn7TpngtVVpRUF&*T{T)w@MtfZq9{g4$|w=rAJ5uy+ohh8J& z*Z`ThWV0ZSl%U?wK!y@e{`3pfB2y5F4Dvu63Tg{hKr{2Wp+~?t*p_xE+6EH^+aViD zq%9h#$rfR#3_sgpr zz(Vwqd6Q$_Ud|dJLK>C|b+ok+;_yaIVx8_)PiBoAre zZI%f4W`b<+M);k%g{9fq#eMq*o_PEK>o(s!d*ijYF6lq)+rE=GzWF!Y8&L%oBOlVuc1m&`#&{h>u?8eg=0clxD6(rAR$j`;yXsH20M7~IX!MZSBEgryGF>Juia7)9(oLX$&GC2g&g+e!AYajdCADg`})qFDP# zai+lAVu(df)Qd|(5neDcHrzuNmn8v01_5Tf3Pu77YKLSJ(t=)1SO|Bd*aBCw5zF$Z z3KoXRf>mo85D+tzPTRW+W)cljgQ7OrDK)@lni8fo%T8#v3b_91t{2qRCt6#0Hv-X* z5*@;~!zdw?>1gNi48=G3-j+V5s}gSXf?6bjYsv9%|pdA~aS=h9|KUE9ZyM&L? zHoG0UTMZ1TMTVqX26;=##wM3Y<9oYbee?RR&DBRAIXrP^mQh0BTijTKVNzWp;rPUqrHb-J$>-wR8G#NR9DVHJ{VYj- z=lxr(r{)bq4?lDOk+{F64^|)sBY^(&EYk9d<_3@&FUX}aFX|Z?>U;jV(@#Er;|m+dp|~eD5fOHA5u)ShZAZZ6E6C9qAny>Fpor=95z$x2{f|dvAv2 zK7C`Ydrx&E$@-n8ja6Pr%$i9V5IHfLrIohVKmLyP*3yZs)CJ2S~Zvik>#AU1Edf^n1W!4kYyt=J}9H$Cw`fD z&=88qrlY)5Xd{GzwsC`OhVkCr0$>LQlz;%JTi139VG%%*7r#s*L{zPDXjhhPG0)*? zBdwq!lu;PunIU2T;CMkaF%a-{7#T$DS_w~rf@}m85BMQF+rnVLh!fjvAH_V#<=BS~ zLWaI11CnBrNuf_l%ueYpRM3q+oGH>k(P{`_4%*nTq9iD9T?HEn<$Ub2wWFxA1qej6 z(WICjfe*u0AS&4^>q@c3NQM%*YE>bI3&kxP#x~$M8LSbhJlaC7tZ2vqRsH!0fNHxm z!0Uj%XW|aiZ6@Cf^cliCHSh`Cy5e7RIqh23!_RX(O!vgyE^UdBXi$ENmlNLzS*5z# zzzR15pl$YV7BnsJPsalGzjhiL07LGy=fqD1y452`h(DD_*GR#kM+I6U(tX0Y^d5G#Ir;6Jm@C zRKh>N@#Ykog6bpT)N%P5$RozI?jfjf0Tg9}2Nj8(DMpEE4OuxsgV?L!V6KHVM92xu7F3=kQ^e9`e#gdC(_3Fg!rGNeB&rIB!;hoDk6uC|T<1)yRbj(4F zFfQ4?A->_xJ+HrM-@A9{i!UaA`Re)2jn+pW8hz^VgS_mH@reaH8vcT|h>0RT4Eoov zPyX`diwnzb<9pk`|Kh3M-mWjsUAuL2n%6EzWnO>FE7pw4s^Wut>Y~C{^Zk3 zGc${N?GLLiu#2$5U4~w=vaOZW3@cc2nMD`?AbMBlt@A6rqph{EJ{0u8DijGVBdVRG zC`dt0g=H!a1W=ZnfJ&mtr~uMpqF+MNgDxa(G?oF25@Y~YFcI9VB=4Sw1j0*D7?Id! z*1=Q-(I+@=kh4NmV+_+;NxY&01kuik+}fsIHp#zMaINWKc)#_J8pbiS!i*bToo&6{ zoxDwIWN4s|*DWC6`Z_TVx+y%!(Yy&uSlh~`$@U3BBlNMEyq4CJ1av}}sj)J!Ud~7q zzuBVb1A(~*1xacnq6w6D? zHI}Xu1UU|=PAPt2eqrH%{oj7`z^UE;@=qT9;KPetb=fn8dvau;tT6ZwKa!cVH+hqi z5WGFbW60R(Kv!4CJMUfl=+nuzwzcP;cKM)JJaovGQ|cjgWq9DDl7lgRthFFw9_g%wLH zfBGj+9Y3<06*vq(zKM|<6M>LnmHT8`O4;)In-|`A`wFi9M}PG2;RA!`&RxHJ<)&}m z?PBQlqhYb`L^_34!a&ZeNZJ=kO3JB1yS=~X=B0VAK}U`ci5G6!?pE-{R1kS6Xu#!{ zhP@z`$g0Lw=HqtK9Fa4btC?~jb3sL>Q_@(WV^dPbrW7Oab)4}NHBcZc#GO)bq-9hu zft4tD&=ADRBqGG79qRa!tZk(%}3&D>H2=KOEgI@*}( z>#nu;_jV662G)2@BG&WlkNPz5YpE%~Flt3#aS|amVJqtNbp`CFUZ=CDF^NAC_|?zE zKK!773Ae%-6|$5U0gyD~7dQZj0V&ux7Lg=qFJzs#sg@F%)a~K5O)V`eEA{2obw1S> zL7q;hYRcW9S{8YWt88fQZnzyP16W9mK@1cY(fgNBg1<`l5UHGUzm`R;jTG`PLsa$& zam$I50c0I?mPvTnfJ7%IsU({&3Yc1M>1=Q9>!~RK8tfhJ?->~Au65B5bb}j9B8{k+ zlyUCAX$C;|w^0+KX@UP@Eug@Mlb#6=yC-~2BzZ8BofrWDwTgZyD8XDUAn>V?x4{uH z_%k+q@WJ_i_{FW~pBX-RV(ikT307Z(OB8SrHa&>xD2RF=hl#sr+qG?SS{v@K8k{hn4t*dkQ*kbVQxv6wY;dWQ1W=I?eXLO&%Yl>vAW=5i z%9!I`LV0d0!F-hjyxzVNXrZtKAw>Wb`K?=Iu>g5Us?IsrEeyQ(Qlo1beRJ*4B64i*3Fr`3XB0-t~3i*WO z00{a@nnu)YD-B5jmSM3!aXZG47*U^kgW-jrZJ7#8CXvf|m~KlI5Y=H2#XjEZVS!v- zwAB^@2r0e6v-)HtOBSX9SRz8k{V#-di>O46q#qElRwq`8#L?WLszkVo#3WEpt)s8E zrT~aZpuz6mKA!gi&5QgpY=Z#zJZJ_$_cTwlvT1?;vMqq8vg6T44p{$6AvKwBow`!C z!vdN=dl`WQU@DO}i$d*x_R_0R99)xQ(`dwkhQWbeUNv<6#?0Tn^zrg)?evL$KB>XCpFqLSYgiH@N2aWMXgauY z^Y$-)^~Lpxje)-PAOG-y#ijMX`P&a#T5FG-8G81qql1I}a+H?d-0_CoyZ~8mDuVBq z=db_cFVD>{w(sB5{=)M|393H*>?)tV=j>$VQ_d37x_+5-TUl zEhq?^EX7=FX}S7Eee76AZJ-C6OAGjir6Di*6rZ4$HkuzIX`m_EB6z3-oijgkPbQUy zwyiJ?6{cp(cp*ax4@?a$qD!`*9s`iHajn_kZ4*qz#q1=Ej8ILKg~i37fR|Wi8Dh#p z#tS-vEP#!}hJZ(tKD-8cZGB~R1r&uu1R#{IuX`XAecDNjKRVhvT3fnmyv44qzqf~v zX7GTIZrAD6%t)l}E?Zz}p9=6TSVx{wUgNxyw9{a(Oj3=8i(tbM2LkxvbJ)8bF46%JL;WQtsDIiBe?njyac6c`|#47=iI;Vu$lH`#P&^5BP1eWn*$Fu7) zpbEk;V3T*NWI~}ZMbPIGhjl(Z-5o>y-6MlNgF`(7gY<&9ZSI$mgXPA`*!SGSyLk)j zo)&6WHZAa<%>v1vq(Ni{F>rqxq2>OZiSb&)t39S_N*9S|(V!LXClz}q3Ng8^poTo7 zi2T#$`v3layvnNp|C>KPec|GSiQ(_$xJ<_KBzob&6!h44+rx>I0JV{SQ)17GXTbO- z#^6BDN1t5dJ7QekKl{}9^G_dVVGuAVVSi=>Yo~ZZGXd-8zP$C*e|T?po|*E^@x8Sl z{qW)a`$l026k8AsE*h3n>}KZ{Ui!snpPifS>t1{Dh2x{6y%#S`T)#EN{S;iP3|5$n zVH7iJRf&zsHYOKDRP^{SlNscimbTum8|PNK`!{1xc&-&;<(zz6Y zoe#29K~N*nHV-aFvYxObVMB&0EDjRo3V^VKS{Q~&Qd1L(6RWddJm9~?!ZBBwD$ zEl5Byw2&C7tRRjh#5A}@Z7BlL4^3;6bFYczKfDOhU5~F{u_j29Fo~jZ^zgGD{NWWZ zyz8ZfyI|b^=wXSOg60r{H+jQ43udh7kd!j6Q{w_z)UFr*BP zBD-pCMrROYvxUvfI+}pgHcgJuE6kF$r%ZKvkzZUM2pVzKMVuv{0w5Tm6A!=7FD~gz zcH$V}6(quzf#QBRs%5tB4927MP- z5$n=J#*~>T$jMS`dTHtG2KxcS9ndLBdARv(YrtozcUGCJ* zLvBS*fw4pG)5A5i^gy!0A;AZLp?s_&pj{Az(hly|uHX5azq@qkK<7XE z&dGDvWUqrgFD+jI>@E`JMUe2<;|*%6izyXxYEWeuYJxO_+yV8g)S;nPKEinn)@b}ZFyPd?nGi7}f0K1|DvuLn#QN%zR z(sc~QAQ>$x6tfi(2%ux+ifw}CSoUsAYSdh~4bk!nUKA~U<}4KQ=EbfIPb1`jF!0o4cr1!@DKL-j;O7;-HAk!r*Gvt%en@QW9RfXrZvG zx8f_r!t|V3ExvXUT|Q06BM3~I$|7`iQHx1MA*&Efp__#0Cw9s@Z9UHAJMLu=W`Mj7 z2*K1*w^PiR)=Scp)ZW&h49+Z@ZL3;{MP4Vfa>7ulI;4*YY{;1!0CEz7NGSvnre=vG z827w-SP|df%|#S3&>)jQ-AoKIO$bo*nV^+P?68Lzzh(fmgK3&YO$+=^7T^?ZIDwO+ zu)Bx~`3s%T;X&@rOn%S)MiUawDD;u%Q@PxtsYFe&#hs|i{~BfN%LE%4<8mlu&2*$c zu-?w7CJ{?k7`J~Y^U?Zy;u+Q>f3!e>uqa5iR8=o5BuoyyDw;xMoz zEiC!y=xp1+e}pjN7r*}U;?;$|p7nq6M-Lu5x|bmaPZpzmNiTTkV~B)fje?+Qvu?ce z?)jH~@dYpCdFILSGbcxG+?>96c>-(j6c`~C_K*o}9@|5r*%YQ>HBv5XWO$}0LUI^N z55#UC=w4dhn7Ot-cD%#Sy;~L($I|lY3VkG|sAmJ%Im;@BNlg;|n8F+YnNZpkYDUHn ze1!-U=+0M^izLj%+&rozO3BO8N=HSUqMb?r=P2KS+7=)VLk8PTC_dB(XORRR>V~W~ zKQ+1qM*kxQV$Bb0fLQPgC9K7~2lGIxERt_%vJ8mOhjCi(#ADBM(Y21At`5F(;1xk? zB3ayHWnmUsNHL=#YDGT^t!=fCMrP9;SR%5Rd(zaDPaC(6R6q(*bKjLNE|F*sF{!Sa zPtZ}@D5{Aj2#brJX8?*y5I#wcXo?;~)6^Wv{l&}EbAtNa1 z<#UYysGXoPUv&sv+#6D;sWUrIT}3tJiov0!xi@sOIqp8SJ!l^WU#a#fj)$^8D+5Lu>ny!(*2(Uw`}E zThBjz1n0vAslAMKz)j&;BAUVT$kQjy@i;CJnEwkq2r3o%YnPx*P0r!v`G&^9eSJ4> zExh^e#HC9&#>V=3d*Y6m=Xh+apou1MlFLjMR3HQ07}3t3zwz(>`i+l1ojr4U>|gx& z!T!Fs_dmRRhD9a%r0%$c(cD`kO*Xh93?^GlP;4!$ zgbpA>DjyM+$omJQ(8_RvO)2mN1KR-B9<5c-*g6TyXN{E7s{!;iUoHO$NKqqKc9uqkR!N^me662G!@hYyteA(VR>Uy z;`l~fP1DVnWXL z@Ti)`UZ>NiCUaPA2s>YU#f*>bGTHZZ)`qaJ;Ke~SI{KWUZeR67Q4tWqc ztLVIsEj&tvpOen~>)7h6RvL@9Dkx2`yV}|nSKYZi!+J(mH1mM-TW2r5|KW|9x!F@E z_A;tL9u4G3h36D;hUjsvOqB|GS>jKB_WrM5y~-EF|M`zjJ$QQ0r=MN=^wTS7UaPeO zsW`Io(|Dqk2P2CoiWZDLGD21*p@$AF1ppeBT5CgHmp-0tuWbw;>BqW)l^`jR_hA}w zK^3i_DM(jZ@-)ht6UBmZN*TjY0Pmo+$#N78J~X3^37nd@P{4$~!p2evPO+KjeFdDm zf`FU^2-$<2OqJsvG0HF$D!NgK&v2h0=&>YO0L|iLk)4xdm_ZhFH>S+Rwt{c|(%-39 z)Na#w6jbLlmbQwR0-WJDWzbmnbD`<8gkGkbvy@miv2Y~-f>Kh!))a82lffz=!YC|T zsSiq}(KU1{NhD2xt@EZU>_OgLB5e$UIB^ap!75Z$6)<<(mbk(eaFT(kr=0>IX=jK~ z(_5LC-WaxZtfQ=q9Hq*0@Po+M6h?Ny`my##g^Sj95( zeu`oAeMm0}jrkkSc@lX+IQG%7;UDg-NOnYVN$gKa637tQ_*KdTI!uP}N77Co$;y5! z+?qxo$whPoL7>NW*WP$%qN{WB^vUswThly_jGM98S)XLLbVyZJDtqc|gHl}}WEOdN zZr&r`+}y(C)WYF|LoYmgobQ73==M+8yjPCMISvVhR;AlZQ>bx9&1Nle*KHT z{>cY-?#%z-`$xX}?UM-k-h1a4mzFzgQUMuvi^^k6orp?e3a<)0&EM1n(Q;meqS#snK)rlblD#Q`A{A?e?VeYAq) z(eM&u3ONp4sUb#HQt!7)!ZxA_$wZ{ce|>sEX$K03hrAN91X0r`Q;2IUa7nEr-JEPK zbr9P_<0u;Q%eA(T&EmGza425PTQW;&)v^gS2sbL^z@l&$Pg#JZ|TGy>byq$4eE=cct`NnxE~JCYKK3JYBrHB-|9O$+>|v;b$i z+$#YKj9*UBgR7@Q})inYH&JsWZ%<|-um@xH};J6jg1XV+?nG6a?e`;ho{Nz33tc! zeCB1sQJJ!0VGkCY0JKKJWEBU-xP19GpK<=y3nw3aX#BOeF8zNmU3mTMT4gbEU$GC`uK$|h?rGOTB#(8Le{O@ zEM%0&k=l)%tj6Hf)7QN?zcD}EK7O>dqqCDGEE;lU2I?UWERC*%(3cvGx|UxM2DJ=+ zF4_aQP{8po0K`s?T-4mCrsf%b9b1~Di4OjAC$-I18Kj6OR3tj;86ZJXL`=&idptN7 zIvWlY=_i|GGSOtK;73^{ND=;G$X4AT)#$5BfR)uW-Pz4cf(YxqGFt5bzBe8nZA%@J z=-WzUgsGn+5^pGuJ;qM$$|f|%&}zM>RL0)%uB0IXE!eoUht z#wKsnEhwdS4HXCi7jA~H);AUwSG&4aYrGsmGe8}kH3K>_y#P1 zFDU$tPSn=c`o{YF(&C~%#=u9cT5I~64X0}-V15)>E|+N@U4q*Eh6|P}PU6Tn+5Lp0 z;M`ZDh(SRykX()ih^X*^U8xv|MEKE!lgdOR=n5cwP{?iQ7-!)iMskgt|My?Nd1rF* zU;o+j=P%wQ&cN9ew8cYkN+EOPUGP;l7Q~!@W>Da2p0$nrecf|&t3Q3|li9hoBL};G z_`NfuqeH=hNu!IGCVuvdPbQ~ZjvnrL?x};UnYeiI*38^|ezBp(GiJ{iIWP?joGc!> zLMU<#vR0MIK)__JXes6p`iJ^HcyDrWwBz9MQI=|~(Tp0cFd~aR14}Nr`lqJh#!qg@ zG;SC~c{jBhoDn?@`f3$7s-6ng1vRua&WJ%awz7o+RkcEhdv7Zp)zW&*s8GH)_Lf@k zkR&M|bsQ*CcX*MiqFyU#Q7(0M#j{?2qfcSzrft#=Q*r2%K+$}R#HI`t=5k~kLLXoJ zV;Yg9S1_a5-POg*5{c1SE)6EDVl^?q;LbIN3ZkRN`gAz++9BOGhLKj(c^WC?4>_t< ztsjAwh zQECdQy+R2N@FPqIGvlkdonT^tqGYFs9f1tx@e5l zyakpm(cCvJ@J(63r>4(wowl6me9vckVSZ*|VRC+MZc#7y@O=CF+G?Gbzj3>#UT34^ zZ$E1Zv;1-CFy&6g^oKU`HF4(K>)0FE_sWYlWW*qQnB*zK zbr=d^0NA^y=dE{dPEOB0{^+5}JF^-}L@_*?*fiKL#Bfm}7}eq;_iN}7&=rZ8@>COD zEiSFh&Mwrt+Ma*r*w8@dyC2^8@RP~q<@u4}?uGe@$K3|lWgpKj7|KLB+h7DRt*iP5l06k5A`|#hP>NUOQCdYLA4S@gtT#y zb`3`6cv}L^B+D%z!W3@oO*Kp5ny;||Z;K2OzoRVFX%9(EM)4i8sC&~&dUX$oMpdH) zj@YJADq4#s6E*cg6_XTIk;nne%6B1QIo)H`YmDuV1s2w6ZkrbP#w?Id(t=*gCNn@w_0{Rcg~{0&q8lFB99&!5wb9psPvCRqoSiWO z;0|=2;&0^r<+{Ut+ZpL}ccKawh2IIENTJ+8c<}HyS%83~HWwtv8Ng8&_X>;}VXVIhQ~ElgEdLYgeyMzVpFN;=|4wUk>LI9%rbz zANa?J#&koBu|c+C1qy66@8R#NqCNx?gjJE9xHR9hcjVU1#pR{d=UzC%i)r{oNJp(* zfmglGgjij(2-1%6Ln64LOt&CwW<>)b86%5Xv59tO&j^i?++-lCQ%HscXkQ*=Lh_x= zS*cg!(v>LLB18d0<^5BYB~)9ASpA{!2{fioc!LhT0DE?KaW||@Z3xk1gqRMLRGM$n z=o!h)rE^XIW*s}L1KpfbZ9e>pdlATImKr+V+87ETUC5@FY;k8t0hx3Ql+0i!zEHKO z87B4xWRT63?rW&cu}v>Ki#5mE0PJ8W#XTxk6UlNR3fUc)2`Yz-Aq_aPce=wU>LN}@ zSA)7zh9z^~Bt-%)F&3qSC1Xk;8j<&9&&@9>%x%-lqIg@l-t0(^N)uTP5>}Zu1E8uk zn)#*$zF7-B}@B_`RqLg5osO!IiDPCTDtUyldU*{!fgTTSE2RaRv3 z&|n`xPJTxoK-<6!NR?EvbUmE?M)(nt(O;1QKKaIk4vFx0i9YNeI&<)g^Amsj(wG0s zU+m=@?-RFYm~NJnQfeTm0*WgvRPuFF2*b$6jg70PMvKm4e#LF1$DwM+YO>n!FC}+Q1lup49hqdRxJh5v;^y6eA#bP zRz=h>pj$(d$b<_4DY;*&b_Vbo>FUsisutgmqU#}hUmQm-YLUd%2-3Zk0Fh|N<@)Yv zB8EKy=0IILbCCsi;H1Wt>~4CgTqJ9wf4nTy%(y3yLj9f?ef*5wU>gK zTI0SM05#g9dDOJPH)#Q#c8rHyj_`(6Uf#w+y^XdFJ$=Rc1RgwRUY=_dVx8oJfDfnP z7)UtM?w_aEV&&kvOrK)^}S9N`_5@1Wxl*zT79;qrMIWn)?U*D zQV0>XS|X;Y7H&CNIFpl5>8NBS8Il5J;XQL9n?OX(%4wh4TIKFLAwP-|k5NR12PO2h zgzn6$DT6#wC_qW4hZ)K8RS7B#6|Mxh0?-;Y z9)g3G6$lEXtIRDbwt+&=H0$Lu!ECp*O7E2rGb!b^gi zsu4N;cev{^(U>2EXkcz()ddim0bYHJ*Prm=)AFO@4nsV&d;o_ zEO#v*$>^O*{4@ivnH-H~;AdjG0T2da#~reqBwtt#Sf>1JWI#iFF%Twd zKuM5EB=7S^`?4xQH0%N`;IdX#0BWN0K6I)$+w%ow2~X2#o66inWKoXw{)W729Af|} z;Ryn~lH8)GKmu85?G+kEiI2Q70Jy4!tnH(%D!IkvF_}mr-YCJtdR&LVKK?i*6=ks8 z-oZ~nJ!qCqZ$^1GCh6j`oi_oIB@#?3iH3`BaJ;Rp6K==>ub>NLv;t#HduJ;TVXv&Tudc1Gu*zMJYj4)I9tC(> z!Ja+yRBQqn45r6vi0sElnC-g_&?4i4@O_FL4t1xh>) zEq5vj`-B=+jZd9u;i_R|X#Ru(lFNkcH6s)Pm2Ur0x-B{EMXL>-#p4NXCh9cOi<9Qx zF#giYN_}k=0s4D;yZpfnI#R6ukx^l;ZWK{=Zt@BjM?X98t$-*i(bP_%hBDOz2Z~9bFopcc2E|uRU%vSlD=x=sJHzp@}l@x?;de7B|;JySxa#dQiPK)DfHPY z*Op@;S=2J9+5+*_4<%43kM!41B}h)2uCCM<7hAXs#-m|;BSn`JTG>s#G6;e#s;Llb4cNQINuf2 z_?*YjM+{^Kqf^{~-Wy3^{IzJhBI<}2RIQ(DbY&FShLD5El8cE%6>csJF}QE=y%!&x zntA8{{SP1h&wue9R>mwWEOqEJVdh_M5~;G_YvzP+5%7Bmq6vc4Iyc>z{*i15XR`#~ zP$Tl8Ug-EWd6wX66HVptB57VN(t7#o;^70myLXSEK4Yxl9HvBUDUJy15uG``p00jY zcn||EEG;dqt`HtdRDSXDCz;(v($9mR+h146Oah?^a9#{6oJgrDbdVZM2EYtJ*cRGJ z1~>s5Naa=qVH=fM`m)kRW$l&aIlrYHhu{qHB+jVWRl(~^(ok@mLnBN1(a7- zJ&zq0WsMM-yC)kE1T4PJ%L925-p^HwTspIs>#H*@^P2DJ@hgH@ZB1X&G>f?KFZz*F zrqoZOg&aGvH+H2WsaYv;*7})j18vnslSL-xM;!lXMl-6#J)xpagBhv^1szCArA*oR zDxj!tPeB%0eui&a0g$t8bwADSj8e{srsY!EU1kd!oRWa7?@iCDI6ez3s(I+?^B zV#ux_l9#oRHaB>{XJKKPV*GQcCEb;>z$y*3bIDg`41#b>myGCcw(Q+I`q{Z@9s+yp z(IYIErHnY%R#IacO3|VUb)QS-V}6KfDjq=U>FMg>NhCh{stQ`)tA5PGW&~fckC2=o zmy!;xN8SMx`-K$VGv;%ZBQEUOpvAtAzLz>Lie5342|`IO+gV6dRL67mJ7hijp<_2ejuK z0*yHUt^wkyKORrMT%dBL23cGZ5^k$&04xq{t2ko5P5qdyd8bpXfDAo2%nDUAam`ee zNQ4reT*y?=+L{64-icO|zDczL*2iKbnf1J??jLGRyyo4DS0UI)fHrVx20(=so0+Bs zzA+1=lgtiuxn7@NURqdQUiRWoPE)b5qvzHbBPCl3dd$^4EM%*I1KJTylr$r>PDmbA1;0F?b{g%V z?Ut-bZz(GeZS63RdKKbvzm8iuR#rkN6j95Q@m3ibBK>rf^NpF{5hM&%GTkXBI@knA zb!nNbV5ge?MwfM(JSfgTRz~Z?rK@$Fo1N|L8shM7 za<0jBq?1*S2)R^9j>tnUF{kjw0!T>gol`88{%{%OA|y)VWd%M{y6-+S5TM3yF0)Ra zIPm1dv%h)c%8?_Z2M>&0y*|Ns@0s(8qK$;@Xd8=kRBFV5q?H%b*PXB$cEfmV`A2t3 z!p&|cMTx4kGtIlJS@0{gDocVy>#q9B#?a8f^6KWDsr5(CjCR&|?tMe=p^Pz!#^9nI zZW>?p0umZh>!9^TBE6>=JrIOL{W?4PdTRrHU9*b|Q?qk(^9wuz&UBEz<;WPUD^}?Y zIU*vVsp%+JEs+F8Hi$wBjqa9JtRp9tg-}f@s~)HPU5a;rR8b5z!ikP~7ch!T=FUkM zYlJFl5*I4#LLEnm6<{M#Q^2Dd1}gyBrj`cW@Y?{BKy1JGtCW9!nj}(WnJhxYtO!U? z77(pN3Jz*8Iu9?{)MO$H@-zqAk!w_w5Lk$p_21GW0v469hE^!?gyHh)`rN{Dt-IF6 zJx{$4lW#7QbnRh6NwH=CB-1rh(*pk~EWk;IBj%m}QBIev&u7>6tx1f)P@7E>!WvO(NnvRRPeDNn8@yyX=zJ zh+3H7tiS!Olkb0YO zM20O%Uw?|hFoGAAus)aNTAhs0SqqPSvMBT%{UAFJg#jRR>y;Ta?oC;C z^9yvevL{q$t3X)?Sc4YPN@|a*1f83@6}_=aC)@1OwTDq8E{rsBg^0GKSV>|D!7nIF z8keVx?ss!*6MzuaBRfr0nnd6^fh#bQm^p>S5>a1(L9nC*gc3x+<*mg`2PvOPWf1SB zkeJ;?k_21SqH|^!=V4N~005zoxq(p}B(-*^*|Dgw0`wK)OIN~t$x!7e+)UXPm0>Mt z2%BN8sas9g6|^EZ%U4!5=H`~T|Ev(Gv&*qCk!5r$h=@Y-7TAuh(=2RS;CHkDXP2IH zVF4^RzxZ+0sWUUqU7x&U`O~ccoF8MSA|O?yEtT>L`YTdCz-Q)C?@d5MvT$7zJGPNb zs_-NQJ^32BkZ>^>(YQfBwk3QuCtl1Ux3!->x#yMFFWkB{^{wYm-o725$Own#Z53yS zJVZQZAcb5Zqn?)g5IE|F1-TRhsY?G0HtQSpm3nZu2o<7IMarm_Uv`}VAx`&{2o6G& zMdU;G?;Cyh{aZvZ&pvfj7WPYK^`tu?32HO5)1egxnn>tmiidTVe29^cytVNmPDWK= z{6aQDA`xW(riBQD_!3-CR~H0OgsF&-HUx$ui>Z>w&6(d8ymwz{XhP}(SP{)rO(gZ;JfkXE?n1R>Q&FyfK)vYahNd- zaTUlPlRjJkV-^M{P5eL|ffNx4%+ln$9EnV!yp;=bRSr3y)DToI+Om&f)`11@VcEZL z?8>$I#pTxTJinLMH6aIgwP-+wQ{CrkWv+)eI(gI1IL7phA|9&HhUboI2^GWZjfkhM*rt7AZ$RNNkNM6nJcn z8$?sN@yRE$00g9PDyf2=O1FbmB~@RvoGKJ6=ocI-bQ`iEm}QjSnO^KmYE>N9Wx#3$ zd5VpccU7=0vSjrGOKnC2Zq(O!U}9~4VWqoksi(WMtJc=xe!!_|GwB3t20&Y^-aKqt z;CHux{3qut^A}vv@lrD)p>+BtC!w<&UrqS1zRSyd>&z#tw=r3t{Io~EsvB`$gW|TN z)0tW^Y)Ih~sV%&PJ(&pYm{csWa<#@2yXUm6c$o@50Rf@PqYoeZ@Z+05{n`0H{~!7W z`+KHl=b7h_T=s+6Z<~15KrWvGg+BTm0Yun(sZYM)g#bvb5zWbaa58~1lK`|6kQEn{ z_=W&F;6Lh}*}gFv+H>n|V4#N>=-R~k!w>Y2jtu!Ko!3>WbrkbxfwPtZX(~t`99Pn3 zO9)XlPQb}w5ZCmwxa^jsk!^jczuCeQx}E)a7}Qq)3do#M*Om2RRYxurrd5-jC5sNR1A9;B zSUY%0LYK*y1f4`cMoo0W8h&#O?+>C7Gcl3JBtf)b@W@OHF&j++eN^DOM7#v6jjYcm zsqZ6CLoQ?U+z_L_y1p>K)ZV(uj4X?Q_=HYphfXAPRD{Vor@#ESf0?*9cTEd4E%41) zK!X!^^7-mJABS38UDep8Q<^g`IYjuxDe6H$1E&U5-CY4!u3Z2XcN2$!;>xWXdyUdP zMYRf@_2vIPl7b0Ng+IBLNPz;3z>u8u(3t~oy?f#Og{c=`I6ghI z0KCWsH_zLRf`S z5kRKPhKf|1{jJ#Y??dHxOy+`)L^%8Qj=ufg_0i$>Cm%n?ybkxa^gI`LxH|PVOWp8d z^(=4P*V|^}rw6_iA$iC!`4oy2>>|TfCV`jj%pEbNmwLOqSvlA&ykrpN1yUP#<(Q_1o0q|05sj=m16T!N z(tn_!Q%nxdv*R7GN8bk~<{Y=RRStolG`Yvhf%F62U(h5w?U9>}Cw$KP(#a5C~?5e0sz}ZR(vVymrNI^{*A&Q{8 zl4dwLh*RDzR1yk0sY)27cqI!}>lASB6?L;HiRiE~fgxg$$UTm%$xAemYE&)NWg-Sh z2RcQJncCJ%=P);?vEB@1vhHQgH9*;X&3)4X-;@P7TlsN4H@~M7B^32RIbqy|O^}jL z@+cHg_$G$o!v_Xle)Agd%X#q3INwQiFqgm$24PtS#~716vC3zapeH@;6+@ASN-QN| zh2mY3jUj_O77BoDjxdmc5&(>%#<)^R75v-qu~$hYacH}!h;eY=zTr>L-C0;(|G{@o z^9mn@I~`u-Q)_3rPe+77Ec9{cquXAJdxDKx-bVJJgcn=w(%hZ12486oZzA&Co*_=A^A*R1pWRkfz&{&??p9 zRt!0=3ltkN11dB~1+Fdfk;!t1QbEgrnHOV~Y3bAmAhXJ63Wm%4*z4zGG6XJh$WDFH zDT!$qlyQHD0&`6m%QSOCfU5*hFea>~Q(|5PC4z-UNMC@-*g8-OOXaO9_}9k!h;rc0 zPhpM`wN**PtEv(s3r0EYmKIld#e=ii|phtmDR@ zSwp?_zSrQ?MywLvpO-g=7mw0 zZ-ns{kTu_1VJVP30OzkxWlq&JCB#7#$jd^CctM%QWM?WYKn>(-`vMX4pK#^Wgd460 zN1VxsnH*eDR<0ohd=ypdxN)_A-|%;y+xx~l)BE@K9T*?GcKtS2TtN$X&ERX+ho5GB zxaSp5c;TU#Eo1P38W5ssE#c1r!XypjILnnvflk$u$k~t^WR;{;$rs?6tUzR*wq2{M zYkS6qre{{CrZ;~0y^}lx&)9{>)EMR)UXg);2Q%jXG(Pes-0M{363t$ zrK+KBjmy&h9&U?`5^vp}o|#`-SzcRHaG;lcgUDS8TP0bal`FCpBt63+!bqrI1}OH` zLspv75LUtr?t)A-$lW`Meo8`dcc~Ov9@kqL)f5$U4Hz*n@~aU{tHon76}p?Bg^UCHzgpk z3+yUJt`r@p%W<<&VjKKmb{94k&jcNYp%-5`bLsM{Fa7GmzxlK0=H`0l7nTSgpd>YU z9G}pKEA6#d>*ICK4t+qhLe?wurYN{tG7BDZ*#Jqz*je(Vno6vJ!Az{Okt$NmsZgCv z3)4}9tj8G|eEsb&o_cKm(L?*-&R5$UlhRoJjEOGhEop8=wNgXU7-R;PUCRvwA9jjp zD8gAvNn$MH;H+uuO`cO>1r<|DwfTiR)3XGL>%J`4^YCgKji2nG=FmzL8=A3D^dNfB z(o!VW9x*+nyE-r=E)C|Q@b!`{waui~7F&t_&wBBrkVbrT^%s?R`kJypZ6sn87_ep6Nkto+B zHhCf`PBgwWx3fZD1+S(kHMkGyX zKvEP}fTRczK(AF@RbAUW&+pAV_uN}my#bUIF*obhIe9YQJu}~YZ=O8o7KvbY6?1El z5RH4lv=>#7j83X|z!Ed|n#hyx!DT1gYqUy4848Zf2q>8_mJS8{6-6>skslu$DMQ!; zd|TbMPKx(ENFkecG1%qpsk>{JHYxyGIkCt?@$h7@%=Z9&4{Sdt`TuhZEH3d_kN3YW zUuF}uul3L$nrf_b(T1k(E;FQcECPA!-Su-^a$tgV^dUZXwz?N`4jbI>Y>H1zb+75{ zba2cZ99weA&uxM3;<=0))XmR$J;;(Ce(<(G{q&1p`^Ky9|A9x(p63Uc^uKQK;k`%M z;*;GzgoQ3n^U1e&Dao6^Q3}sorx;6N8PMt$7!?XLNm^H5Oqtn3k_6jF@uM0C6a-=E z$#*>XhkyJvc1k|~k!QFk<(;oQJ?k0}F)6D$E|WP+D5>cnn@}ILFk}EyF##1PGn&^) zp;*OUds9rK?E3aZc=F<(-QB>3kWB#w@Ln>@LQzsqQjsK7J){Q_M>lvXGqpCc4@%vH z0W~D*l4F;XtTghmasuTtJS9N=*hBb2^$~_Me?db zj+6+b9HP`m3M4BeoxF$GN11uK`TFGzgqjMoM2JR09%ANBs|ZSW255Xa20nzEmWXsP zEG>||GaYLIof-59sSKrAq&awy#th;?AYkm)N2akLM*=AbIw(F}B1=JhDb1sn3}bF& zukuJ(+Hf8KUB!s=s<{Pj#sWk;xq5Q-p1V$b_AkyY zENnge$lb5JdJaGqGl+it9Rinsyh+p6e~gX{0p&1=oy$6uCIZA4V;e$*t@KmbWZK~#!=4uBKcY;Em6`>sd+^7Ajh{L1<-|C9IM zddq3P{uB3Prwv$8$;4FBG)BytavA8Cy*M@xu0Vb)uW1iL`HQS62NumDv!M|W#Azbl z2Ebly_H6od)-Eat0u8BAQdG-mrDr08kdc|7l(fmvYf`5F)Iuac9?TU9H3{M2(gq%- zRE|4yYAYNZff-VeCR7DW+l5^*9m6YJK$xvUlFQhlj8&AVpw=ZVjb!zZyaCAu)WnW
)OP+TEoA(!kMi6Zm>x6OtQ!!lux7yMVuV}^eYP-vf#@`IF> zQHo}uDo~HS@S5KWBbqqD^c`{QpgGsdjMH$7T zSHmdG0l(9!GsV{UUomK-Ugg8FfehEe&!!S_R6|=�I*sMH@QHEDf(ql`);jlqV0D z`K|bD?DN$Xhau0)<`$S+;N~sBWY5CS6;@sI3-Cp#d8-jsoX+5ca5~%@V!y{S&qFQk z;B%dO1=h`Z${%@FOj6vCL3FSSQ^cG+nwJ=;i!han=2Q_EIImEFUQJ>aHM05c3t@v5 zSa?W{b8|lRjo0a!Dddqy?|nbcuY;O=Ceuk<(H_(jG*5e)nEv5k)j$lSwnjn5_}0r)*lb z(3B3MqJ>K5poVpk~sQ@`ZcUcfD2W4@JMJimPEiERgoRf1AYsp2){`r$Ihqs{m|pzc>P>JSl-c3u4< z)B?B?aKQ>jN<}q@N{M32$1*FDvrOB18Kvw@jR1u$R|rvgTvDM&;fA7G7qK#xq>HS@ zs)ELH^h3%~p~HZ4vgqCdSjt65ae>as%`Y~#mNOnzEaUij2dz1KQhcA&Cq>Rk+6C?Un zU`>5;%~VA6L;O^GW$GKK1KsHu2#0Z;Z;tx-7ItKGH;(`lhx&}88nGU-k}5euU*DoQ zQ>o}Qu*j$baYCC&go z->AbyZCuJ2Tz0cVS)=4A&pDWIkSjjW`F$ucqb{+LI%pSfOZdsIDl**t_uisMs=S-Q zM>XF0)PsNe=P%xJYVr9Wf0yOFj}lA!1-Lw_@qzgpPNiHIQ|XXWwornv-6NAt;u6IU zfUY~$xlOpu9Lx&G{^`}#yYIa7uG??F<>cyd6xiKaa#JtAtK~KnK2awp8EPX=8iZ}p zz{f!DDoXMO$AUlT0R%;5&{Ua5I%y=^ZK|CLb!JU7i;s9CDvkh8N(pQZ08F>xipG z`IUNBgZ38OJiE5Jwzgsabvvy}h|)VQm)A_qtjeg6aT9ecY<~nEd8`ql8DNTR({8G4 zd=dQ;<4K|=0n+QHAg#1wmZatB^HdgyXv*%n64}^@E5S|a#vP9OLD`OTBWGJC!eN+3 zp6mK_j&<3E3V5&Tg^CvfEkjInVvQ=;-n-|oXYh;Fybh%1vlG0$9cPZ?&De&4=Qy?Uof*}Z z#TVf#raWGzff0)%vhg-!MCY8$F&2{ab6hv4AF4=|*Qz1#5dFNZ-Ja^ljx2&CA=ZUJwI^k7X93fZJTHOK>V6wx^=WK+|8b!a{lNJ(T zxNey$qP)J@E-dh*-qTM#{ME0&_T964KmQM(As}FD5(Y1J8Z~@x_He-bh*hE@f;Xge z_ezR|+uDrtG%_$FyL{+g6vZWO0pSF{Uw&fc`{PHY;5zgR)*3%06Nr|^TN3WZrlPohXuaMB?91^ zyF*fspMe|ScjOSxAjR=Ijq$Tk{y^BaPlT~h>pNu_xN$OtubYT>DiO=^>B3SyxHD?U z`K#yywI-t^L@Ld17kJN;-@b4`i2iWq6hBeF!rmZaAl`1m4<7k5b54KWHWQwu3tL|FAz3XO zirn7hl&6~FSxPMHI*{9AxL;|*8kqRn0uamB?OE*mRj=iaOw_4m>OCF+ZphQ+2Ya=V zFrdnoI5;h9|Id2wQ_c!1FzK36b^+K0tqQH==Ofl1Y z4&E@_t5!>p<49pYlEaBRg`=v;S^*nm!G(&th{~=DUJ3iyqxb*j?|kWz2UdRIxkpi| zqMr~h>Oz)7HuEMW1++7$Xe2XJ>S7#X4inZ(aKym{K<JJBwASxsuDoKEO8-WUfeD`blqtNtU1>WPCJGFf&H%HI!bp zn}vGmsBjZBBc#6MFez=hk}+ZhrM0L9ngxlYN)>BKr3KgaZLAB*=x2!${W7_h@g zwA#rDc)LlP(;ZTjxo9e%)whtgTHV#$ZXTFQq?l)<_Cz5j`)-twg{tbO%M zuRQeFTh6|A(XA%|kcldJG2vVy2^vbBa+lC7mSm0`JdaY$ z2ZgQ8-5>hF$N%t8zI^H8`Y->|hg?6(LQ6+$C|qWe9Z`5QvWSgf&M|HMY7o~i-bOz< zZbJj28DJ=5L&{R>uri?=dw5osj^DC+>dfg|UU}`c3zyb6uk5f_h%HP+pX_xoegYp{ z@2z-e!Dfuvv35OSzqFqZ_aL{_b!V0z`$Sxu#$c!io! z8z8K(N2j;+(t@tQC=x~nbKVNZaG1fKlWv=SY8U8K%uxuD25ANLQjeUrC*4^Ed7{pZ z;gl>j6%?;{hL@n>LyH{aS4wu)_SWs@`+G#6j7&fQkx{qOfZnya+F9Di7X0GCD{3Ip zVIel;d)eeXSX;2kh@Ai=H$ZWvNe)mP0F*%>{!0t(M4{zJg{Rs$z~MD@2%Xlbjozrf z=ne&3lF~RsnHklpx?X$`rq@iJ4|25Er;${Le=V`dceAaX{Y&dx^A(^e^UW{j7Pxr} zu>G0eJ>?e-{kF)IYlH9NHSaGZkOAA*sslR7ZLlo@h3ODm{h<+ zjZ%aop#~H1o%h`Kz}n`EU)#L%Et_XWjEe-u$X4Vb7UuF(UOWlG1RaI6A&fF zLCPgICuVJdQ{qW_!zt=WiXwlrj90Ea{`lKoeSQ7wFRuOk&pdVV)GDi4>?95jB*vJH zR2j1X-h`vV$ObJqIvI1UTOqP{dX6!5+1Q)|uL|a+)I^`h=?uVAmn=$ ze)in?OY4`pA%<~iG=F2vTNu8jdBGUC zx*p5ePDiAwP-g&2j4>okoaB{9;dpCvLSGcA5;_7kkWXiDRyI>@XnDv}Iw*+cc;7_z zs8FQ|xZP+|&?(!zZU_ak%p*)4>xSUo#wNu0t`E)6-FaDM}W zf@%XSZ`Rak*2U4s0X{gYDfz<;K8|LzN4E_K`RzH`H>Om(3dwTg6#0o1;vbzviiwT} z8P(Jf9u>4~vF?13#zw2u3r9#44dRcA%Z^CfP_S^K=PYAyZtctipebX`FXk4wX$vs4 zxDDjyUr4Z?kQvB9!n7e`cTseh)=mq3z&@++7 zua@r^T*wp>0*M@;~&Pja&u8 zT|V^KJ+Hs=^)I~e+WSBFFh8fxnt$Y*cxq(`dL7Kyf=(!S7tmE2f0=9N$_~?>AyiUo ztePNJu8zu-f9Dow#;vWLyYD`;y1M$?zx$P^-*MZMPrME3D-a1}qJV3**_g!*<`Gzd zkj0K-LK9~jS8PlP@3?#AY>HiNz&Q6juC7JFpahu{M(*=a*j=~Xa_j2KrHzfV{Eir} zANT#yEC=}zH(QAk8$ylPDD<7)6oJGYuXd3sEi;9)8IJ}HRgG)iXfLXZSGKVa0Vj~Om~6;gyiM=l)~@~DF_UQbFC zmQpFD4oK9uS6UdjnAZltK3dyDog+br3u$1=?sT`G1I&QnjlygRYV9f5I01{wQzcw< zmS$-k?tj%9olJ|lT2`kR25=1`Ie0SrQeqKju6km=Lm_sF)RzR${2Czib2vRV{t^UF5>G$Tp1$Na|nODv& za1{&0@3movgCSU1+u+A9HZzY^AQ+i#(qNp&VKMs?S1^;YKJGh67J1+q zucaRl}5HYMoW4VZ(R`t=II$iW)s_{n7;?v*v;HN+Joxl9tx1M|M;n!Y09~36?c&Cn7bm|Ii z(bo^bj(OE50J;)GZ~<`fwxVz%3FS#BUZtuNrBQ~Gg~uMb@3%kkSGV1I>|-DOzEa#{ z93)mUO^lPvH~SE^XawR$cop?%n(4^r)?JRm_DvtujHZ?(u^vNIgMqaIAu95+Gy3%D z)ibx8I(z=o*>e}TB?gdo^EH7gN8CVb8LCdELwf=ug!n|s(Pfzj`x*nmiz@EM8I&1> zXtKyykyY48rU@RaMnBs}UTJS3h6Yo6HyVXh=mW_GoTw^=g^wU;qZ$qkzsE~a#f+52 ziYUdrQAb5<&Mfnb)DwQm=4%JgI#x96d7u0|?)Fgu}rIet_Dp^EtfC_6} z<9dJz=r*o~D^3;|D~Ui^!)w&0Paz7GOpJG*sb1gMAYRE#T|UC$r^{&WpbBg3P4f$!2L~=yP6@am z_t~(}5(m3@Jk;>W4D4y_nXCApMu;llcO6MzBh z>L`(cKmr7mHt6w1J{Fi3j&TdD<{LqaEhuD5-O5x2R0{+(yqV*Q5}UR8$%_}h^xd_! zonQXPL_ch;Vfn``AS7w3kJNg;N{UdU`vy-i3Jc|qWir*|xpXc`95SUl_u6^tY%?0Z zu;9jo8=E=pis6O!aj%B2_;nEQ~?$bIr*z#&!% zgCeZL0)tIo^W^U>wMVKWMIdExBIa2kEkvS#lubz2fcc= z_12Zsx18L#yx~*vI$x-^>AWHxj?CN!e#8Q8i;q;8XeciuOzs(lQCA}8GIKMwrUHpy zleqVuJI+7FUib4c0*K@o*V66lOz6)N;tF*?R3lD+-QVDaHCO#sk%S-cs@mT5y#)Gmnj zQad)&p$63aXsBo_xIs|RuKUoy>!fPr66o0Ma*%vW10%*p@ewVpli=HCD&q&CXhzC` zL?=~e8{@hX_yeR!So8>z*F|m&)D#JMX{Jj~`N@>ppR|3xON{a7`MCw=7PtuuFqqsN zLjbgcqjYTH!=Zx{aj5CwhB1FQ`R)SZr2-NJ--gGM3ogmW;SC5V29}S`Qty$Y91ge< z$9bF}5m?U9b?8$V*CrcbDB(|F$>_|HV=+J{LsDs`ro|p_D9dW@43e*%+x!Jswp*v(`|9F9W~UTT%k~M zh}o-d=4iW)Qt2@&kR>dtjoVU-EGZ-qQ%>yDT2Hn8V4MJyY%m}`ro`vu1zlLY=PkGM zllHHlz3}?^i}uX)mb4+^l}j`3-U2#iMN=~Jl&wjba_n;Es)|Z9Ew81zT_#FG#bSWF z>Cy+ZVftDOoYA3Ps1kVcS(%a!_$7~427r?rS80?4Od>>|5VRepQ%Llp)V9{@`CjKa z>jW?~0>VsoJrs=iTEk=m66K`96{R`{r9Abyx4X`(uuh-aJ9%P7DGOQHFbh5hFG`3i z;V0hwd0^J#Vk_)owKi*q0=vesu?SY0LgciiJs2CZh?T(;gGD?6R4b@mSlLu#am>JS zl_(`637Rz;aIb)nlK0f|Az!pwO?WkdJ8&#JTy&u*C@K@W2|YXDq&OvB*1!D9jF@#w zssP#~65_~0Huj(20_!H7pXV01DGM;*aG?D5#bw^Eh0DlyWjzPf9E_e1j>ND^RSnmG zlXbF79mq}<-f-C8Uhv(}z8BG7rp8?sqHd~a<3i;#y0a@X*fvuJjQ4WCD_;4m1CutKbsK1+HCL%C%SFQAhpY0^6AO-us@1 ze(yhjncr&r=ubQ?c3(@IMJ)R^?Mg@0k0=8y)m1i>R0eoHl_mnmK&{-;)`Eg@sg4|( z)NAThaU&i!?Kp`=&1kAQ&{+y#0AB_$BU`$jy^lH1Kz5gH>!(j1U%vOwm6OY_pFO|E zPXO!?;_yVF2tkn`upmfKFDA0+tl1@BlIuB+V_nk#sbh=gG+fj;hbFed&>EkD z7o&ruIP~FF)iB$eBpWEe#{{DpY1+^g$_Wz6n?3*Ek=^ z$y;`OL9l@W_c1d43+qfVxPwD^6&GO&uDf;1!$`Nw0tx#u^H@7SWR_pG;MG3a=ZO=K z4=i3Hl>?P?V?x2r(9jFXRRZeCiO3JC&+}M8lsRzIMjaOfNZR?+W{5kGcV803} znjz0kB0FJ@<7laVNihbZ-O`zJLrgi(!ilvVtMTUV$7!4+`{Ts zb?ldss<1t_ly2%$5E=DOKkAhoX1In%5(J2pa|K?=wVRTS_kc0VG~@!Oyt;^)5s=hc z!;eaj&Z@Fabug8Zb^#y~yLOoNy=;PIq)FG0PveUoz7*tn0MzX@KhG_2gBHjz#z`z* z+1cXxFWv#|Z3c*Rr=hR8!3513(}kz6%EZKo3n>!O07 z5O8`UQHTp>k%t|fJl~#YytpxiXV%B-Q#k5f;(kVwHN~oAq@|>#iw%^Vda(H;EiEtd z{yx{S7MI@r%p>Q{ec}K4%y<6zfAat(7cN{{InGXG;S@_@L%J?4YN?43!XaG@%R3h5 z22uzR*xKB_@4mNi|Le~_{k0!?-~DfU+uh7LOUnW~KdI>9N#^{kM$znN!JB|F4=~-& z3)u4m)vAR^f)yc#s+OU^naS`lkq$P={RdafxQ)SF+)cw2i^PegkWC|d%Z6#z`BtOV z$1?#!+M8Rb$NUM0<4erVubsPa{^A>+FrERhbCtmW{t zB$v4jZhX0#2NofbHHnx=+0WF1x^o866Ob!heK2rc702 z_cTdIkm>*uD8oi{ijhH;OJoVEK0Dq_>2wq*=R5%FHk_a57PwIh;EOY^*eJ8U$GF=xL^&fSjeW;exx^!sU&zR>Z$kclyDx7f z^kI*4-e~9sSKVIs9YT+NkzC?#su0&-pxprhPf;XH5i^!E^wKe20KKw&e1-TY4|6^L z;b;G^-}uZYKKX@@|NQs+F1Vl#tOjZ`N-0d&`5;VlogD{~e9t?vy7I)^@Bcr4^|SZh zwellB{7$f0_2?i@5<`BR=}fBiW*ae0S{5p6lrfwlVLD?k3T3LH{40A-gfB9xk6f6_ z`+&f5gfuwel|$r%RK-B80?<}&G;E}jAc9pSR#SxKD{n9WJaOXq-FMxwdUEyka~Ihh z?fuR)7M$RT4!-YjnIE)k(d ztXE|!axC3p&@I1CWN@wWblA!=KQK!)$9fo{m0ZHZ0LwMqKvHA{6kyx}P0d=mO>9)x z{iwNmetf1EQ3EN@va77dtg0#-=ocUn}=9aqx@g>dj# za!8>6Ps4OpDee5GL58al)5Gn79(JpQo47Vp0AnSd7#JwcGjj{fEpS5?aJoBojQd3_ z|M;~pPK5D>BXB|(`IPG?J9Z&8xTS+L;#Vqnc_KZ*1n~sESbtN#^P1!t?U3Q?pcqUd zI_g~>Zok6QT|_@V;#JE&_&K@7Ger#<9Oi>83$cP$S7!qknMycja>F(5B$yW6y~GNH zdzhHynMxLKyY=)he(c%b_^mH|=5t^D!S8?ki(h()A9#Ru^p*IbsmT%}M+Bk5obyD` zUc!E+-S@xui9h+%udS>s{n9^rAFxi?*U>a(cHkk!B$wH1R;IyID^8`%9{r-9osfF! z<`gg%6qO5G$oBE}SKfSNM{=4aDv^Bc^C?&mT%-Y|-J$@%66mykAwgwFSEgUKnm~QW zdppKLJhgq-Tkg1cY5meVZwtB-d-y&A?kZ`Y2-aWlsl*f3PqcN^lqr(`bntN(kLzx}QehFRR2h|NC*xQluuAlL*`K1A0HxQ42{~}Yw z7Fnk9$Gf(!aJP$vD!E_uhBUo!@!oEZ{1l2uG$ewJHTp z8Jf`x3uJ9U)3BoT_P4+Fo8LbFjc;Cg{vSNdT`=Y_r_bw4&KMHX%yQ}f!ESE7+I&K< zx4w21#hJTmYYw+8tx`m7xSjxXOGutGCvemZJP?n>Hi~F2T;a}b>Y~{i00O#tDIVkH zwn%LWDbWv$I@IwEn8>3hXPO%muw9oO9ZQ#amYZjh+GBc#dRbm!!c-P`ffj=j{m3_s zBZtU@eVPg>vPCM9Bc?)>gfzV4@tWZUV9j`-Y#pzT#-9}2Wt%}4c3t$sr#BTuT^7Zx^ z!5o@xT`+aXI-xvJJQVHb3d;9T;GaPamBb`O4tQ0*uM-31?h@0Y z-U$~2+vdDvnG0P3vw%;y5Tmh$$ZgKNu947(r2ssG%L{mVT(e$E*6~m%z(iV13XPCLNfuq>A@m{KIk7_Yn=QtQQ1l7z;^R5(5IoZB&|*w;_V#O)-j*8XIQ19DdQl zcJ>{c*t52tY1Fc-klZt+tFSY_!XPKxEJ;8~I?w=(Kytt2kHra=C}^>b&FxET>)e-V z!LAZ!g7?J7ex}$Zuc*$*hDgy1Ih!T{O7BpS%szz;oO%%p6Nn-WaW#UlAjI?fdpw&@ zK;-KN8$nFMKVq0ExA#L5lP=Eu#gzuw`v6j(dAJ2M6rx2{xgxthCt{D{wd4(T5Qi1zD`dGiRoo}LyTF0)#G-DV~5GOG+YAGC#Z)?FB7mZm5nL~3@%wfJfZ6S|?Eid!R z5rBzg^t~|C>A~F*4hGW)f&uSK8d>$(+}bem;Q=7OZVP89;=C5{E&^gxnYhYw{v{^@ zLb#B_ij$MH_qoUz=&-e!B_9GHBOtc>6ci-j03uSf1Q8N+iY0*))u&FK{K=0z{vZF~ zJD>fFufOB5`~Lc?-#)Q=obq^Mz=NX%;yQ0yC22|JXhl*PAEo$7w(o!M+duocZ(iP9 z{P@ql!{7mQF*-s-XhbVdU6h<0L-X1P$SP6NgjB~Xx%*YMqy|9Nag}|*hNCJ`!r~GE zkWVfjt7$*l+XmQ^m*?&5<}o6F#=)kl1(90pQGUXoY~v-)Wfov9!tcZs=2uRQd$p?E z#9r86VnvaAmrIN5moIM+&|B&KO6}n$*Z($G3nW%guSU~Kh<^C6qK9D`B1zIa(v$~;@sc6<=82|7O1$tfofdZ zK%*uoT2qGh4oUbwl@2YGDNwT*P$@w?+K#QI27>8>avIo>lQ)S2AJlfd@xbH+MiJA> zBRYZ(qkKef0GZ89!wmdq!E$Y_9ae!3rdEq*qRviEI~iEg=V5~Ig_UEujaaziAyDQk zKnHC)FPU55C=0YfsB_`@>MPsaOX3A+&L`GnSm7YV&Y_WMSXI<6TGh2rV8vC1Bwvzw zCs2MK^*EsoF$h0K?cD%Jd%P4*R1eD+l(R>p@iM=~#Z>~CdcnWxr%I1>0k5p;Bnn#k_u$bA;M$+4XMyPkgZ#cy8t zz5o1;x88sIJ@?%4`s){XT1+gJ@4yn$wYBS^yw|4@oTmA)?uQ<_XLoP$i(fwXGe7l? z2OhWwG$x*oIKqVHIMwBFyo%f-EJ^hL6njy^^pnMuq}Br#GE7auFi{PfQc^}{D+w`B zzW&y(jbJ9=VPfJQ-_p{K;ik=)_uBgUf||tK!|Qy&bb$H2*<=h-c^fz>4aIFiE}YX& zt}L%C-^!~B*6A@-`06*r@JL@#P% zsx#E7q9ndz!fyf-^;?DA=Vnr2O=u3}sx4*TiY8XFK*8eo>_QHZit=l#v!)h;4qp*$ zNWiLSG(P|cMe_it*>`@LTj1Ijh{FQRQOU2LUb%8{ZH-$DuE6*m*6E+h?hE?Zy-DXV z5vLsEaLv%=D?QK9ZoBoyl^DH&-+`Pam>T)r176JN%c=cwRu+BuL9tr(5d=C}HIQD- zO$yD0Ud*KuXk}`&-gwCA&jlai9=^i5zlX=!S?l2f58}h^6&InrGb|}&C+Z`x%zA?0 za816xrhWAJXTJQkKm46feCb#I*$39vcn9@%!l|-lz(ZLPQS!hn5qBnAqQf({o_h3= zd;gDr{a+t@{*9Wa7KHA@g-lAKN^SCvyh1vL%&rVv<*%}Xb} zML+GIc4lGG2EeC#>q;1R+WJIKeJBB&mZn90;+og(aNCHxGCSM0eheWoKUsOmQQU~b zY*AmAp*>?WOUKt(Foe3V_Eb=MHk~}Gcy!T4aZJ&pvQY|+!UHzM ztB#3`2n4Q9MR}>taS#Rtz0t%LZbS1-QHbjv8qf_cls)oO5=DxJM&Yt#==DvQH*hLb zML`ZyR|JNZn)6pBnO|k@QVT_8kkSt3=p>?*xrug}cRi5H>M5gAA$-4N zz7d0)3ak<^XA%1FQlCp~CuWG;Qg?%luo@4on3 zzw?>rf8v?H{?fPj;n(gMAto6;W0RMwfrE5Vj#|^+{!>pr@Z10Xg;OU_{M3&>n|M!v zH9A_(>4tk3k}gHD1qi+mnl1Fj67Rpa3B^iAQ=|W)6kDz z07<$Xd%O6J6ecLT0Pf%Ae_v+k9ZHZi2(v?$`pS$6TP$RwMi@#4!j?>nPSy1^mO|*kTG&mXZp#>v zmUr`olH~2nF&+(q@YUZanCc^#p((HK^8jdQrg>&=food8vCKcCkM}-bTwmwMJQ+{% zaW%9VZ8PKD`U7+wpQJt%Tm3;m$8+~paTR>^uW5?cPwy@>-!OzT$+IHBGS9{auVmbG z`Ny9baz@lC#2M%g6iweyBI>r|+)5bdO?OlXf{P*IX`6eNjd+NGnAzCn!x1=U>mt=e z$5XOI5D!^OO?1}J1XcwU2DqVC8H|dYJKy%Udp`2POaJMQUwYyj-+lDad%yPemw9pD z5W(OAU28L`#o*1O4D+S)J5k>=Pe1(i7tfu&xc_rM{m7X!r&Lgcq<(If2TqgvLB7Cv zr5l~3sxQI{FiEXuQb4X_qH4(!a-4e_ttRVqvNQI#hggAyDbwEPz z;AqCQAF^=A0j?C~cYo8ksw;Z+jG1R^wT7Bjr7Fu04Wneq0BZ$62Uh8<(sYT9 z?3^j6P)Xuq@-Mj0BCvaF_wwfQvfJ|1v63)caZ;Z_rr>%>@i+-QogkC4l;=PRcm>5t z4^TZV90wi4SHmT7B}!>ePDc}~yNVYW$0~FRydN=yeKIV1Su`3hX6i=eM`sZwf~ZHt zr_(m^%#e+Lv+q)!;HQWws2$9XxH`7f zT)e!_%jJ$OE>q&z)VVY=j>@F5Cu()gg#g;zdz_t|_B`IS{LRW1~ zn8JxT6+jkgSOKD(yok=shA*{Y#kQ3?%}=Lb@=(4Q#eS5?N5gWzEjuWjSGbu#2Xfc6 zw>X#S7rwL4#iqz_6GFv>C=Hkrc@5;-iDz+G%0!o_f384(w<7%;P| zwN*{7Raz9H6pGETsO9>2hsP#7^I@lHc#KK<$*zuN9L z=Pdf*6O^jS(&Vuq9@|WLfVe{ZFsnMmAFT1PzLU_$FoTDq^UMnC2%yD}M7QV#>CU0Z z9eoUw=61(W!EXg>1rxp1;xGK{bN}ksKl^Wf>$Cs-pMLO#&ws9)9HBU;lUi^`Qsu`pA#H8_(#xbrWeU*-fAyhN96dF9+Qj*c^71N@duZ z51ADCp;8vz(3vQJ(565&CX;o8#wIB9N(d^KsBT&yFH=!~qIcXMG2pC#1;X;Hb z&zT88$i$Mk$tQ=?d&uP7iS?8c60*mLw=>d1yw4U`iDtii6NL-=13^z@O2k7+prUm& zCzmp3N=@JxK{mud%Y;G5$aU0{ayGYC$50DXX$TnM908NMAuNPqVa*f59w^BbxpY=7 zcw?zi=!m(D>NEj^A|jzul|wp3odsBpze**mdPs{6xkNr&0^J>9WV*N-P9g)g`CJSj zokzgNaOoW>)oeC^Vwh-m#hXdfxPdNgDg;JSyB3@MY!8YgBA8^U7bd;V+6l2qPHI<4 z;t#3R>tvx9>gl2APgGx4pa%k(UC%B0(eDa7QV=SX(qEJ~)f~+X2^zr91E9em^UT}= z*S3IzG~1ugU%HrwV0i?muo!X~!3Vv}wW(eYglrtnILl0XPF5S6jA48MgS>(sSA_kZ zRxtu1m2jDG@LF+Q6!9r{$V^GlyT zTL&wjH4Av)S~MpD5N|tk`eQ%&#IOC^&wu(eUw`+r4}RgVUgC#Kal`TF24h`2QTo)j zz<#G6eD1LqKL5&yh z&h?p@L)4yV_^yghcz^|%8x6fjt&)-&Bf@D^1x%beBg|GbA?jH(xE)sYbL@Jg+iVsEw!mKB%B98Bb(2&a|>LD1@L{B zH`#2n$qdEJ6lVomAKW@R2W0n{*Fo`mKy-+DS==QzJg)fTU4HL3`dM7$`DNBW60P8c z@I?Sl1SmHF`w^KV{$ou3KA@iGxQp?0F?&~owE<@GD< z8T#&P>tFox#gBdT$vf`24I-IQI_Tfwxy%qhT~a7@niPN9!bSxL~vYb%&ik_5!CUlH! zQWV1UBSV7fSLxijBg7&Sk|BK1RRCF>l5KqZbY8!nc*9spy--NYWYCobhQTPmH<%*l zh(^Lf7^pS!!xw#3Ln~E6th%5il9o3JNY;OZM6|t06+jqL_t&})GAkW z+A)-21CEMStK@nL?BE548)OO}%-tjcIK*a=w0i!L4$-kZh(H!|gr{vIPY8&u0Vc#} z>0RSGjU3$vz%DV3U0f5wX;3U>e>E&8Q3;}5Vxo!0wunPS7EIVtQjwI2H-8iK$TIWn z+yd9IK!z7?e|PP2e*F|@ol#Ui1LQW^%HLgs*pbx^(V0pHt8R}k*1P=nsZD z73}rk9uf0fjqJeUk`T>kA->6(f`8^)Z*sAtd5MiaE351=cD2WkdlB@hdPR?sfs1%~ zuuUaZUCc^Y5O2mYLM(jbN1uK9jZ_~x~Bok~=$$*|s$P^KZUd_z!y z$ES5r3Fi+I;fYgc{+(W(9|~TD%R1qpapZ@YVDBWI=5;0!&`3J(NhHIp;?&~XYKnfF zBnA^gDO{9Uviz`vA_$uQ*B=JKdLMi~9Ewdw-#a5Lpv_`c2GDuikp#>37zC^7Y$q#rP&-8sy+h`*L5U4-qB_XC4DI=2f09USNw4 zLC-QjOH`{qF8wgUS|65i8<|-Knc_=yHTpxz#_>c#ZSm$OG-2vcBbT*4`uvms;$MFD zKm7g|pa1ZamoBZr4yD39oZ|qw)xwPYiQoV0(dcC;z=kWiV`~Rxu%> z#pb1`v4qVtBxEn~MWAI|5+XX~sb4yP+m2C>bp!8&`S6xRZM{qYAp*7h=&VSoB4P>v z9XIWVNP2%?MogE26uXGr{lh9sML#a5*tKbeS_QJ@NjWv!(hfeYzUUV0y=@MzM7B8E zJ8|iB^crH;QV0QUTRu`KaUod3M;=P4Vw;iK0G~4_1ch1VPxzl})Ey`9pA;JYo!*6==j$s)756#)R4^ zrB#MEr=|?IYhc}IH6t@*@h^D9nvIBic*4tDUitw49rQr@U6@hLl(@6U zYC&Qd#dLbecS^T5FYznr{t^*6-ej1~&OkEj4sIYahUQd}l;SAlRbRB5SH4lDt_ol3 z0@77?`b5*a?z;15e(JH`|AUwR;{W~nqYvNp(zjkCXp>T(^f+%`+5N%ip7{J1U-{N| zF8%la?GKzhc@pbPg%nq1{k^Un<|;DIAx>=-ak_F~iT*h@PCMocuK|dr_Y)A7?g(mp z--6Q)9gp_r0YH~tT!E0FAL)t3Ehu)f6Dkg?W$7dW+m0T6sGgrh$s*7$%ZV-~`pHZj zaiHZH;Bis{7ab`}dvGJxXA#KmJQFB-TRna~4yNYM@p6@?Q~F|yErE$qI^ zQ(q=9PdYUKMq|bRa~w2)fZ$vs@s8Ct#&V;#%` z-)IQDpAa+G#7R*)fONd-KwgrE)qD?7>^48lEpQzczzOjBpY@Fm-wl_iY1)vw4%{(_ zLww{69Ez#VG2`D&oz6xCJ^b;4pS;Q$Fve{;TZcJ_9E^xq9%3nkH~9Kst#9jbiw}>o zuW+C1IJdg;^tjI1i4rV0bteo3N|K~pPNx-2osO=V0=t0=h1Zgee_iIv>704<*>^qm zjhD{;!JmBNp$G1~`|jJ%oxemJhm7z5Y-3}aH$HD}?*94bUi;Axy!GCD?||ChpXjFy zp>CR(vzv7hj|Si>&EPTms*^W^EawZVn_!p#2r_8R9q%g9-Ml2`&BBe3taH;!+C)6Q zwTXrW)%NA%@(*>kvfaZuCEbQL&zER_QI4Ca-br;MS%uZkD1ybjB1^&!5#h}gyIv@7 z{<6}9uzNeaJku>qyqVgQL3SQ6M81$UOhN$qSVA`fBi^`($WBo{&(9=Vaw;Fz3x6wrH_|+8~(#GXPB46}#L0(Q$ z2*(-5xip%p@RQ$#g-(eEnd%;eF6HSoL#iq}AFrnK23ZtBXIx%bhaS^9Iv83L>5G5i z<~ZR$$!Qv{Sjw78GnZ3!Tu`mi$SIqBHXp7DfGlV$+_7kAIf6tRCtD@fr!cmP%w2Hl zSdk7ExW#z@G&bKnKexcuEWq$$C5G+Kc!E57f`7Ui{8j2Q-mQI! z_D-ETasNHH|LVW}{Ns`Q^S zt?UVi&VC!-gakTeHO;$E*5M2 zBGt`QsDqw`C;LJ(SDnQ?kgO8Y)hKt<@A89m1TjQ06%Ez&wcxX09MmLXx63E?Zp8tc z*@*kOZgXWE2Zp7=ZG6SrWEel02jVmk)r#k+eh4 zr$AQ8T+g96X8M#A((OAt+cSyuaBDbq_wb4#UhI?k z3Ak_o+f-hGL0z;U$)v}O#|^I4m6cmgojh~;G#O)`Ww-d~QNkyZ6;cV&j+QsqFjao= zLS#u<(^QEQ!S@}dc9R*LK#pmG;%p`%vm>Gn3S9ggzsc~kKmFvt`t>h->d#;N$cLW# zt1o{GP}Ud-0^a+shd=e_-&|bS{<(kn9;V*RMD45dn9-Y*kA&BtRc4qNBkHRn8Ja1R zWG*$JQ9%;7s^}2zCJuQVwf5q|Pmp6Crx;58V$AfLWgAQU0La^t7TM`lD?mB2s30Mc zl9*8{aw2$g1&C!s10ug+LyQa>LaBs663stcOe>Dq6hIXn=w~Zgc&i8CDT#ntz+q7% z+k@z&_H4+hlHrbgBNf}2iB^0Z%0g}{yT2#VogzelW_h^vUJniDaxO6;a7(^l(RTzy zObyj=j_jCfr|qWGNc*9pboCM~xdtU>08Z2vlup2{m_#P%WwaYkSYz)I+|Pw2xBtoj4) z%y7CvtAUi52T?e=xXf2wmlC}9L7>CK(yL2Lr%$Y&Tw&Sg_-TH~iF+Ur;Hy1I5OUBT zJsU)fYafcg$4I7Vk!kFNsDWKqKRSRgo>(V*q@pjL;7{t31Aw{up1W@Q@P{7w<4?W( z#M|$E@WFdtc;RdOQ0Eg*yzQlz&b|1p&0qM~yI22~w*DyTwUYV=276;2%}%P=r?P2> zHmL~Fn+ED4SBPUc0J1-WH35yWhwz6U5`s+o#(qYCEFaJdjRVQ!(LkM%P!IptO$NC5#su_L^#mP{$4QkL+a zj2A;Hkl}Kau?HIp#I#sGH((H!d)0_WV-fd+OSDyEOG&np16<7LbqEiQ7HNQoCkCQL z3G)s0Ta2d)p*oSt62*`arFBg8$WChN5G#;D=LTH1D3S#iLXkMRkR4HOprKZIk6hYQ zQjnv4Kwece0i4anOq$kY0AyD-*HVa-(W_)aP@VXL0yU8kJG8tft8-K?BuP~m<(q+M z)XW2*7-@c(Ti{w2V60tQU*EjK@{iB9w9#E-ZoqZS0ceO)gHXWoGI|KBx%5=Y-4gti zfvZ0JJP! z=_o>Q_FhP7S`5bdfu;B*Ws1){O{g>Vs+)r zZKrQJwfc!qe(3}6yZ^CA-wN>XwR>RkcbK7tGc)0IZ7!E(*h67saBXwMZ&!mH-%sUXV}b$nIJ5)g`Fozv71vT6Ary-afh2xxb(~f^074lgN^}E?R1_z z`K5JZcmlOa`O?6_S*bg9AUgL%OcUTK=HO=wskq#6Z!kR4fuBs`|F!QX>byci^IiUN|9-WozIq!D<>; z^bnEu{3)Re=SQpmvFg7p5&7gN6GL&kRr6gl>7@rd&jy;E}qtH?> z-Q>${F5c~Ym^+%BRl`c?X z6=`Kqhg`-QYO^N`H(|{n5mh7>%1}Wf6vN4_~EAko1t>l<)I230t}oa4}xEtk)D|5uuU+6 z^A-o%h+GS5_0eftIrLmSGtFQ3wV3g#sHrkxP?IF6-KIcjA*fig#}*+LPYOqLtKdli zA8&ZkGxE4QK@XR1Ed$)81}V@L6}cxVN}&2rs|dgZMwR42iOUuAOM<+hIr(sJh^N5_ z1Qbsz@Q^(Ex;<(C_%ck1a#nWO-oLYX`AW9%yLy!!)xtv%0Q#>X4QjCUyHrh=Mk9rW zHTBgdY@3P1kyVlSAYd|H&;sUFDPng`Re{viveg`Vqcj>e%^*Tc5(@>`Bjhz0QA@UC zhhbx1Q5P_@KuJELKFTT`$-X0|EvK$$gs6PgAdLF>Bs5#eApxBPI>wc?P%;K_Kp;Fw$9vBC=i8#pDuZw{pU#Qd8^uXj} zfC1innrV|xHo}$W%G*S2FwlzV)B8mB%RE?>@66>s+Bg#?A4Z~oj@n6Ls5xYvYZ!&Od39`o35dI0-tOXya9pE6 zdNqcqe~Ex_e2{YaAkTFz9VZd{WUFbwB^yZDBLn1|b;&OH2@IEj^N! ztn6?T%i>9D@agYTw5DW8faZ0|IMWJf!+s=8V#_9MK`wbX$9FhMOeFxg79pp|#`Y+e zt}u=_HjO@P4k1Da1V0rdnl&Z^o1>szO>$F7z@gKnM&SyDOGt=p0xY(nyX3`B0fUjA zOh%*-6VPI>MCR10y~Og3;HVJF-1p>VR0f3*V+|J^v_p^%4iyj)fzsR`m7gVYffnbm zj4T#fB##IqTDlqxl(ztaQi775KL#JG%@1=6T*U&8Kvrkg)-RLMQxldrQfmM<#6G;* zupE{~4Da|i z(2!wpDr9q~V|&My=%vktm1Td~0suKoZg z*i94>a|=o-h9s7z8VaT|))wWd;(kF4qRocOW~C}byI*|`9;Cbd{3f1-6*tD04c+V}`KG(ulG$sB1EDGFn34jLz{XDchK zhRoTZa!5gGSLBamd{s!Vx0M5Zh=EA&_)#gZ1c+2`ub(YWftlk!_IRK*9K#L7T5E@Yn+b+u)y0W-0N5*zJeET08+v};+tIGvlD#A1{wIo4kI6_oZ4;x;A%!jP%`85 z1LKC9c+1So$A0vK?|kW{v$x-N&$G`w%tUi2yMgQ*&y1y_CHb4-IKCur?2snqpxjA_ z!FdpdY`zw^_N#K|1+C(NMy9KfFeg@nCnZoAVkx9*$*GnO=K2ZS8H}HN)C;q4|CMm8BG^pP1EmMf5RWJm>#v?U)`@^ZE@mTuCbf*-m!0z!d2B#38-X!67H zbXO~d_rJ$K!l9LgvIm3aJ#ot4vg3<|cgP6xx#7h-h4zl|rlQS_E4%^pir*M`Wp$>@ zU8giqF$r|LbV^;UlHs5ZnhnTs4{!uQn+&D^DNj(OfC^qxQ1ntUK7{7DAgxuUVTjr` z+X6OsYZ6UX(1YowkVh9F4p${om869$s$zqC;;(W&Kp&Jw6)06HIGWeYLQbelr0x$^ zS*b5z6CkZNAe242oi$xkH0CaLnt4EnN~cr;cGfXEZRpL{yh>YVYVT@%m5VIo6FWz4 zaEnMOl`dy{rU|2+%*Y6+*6CfjlvD{{{SdO@lp)nv&R>MsZ9hNHEpWgBj@%5%{q@V2 z*{;KEEKFR?0pQd)p38M)KxXO+g=1S+wl+34e4(>nz(XaDgu&^%TlimG;sw6-3l-Vr zOi3nGCpFi>Gq#0*kUfFgj#HhF{$;YenPSeBwhJiR>vfkMJhC4}7b z731I%X}Er5Z|37YvRKQ>kpx-MtA}`Rmum`%z<7M0`(Y4Ldfs@=)>Q6=9a~&kT|RMg zaeL>u?`+)U7l3_|ZF`FkH}axIETCzyO^(S!)jMwTOd*Omf+k76THfSYN!n%5D7G;5 z!vO<}+FyYqG}%I@Fg5n5s`0YulT#^P7~oc8 zHe4xvA{BbYAR`$pTC~NLPtw4ED+pSbOx5N%^sS+H43!1WC0Mi(hvHmUBJ$VN0tf~Q zO@W4}aLNnIN-C^TIu4YrED+C%kntoM7m(>m;vuFWf{`Fy^trSX30t+vc#VMApPa%< zPR^X>D?l1+p5_)f!~%>E_Lj0$d3W#P#Y4zDBg-?Te1qR7aw6{8 z+}dOcqTbt5geiQ(W%y;X$Q`b{y}4!**~+2&lp61j;f!2rjz}5ThzY{Z(gL?TnDux@ zo=G^EVoiITBk0^vaYThdA(e>bT;gG_O-rv7C}fM;O%0dG@%CX?j`4!W5wC00 zzbOcqb$-+MDA;X?S%<%7VQP(fXg|*wrFEG2>SldPsZ-e)&Gw3y$3gR9frhz~D8*KU zJYfM7xRlbLqzhq-x)_kf?X#WY7&mGY<;cxo2RdwgW;cyQrJg`qeW*tY;HsyUiV}=S za0ykp<{Os26CC;L?If z=ctIBQM0rf!3|lJk#xuwXR}c`_8&1!VaGg3GRoT%f)XkX2t+PJt}NGyAS4yEtSI8= zR6p<4ERxC5Dy%4czgUk;{;*G3l_(jSxm9?wNaMS@rSdCye9FjQR^6 z;X1y=dJng`*w;*qLTZyyCby!`NQZ;tU0M47SX3)15BHR}98&||`q^PkjK%lGdO%fD zq%QoJ&YPM?7kHFi8qcHX3#2^pi5&=!hWubwKv;xIe?g-~GkZsQQ_p44tC1}3ty#G6 znvZuDD*AEOi{FNp%@-Y=*Ww`Cn8Le192S;& zMQ)0@k#1{;NN98O${xQF?2?mfv@u;MP#}A4R9XzG$UG?-bVLLP8qgl>!2@guoGqzx zkD!1i-x9pnV5bVrIyZ%>RP-lYD33&nDiri`-AP%PRGeH{G7>HgM?i%YYU*yn_2gDv zT@|0In&r?T`Wc3ZfiPy0R8k%6bCQmnId;v4;<5z_1pq|ggCx<-2C+m=U8#y z=Lz0EW&vP4#|h*cD>+?^1DSgucx;^U=GK*s%}thnids!MjC>Zw>sc;-wt{$n-cl6ZQF3}{YV`i+>Kq)ZP^M+?W`lbd%F?2_rtI+iJ> zs3~5O^7Z`WY*DsS=Cl?C^&SVi?A>7xOV8JpH^{o~_A^>71 zxJbcu5%>FW4t*DgNKnl{DY7MlkVO-Cq*Y&1 zy7+{!FqEcCLe`~HHLV<)ykyC+Uewi-7t#F zA%NiR9<+~1QClqyTYD8X zGX>mD(y{xw=#`A(D+;!6@@S3H$LnV-MAW>+;T4?7Mrd3(mxfFmZirm}N%L(v20McUfG`GNv1#}aRxCI_oKYRZC z;_@;}*?qKT{5Yx{dU`j^+9MHm5%;AXUagO?+R za*$G~hW8v*p;fb`O2-W<9H5Z$?hSLbMl*W5D)AA`?_pM{n&5zw^ID)_jQ1W&X%h~j^yT8R# z?%QDqoINY?4;l06Kkgx6FTc;mh}H;pVHWf0aF>Iih+g+|dtt>8{S~vmd-r5#lI=0y^ zv%kx3Y}Df`2Ox0`MvO64SOST{r6oc2Mbsvpnv*3mOmq7%*Y5}p$ z(**!7F=^pOL{?!J>g|wm5>6eg7+3W?02Wem7S0B<*?^|dyVij0Yo4np3DumH%!Kvmr( z^J>hi*#XaPkm}wXS1j1UuPblUBGNz*I%;z2#XXbPc5t+4l!y(HM zE<)MKiU&gXda{AvRfPgsbfZ=|)lE zFp2`$PiwFsb=9L$F=s_b?m-n!2#Wluh)Sz@BowS5BngVTva-6rxWdNiV|!P2cj)+R zvqeT1TwRv(>xTL$WN;-P28tw;q*j+aMbfn>^dpO$>%Tx7-V}E1RwaYA$Oy_|z|dS? z*(_Cxb}~~@Q(e}v6)U|3!X!jnvVgIjo;X1)0?I8$5-6Qit8FJWnks21o`TD+qv|=* z(}qAR!i2blX-CV!;9r~CmR2N=O?fdg674Cwub`s=G_^X3NJ8=|udkh038dPDKz|Zq zR_+i@*EUzxr9#P^`W#v_05abLG_lG&H@85ufMeU?yue#XUOoFdgT3vyVCeN>N5lgR z&Yy2c#67;xkUt)|;cGbS^S-&q{XML{u*HWX@8r>YIB*@k5aNqWs99`T=h}qmr#Kes zWn55kK~_7km1sIO86oec2=|F1TXxg<{ps&0m6DygI-$HiPdBRiy~^l^gknxxe5hy! z>L73Qe9&Y^QbcTQK2$r)BTl43C_c=tNh!9dq~&sgHK0R^UPH4(l1%PXxdP~i3oxqN zam+NJU5aBEm)ynAqjZtQfC-xH8zRS)B64QO$RJeFfWFfMsrp(ZEHVN`O^8=IkEVJ69FoO~<uvL0L|lLLKI&>C|wR@oyO63p;S8>Tupr#$GaVnObTgMHVfs>xY-RmgM?NVFYFw}$q z6&1^(q>0^RIZBk30F=>)6H64#2)ZnR2CxXFMkVFFV0-~#_|3osYLgw#ywLdy-#Xp6%A|erFC!&JgVW zU|>frV_Gk4(PV%Q0G1wB+#J~$PKO&{Jc$00nPB(I;&%32y8<;0`?q{G)}edZ1Z8n) zicK8A9Ymx~?9-H16V1|5-UO+~l3a~kYmUkW#sWn{OIQhm=3Yc4HuEyl$l0!LaNdQ4WVCMhR% zh2>EbX1-2MdXDwI3pIF59H6kaKPFRAkMx|E2BL}Ocm|%gKBsK};H!d5Ske#`fepFX z%i%8ULewm+kAgL7)5?m{=0(Ycn_%27#!4L{Vr5+dnUdtS%*G&In!d2ezPm*`e~bV% zx|0IAUX|AKg`_43BObbIa0RXu#TBPAH4&#ukc=#KX~0c~R9U37BWmhfR+F9vR9=~O z48;ho9Brybq8PNJNTzl!BDx&nmxw}%F;ID&f~#_og4wYtR)ARzgdvqQ%30Sr(kuB| z!oBoS*^rF_woP!r=flQ(I5g2TKm}06v~=is=(Ii`iiGiHrAS{wHr=f+Wdk`mXazgC ztOski>LTMsX@pFJX7l#|O>8*N%`Kn>YAkVLBlD}TpT&vd{~5jU8rJ43lkRn6{qmL% zZa==#;+W#!s@b**|pJpuO?WPg-th)z=Dqz@g>ULB_2?*v4Z;k z#lp#YbyQw@0^Y;&UKm~u;5XN_dV>;tL6u)r8RTqO5q(jCReo--2X*ee3s`ap3>O`_ z`oA|Zd1bYUkQS$>93Xdu(1ob3%YEhYSgN{3%4-JH+59SXxKr0za=}c0i1uv`(+%HO z;q3=*EUVrU4zXC}HH8BxkV$y+> zVnmc{0LBw40$)N6#am{9$THMTGinF2f&&{>4zU*uEfSwj2w{cKpq}{#M%&F z4bD5Q(MNJ+0C+p0!LJe-@xHnm^1KOecXzIH)~MXU{XI^I`h;c^ED`w3w1!TEtM@Gv#7MD*cd3h>)Ubh18{rSWcXt2%OU@0DwS$ze%p7egw-MDP{T6>P6zq*p>U zvw>|Kpp~RHu^(6oI2tm<>L%NJ%&o0c-Y&u}VxH4sw5U$Ec(o4CmS0_5GK76=^T8nw z5SpDMN}}eTo8EHhN1QeOqKwQ66?6KCZ$JVx9+L9B!%7jrgWRqXo-G1Gl@f^EXuH_n znXwy!X)0K5ygggudwJbBm;F?nh!#8_|3aRcS%pMiJ8%h%Em4P$hFS4HgDEZ6#mWtA z*n_sh*58PoN*Rp}$sIPFV)TR|4oFznr16XQgSk)<*QE`l&yySIcn+yZ5XS@Vs;gY^I( zLEj>NK1l$(!`KQLnlmIrwiNLCC50N!N0B6X=6CTZD6SF`DOBM_NcjnVunCLHLjVXi zQ#l!vErmcO^zXUiuPW=&s__q`BD7_cMo4-9qui!?LJ|vu6+yBTB85^bRz(?h!;4rf zBmv_DFG3K#5%=BV$xti}s-+cNa?MBs1|n4eD6AD%9Y1iE=CaVLoy5yqc656AQAbY! z3{V&t%6nx`NZktupcHdT(JT)#fRrUv{VN!q$SJ&J@Ig}@AQ_=6T24hMB2tW4m_PBQ zbb3cE6i32bci9x193>D6L0ly{zA#Xzn6Kg;-n7)lqu5Ch)bx!5q--|f2V4Sev?&Et z2?k_`O+8P~&UpO~-?m2SvmADQalV)>(DH`|2fki;eK|Y|nK4y*!O>+bD#^iSoY2Nz zUEDejDxibj%H^WcpUqvveXD>Y+W`*2(%#wK(m$$0Nl(EkMgGc`Xi)g4GmxBrxzO6$I?<-Ww;<;Uv_W|} z)-E+d<+FDce`p0_`F>?7%Id|CmS)VQ$tw6xNyaLO7b65z19wV+-N58RM`kIbUDP-_ z9{_eBE8QzX)kXAHhJ4Xkq-P3Z`Ai`)ZNhW|M;Duz3cB_)s6@DkN0EZET1YHgaR78x zV$_ReDGT*Xpl;*?8uu^6*I5z+2A6+o!ZEMcV?_G0iTv{9SLT2$1|L-wMFyWK9tl`K za{2R;057f5p19V3%L9w(a1rv1DU(Ha-9|0WFyD)m9IOL?ww@V~2ESD!aNQUwc6!N54?G7e zFz^(D!7Q@sCo3euStyl>=*3l~K~r;Y&YvZz>O|E9U4^`Z3J;c)V$v*u3QBl_o!(9> zb;*QDx;5GMG?~jLe4t_Lnvg;Wibv){88}Da6TJG*}lbk&h-xJa= zQl#?o8B#lN=v}*2a zH4l`FBV)%fWKRzk5%b~ue)MmwBeow~jI64$a>^~NUvp-voA0^Z`= zxvWsQTt^3B(veG>c_NoYYFA*2utiM>Vtoh*S^X+3RdQCtt>P3dK?hJ+e|SIa184dx zWfTQJ5F{oI0#rfIX+>HZ1nV#eAl?I_ti~oXX`D^f1I7}&*xv z-t?97A&%0hi7wAvG$IY)H9&O6bVfC_tVOTyNb}gr?jF-jR;Ltx!6QP4JjVNt)HSO|K zqo*qG6XSOeT-zPXSKF$r{Gh6;5?TxdVNMhEdkF6y!LG^k1=YZOLNXHKmNs)1T*U~| z0ZP4wjgChP19wra@pCjw)Tky5YQ6_c#$~O1_0Cf)X(3WR$7ph53LyAnS#rA_w+J~Y z2&a7F`e3OP9f>fkpF&CgxhNYdaPo>-;$DJ#O&(S^*IK7sP~OfdBBElW%P^~wjsrq! z<608GnjNr^i$%V_077zaSZgow^Xv7Z0DPF#ZMWblq!=sK&eT8#%{RS{0nJqq1Ayb` zdbO)x^?s%SPrxh?EJg@cEl1^F0j8SkS4kk1Hclq>$~zUkd)S>!$8vUaE) z3n5*597u#su0Y;Wi;R*rW>&HTASaN0YTQ1k zfus{Fv`GM4sRJ9)1{JAIPBD?%i0m9^a$K)Rd@umg6iNpHB%RGf%NnYdq}YiFg)~(r z(FF0BoSaH(=>w9a)`3EWXf16mYIfm;L3wT$9mISq#kFS+0ocp{bpdV8Kd2I599s1} z>&~z^I5<2!IJ!7_mtn-B%;IXsTSNE;qqn+hoYja`MXU!$RSmJ*>FY3e;~9>3lELtP zklZP60_=gj0uEekC~pep<&1ub!_BPJj0z1v9r$~Dh7)+u0b+lK223j^PtP!>zWl&4 zd1-lS0uX)qJBm<}wsfU(1zSyb!=%3iPSilIxvQ3Qd=ed?R7(gVdOzM-2k5@4gj%aM z-LJX;W$kwsXBn1ntuXsQ1ZRr1G^vBHfmSW0raZGlISt%_ViWBZ7_6!pIk&p8U0P}l zqw@zkfKIF6SXf5na+4eXY7(jj5`uo1_y4INB|C1jYBC~i-FjwgPO~b&7r}TxcnPH) z9g9x9XQvFQt%$9}^I6uv($ji~%>=R|IQ4gJPmo=mcSgLOQlBUx;@%C8W$r$pb zV7%NEL=2?8>j~9oPKcl<#N<%?-l~H_iJ7m8bh?pHh*vJ@UZw6tj7zx^JeiZ-iGead zsdb{_K`#*hFk5w`3QlPgBL85GSdu1I{;8zhR&t)KDyi`UWgrhFkWS;{;_Zwg7Tim{ zpX{X(A?WeEQIO4X>Ew%8m-Bs;IY^5CaG{poj3PR`CR7)qn;R$w}amm7L( zsWQ4fJ|j03T@NdOdjLC7KTF-=xK_SredseIe5Gwr4Ll8olIFG*JHaKUf)B-)jsDQI zJ|F_578UG@3MjDI?m3X{7|(U7Ag7g#UxwTZpzpI}Wf;ZY}t{~U=RUWyTMxukK8l1`)djESK6$P z9u>$E0R9@E zL}lF8bY-NFM+VlYIN%Jvl2cf23=1r0{0FoO3qg`nH#=3Rs(?;$$qOYd0;hQPqfuUd zNYy9;CH)v1thJc1Yr*s;I;zw&C}FCXsm_g`n&(mo+Q2%4lR-3QR%pbxTWD&!vAYHR zAYi73fUO^(k+WrBCX+6$0Z5TYvjZiGkc_Y!NwGBP34be4`!K4|{PUOQ0H^Zz)C8HV zDjbBBMQZCB#4L-(toK<2e_p zy108JcPO7+TfDj!ml2Vb?KSEML|WvVltCNOm-~kYyzbDCO!6!_zJm(2kG72KbroaIFwQbiUno}z zKRcdZSm@;d24$iGaP*^+xJTXDnxR&*UNAv7+|fBNhy0^}qVBPRItuuggmvlNqL7T% zOc6VWTL8BuziOdpfS!NJJ)-2X%`WaVPSEi&x|)&T4ADBI&&WCvd;y<^si51#b<(Y% zUsHmvFd^Sf#X2v&;xv=x`en%aNr&tCY%#-o&Ge70nT;1>fH)=ev^3Ok0E(EXm^~<3 z0XrqRx&0DQzhzFw=pdM_3wi1r=FU)hO7ph7-Lak;w#H zgj_&^+p1zv$xt+n)kGR#s&A?C1{ALsRuke)P~fLdOt8U>42nM$6etCG3}45ZqW)8i zQ>by3SijV;hush=&O~N71i>m@)J#n zz=;h_uw#TI@d2c0hU@#r=&AzgFAiH@krd>UH!XAg=7IBCm`yt!OKi2w~>I$ zBL=_eth+;pFz%F@m+^E#E2*O2YBOAh1+vmE#hJhadq~CFQDYIB|JrDf-q(`xV9J7Y5p$dF!3w6vrDn5{g z;rkk5q!5*wv6S4i3UQ6SK|&?lwVY?7B1=-*B3f5F+uCFeSfP_GW&Tm>9upLsEVatECuj-IdY=loqnocfL3k%m-w5EDM zP!m>cbQ_E*#>qXe0S~X1@xGZ~IXyZUAa};bn|KSulhrm*ke{E*su1_j9+ODt%CXTa z0=;fc!!vnV2?M0z6tv=;TSO*^O4Lg8{jQO7tTH!*iprln1xx^_6>-ZZBS?c=K?O6j zG<^?HRUzy;O9lkHcql9F%x-i>F731mPi1coi+ z7VE{=EgpaD@yW&c`PC)bcRbyD^zh*&-+RBh;?|C#?uu9&T_wFX#5@h7ErWTuD!A|Q z5zUZFp|MnCyweCg}ZNU*WhLBXh_f z?7)z+f`?ehlHyqga@5@RaGR1APGh5&V-D^lXD|I}g*X|{qMo)lSs)|QdWM!^g=!fY%>gz?H#+l zB4ES8925PE>!TBqZbM2df^`Q*8qRjuYzhv#ma?a1$}9{3W^Q;v1_JndhA8+ktW1*m zG9k)w46orzj*P&6Cb&W;c&N)z&lRZLGDo4SGuqwSnF|7sjfqrQ=QdTKywp;-;k_jj z%ZA%qvNbJU_a(H(?5hS}fudEb3@=QUNHo zu0%{2sONrS002M$Nklk`}3flO;_){s9d2PR0Z(N9+daPx1&%ZC}`$^o<;q=yT(y4pr3d6n&peC z^WJ<7>Ra76G>2uXY3`FTO{Xfg5jmqIRkC426GVyDs+KMMadf1hl`3DyqkCUXB*uRX ziIE`46$plQkf#c_L6m;wN9pm8CR=+4d+?Bt zD9`ztGE;i|=^S-Dl(iqUI^~pFNUGQ=q8a_En#9R5vpW-}hXo@&NW#RT1szc!T+*00 zBTGf#QkNCA)vDPYB5r)SU+Ds|%k-4W>~;Rjs;(JPK^Ro%y4dkt^r?I%x0Deh;GBWhhxGo={Condsyyy>gLJjpA@hG3B9Y~G7Ae#{!UGu($Uf5rz z82F2j!05PaQ(%VzwPQyU%9rUaZ}h$|AyynQp!4I2eH3hz4!mEnc7@t2i>~KKd#Lnd z{wpV%bx^N%1~2?l0FI89s?OTd*k_IyKcI-X+d1%Q@xrGouxhg45}yuI3lvN{NsIXx z523+kTD%`-3pi%_M?+J6sr4xPSF__o;(GBw5&~Z$Glwz8Rxm(u){ctRA?2E@jEyAkUh8oGqDyR;u zJ}H5zdbgUwavER%6yrHq|JdTNn@q_VQf zk#>Oj5YcC7^$D1Mw~*zb#-|8}_NTB#Vd;0S5;c#6FlIqIFXGiN1Tg-P5FrR0-Y*37 zeNrZKGpb(WA5T^ZD|ckDi`9c`}(!c_sA0 z{@(un-s#!d>FFtVaMwF5nT^`G&hS#pWDu$m6G^fox>3q-RNbrw@`?vz17J@sgkC+b z$gR8vG$6@b9}3ndv+AQTQ_uo?vurHs=BI` zRVr>d26`o@=SeEmp{CVF{)uP?dM!)z(bbAfhl79(4zs#Jq!2Ie=_HUQ4J#s~UR`18 zYeTsj?mPo-GeEE~r?H8O)swrPS?Xfn4_meJThL@|V27sGCKOXv99F?JiBh5DmQe^^ zsiX=N#!m;mCPkNqy&x2bJ&+mk@WXMSIU<>)xu^wder4!{@?n73J%II=NDEFQ1sewB zs0Ukzk{}71M4Nwrd|?~2Z|PJ6a>^p&HWJZR@$_G_D+GO`19cd?88N}5pTRFq93YK7 z2@n-C%;0xr)6UL_#UW?7gbQTnIkhH(thmRn4B`S>kvftCdp4ZRr!xgZaz)juX=3g& z1g51T`K>KKO*5Gs9Ug*~o;S$ZR^o!<&DtA>~v?0#{oS|zZa_1EO>p~&Q z0b#u%Oz}E-K_&mnM1jZk9!GKqo} zm0WriE=ZRv4|bNst8*8CfP=&8MM90yRJ@8<+|W*Su8T;?>aXj)g5DfA64*!p38)bm zgTxN@_8&fY_=j)3wYxjspYF{T^Yim_+#l}Yj*pI}<8i(lKdVV>h8FgKQcUV=jv1(6 zBB6#O5tXOGWQJ>9B<1d5Ju`#$F38=K=zyL~E$ZGb2{MBslLKFb@3Tc3TI?co2aPWQ zh5BxXNXDCDw}Nu(=@T?}Xu{~a4DRGdjK#0|EYdU*+Z-Kk@n=xPoVlsCEK-@RvXtu; z*HkqzXz>)C2_nM~;DVt0V-QF+tIZ6R=qzXvjbgaI-71*gRj?aSO71B}%tqnWdi*ed zvpIebm%MEcVfkj40HuJ2Jf=YwpkpJF8-(Fq+S)5b0f;sp(~FTSL6vn0V3nnK){k%t zGTVZTH2s4FG21nt;xZEmGfSl72#`Js=Rkv=XlBH~E{0UlY-M7B#%CDB<=R@N2<(Ek zL<3~W*-K@U1UE5>rhFrF1UCtsbRa8vlP`kpY_s{s8rWQt6R~3Op9|KecsZqK9L+p1k|y=?S-47niJ(&Da6vSh4k(4YR7C3#-;=K&j+KTJ;S20u-V`>LxF? zuV1PSq9%E2MW+%NV%2%{54X4GbT^*~AS-e+!W9hF=uwo2!=iSrl8o&JOs71YD+N$~ zL&#ZNJOVD(>=Yt-z`5E6&oy~V9t|)0Az{-&m!?ccT zbZRWG2JkA2wEL1*0MCm(r(h|wR!FrN{AdY25O&QI{=3{MQ>!uBz`StWpg;0cOh`y5 z7vGzLDXZ15mi2*123Z}V=0L)gQjFZY-pm;~Eud9_;39Jvy`T(4!FtlY2wv5C?1Bfq zHs2DLSNoK?&}0Z03C8qr75tQo%*A_87@B$@bnP>Gcsy6L%>B6gXTb&__equ4#e7A8 zb9BPTs!BVRt#j*h5R@%Iv~;dx=-S{l>1~EVs!z-#MoWJot6e_rqwgS^l_isXt8TCu zAaNo!H=vat`7p?fctv2Er$p+U>^cbIv=hY@V)EPJ)&=-QUugpJ4}JLXoLb>M5XYRe z@tDA@ivAog1zPw~*c2DDWpq8fHL!s7bbpZT!G62q-rE&wHb2@x3 zbQt#_1+7B$Zw=vqnKT-LJ?^ZWGr6L-CPTbqap!P<`r!E0fA*6fKR-J^IX!*n-6v0; zoIW`@KRIL5kb?$inBqtvN(#QEpioNkVRR)aMOUrXh!@}H$CNL%3LXoZuXo_SNES-cw)|Cegzf_2PcN*CK zl`tTnhC)OL>qvt_I-+ph-(euz?3XX}o8v|T8wuPefeh)Jo9TG+vDY7e{TsiBo3lHe zGJJS&iPf(gK94$`Fs_&xIy^XJuITNz-{vU~^e^{wsHog8J1+TS0Nxpv_tCsB?Y5e@ z4`N7*mKd&jWR*I^z={5itz9m7#ADZWC~vHLneWnBA!Hqa?a%zAqApsg$QRNT!y1=F zNm1+elBhW@FfPix41*Gs3@7XiCF1nts2Mj8158BRK@JkNY>r?@=j!!v!2b9yoMx>( zB~4(@Ha(h=D(YHE+>e zLRWd3BN0%Td?&y@2Gv5 zk3yS~~TkC;45Ysp3D6bx%zDIAdMBk**jFS+sIK0GIANFvnLx3x#U@$s zS49Bmq@IB+G#-VtK_QDDM)g$}+xg1a*3E3^X8!1vhmRjUc=Yh_@vFyp!#F_iK0SN; z-II5oK0Uv@@R2}XLai50Ul#{BOI-AE6J=b1zzM&BUup|w+R#M#;D?VhxCNOgOxIB^ z!f*k9fbt44$WTBGIBIkj3xhjQX*lVkT09ng83X*Dpxe{~Bnn6g+u3`Ncmt~w05nai zWX*_F0E(ZS$h284W2kwq0Z1Fc_U0+DE}_kNBZ0dTsL|wz+TMC_c=YPSSHAt7@9c1A znTMzF6)rE%8MJ6x-h76N;FYj!7&M{#P%$B!OT$lb$yy?3b z0#v8!(}V32W6xC)4yyIq6W5|)p}+_gEwm=sL*;R_BI;}11W=mN199ox4l97<<+4FR z2$9U@*LmRU#^>JIdX_|X00Rl#kZzUKTY)qbS40NtazY2Ds!G8}d$1XpSXrtnlStv% zK2!3X4|y7^h(uHtZq`kaf)j++lvKc6I!#|f;>Cv72Cjr~JqpLfvN4=VtgHYs)fHeX zL9$!8@mlqW3}Pu$Sk6hXA_K8ifKZGye6xkDgaH)QseRB4R@{1B{iQqJEY{|CBo7G_ z5{#!RHL;gD9y07IPAXM>8f=xg|0vtV-dd~N1qHu}a$|&26l04QRo}%=oo`<<*)y3; zM@%U1j1H#<)2)N)oSr7IwhI8|1*st6f* zlA0BuMvx?Bs10!_A?-B8(yvUiZO9Zw2|{+Ag-TaQpRYbxtsj|MjKGQZ2VVgM z#d8n9NGKH7fvkwk76+Ua6BppGN~I=}1El^^Tx>=tA6G3UL?U12Y-WHI&n9dnaIXX$ zN*cC|EWVQQ+G{GE%d6@BzK=`n@P*_h55%K_r;~|#+06%|2ggST`}N zgj7J1VNst--;xEX|+{sCg77k-y}d5Pl_2XpAv?h353K436HjRaodj$r;i>U<1L|EE-o+mXwQ=q7RY!}>lHeO zEr~oYn1>wvSX`$sPeqcL99Y-JO0gz{v2d##kYJjCbVXssTv%k8FFlfGi^s_zsU~c4 zqF`K2inX9aR+a84b(RBVQGA(Z&6`9DB=Yg0$Tb)sK$uVsqi`*1%d}#qtb*xOtH=Qe z$pCH~pp}d^v5f@olRySaG{N3v^7ysa-uUJpFz!)|3^@$<_4R^1(O4=r12OJV zPe5x&w;&JUz+8&EYJnx7R+zUihXjly z!9GfUg(4I>>HoHw{$G`g{1Tsj4ib zsz#`WMDl!p;eLoGFm~wMmthC}Q*!cx z6msOYo}NQc=>=XRF#ysSvdo2SlX0`Ni}ZC0<(P3{8!|BTfznaa_mbr`981&UkOZ_} zgt+oHyV9#k5^v%b*b?b=k#PabNicEfpqx#*RXi~A-!g@5v{G*403nb~*ht_-5YN;Wed989NEZp_d~%(F1sYwE~> zm~mO7v5nBC9URC75U9$mBN{XYxiVhjD3kYrsii^%ny5gw*-myBY=`ERKop3=xUblU zPb)2k-qe`7o|3O|aK494b><+GM%oHJ1KP?a74SL(ULFo+j3jKK^`fjTw2p%oFp!A0 zqgfW5L97aj?kEQ}%8mab|#D zPF#{j6q}u7dVAQRI_}dAU-~{uF&5-(vtMQSy8W& zD2&FROpX==_3ZvWs_5 zPjQAWXLPDLP7-2Ow7!1Ay;NaUmEt0m8qV7}?|~v?IEl=JB8gK}8?dxRc3-7F%m}e$ zcRf<@AhP{jZM2m#*GT26%B=;ce3Bv-0ePi|qZGRy>vcWG8rAQ?frD7B;ef9}{vNoe+kHhF^N66`zlpLo*FZ!i2uuFMk^dD?wR#`*WV>hGAY_$81FXU#F+a#`q+pCx z*IDc^0k#E!mstR@8QJo@WY&k@#l`IMl9g2`lBLe47hxk@3*+1n6$Y^Y5>!@Z2#q5h z0#X|=XsAC3x)}jHd_+X$CIAzorg-?LwB_UcSuhf?7`+#?%DQ0SGqz9MB}N$o9HIME zm2_-tIvl1k?XB;N2sEEkaC_~7Cykcd?CSN~A3C5`jXgx+MP_X?C~^)Vi^(Lxidt7f zj>HRpuvbAD3q*?)HaJHt6iY71B??|Z;XmYz20$OkQXwcmxhkAVPByTXE-yVZl~L_dUw#3Vp(@Vz|zAvs?{#<0bAnU2N> zlhG>&Q+5SiJe-|g9HW;mW^=rvC#Nit&CjpqIz)Ov&cdZfN!w@QGW}yqZYz`cFxDbH zA!1>L&WXrOPmvrE10iUtFrxcd0ou&G9a_{ugCoQd3~dB~)2c?0X+)z{WhGcLuC$1R zVombGS&T!SEtbUIWM+k7BEqF95S!$BSj9IEP?yQ(yph0jB#_~vepFHJY(F?YeD#%w z-+AX9)KSKoHh{Y^o;%?+W(@Y@<73p315t&dB0v=!vLH5@&i8qT5IYtxQCp}hAsFrI zQ)3?9Gc>^WgjvtLgYj+x`T>1~dSM1)xw}~GE_fzh75iNYF;^fT6d~eKdzLo5LsGHa zVMUI?a3|f;n3HHoO4(SHZVjMLgb)y_dM9AS91E9XuEnS?kuavgMFRtTa$i}=WoRoE zv*Gh)mMn6_-ZMbG5e$jYmRzjc*38emFRw1yPsR)oTYp$q;Em2M1J%!I4V%d#J;)XD zuwf6ZESYUVhOKs8daj>LlS~4C$Rt9*hFV$0$0-w3N|S$pu#;YB!?Z+}2L#jNtY}GO z<(vs851b=L969|k=plXEI;Gi~%rY@ujTZqHb{-SOemvn7jSxIQea@htrb zT1Zdm3SY=IvfK(GvdB0m-t3CP(~V4P=d}p%k~c6c-A+%m_ zg-6h}ZxxG|&qXQ``6;*raYZ09l(A#^WOa}R$tfMkOR}mdI_wGtDXlKnVjBl&O&FW# zMgq^5K*pn^7+w1KwMY0m@1CAa_V!flT2@x&$7saGe9pU}c~$g;X&%Z@BB~Pr74d{O z2T^FsTZMS*D|c-aXJ|Uyg^dPvs3tNnbNgyYe!r1a;TA5K<2pK&x18}J+BvS9uLUaS z?EMmWAw05(IzxLy8g1?R7gg`VeIbIE0*Lz56tMC|(?qyQqqNo4ogkt{wQ_>M~ zg`0u6z1M^AUf*pNFn|RuqKySHhlw1*aB^~>;saQCwu4oH#6Zh~WlliRYh6Fk+TxUC zd2OhrCObr^I`{G3$pa{mvxL~Xh@|Ets1y|ZiFwfWn3OR2qkq;vq{+rHR9Go zH)QPO^Js567LTvwU`C0>`URfQ6CYK*Vs-2(?^vA8{O7Cn_*8kxkQ_z``65eD%43pq zjPNsoOwCAf39V#NZA5KUYczHQCo@E-)N<+bboRa6SU9E}3kJJZIu0q3hb+`>jKWg< zHhGhg?Aa#%%dAC`mgHiRqs&#tkaR1uae!`#V{@^QzJefJ64hV92>qO3Iy0nL~N zx~?cnp^hd1FLUUHUkIzxAOMg4!2+QPcgMa)r74dWB6vRlDy_%?eTO)Z6}6Uu#>InbsmPw{a3n+4} zK)+7fs*EJ7#-2%+G)2$!1S3K0C88^4Cji*KHuT%*PJgX@nyddQZbr)OtR zPtTe9Ww+2N6Vr1&AvaGi*gDMw6N1ku^65}Ncw0INp2Iq8n)Y%9&cS{mK~l*Egcg9k zR9(Sl$&--@W2!o3W(hY?T1OlrD`SmFwVRQV4F=K`gghDW&tP>#ZblP!@*V8A!XV^Z zsqJFp0Np2*P1;5R&y_%wz|Hl8!-F6GBcJ^G8*lK%A>IrWMdO%6`%L%tux8BhFfMsC zOr@lC@Lov8pq}N`LE~2+KFqz>B~M`a?E~K@9|f2Z?wC$+kUPpVwyAfS9z!vzyXEG*X=RLcTJ(a>q+OdqbrQB)-W z8sJ;iu;XOX3p}XevFyC&hh5J$J`+Do0`cLC%(80&wr1>W58;T}DlYG)GT2Tvb+K&D8wtFu1lp+Mk@&aY;l0muG%+fH(xo7Xpm&)Z z;_-M!GxI)CP&z33Dw>0PGb$)%Z%II*NRlAq#7|I#`oQtW|3w7EF8R#VTyTT;`Gv=>>ZRL-$> zUN>?T4f>|xlU4L=Y607QtyIMAf1|}z3a!n9?)W|WK>5xW6F;nf;bhbse%%5?Ia#3~ zJA%Y%H>x%>-XuXZF`2B+Bk|PLLkh~b7j|9V)gaUEc5*HS0$I=6W)&);>$ONFL>_1i zP&q&d8JDD7CD4eUpK_DB_-$9eDdxn(_RZM&p13}?i(BlO{=xN`Fi2dWDw_C8+c+$H zHxplPBlo;y%Sk7m!imoCB3-D?}+SonTMsSOAw6RJ&)`75dqvOS5o9odtxfukc zL|SMSPLZBOnpN{Bra00i@#Mf@lYhEUE0rST+tTtO3!+GoB&+~ST!r0K@hDFI@mMU< zXcQ9r#?{txv@_q@;v+oU4-WTscPEy?kIu{-y+ucd%}(s(i+I6oI=|!zEX2+W5_gaGnMa;dW_B~9j9#Pt7G1Q%{vcgL=hcdr;Py~-kQVI?ckB#b zK!x3lP<{JHrwm2%VoC2WLj0!5h9o=}lB|DGHO-V&68Q@QAh)29M1&DZB0aEsOB&Hc zI>obwwHl+zJ<5>#NC~P-F|H)FWhOl#ByHgA?I?LN$p6aGAvf%rp2U600^`MtP9>1j?H<7}WqX2bZobiE(YH=Blg!Vqw03w2=^5L?j}(}_M1LufHxo?j|Z zCnz~eaEDz$ct5&f^d+6?_`hzbCcAo91S<`&0|d8-rs~TDAr&;mKpiYA^2$x3*VT2o zR6d?85}6YjCNl&t;p-gDjdEl>lAHd;8r+~W8apA0;lUk$Q z{rw5vB7i$i9;PS3kc3&ff~X5iBJhBJ8C4}Cp(xS)qoA^Ros+N ziD$lxp;zfusGzNfF%Fd+u>=8)&Wc?6rHvv{9U$m>Y?DJNPeOGu5JgD{BOm-&_67eY zY$ULe!26ScV@IvVgX|xF{dK$+Ka#pP%{X_g8ywKw3Xjp?J|2Iwb+~_k8rHNrGEqlO zNdOp~;3urdN3M#oBE}Rn+MmJ7hEv9U)VEkWcH7b#nklQM46KGV44YRNC?Aa*?Ad?dEQPw*MG28>1T;w6hD`0?0A2FgCT4)J z7rs1~m&HYQQ_eeYUx3pXlT7gtKS3^Rf@p42T4)u?wX+7rtwc+_1;{b(Qqt3PQwJ{d z0dtT@*ENf>#MOOUeWm0xM1_iidariiM6jcpBe$MRap5`U*{JZ_x!I_fgNS#EKYNe3K$PEDx zg{sgD@gf;4<*rGm<;Kv1N)FZnD5*cormTDIY%>WoW}2DrH1m{~qTSwcs;o9-#jiwG z`OvM>a9fgHB9cMY;&$6KIgCVJ;Q`BZTeVa9Lrma}K)rRazju6m{orzTe6WAC&zI@X zXarvFdVF+*4+eMX?Y>H$;LPQMHFSK|rSC9uM}OQQ28Hcrg{-ntp>5zuj~G2_PWqSU zmJ4{jD8$x-U&<+=v>N>?5!0!;Jy&dTcH(&n?JY-jnabd3uL~a72G{0m@N3;`6WvJQ zeM*4g%YzmBAA9|EzK_8>RGqyCMa)ADXvP?Ngkgsd#DF|F;IlrwK2c*5{T9usF2H_k z9k^z5D4Q18J1(sW>#|2L?o-;NNPMm!sPwT8ODBh z)CSnv`coL_FqB25H{wnE%Q{>^f@+ct8^$h`lWZlmR<2jg8H!9Ra+h;qOI@=YJ?ZcINU1>cLK zVZLN}mw6*}7tRnJUVo@=GvbXnPsLQ8JW47Y&;+?c`1Dm%Q|CkhGFb<=V)heRw3P(| zfCg)9lcGaJ1KNbUH@>1)h#H}4HSd2c%q-b*^EG&du?ZUqd=LpZWSxQ7dGzoV-aP-# z(Np(RSTCW+IdfPpdbRuFv?GO$v-l})ibDFc8= zds%iRvmGbce3f|JU^K>I8SVE)24 z5{mcZxRN32ySqIZ9r8K)tJxk+KnLIsjd`Qic0P!Yh@EeN0lT{UrV09z>hK^7r>~P>l#TiPa%U|n8#298JJ;aS$L);4Rv(CwZJ#XNG z#{#3#)VTDhIz4Bz1eTt#Icy~Gz9qmAi$-z@VDyQ{kJ-D!eGhLrbPPrl)+ltyIuGPB z0NMeE=IH2<&-X-aqJUz`8J3Jn26EXVnL#ma?N4}6^^ouT5WFMi#c(Pm6qzK%&p;06 zxlXZ`kkt2iP`lo2{nFq5Kfd(E-}npv$$!RjLe!>94A!WdhUgY6|B?a7Xq-sGn|>=1 zWtD2&kL4cpsc{5E5!G^nM$aG`<(Gn5G6QPVlO9Y36VTKi0Y$fJoXJ$x<~Pu-=G8}` zBoNLS36o%917-DQ#3B;3G-tgWXLyLH{b{)*5|@};o@D@&FU449jR&FhKZ&UyHB#vV zl*TQoSC+@Bt*1aG#Wd|kf_SvVCK@Yb+L!7-$`-_`nG`Uv52kbeAI~uG7#za~!eJcVKIIV^~XQTAt z6ociaCFIR(fw(DP1oT#|&SNbRzcq|CrJkU(Dr98M2YSo!3lRhXKu|WZbLaItpQxJQsoQ~_6bHO~5=q1?2OL2rzYheq% z`Ngcw_7=-iK50kiW56OVVd2fr>D<`T_a68rA5@U2BCgb&i9r30)d*tV3%!Fc$()@* zTm;Z?O|woX)B-B1vr)^n>b@3#%zYipamw2H&AiW({?F8%&W@9yiSBq%ZY}hvk$);=d%EcLAFILL=3fRTlZ)3>NK_)r&$oJ=vRgGXp zw)oKH>FL(-@e#AvjClc~hhczWFOV^VqnJlknQk6WmV3@B^9>C*kND&c%7>q$S_C-) zFQE??;GpK5Sbn>j?v2hyMjj{jC_ zuMdPvFcC@9*VI?GFs5s`s)UY){2JgE<>*0msa_@%MXGMKMgc+9a*+xSwM>HU1iG6V zQ$!y~E$qZn>O%^brW1if9xRXd0~KLW?5+u9?~3~&bb4e!rUFSL%S7RYNcun|ka*Zj z#jOR>j?B!ekeK;Hl89{`|EzKfL9aK70pto88A3;}0O!X6DLYkw z1LTi?=Wpu8hCbGgC&X05WS93l;}T`TOH-qh7w0q2-auG}#4a&+&}p$qqFvG|UJzgj z^U61^aHvKjH@m=|F9-5N6j$eLg8{FYg}0iVTU}Fc5#V$wWZEhXj?ndj02SJ~wCi7t-ZO($0e4MEU3v0Sa@|hE7vI)mgLDw2D4NYYtllo=ypO471_YS zK$gM_jre;|m=pm9C|4uxa_lX9^7NXA?(eYH!Opo~RJsuJ=B2U4ilBHK~~oc7iW`rEwieDX$2gw^@RgN9?a}*c4W5 zaCA~=&!tT`^OlZgOy`gXMo`^0h)|+Af(}By^nf&mlH=ExG`ixJv7FHaHpZB9P|5^s zv}(GvIBW;y-}zlJtN=C+P;1}KX(NFTD1jIk#@)wWe|&ycqz| zrc29j_doQQCe&grJ!3aR6J_L z=Q&Z=TPHr175`jY0o_f6z_KYLLwcZLBSlk#xqso}SrWZi~ba03( zcbxi0<+TJ6czi1ll}BYW{X-(U*Mjk6qKMt%Kw5Nq9(4EGP9am`$1~6_8j+5Yq)PIU zE8@1S2ud1jTA|5uvB~ zdLaEPy|J-a;*_MDig%2eN!YdBP{`t zR=g+3pvYRs2oky_?~!`?^vsuO;F5Y`*-*giS*pCf#d|eKaSoaa(7(L*!0&XC5uq#H zv{rmvax4w0G&<}7Ng-H?nsL-R=oGQy?L0;_P!$_R5GQd9vc+B(2Hy(t@8F^F6_ni_ zT8(wm#njD_wz|O*-Zu1vU#qo)*l&?FY0P4$s9S`j>hEJiV?whaKNufYRQEgaf(F3 z@mB(GzO?}dXJo@Zmn7xFYaC+rA2!lkpcrEca#LhLK5*YPR%w+8AnC5ZfRi7d6m|5CjWpBp zW_rl%fxAbh%9KAl{><6As!XI)$Q7(D3?-+RBH(lhF03b6l%*RB0!RGOl)ld>Ygxir z%n&4vu{u$z(4>_BRc?)i_$C&YnH<~iXgH_K~8|A3>75Tj-?Rn2r4dm)r8rgIrBj36hDEY ztHhkRuX)O7suoNYmhMIbKz6AGIL1zcfjBJzIAlS~)R6rn!7WE##S?OdC_T=1Zs~V3 zBg?eWW(J5R+Jub+KA;4eA}S5Gb#r`l$OkUoeDkgSLtlNOssORNgP59uUvz=9DU8RH z6F!@YO_?&_3ouY>k0Agb3>rtG9C_H7du@Cnc2zTv%oqfvRQIy2uAe^m&1+tlf9wB!{`BYrS1zi4Sb*aT=8gAm9_$jb(Dmml|Lso`=Qg_@Tr%82}E_Lz`R!Ydoh#1Ui(V*=#h0$VH zzHo_lcq8ZJ;n5N1jkUx)6y|QKlCV>1B2y?-J0}0Ap=NMEWLO_gxL-xSuA&rZSk{I;GyZNAzoAr-#0Ea9Alcp0*YYwc+HUYRmQUpPUMT^=WB&(mF={cD|4kKuq zZL6p=qvW7YgEPV7%ds4wTUWT_Ja>klt%JwP1s1_14|%7ozf0^Ec9!yzWVgZ$()6->7JTC+CiA;zEWXaGG>|T z=l%yDXzOSTyCMdE6)M7@){fjtvn+3x+wm*Ud^~9~&P!#ynU<6U&^ReUVM84geThRa zTm>Z#W^TQA=R9^>ic$tpEI~Ff_gvHkf#yNOp{p=&fDXm(GDpggtI(njsYKMe-VhQI zPmG6D;W+BmQfgH79#OR)woZ%d^pBni*RE=*O%<1Wbo67qAH{!xF2~Z7dPCIFYKlQe z$5{k5GU_xaEND8}6hu(w^N+`f5(bW3j^vug1=XsGH4)RaX&k7Ug>|$7sSA}YOQ5l| zQoz_3>R=irl3Jp;M2j07*naR4}rR=6g0D4iK{fe4PrE zi_CHOMno;DYy}So5Lnf;F3ePA&BSWv{Xk^XBDAnxK&`)MtSi+Sp)_M$>MD<~X7{sA z@F2j9-{6x7X(7ib|5m(elcC-U8n+q=y@2$UJRQhp0<%Sfzu4%g8$!7?JAo2*h)RP| zU;1->dV0Z<<--Sj(}K2{T+elEq(EPEAUZA#!2k{UAF+uG&ZKTS6TXpswE!t;2pF>p zDO*icE`6GZQmF;`5XcySA7L{HIEPV__&3A39cM`$AaJHv7N^$R2Iux%J|=@>9+_nS zyV&4he7(){|2zuFcw}ZsXPq9(Jl4#nhsUg)GKm$($gSLwD1@DPk`J+@iJ6hS9&Ppj zwXU!^Z6xqMCE%cbCa3{Oe&ylACv5OJyO{3nGb&9ZXAPd47E3Z9GY^E~KEJr&zL-}8 z#lVw?cI#?Nq+p143c+NE)6t#P3O}QCglb@;1iD3AK&D7;ZocwQe&hf8TmS2S@E`x@ zdxwLA6)Z14s4>)->^R+8fDToIdSwHMCW`9#Z+!`{q$-b!NkU7^2?TKjz_4Z?QfPox z8bgJ9s#vLG?(tN?D-+_@2f@{gXiCfaPn059G0v_-sYOlnhBAPpz)Cc)nROWiDsC=C zq6!CVibsW`jpG`LPA5}h06lcktN|X?62BsdlLDx5O>61kgO!~o;m(bXn?yt%oST>O`uK~23EJeU?P5l?S zlHm*wR@j9nE8FOhrC1bi7G>npW^;N3wrOiP_lYK2S$__o!qAFvDGY^0PIeH7_9{v& z0jZbER~+_at|;KH{BY*555J}jT7$&(0KNQ?=Af&73y;^=v+bv6cq`;h;FgsDH-?G@i|!5^bJZxLkjsQ z7MS<1Y4B%pq1#YvumLP)6MdzkqChHPsV0vUEP^d6_c1I{_b^j_4=|XzMil)Cj#A4= z%`APF=u>0>+flfxZ6#s~$GY|G-V9YsIzm_Jdw(iQ!D0fqWDjLw;w1zLK;nc+Ta3`v z*KyfFE^QZUqVOt2R80*ls3>cIv^zpj%0m7;l-edu1g)&Di&oa>kclM2Gd~&Ogm~#o zNLYL2&9O5pPIz!_EWZ?nlZ2wFOQoD?So)F}*e1gD7PCEU|KTwrXdmpc1DY2-GyUTx z66QJ}YOQy;LH7j>Y*O|~b=x}oelVzfYJ9mE&Do&g13+|7aI?TBW2uzV^INBUw@N93 zFBP&rgb*ObE7-%}P4}i;!~t6RJz0IAy~Xmv4wf1!aV4YdDV{(^8pVd8ewA;Il~1Q_ zQV29mC?=R8C~gcnHL^kI6!HT^8FMxoRq+pL}9oTwMTNfG8ln7 z(>dB96EjIbOF88kh!kiC>r@;7lYBveWJC1H>A5Y=mOYwE)|}hJf772~E)$V2eXM~q z-$7*xH2wqgc3HIY_Q_7KXV)A`DowSs(wX*hKq((ZBTjn16|ge4A@N|y*pW|$N8!w{ zf*n0Ipg5A!62&Z0Q71idCx>u)t}aca7QSJD-vZC(h9+>Kc9)2goy6%X%>B^)iF4#V z2O~C5J1FYDAZ;2pW!Mguu~ZkE<3<7-34A0HKo7B=_4=dNzV(N1@+x*MRwbPL?I2>Js*^3W03EqUtV0GHqc2ew?hFK zeW;FpK~O2Hd(};NRgm2o&CxXVNWARjZ-obx6uA{Biz-$1Xq;V85y1Z{=2VqesMu7w zxC0T{NQO$O(NZK18L0*m2+^$EK_)4hR1<=B)%D3-7>R0GRkIsM+$yEctu${v1>lm! zo5G^N;?o4oOj39in+{MQrKR^Hhww}!>E#W%x>CGr(AH4V0ZlqXY14xu_^iDko^mgq@$URLD#CWXnZsVHX zaDxmMUnlJhko5!yAAwWR@rjNd9!=B@!l{n>gi(~JGeasGnv*F^HtE-Za89VTKqTe} zf{)D%kgc={8wq@55{TMDA3l8W;PmY5>Df7RIx2^*CRACB?^2+8GN>i)(HPI{sMz+Q z(B;$Pqhq%Cp^U;+FusVts6c_#4!k>Y;UsQ$S}qd#{cngn=mhTgb^THib!u z?o+c-0tZ6ZYQA6xqO}lhEDNPltTan6Dv17u!EEm$os*Cv*oqMi2iKO&xe9ZM`S*ph zZpcjyDnp8v4T40~t#H9A6}0k*tM`;nn_~o==|O4AfWA(-JDCas4`BL3>haRV;*FNh zoha%#+8qL!Ndi&>g5o4%+-e{f`PZSKW~hAR(VCY$lBpHfVP1txE4QkdlXQwlF?+76 znURthi@=ypLA(kebt55zP^8=eStqjL$ye#?2jv^=fFu#<;2I252| z#qflDM%it%zUMF-dTRFza^lM#R~NHOrVh?8FV5)}q_~TUm5VtX=lQTq{P2X)HpRzS zF*bONSW~jsSNkhE>ITte-p{L06KHAd8T{E(=mdmJ>fit}3&qDDE@uaLK(MW`w@GZ1 zw2D4ZWJ7Z*AyA~eVpbrK(;nCCo)Q2z{P1U~LJa zO&s?|soLR?xZ^@Fku_Gxasa}jb&-&)MGBw@cqQU@+0O(6$d&<33WBf#^0WWgT(Z!U ziP$x9DsGmSJom+Xq%YdQjdiF}U%EGoM~sy~T4O6c+MY9ejQS~Wgyc*EIb>)aLHw6r zF(_omOS@F;(6>rP1QrG^xU!dU<}v{BoXU%eW)r8Qj5Z0Rgn~We%UF#^8Y^12+h%}NKi4VVEP?f|vpH`h@R3MBW#IVC zM*|+c^2)`<#r*1$>3C(0b}qMhiv^YmYj${a9Bo*o zU*-sfwkXD?RSLwo6<;d!Vns95SrR|_>mkaBbZ#Z70@`Sg7ekLmypoQ$Lr=KFw`|I% z;4>W7W%QW`^fc<`$&+_6S14`X@XN;(t#-rEQK=|pUc4wR^e=3Q-*mt^s8O3D_O=o= zjl!*?Uy5R4UvJ27P^cMI*lJk-G6N(q7*5Z4QjeQjCc#=d0dv4YEs_rvT@ESjHXXTKQ}KNqvB%jMh`Qf+VB(eu?0+JIW)C$RFR$GE-2vs#z) zIlT}gOtbhF2YjAl3c9RWZ0+ig&_d2AC_*qOBZZ@6NdsOMZ?@RA%SP;dzRh{SXJ^~Rg zEu@3VTpY5NXccz!`H{uqk|(NWS2z2%oZCK7 zbW$NQyl^n^4`YFZHQ7~r``i;(06 zc&?q8B#rJukHoEU{+xAGeQ7$pTYnr2Bc9suF*8@qTr7)c?@-a>CK0i2W`LCRCTt|| z(Mf=jiK;=T`C1@+pl`qV9d0@qYmDBgW3!{w)c`{BM@j}aa8KTS=NJC>zwym){NBLQ zgNG0Q%)k9}pZ?@5WfU%F7P?MPp8U!${lb@j>mLc0@F)M&pZ?sx@o#EtHORPUsv~lOsKIbD zu`*C@F&V%8+h6*h{@P#RBO3$IkN)#N_H#e`=YHsuKZFnpPiiMK5r`Arg*U7zs?UG^ z^MB_HfBV1qFaIl~^p&rC^$WlFx4!sWzxgLV`_q5+-~IPds;Ek>AhwVbS~lJf)7;cs4Do)4Tn`uGq1#Gm}vj~>3Ra@WD~DC4<>O6)P+lv6^AOES(ed33HJmoZsZ~nnozxW$pz#A=qgTn`Z>QDdK z#~=S;yaGKQRJ^k;Mr&fAhsgo;@}*+B7#kF`-uLNjvWgaksEezu^7#E=6R#^ zWJ(X)%_B(2Thj&MSX+7wHrXc7`ykkUaIS1+ka~@GuE#rkbAEiiw>_IJXKXc^FcIWq z(@u4?dRa%CMJufUw3Y52i=}i9M-t?M)T2LQ{vtVwK(^$k@8iOoZLFk#D%Xez8<^nT zciF@M%eJ6k)#(sj3eloalT?y|C70$~GkB-~Sk<7wNnBQkX%!2O5Rjh;r3#V}5{RFD z%}m8zv3urXGSdY@8(1M_$$oWX{&UH_!OgkLcHvAER*!1KSKU7d7M_%1E^HubODl;b ziQxbg8AHWB=_FVJ7%>dND8;H^vW2Wm*$_~E+EM3F#!R44F=MtqAyqKRVyx9N14K{P zk=|Zr!;mf!x{CJ+?JhGq=xOK{*Us2zuyKHt=_YI>@R3R&W7o|+JC9y{1*^}}09FN! zl7a6bgF7QyJ>!*1Vr%O+f9+TQ&;RYO6M6md$3Oiq{)xk*qc?u{|NY``{`z0}%m3ZK z@Kc}txj*;kF?Hm=Fi;Rvad3E84iJ}^7x%OBMMG5~Is~FBN~pqCGu>)InZb&F^|ycP z7eD_$6aUdq{p64Qu^&4-J^8hN`1k(dul(Jw{L?S~h5zV3WkmxE+n@o8`W(0dseh#n zudn~wU;Q6{{nzxOKJ(ds=~F-U2#3cHc=ipoj>A&3K3HfMI8thO zd>ss=|MD;Xjjw<8iW<%`#=< zHRuP}F#PA%yv?O>Uq5^D<~Me>c$+_SdoeAL^r0GWh;hBX^R2J#?H~QIf9|u++r)XI zf`s^VRLYtX7K_=*lQ+3r|DE6d`(OK~ze387{OD&MJp9H(jtH1W8U;hR0eCA*N zw$3KJ9qc?$@QY%l) zMWFO!#$&+Yffkmib4ER+4|qW~&H#TlD1nBh;#{~l#w8uiC)+@l3ub-rflkiPae&Te zmsigAY+vFAu}du8CmtuofTqn58QW~}KiS;ID?4WkoE}{s93Vg5#48+bZg>kQ!iF;j z2y%qD-h-BvAjh6rJj(-IVM#xTd9LYr%5(`f`f{?kV)u2HX5;L#YlkvvH|iEiTNyn- z-Bosv#IKUQ3aP4Xf^4XIq!D+~hT_s;qHu6?#3on#E2AK{!qS69s$!nRm17g9C*bV~ z#K7b%Qb-qsrAZKNQW1wK{~vp29_-sy)%iRA?)2s%?zURZ=8jnu9zKn>VJGVF7X&W)Yd2Q+8I z@Ogcba%6~~J`i%iiDsgh=)?hvuqTI!1iqFMsC(F(nXOAtoH%jIt+z1(HVN)U-XifUG5v5@@Ic(X?X>|fKRddju_@g#ph!mAv#5!QD`xw%xvKO zpdxUsEAfngE$!c z@gM#EO&_~)adGJtzx=DGPF)5(xzB#~ciepQ-~QHb{kPY?_BE7#&U2nC8aR;|VhYJ8 z)5KA3KBn&Qv5_7-U;p~QdL_vS_PU?_rAsfn+^G{aG|mKe(x@0H9&L!OCs3Blzq1Z-4HO(vDDn+~ck}d-k?B z|KlxYp&ItBqTAUw=wySPr9pq8=fY-#{G}6e7LiU><;XD>6k##eqC97DpJwKIJLfMP zSXrXGDBG;aA(PkASe~uHC2l!bveL8}HlG19-2~r}to)FTNMbHs{$w+A1k6IPqWF|$ z5aty);z3K2a&wdh33C-XzBxt#uBa1dP-Wf{l4*)0f>5#%yFgNcfHF)*mq6N>)(|T> zux2DBJhs4U7}JZTAmo!FThq7#yZFbXQw(`Hw3Ax}&h75j1)7eH1w=MN#x7CVJ?F2W ziwhINYhb`xu<}-&yyL4_s@$;ULARxoVymLm8$G=vE=7jnPuVw*^=CdJOerf>UZmB`*SQYoSOalpZobCi<8Ji0uu>*jU<2y@W;*ATj*^j zU`4#)3EZg_86$T7-h2M^4}S+W{<797g=JAIQ9|2A3W5Lpw#Z4t*@;-jk$F6_Nn~ohn z{%gPfua6x+(V(OIPM$b<%{AZp?swmC^Cxe<_9;*0jTLJfD-E9+GFOoyK*thvWA;9N z)5p)8xeXGRU4HtPe)*M$j~;WV$1H+=kWP<3JsxbbDIV0LXKwlX8{hx#m4io~|Kguq zUO5;(qdcdlmJc2|b;aX8|92m`>-JktU-bmOR*Rp)4_|_3L`J&sDp&%HcfsNntO%aQ zg>z?bKlABt{N|^zF*3Z;%&xFx;Q^B6G_&{FPknG`E)%W)G)j~$wt@AXbU;_GgeGe=8?{PfSh58$V!3OJq{2~|2VUz*RQs;B% zAt)6bj!_T8wAvmxCNvJtef?~}%u?FY>3`K^K;ot|tb^kP8$@i-l(Na`75R~_m4j9C z!Khu&Iv`j2NZW21?*XSS-j(T&5hw=wBd>Q;T^kL@D8CYz@9UF@CzS4w#QazU0bo&K zZM`kT;13eu%r8Vqcl{HjNo+^R;%W#Pc;fZz%2t*~hmxv-qQ!{EM@hk8K+fH-$sw2C zqZD*NN9RU7%m+Ct#uOTHe>6c}O>kpR$4dnE0~A2&9inv_X^Q*cL6Q+MBU|9QOF-)y z2wM&iLpvGkl9FC|k(CE7p;NLmPKv_ySSTum3@KYUFpxKJw8wRkq)@K9kZc-fnU;Mk zN2^)G!%DzKQuPMtWFy4Lb8?tS;Oij)?ob~Ir>9RIKaLBOZGn2;&2>lbCwbF{KS08F zzTibC9(F0(ukL!B6cDVhuQTBBqd)%BzxA8{=`a55HIMs-Z`7CiY693m1X`7McJSpL zGhbq^?d$LtRBc1Xj6V74-*M#Vi6Wv(Nx*7c`;6z_`uR_P^5%~}{NY#dB?L8=nownA zv9W;udE*=YHwi!SQ`hls|GwP7pStYSkN@~T|ARmHy|=&PtuKA)OMw&zf2evivieK! z1?*8x_#S1vV0Ah{@%qOOi%HtpS$Id1tmM35Pyrm@=7&PrFNj z3Pj{YB^-9Fk=F!SH;yeNPBv2H^B270POs%#D;xct^=%gYFlIC0hoQ%7;qwcwC8?LS zD2u(EhPd7Yab-z#LJAUBQHO>%cd67jt7 zZym)>dl3ijmMFq<|h^ zOXzh47XmRc$bd8yRH7c>6-xPjNJxQ4)&n;L5^pirO30kO+R`SO4^zm3%Gw6r5}C&H zRVk}ooQp_!p=`wJ42sUu)Jy)!<*FbHIAFsB%aP(CQHuy)WGX2+K~)tLAXLn5DzBK= zqfBDRi^HG7w91v~g{d9_L5$mnqdCc?5y1}*>*dfatF>s?y?!D*MSOK?R9cfTk-$U( z|DXi8eN`E11OAp47mpr3a`xQa(Ff=i^;WVQBA#$R_Tl$0E-gRd>L*oFbb|_n#d=`i zIe2k-D%Mw~}AYNv5I`QB)b-z~-e$&k#dC!^8{_T^W@m$7I zARZp$1j#Qj=wDD8#qL5K=f(M=N|s;Dr|!;xVRlIK!nR+{8cl(brTW!M;SWUES}3OT z7B0W+5x`p3mx-ns&Pa84FS+F5Br^PS+2xPK>0;yt_f-#;V{ewPa((Mlp7Dm)zh;RQ zF+B}8KRGTpMghxKnAQ?>f$A$&639xRq-R@D)@K=NSzBMf`ySU^Ir_rORxF;yE6ReL zG={Sd4jTQ zewdjo&9-epOLhTF$STv z4^yPjcH^O7gio3AtYJKo;7UT^Q8Wb{w5BvrITEDHmtEONVv8j|jFIdGWm29)#dBp= zD^|o>FSJsibU@58J-d^WlH6ny2dK5eQMLtI-`wo6^s}Q> zI*)tRk?GxC91GqocCkc-A)IPpcirI-ldu^bg0K4Alu*=!#>Cz8+?|=_HH@!d>Y`7z z(^%z;uy?v$&HlwN+y*eyBaAmN>tdFgC)G_cj206ZL=PQ0w9d!QbWoz7qKu%+C7-wzu@e`+({AxY#px+3GkowC4BR-DiLMzy60&)&s;g*_9_soqQr+ChX_rBEZm9KTom3#n)tc zHwWJ;{(&!z%+6m_0LbW7HTA+GpCH)d?Hf!F4^@~gluxv$>I=2S)CS53$alQ`t^6)R zbQP{T@oyq{+#n1wJb?t`oQf+UM%OBZl{bV^ zzNAn#!wN`VZ4HljfW(170!(gERgi#=2_~Dz@d&#LuYK7bb2Du8jrYUePQ9K?`d#)+ zvAKvRPE&|b!Z6q@65WQHF1&A`D)hY&Xd>Kma@of!0X2AFvFDmcoN9hkSkVu3XOgxwJf%LmT zsVF##HtTP6SEUVcY?w`AqdO$VI<18{7C_UT`}1s=#J780=>i6zKDq~M}5*R1do(p`52J6UEV zB3Rh3@i40v{}K?$Tj!6m&$(>q*g4+G&xBazd_u9Ym z%B!C7ZQstsR4`dMK7ndgT}(k&YwWNzhi81?K@z`5)kTC&V1sptJF6PwJy37?=3qfh zLTVCmu*lZ|n$#>G8zJx1a9OV1gQkF7TnId-Af-qk*Q>e z#L`(3MA&uLVlS{oA|rPEvZA@Qs(36HSrBa@A{|};LDSes>3yU(LluI^O#fqNXLEb7 zy0)?5?gC(9H84nFm@_*HouZ?H4pAI$CS&clzZ z#B{dwvC>rjP*_b_ryWg~e{ZbT(ju}ya} zT^?uHL$`>-Z3@Vi>Wl&k!(=3QM^cZ%(eM>E;Tzsi7qYGePZX@y4!Gb*enEv|c(Otj zLbt`MQjo9?(kB>8RV-lb%tlXu9{@_XiVEAsE#tL-98%nb6i-H7xOQza1=a~nH*5XI~V$^yEpF+pKMD&M)$t4WUzXzbLjFJRO!cn1CL zH71o<6Wi-WKMEubwa^kxNor{?1^}2{VTB2a**gtSNPDSWh^nzzbS!6Q zoig#HqvP5X2QyGJm{?v`&pYr=fj#zdkH7j`u2K7H(XsT-DLJy?UBDpB8^tXA9>YdzxnDX zL0)44?>z6?w@Y5X!GgX_aLsBsHfUgE-W)|gO`LA#LyL_siy(%t9o zT3fqt;J{%`wPwmZLYcD|A?U+oSTsi#t&J+XPS&iU3jn+^+Ee2|cs~oQAI3S*4YNpv zbP#d+XR=gtCIUX~oV@VlD=F+0RLqH7S!T$DkM+v zXSJZ=`{H;9wv-Ny@)g<_vFI$RM~*NPkysh?36TI03g1yHg`Z?1ba+264`jqAFf2G- zntDOUj>@WMg%<$=!P!dNGeuzzKPRxla^WcUiIok zhPGj;YwMsC0!WhQ;O1=9Lpoy^7j1AVtrDsLhGLB~(326MlF8&ak-*nU0%{*`Pj1M) zDP}D$J^8TD-12#xnBKyo!}HM=tUft?RB>=GIe}KY|k8-ow!84;+gHzemBl zGkq2maR)E!Ncr5E68j1bOOHoTA>)^$xXH4ZF$?J}^ZD=I0`4029_J&*8D;FVW5}pK zd3M~~+w#SmJ;t^q^O$sbAo4@E%HDF z+Kr8MUjLSM^q6FN<`c$?vD#JD3^juzEhCf*Yd$O>D?qGvO_5CHt;E4ET z0X)35)qD8rEtN{Glx4_How@bX#7T9Xu9hY;=Ok0GXcfzuiwDD13)D1(kwBK)h)x?! zF?r0wb!WSr_=i zZ}8%KpJYl0fjA2>R2w1fH`(D*4~b~GZNw^Q*_34h)gca_&i8;tqU^7@%QsWm-3PNt z|6z85@t~<5GIz^FTq7{}o}KTjvzr!9pl`y_s;olB@tLKw(K5IgW~VK~l$M@(SUn-D z?bwsFr}2B_fT=g%1TT@$jii>ou(yNbMa$DzP$a;)1^J3uH*;Ofv@_kJ_(4r&`14#L z5ej-`&8aVS^3QIOVD*XXY6ZaNwF5;|c1{z*5q=UmDJP%i6bi&jqv~^#K)H$tt7}?R zI2%oe2E=JrH^Si&!0IxP#`vh?tkzJ>@n9Nya3;l683>}fNC)ulqdajN7yykxa=+dT zYKXYlk_=mw?uC4`l3s8riHe#XI(6BOjhcm0ULdJ@9v+Oe>%?qmvPGT%T4IQoqrBF? zMKV`iK$GJ{0uu>*eI!u#AvY|_c(Ag(bo}U%yY4xM>Oy0qpdrfL`sAlQ3kT?puY1i; z{@kzlfP0^C>*qi7nm>5ecRc@v*F5Fvs4h^guWxWevlk!suoTOE3f(86shj(xCqYI# z0EQVBS#L7uroFuF#Y$C_WX5+K{2-u5u#P-sqfc>pW@cCn#NH+_WTmi+W3!G#M}a{a7R<=W|9Snp-+BFuzW>GgByoVE z(ZS7m`dv4?{q=wGXRr8`S3dHQSAqxI5NZtk>R=;mH$jk96Zl-}{0W z{BRj6E=yS>tq*?iU0mX-LV9RH)xG|ttN@U+Zh$ESj2#t3a#WnOQu4ZIm5VXXr>z;D zV}P!_AK5D1(hjOm4yQ=Ce(NsDd8hDUXoR`ZqjrJOSSn`0v^`N1Y z40O0v9RJEzOw^xb^B5`G<1(klD*WdMhcJZq4Tf!kHhkVi?fN&YtMR}4ajR+%&xlVU5RZ-ZIL1c?n zB9)H=q!<;1mwrPnK`82qOx8@fXQ9s;_+=`c8e)_Rbc;esv?Z^J~kACMxFM0Xml7k|{@R?72;?H0G zdt9El0Gk@HSn;r+6^u>a=hEmTTYpo*O>!zW4GX_w&E|g*;hr>!zrJusZL0=k@P+ z+nZQO!)L8FxB8TbDH64hq*^A`B?n4qa+gly*Iq?eSf{Qy!5@_`+c}3C9mk}sq5eJX5Pjp@zlvnc&Azg$uqKF z&%i0cWbESoaOoHTRHvt}c*LWRAHU?Ln?CU9M}OnvAJ43%4GWjB{H8a(W_9&E3^1yP z5haiaEp@novsH5#A}5k43<)HRZKBF`B-77JB>;d|$D3bmPE9)!0eP~rj&)?k6>;(i z6-jAQ1Q8N=jS0+Z57$#!fY*{;!QK~6y7LKNFh3Gua6(Yw$`4~cOLc2=TQr~u=DI5lF@ z*D#O{3v?Jf7QLUmn#YEf?n=pT&6&b5mk4f65S%l2SQv#K zO`+5>dkc=BgMjY72to}oF?-R)iWV@YlZdRdxqyvM?deh^&&@Oa#!wa=VgME7Ad`}| zGF4y85)hp|qJjxx1Vvp-hx0_G!<;MiiiN4I6x8A!I*INSJZHrRlIsVv@!?%9ni`<5D^Lz^_ z_w&^BcYWUvZEmdJ^4U-SkKg!r&w2g}uX@zuc+Y3`{JkIkzX>A)k3@AnXpsh%0WJ^J|0R5fcXLS%Q*CS94$D!M0aEq!)@yDfL#B=_P;tJ@~oD_ zOWQB`(B#5Z(xYAVPAppO*fve=|A|Z5@F#U>< z5_5d~d4|iE(tUh&HR@}K|x4exy0jUWB+OJ4HBkG%4c2=L4o zZu^rzdG(nyXF&KXulUtt$BwJ9RoIw7_ZMakaC^(`_^6tilnfoJsTaQRrN8^Tzwx@) z{oXU5`Mhhcc_y=X=gyt|%fI~NFMa9EqaO8y+iv^J>gomkGIWy@k zJLB=NynADNn$+OQy|XInx$&(XpNK709}%k3PcL=%tD?X;iN85V$j2rtwJg(*i>wE zCm2h`?L=at*5wd7C}pQgcAP(Q!Jv3s5SVHLgB*-_s|b(8z|O%EGQdBNOCg5;Lbm9Q*7y0CB zB7v`q1ail5BbHX0+BdU3Z^j3m&XA1{S@>0RD?#_S66OUGI3$4cEW@&42Os zF-{I0I`X_1eE(ICetfhO8O<``m(1);Gr-S)$HF2z_jt3bSvC{L|9K*dY ziZ;3Al1o4NiJNN01A0af^k9^lFJ(cEuxsQ~qdq5uyZ zI(pr|__epb>CZm-i5p-0n%^5IcG>AGpZ%TRcjVX!hkv4$C`o`Imp+fGCZ*!D>fY}1 zfg@aPY_VFFMbK1B+eXAMo)X#JW$cFS27Gemdr;d0o^AOU7n+|u1a{)Y$$$HA{^P4( z{f8g;;QL?os^1>xo7%k2rpF06MB%W9 zQo8KNe(V=s{pwe}=RMc+8)AF%lfV60&-(6Hz3M;G4!DcuEdgHuu!~p3fQ>R@FX=hn zXZT+uph#TO%pc* zA=6&CJK5oIca;TMe7Sen7L>8xDN-iB$XS~*IM`b{g6&>`a~HK()msBKp6*52(e$AJ z0-;Q(ngcetX0B%^C4*wV--Y|jcf{N`Xm^K=6IrD1rU%FfLk*|{mM)5Bk`P-+e{x}% z<6>C(-R$(~6ed-x86Fu6dp38BxWb{b@DVF+LpxQ}wVV~#aMHJ|Oa+ltdf}tBbln1y zN|Px{SrnBNjWht`WDr8e%aR@u+c>loimQqj-`-D{1$0uqMF~%*rP>PL-h^WE)pXq2c9bS@V4KHROk3p&?)Da5qt~<|Odg>JTzp|Q5Z>%!~ zvVPRDkQT}dstYvaU3ZPnfWZ;zEb3p(qa2xx4Q?a~rF_ zSt>Ng7d?-jxRm$#HR2j$M=~5O0XzRxfK*;e^2!8l6cZzZ{?_&;ON)Sw^P@mW$HKt^ z)bSIT`dH$VU9-~%53-7Tc4e`5V2QOjQ(WR3X{)EF?mBzNXFmP+aI&zlz=vZ`pFYiQ zjYt(bC`Zg72$=-hU`@;x+hoH*}E>fv(jvdl^HR$ig26+USr1iwT?>exu@pi0P2?V3O{pe{d6?B$`}Oh$IWL4xj)PE>g;D zkxB=6yT4~nm~zIJNO0nBcGhpmXXj{UyJ$o?YFf7)87r{cV;sonKwQ zu(rVqZRgiE?zynaadl&JV}o5Do!RvB_4-5_eD0u-r4KoeD%)YeE}g1zNr2a4vo4Zm zVv7KZGzuobW`QCAiMy7o>L^U9DLVV_CdUO^|!MUrwbrGa=2_12@3TZ9rF9l%*kiaS1# zI4V&A8-kX6LCAtOy{u479H5fJoW1MzFP-Ieu;@B&WR-$9Xx*RD z7bIO2yp41JlI0mNKU3fnFH>gAOUrJ|!;_-gGk1TC3hKm*e>hkSjQaq&vUsqePF=3M zhv~&@iBp1?g;j@h>Y?K0IUQxocO94+$an_xVtPuLRfayYlBj7zEEYCMHR%jJh^>v( z6$DGFGqOXb>5d6Sr2@u7E=4iqhP=hTe+DCWo(3^_i2}S>NF6ZEy`KDjr!XfKs+$5{A^XT~Y)j?`e}Jtu!Z6 zt734iVG)K3gHFptmHXQ}x**%kE+Qj9s2V=k-qLb!X^HKgS&dG^&amk-5h`duK{`_A zoVKx-IEW}`#BxOhUK+<{n;%br@N6EPEM-9*m8)(gQe<$0H~I1EE?ijWo&Iy@*X~(c!zFTyBi{9o+vmDA zo$q+m+1Lr<-AIZ&^Ru!E<)d(6Z%_v2q`DPLs@4+< zj+Ym5Vw#=DVD}cP*no}$g!*gb=|5%HP2=p4fVi9toS$FJs&HM}Jw9O9!%Y%`do9l{ zF70QeO|ix8No}}M`Po+yX4O13s;I>Y$q`dQ*gNdgAV?Gl!MI_|YcV%B5|>~op;=}u zaOK~90=Echp_?w$fl)l-m!c(eY~4sC4ONH`_p!4Qwrz*&A4OH^xZa^hq%HfdhbfMx0_))tb-o#f-^eGRRxYHs8umHdQGJ0$fz*+%T=o% zs*WN}n{iTOap)qR(PH3>ekK~`o!D^9!*vur)?e@Klk&lf_ro_o8T;`QSXv)VeJ6j;k;CX34vLFm3whbV!d@;%FxDt_FU%6P zo(LA($=OOlm3@BPX2=h``*0sKCmR*Q5Z1E%k&p>rmbAELn7~y9V$ED=mfSH3lDIyM zg|Pa^m);p$>*Ivs3Q%d~nerTn!jVkHkE^agqYoj%a=;xq@d{V0*_dH}MubU*C>Q_$ zKmbWZK~(8M;ZESfuVgXoB^`;G4`@Sg|lOpmTF*S=jnyH z1*GD#8j;{cF*x{_xvJQR0Z6t1_7~mvZuoV8lnX6pJU*S?oQbDpf z0q&o*Y^kPImMHvd&?(9#&8xT9#7J&yEEuoW6r1=uKEP=19 z^PNZ6>hb0#P7`}=xJ%S5n+W(#dt^fv1$ZK1i&NN9rn10hOKvSdisOB*bK@402q?)F zx$N6NWy-3jw)(5ql0Q=gbWG7s95~`eDNE-L_e6@>sv=DClb%0?Tp`7}i!Mz%=^>GG z0XGSUAlXtyt|Eu7ToB;RSPF2+83INV58%WBimWDwi3A>W32+y(s)jehZaeb@zRZrH z>+a{MmHqsT>*D=6+}SE302tinK@czG!i5Wa%gcUUTqVPeu43u#`in~6&t;(RC%uvy zlad3a+OxDQdUX@8VTT>1N#kRp*uXw&mIptK7LSxTK$*DmLjb-e=FUB!OlVsi+D**2A3Z>Gnv|6p%^u!mhowDYVj8SKvS z3O(-=#RY={KRd@;5qU2sP#H3BFV+%=HValp(7jpTP2ScDuTtV<+|pNn^dDUV=C zGvF=ZI_~y%7X}NAfH364(Us=z|3jB!RMIY1z=|lSIM4_!T6rEL%2Z*PM#+>(CA^Sd z`vP1Sww&q0)Hr=ai6l!=iqZ1cq_tw0F-XR4L#la_X<08{r zoEA)n$&8_}HAX6V?-Xtq+k^%P1Nuau3BN9SE6UzQzW(njG|O?Ytc>R;*Z4;Or#_8S z000Eai0yCN!8wmNM0if(u1%d%_l#yyJ@JkO%j^#%*c>58PV$8cq>@frm@$zy<&6DAH&CyB{yLEiJFKmIXT?@Jt&SlY*NAf6XdZm4`lDVUYm+~92{3^c9|mIf>0+F{fY zdY91@AJ*gazz<$c#voE&OJk)$??Fswqi%xLlJ$XO_vR{7dzT7jNGqyz>IvmK<6MGu|z5jk;q6t7fbuuL2a$*V$ADWisO zlGng!AU@>1%fkCih4LmmPAx-y2@$EnVag0H=I3`9UFDrVrip#Yj-ss7&*;}oKSXVh zgm9R5toE@I-a8mshAr5RIE<$Uc}b{TfIAH74_-i}2(^k@ap9d3LU_)F1q>NRj0)Aw z9}T83RFelBC%s(8!=^!$q*!@HiojtZpDdt5r_MWi^Q;9bbo94Y2NL-7ppP!H<^B;4 zD@{$$(>IY)?o7HQ?HuM5o^FtASTAmTs;@W0wZ4hTHe^nc0WUW=w<>fP93n#9=v#L8 zl8m5LvPr}1AgM^jf%X?sS9?xA#xbW6qVZCor&v1_-4#zQL@k*5+3VB!FcOKB3H zNZ>(}fOjCbEYCM5jvZTHUFYN53y#^4tWw~7@lE_dtO1PqPi{){M98Ar!P+`oMeo&C z#SjYKruBqvB~t8x4pAswCOSl$)of8yO+F?vpt3i=H?_n&`778|R43LNJECzaS4LHp zptC|!=|7#D`~=d8iLx6)5;5H@EToX4F`}b@+BMmr9Y6*_AWn=U8@afWm#2IN5KxG0 zF6`78T(ONX>pfW_p@OIIEMrX0&53`|XMGa5$x?L(v&Rx1{DfSth&Rn&X*tSmgBee4 zuo_Lp72ccez&`{XRbkcE)WRHF&;W#ind_AUH{`M4|K4x@D&TZ8qDKHDDFN+6g|6O?zRtO@NX9?fcuV8Ems z08TSoh=$W$YTj?gn1dTUsR>pN$+m$VQm6 zk<1OC9nUU8E|nz%>Q(G*+g3kN}Cd3uU4b8D`IXQ?h5MT zJ>q)3xWV3O5kabz`c|V;1#b^nflydWO*?^bGkM=eIGiL%0XBE-+$Jtl3G>GKg(5Yn z3q$HwSRN|3JKH;a$Vdf+cmEFbRBG zoR@tV0ovnh=Bi6ny$*vu5cUO(JTK$_@R5t`rbq(g2tHPK@~8T-$L-k3M-5Kg|6zb< zU4WL@xF0HEtO=~uW3+%_HO&TFR?vO?Fjld7_&tj(e|AR0p#gc#PS6?Ruq-Ael`Z1Z zf)yB$Eg#mM*FZRgFvwVk>F8fQYu9t717Qzg*a z2t^{1LJVC?DGiAut60RM?#L6F{OcPQs7Nu;2^6w;D{tK7!b9AmEr0=UnQWSmfdzAD zPa0YOhmkEel9*?m5c8YthJburEu)|?l5mAo+132O@)E8OJ`^vyZS{LD3Su0IQ86f5 zeHba*Dd`B3OOTXY!mJ$1FU=)qaNNP>(i$KG#jcmrfH@N(zz#^#31KC*qp%2^V+G3g&pFjqECjm0 zqOjf+wqSJ+^IGYa5KKXm90h4VFdbXy(iy&VOSQ^#KEg;EDynvjI(f?*mFjXZi` zZDSn^v9z?Trd25yOcmAFCIWlM8@0o1D*=NW0bXIhDuu_W!*KWa%w$H(CzS#OFox7jqk|k zM=)9W>O13A83sVwn8Pe_#eB5l5spn}E2T=}Pih^sXZ&0%(}sLD`N9|9v-dk+Yiz^7 z!e=tbX37tVM}!uV`!K{2#BkaD=srpzY5)&jPfN7OtLiNBT=xKEUMy&3r zY>Sc73LCL~!2ze|W@0o3IlvNa7a!Lm_B58SSrRWijUq-Rj}V(flm;-4 ztV2$w_@}s#wgpGz5T1!-L-T2-c4xPCc_iTLgU$d`$v!R-(_UOTE=il%zA(irbwuZO zSz0~q9zlF;HZEtls8(?#$3Tg&8x|~23cPlV*$L??yxTyoBn=eQ&OS4Yn)NFyww0)hLYX5)3E))buVB9TYrt z;6RX5h`&-jDhA6&c?L-^o7PBVAl#>9lw@zAx3sv3CZC^kO|EL4$%gRh1N6e&-tGdX z2^)jb<53eDeOCivSDf?WL6q?!KB^HJ)1U3%!M?${9s=-&=$+uYe7y=7xT>I?9z2hI-eYO3z(?ck2cZz|i8y@oYdTl9d zV?~Z>u{ks(L`pP7zM247J=g;<0c4pUHAKEJNT5ibY-kIjwnd-Q(R8TG*p>Thnk9w;&oR^1CL zp1OlddJ+rM=^iB(Wdi<8Ckg{mVfb$mVr6~Ei~CygjH?uk;IVNd3k!*n6FtTjrltx> zGdfn!pl>#kt}2YdHwxKlO3Dms>?OE7>%wh;)mc<;senuwze0xwwGKK zwcW$DH`tx*WzbdP;mfFu!WOY2YCO)UNfkj5!o`8m+p*28NCh1r{*#EI7tCQ7s8Phx z6v*b1Bba0(BH>_DnqBic)>t0$>_Bb3Y@AYvqG>|XoY4&bRL7pjJg=*LcKGZCy}!r4 z0glkp{gK2R-Hnchl)$Zz!0cS&@zNq_Z!A~a*goM-EV3p2#9PxKL@tF%7Nm8MV2x_p z3RIRO4p96xE6LA#BvjSv5?(}->~wo#agy5TTsjrlf$-Li1e2y)O}R*-I+!#+S}vP5NsK|dSK;1MwnWb>b`J#(ymn@j<^xgElw4n?eKQkMUbtNdrZ<` zmifYb^J=pS ziMK`g9#J^Z7^%-pwGx;CidEFKXjqjnETD6FW|s|r85pM~*fU)pro9*fa=Oj0gSqyH zy>&2~*>#Y?kHHqqLYazpb2`z;CMm}zD0$cyVC8{HS#k=13VSP-N2ri!Urx4{ZjZzPz{??vV#A~Tg3(ZbGG%Nv ztb%Sa9C9ymBYTfb?{e4r?j$3oy4*Y;@Bou)WM@&Nm-i@=67`y<$bu5O?j<|7X%*$Y%SW2JZt6uFhFZ~P35gWGM{s{J#26tw4{=t zceF1+nV)6A?G8#42WX#sCKnS4JeU#~-plQ-Wu40LBS-pMcQV<;t6WhJ@}sf~tT(V~ zfs0&^5O7;}cYdouE>p}~-EkmakH7c)c|HlT;0Ln+h&BU>adnm&*|Wxvt%+oV{bbo# z4UdeC^!dzWbiL+SI11u#BZKMaP!{=8fh@2_)MM}KrWRoy3O-bF#cmH9h_>_RzkQkDa-iA+yLaPeb@#0 z>^6&&rucT+3~%MDXoD5s3v&RQRUh=PHE@HOH>q!6Pmg!D!)X+6ym-@gDZ+ zUR&E*UEO5WGoBC*kj@W7U^rlVMDW129HIg)9He zzmy}PWpfTLz=BEtpiElC&SgVSssJqnqb`qa9inF1XoQw&)v3QTM=U90V;}~B7zkuQ zQRe8TmS*t_~yFMO%~)31LgZU?g33t7b%HhC>0G0jCsZK%OCx zITl}&jS6-;X%}~k=U6I(6+-p9o+(yEW)y<|ohXMG#Vonh*9(JyiWiNZkhBL|JI~ZY$0j{6XBLb(-VlK zq6MknAQ)B13`q@KRJ&9SF_8R74;(0}J9T(J=EettBd!TB zkUG*I9ACkAfHx~0&g~`2Ms&I?UPN+9H3u@_t((Y88{QKb(h5l;KMYkV+g~*NhXExw z3`D(BKsm!+o;^Sd5*kiMSQ|9W(kV7XQuHi{?mN59BZ<`{^n$^678xv=_dR*WerOpq z1Oj7n3)&C>3V5HJ$dIF^L2MdICe$cc<4P_^Hv(7y6H6VcTUxuqZ$<@c80f(3?OL}~ zwE50~)329udS>uSKsZkvNwYy{?!ZqD6A4Tt@Q{!Ik6Z^196&o`$QXH10T8%rxznR= zN=4-MH76XHn~;W%n$ zu!gSoU;u=r(ta2oyQO2nkO(UY(3pHOi77q3Ad4lyG*wI`D`EUdrOi#q+4wMpXc#g( z>eVwbDo`+zsLPzF8Bf+(n$7UfEaQKE*^^NUY*7N@7J&_qIv?=}8jVeHtofG;DHw8I z_-8_g?|m|}6L)8u&w4Nm#-gj*@&*ItY8P#ljV{)h&mzPH(z6~_g0Zd|{ee6E^3|vXjD}n0=tZZ<=$*^uh3u~JRsX%~FQu>l; zbhyb+;o=Npt}UZ0!~^H-=%UNwaDeu3j#-h`J9uCjIp72U!;aYWwS0P2UtBI^E<+a? z@Zl2bGLo9<=46~xwqzQojflMGG6D;hToQvB*P5B#(m`e~N&=J^_a&j^X?o!`LR8T= z{FWMG_Vx)$k&Z%W1l~%!F;|M?8_<5$qihg_IUtW2W2au}Lc4R`xIW*oA2iZ}Ejw9} z7+6=j4h7`Mn^LN}m{cye9U_N0j*$e2=;d$@ln}T_q-UE(iwc{J;@gr1nLcJU{crRw zpFa-buNpf0X8;gZ5-mFPG>}CmC39LPU669HMS+O}RAQeTClYwjC6I@iF{-5qb{Ph^ z?9{0!I5r03Huc*h0SciNIa`1G^bEfE^IZOyL!Ig~XHs zftj9Nrw*-Myr0c2J_5>Khpc_(9XD6}@WPh^KY$5|8-N28afvrbJYmDUD5};dMDpq0NG4dDxa?6q?NG^C4t*2AVUdBrMk>=)^>o zH0VHH@wM(j)!HS1Lgn@*4gjTKYvKT1B+SX>L;??z1foz%3yj~=s*VH8i@Xtb_qls# z=N8I}3Wr%O4OI*Z*lCH5WfAf3t=>i3rHS72s0QDK!3XN|@$c=eE!Ovt&bkx69d>YK z1@{XxT;>NmZL#_f3CoXydbCu}P@9pdTA80?1dDP&pkXoaY)QnZkRNh_GXflHLm7Uz z3XB8chLPH#M^jU-QgoP@n$xl}l%(zSH8F6b+thgSqxXU8thlPKXrqhqtQ=u-7HkXg z0Xgu6A>6L%9#8qZeP57fRgelAN}|*@h_pg*4lCMlQ%lt@K@}TY5}8*y7}jc-TOgju z;zX$`Xsuau>e3(Hd*}T)ei1w+wR6G-oN{2Zp!hsW#0#}O!#S*U_A~N0H;kXT=!fsv z?;NynthkOf1}3r2>pw6bd9{nnenkJR((WR8=&xAzW%+G{mWtawQ94!jTXXvnz~U zH@psOM)y#D`~yW>`$pK}0^)!su0PA7H;?(aAE!uWc}ogLR6s?L zoWUxAmXcDCQ8&mmvXLlE;@bF`JzP3p=%oEzL4{-D`nnM3%m{07OIhpXoRt02#KK1p zp($+_5rZGp#j0mh?;eCah^RMuoX)eQ01d+X-y_A^Vkw)L!fn zP#RMi$s5h&7?4@Cbpt521K$W*xC@HCsxz#smq1!a{}U`p$7=Jrg}G&!Gm73PmT#xr zCv}oAk-$U(52^$%y7|>?48-tO{Fm-H%LI2O!otwFI^EAVM_KaJ2OgA67>dGF^IgQ=KEn6SRg?N=(=799(Y(anM1;>g zlwOV<CdRIZwcJZ9`9+Z;7$ml^= zK+URL3L2J-2^n|}u)$G-9eaS-{rT!Ufo%_KDUvXv5LHEt=aQ*FZ49aSGQPLO*iS}% zII^J;?hcL)b#b7~@6j?ogniOw#E{{SQc@2F>fnxl1A~diMkT$f0F#0NZKbf5Iw&?( z0#cQ`p&M&K69{JMlvp$^XmLtf15vjl@H#Xh5eT<;QThS!B*LI6u3RT3+l7L-w3LLd zB!5+~$VLR6yQ8N`lZ0G|&?>Eg z#0(w+bZs_W5LxJwD<>&6AI%7Eg8awrqiBkNUpy_?P+kx54AEMDC%CJk-MuaS5pb2N zV<8`tLq{U_MORAifzDZdfg&j@1Bu(XbRdXw!*Fxp1ChjsWD$)pJkz-NOt*&C55+J< z6+k2*hJoz@l(tLbM~Rti9bc|nWk@ZGoWwP(Q7*!qkabsrJ6(;^^b+pB5Dz`GrMy%2h{}E|AMntmC;em(jz+ z#7=Rb6*5kM>$A&JXuKb1rg*bsZ-*Dd&h70TK6H?YF!h&+&}7;?HO^NVU{muKjh=Vu zSwuO{CEC-+@@({j&r{kF%|*r7{f7ctE2M8R-(VNPc+*I<9x768`2n26tt_(!5>Vpj1Z_i zcti~A#=0aj0MIs6FhW9isR{6+>0+EV*B<+VKb$(<##$c-ewc-^6{vSB9x8ov zNI$>e@h$i54F0g0G0qS(Uwp)#kGZmO0e(;Bym+&TWziV6423v36C&|rV8ZG}V5vrP zAoM_}Q>>$IMSKwZ0;0BHRT3b~4A;p<+{Bc>+$sW(sV6pGkX#f=u_zaQ8pT?b5@sX} zLS=5DpaIx1F=b;AGr_!IC^De;8sT`LmAupp#t$<`!L_nPF^*M1=;L^D9Pl9x8y%|U zqqCcXE)WF`I6%#jl1C7xO>Gs~Zf*~k z74oAE<%5?MSky=V4ic)UgyS^Zq%@(oJ~zI*67Z*zA%qv?Nfm%Ey3|F%$x=yHpj0&x zp~9h6^N&mm+5vOVH>j$)7hTw&Vv&T21Jns6UP<*N>|N%_1y;(}Wi15pvR9+r%EvDk)?v2+(fYuy}rAzj}_Rc0cf zT=Qf30ZTQ|xs3Wa*3R%0BOgu>K3>6>*B}lNU-BBS5BSrvu@` z;U895@ng3`R^9rtou9m*%2iw*EaDNyRPK@{@Qj`jB>kOi@QDAzNKeLlrdTfT-Zy^q zo_w|f!ryY(%;u$d>^I{~vP$Q&f)!d#q-I*`ZH{q5c_gWsvxtGAd6Yb?nJ(7?=Ugvs zb*RJ>0E#7az+C$2Cf%{38wV$NQUnBCgr1RVQgduZjtIkYDO;GWMnd6>(8Zld_|~fh zLL^dEq_~6%g3hV*xiHsDx-S1-2&nXIgR#K1Occ6`h%@(G1G8MqNeo;mP$fHTf>5V| z>$>^3OfF&7fO(==~s0CwRR|<-(+5<*v0&VTGvmloS>6 zs$ELGs%)MYvc9jo_ zq}kbifBT+$?qwWkWqGM|#~9YAsD^he`Qm6-9rUAbweuY=0_!UKhJHidZDT zS=U1c$#tE5R$fC=O{~kH5+;xrX9Zo13yAD7fK}ZT1VL1)N*b$K3VB@WK+_I+i6-2D zXM{Z8QNtv_e9Q&|41Ap2H@|q(&Nq%4tRGe zrm#%D3(PoI?7O_^?12IiLY4>jX8$cCbC@y+haf%@;LcNkMqW%NI95j+n&PqQ-8G)# zPLo*#SdYN)FM3NWDa!?y@yazzvm{QlY*8WFfdH)GLi5QECmZ3 zlA|z8Z%MYOzph~TPl@qTcI)zDN0`Q9qvB(U!zj3$B#3p*VGomA1%rqpp0-|C!KNaG zwvHsxwtyB2;ORa*op1w#$ZzX83dFQ5+X^uq#^ViRxA;3QY{TnecGr!kdBu_DDCD4W zcGl5aq9D=X@_rvt8CF5E9am;2c#HUFY0(M-SyPHiQjB+X3~Uu?7$%FLOO})4L;?>r z31AOU4|`Kbj~(Hq=CzH@Omd@Sxu1thAh&vMcaqdB==Inftmd}!B7OAE(W8eM^2v%5 zl^7#E=o_GdC3X?h!iIpevzwb67cQ(~^w|9wRM9(~T%^*JSC{nV&Txyq<8zZf7^2#A zAVvtWdR#a<4i0(Yq@pCIV>HlFfSzE}d@_s?Ae@zWKWylXKg6fMd4s)1+#Lr}iFW*= z2#J%Z+Y{M1$rTM7R|v7Hcu8T^1~Q9iV0Am#D|nVKvumMKtkg4E20^+&1_Y7> zRl&w`xhlVkr)1Y5vmRW->WH&gU z#TIf&oU>jJG4XJwlBuagy%I6pMmStR$e&oGE4Xn3@OG#2rdm=XGlVIymRc|kQc~jy z#2pLUpClK<6d2>$%DY_c9}~*6r=)cs3sx-m9ucX~VEh+M2k2!SSp_7D5f%lb>r5)r znA@4NpVsm-7Dw~>8G!LA(LWSa8)O@9>E}6ta(tSPkG3Uv(}h9-!z4W0M?^}5sylb7 z7mc?{58Y0hbx}w7O#krqx0q3sUK1;<)XWhMCYn^ECSos|_N0dXfz8?i zh8xGCUoy_GAx@nv;5Bh7tY#1mUfr6sAqWu(44Pb7Y$EAW zC!WZ6XmMFbE-pY9je_Y|m#T$in4(5<{_Rn$i_>g;1U}cH#o-*?#5&`utoC3;s5LF4P4^$Jm(J)*^@9%fp97G5;f1{quKUSHsaVtTG0rpV{LWuCbM=9@VdkdLjju!0H4XMRy%4p)})3 zXk;`l8XVP)ccq8H+t=7~{`4eb|Fs2j-~G#~OQ>t36`>xF<5#g4$)yg|-A`)xZFGP_tJm9OWiLjD=kRb8 zoZ*w0wnt>ew-GzUC`hMj0hnS*9fwD+_Q7*4tDqCHt^=^~q(Zy0IvC*qutIWcu+9Xd z)*!+ahRP>XbSdSb0CO3Vky0`&QU5{(GGOC}!jpm|3+0g>K?o7tAe$Wd%T7b6%!CLd z79yj{CiMXh`ytv@C_X>|SZQxVPFqGq1T16)#K=%>JBw-?fhmZug zlTpMoyb`~*&QASXe49eupeFFHCyN0F6bGXhjQcR+oKYXXrBTbA^)*VFpc>FbDmS&n z{RDLeww8Tx@iKP$_uhK}#Ox1Lqd2Oai`2^f;4n!@HIW_zfst|6LHBlh+Iuw_nXxuQ zJ*&-hSjSz~WR8M3IX;3%@e0Qv5CzG_A!F-8<5UGeo-z9@5oaH1#!NKgs6+6pWTR$1 zT2LVbfhV#ZyvHAGzp2^wo;*0g7~jJotJ0?KZ^vRPh^odjP5_f29Ex!yPzzZJHGD`) zCPP_xKUwlT&j=82yyJCgN#IsThjU`MJr)Ct6|kEAISEBlYx8_d3viY|n;98r91Ft% zn6{he?Y`b0A2JY$L4PF|a>sv2gqoS6FH*{N^hZ7QM|EWq4W@P(JYkXsEF>Z(ISvp) z^nxIA*%#No;B|y#st^&H?0MlejFsW5>p*nT4j*k2aDY=r=@BfM$o(D!jigh`K7+u$ zKPaOZ)8@Xege*eUUcm*jp|V4!JKXoFni&P(fz%mt;c|cK_*Lk&1mo#x*5snv*h;2V z<;O9M;$x)7qQiU<1Wi(iMb?~kxKn_hr~4Agq*;B!@GeMxm8b9WUc5b+5AE&o#5Ki! z7W3k;hub$01kB36Ncra#Pa-;CBQC0 zm}n0&3!ly3^*~WWR}2@0i34U1Ov%EBa?AVdpoCxdpdW%u++|Pc% zhwTiR^g<`$`YbIkverjkkq2~Yf)3)4luieg?g)zUs&)z@x@~rf88^m(D9>AC@qy4m zQ9kOPq52s|FpA4Ebn{)Xe1nQHm&`B76R9_4||ngU}$2|q6bYpw!j-HQYA zjv>JhXn^$qhH_V+s&q}}=ualONS!34o^=Nrs;TqmW^sOElc`L;E>f-!rRu#fqy(5Y zK#_q;l$^ouhz{o%o8Yh4TR?{WV9blpGzlx0_)=O3YzK6tOw{VmW&$BBQUiY0T!#5C zx}6V~mMw7sQtbnf)#TVbp2U+<9uI|6X_@X|<0D9C3}b_`-3wt6vdRgtLep2=<36xt zlx*aC1XdY=RSpmdz9vM|$ACkrkqfKhDf)=3MG}y4jdE4#BER5^E2V0~?MYio-)yN(<_yt2H^tP1x$ zgBr2X>IIA;YNAYbltR=KRaABC3n~#*NOTGrT(Ce_AL!l-OwKR|$81_DuM|_s>?^w*be=n>W0oJXf^|cIDu!xW6=3B(NEV#Edt0q`+%3>qg&>nz{l2~^Em1B)&ktmj+ zPirb2BBt^mv=$I|cV(pGS&JiT!7al{5*j2MH>Fw*F!ro5WR&2FA5!2%E~Sd9809Ns zZKVLg$paL$$sZkPlQKGtg! zu$s(0JjEosAp=b;CWrfq1b;h-%g`<?8(@^k5R`^E%%VcriZgkBTb*GH;{jxrMcKX-mbN0ZTGb9i(wrLQX-r z=4X$)%LRHS>BM+-LCHiamF6DOnqwiunp+R!pYO9Wv*SvjRw{FvEsICIBbMMJTR*tyOVORUZ-2sJOjnB)P+#nBn7Krn@g(<00U&yL`N#ssG0zv zJkuORQ$NcZAy7Sui;*TIfoPXktc6PsqynR{t9;YBtft^7ZeheaY~6`AhJG6mo?DqfI|BR&x1b%l#JWtjfV%iNK_6|i1o zB61D@awIa!efb04$+#W|&Xk zT;JN>VAiX@Ik$WK*x^Hm4ltfD;G152@G}}pwWNM)%BRx^Vz6Sl_f-L%66jP#6jBGR z9tu?s3|s)ay1I@u14sq9A2S+R&QaA$G zd2v-zxRSVUkiam;s2En+nPi?Ck)5065H&l~*UuYlgGRl|5jTh-B(CbIQC9(qu_E7PYqKC(aium^nuQc5b!SKeH#O5$ zV$*HD!4B}^6kj>j%kh2SC}QM;L#H{B6ir)y(u_qSjS!@YrZ}%lio1qV;ssW-hiOR;#mz;#qyTu7p-VrS3lvs?4t%_Ul+86{ zsXnc&*oR19ys8z<>0KhN#KPlsnJQ^FxKMAY#hqm%grXL>I+P4X2?CgAO2-K?uO*bU z22Jz9jGcsTN1H2Wxzku%wEP6EI!U_Ltr=SJ?qq@DvQoM_Q%;hW4mTbAgK(~Dgnrdo z24I7e+)_chU*ewdNW!7r-*iNvGgR>QxDs2MN5C|oQVy;{2-0?MDP>E@LquNB5C|eS zk5ozasYvNZbf)mQlNLzNN6>oZG!QBPL=ba2+@U4b!bO1G_tr@isat@|sRX%@2~+MH zCJxYjWim;bNZ=tS0q$WQJlUeK*PGeh++AXDW_ph)u$85y1=l;f&zSnbCt2=wZLOEl z4OB+O;eV8zr|AExWmH3yM|lQlAI&+LP6qkZJBt&rzOjiDbNKKf*6>z2mbWyFszTEw z>RA?uCnhEQfc1?H>^-|o3mbKq2TH#0j+rFQWXh&E8qd-wV3(u9OsPOz8`G#;V1>r2 zGgRYeu0Scg`RGD)BK+rRmBrDW_hX6V>uRtW5U6p%GGv33BhS8(=BgriL)!R!@WIPk z4hOj`LK)%=;b;JW!p%CK5-hkVr}QbM_p{mGSl>XP>@Bdkh+o22PhI&;y~J4-Mk9lT zfoTnnj4L!74pI>U@=RkXRT8iQ6py6jCgQ+=PzkC`ibFdA6tM-kR1&6g?N#^`EwZcb zAu$2kvCK-Pq!iWU%4cpWqa&0+^;=BLlohCuz+(uBkT`tiB)EZnBCaoht7YhvaKYD3=O%N7l94o|8bGVfE-9fF|{M7#N($F{d7#D zI6LW{GR8IiDF9W=juGI%_y5{E+vO^9BY=X90h<4iZmq!KYpj5mgJr1*N?;ZPCU2Bs zcCmj3AFOd%!%~tamQ^YqJK>y2gW@L4c}m`goRU@7?nkC@+HI)Rv}%-Hd6Hv8C9zwt z!$WkwDnXuU6+gDh_K%bM?OPdc2yIGVCSeS1pgklICuPn2CnELnv&H+Kgh4QUFmg{a8(fb1lPwa}X%2I2RPY36apJ zwzd{02~2PcSeVQryDBEG^rFm%eZwszMLSEDqsCVUL*M)F2A? z7f$8jew{cHK;PWxKm&AZN40uHvIs7s{-{$Cixy{Wt4b*!=>$4VKmd=HkS%3$jHAj$ zXA()YfVG7^h)gms#Rx;<6DdVcA zY6m*9@8SMbZgjP%C>Bcb2vP$Z)t}^DTjV@N0YXfgcbBxFJAci zW&)F|t2b}134nO%Grl$hmRZpv*<#FbRyz~81kF{9X~^PRj0M7M)G*VhwP9`L`N;{} zqTlp*Jj-DkR;NV(C!<-x@M&0@TF^#mVII!z&oEw2hk%67ex4DxRpXDmWrz?GioV>Y zVox+?SZY2wbpPn~@f|Tr)>I3~u3|ordV9kY@mkw6K9u(Oo^MIJbW-NHU-Og+5eWpXMCt>V;^zogY!6v5>x8vxGK zw9LCD7rw`3^6^;ww|`U%u{uNt0Eil0(TttNDV_iyWDk2|Eya{S{beiT7adUH60P%3 zfSZui+SrJr$|MsV9g@0TupuFj>XS%v4zuO`A|`_VcGA{(VL&L6>Ag}>15F~0^e@GMmLXl-?bS;87z*+z#e<=Q^^1W{DKyxqBkJgszd;P| zp{HGg$4*9e?>bVAdGziLhnn&dcAA#5C32l&jZ=(X8+MjpygigFn#4Vxy)K~rCSoB7 zfO5=9t~r|4YLkS2-!TdHAZlmwhWf`04!P_&ZD-FFAuia zK|PR>1Rrr=KM&y+4wtDQS+bUb znpviYr@oiq;v+La)bZ@z`8l8cViL%Sqrv?atktuC9kk3909}VOwJiy|{T`StP>Aoi7fsOpiiHdWH{M2F2OuFm zV6Jxm-(eHq){@;NDyFWCtRN1__{LuYpfU^|hL39SU=6T#zbCdL$0-6O){a0K%NJpx z6&hR(FqeDPY-xdc&3Lia?F1&EAGG8=^C(e|pqd5qf-k`67B6}5+Q$B6e0f2xMCX9o z5UN_Pb{T>n>%nOzZkHU^9%q2m`7s?e@NH{=YxT^_cJuUFq|Q5NI#_5TX9DLV?=v9`;AKmXh+vq((dKHKi2}6senRtvhudM#j~ywjCfKiP+2{PyUmnn8u0W?A$6sxsanxT19X|3|4vHU0zH?*I$N5j<%B0FMx@EF zd(bC22*B2XUus+U^n7aMQh+{n8Dw0864go1TB9f@iCWWw3<@+#_I|uSn~)pbJvmR$8n@%?%%Es;1oG*Vwgb(XnsF7QrwO53vIASo6&dF)VC~WtJKWj2uUb8OF-2o4FRpKM7OE)-9M|ut5&& zBMrwGJT8H$^kX_|;Cs`+q0xwU?3c5|-U2-)$lw7nd~hE(z53}tKe8ys#vOtoP1Vj^ zZ4EUfD8-OMpqgtT7o8XXX9o6$Fk!8`Jjbn zN&4Fo+n&Zob^lA9z$9`s(f6FP#aM^SR1mXCSV-QjgXbp%@$qFN7d|4!9wXZzlOcy@ z*6lw8L(C0HA1JmDu_s9u{ljz;`mC49;N1w3+ywE6C(Isy7OY z-7v%wB(rP=Mg&0o%cc#TsRAQvKo-a$!H|7c`FTG%RF z)^aQgY0EJaW}C>8I%RmUh(*c#fvL`7l=&^cmc}I1lGhA5BOWPn1w(+W)57zQAO9So zP&&>4rS0S4sDbZE1Dj#p^Q_@uQbdEsrLOTiWdV#&j$gjMWX0;|pMQSy<|m3@U;bb$ zqS@2&YZk^lt>Yf!E;ptK{A6-$+7G6J&K{n=dGiam&X<>$&Fknjq_1Te4(BK)4Y6}E zx|(Hb#rp?o*LK0#>fzz`Jx^EN@R$|;wznVYeo4&A_<}WTozerU<@AM$_-u9(_^k}X zBRGQvmTBM!&h_YdYi{v}d7~dt@wOqthk~J#55z-6j_#e{59jB%ER1{nsC#oi#zRAs zMr4tmQzTVby(n~{NRr4-X03Z=fbEJ=U8n}i8kr_dyRuWaz&3oa222g6e(^9w0Ur1P zR}eeo6Zq9^-^o&*uz*;At_K5>E`No~;Tg9ADZG&G#Bl)*#Wz&e$Jjc_^@)O@)&Xc5 z0O&#uVq060969uugUu$Eh%~=w`-(UW_%x~9W_J50$(m_W%?g30Na!7Wj7p0xc8B-` zKop>*MvJqU%q4&h)xjenks7q45m3@Y9E^)csO-=WQ~-Ug}?^tQ{voJeAA^ueUY&*R(y%+IuFvw+6Ymf^r&=aZpg7=V}9nPSbIz`;uzpq zr;jAXpP;ZiH8Ea>UiFgT?#0#sf}5kaHq;vZ_*6eF2-8!%NIB)t0VWT}B`{TYOh*lT z_ZrC0c710HmPOZ=JbLl+;>8P=#_sr-7}GWs5ssYlS#ox!_y$F-`j_R;P+?rMk$`bN z_KDp*1O-GSye<0G>z70W**!y$GSe{ZyamU}ryG{8Y_G8bqg7v~`$-M_v4!aR`u6HA zA4I!@!pyiBtn`K0!mf|lb9d@A8RZWfrm&K{8JRhMwlnkM9A?6?jlTEC8IuXtaA2rQ zi^*CSJ`GRrBoKf23QQ!+X!lGtv4NY9n4UjpPY;`}jDeg7^5N*j8GiGeIUV(+jQm^L z4Q>;Qa+^&;jNK_Y)Us3e2G8%-1FH>ihb7Q6WRTv0{-LS5NgEIK8_a1*TV-l4UeB3oAGsNsx4kyC3x zTH;rQ@V}Il3OdCL1^{#zKA?ah>(A2g))eGaRLX%igLXq=G&cNH61rhaG3AP&r=K)! z;1gLSDZGHrz3y)5$3Qrhb4~#mIC*MlT%Wqkx_q4WEpjL4Ell%pI=c3(e188wtRx{Q^Tgud@K#0nIgaPeyx zsv2t2!K|@3LyjoNPr;BwF3|}fG@JPtfrhGzzNi=#F-jYeM&HL7AT)MNM-6=M8qgFZ zLpDbXqx~RZ4(5k<7~;42uoruz*&%fE{^t7XiYlMbKH~u;!iO`5lLysBp?No#s z8fQ`1b;Mm5sP2EhfAQjiXPq!r)M}41bBnr;!NmR~b^@KBo@b>tjDPeiOWZnQvY>MH z_8kwI!w!K7t6#b+cQ89WPM`yy6aDB4we~z7MfAhtbMo(k84uMH*=QdDc6X5F>WVyQ zc-CHQICH)MPhjH~9*7ep@?8nmx%iel`_0|Z2qFXC$ zX1fmgFCs-dUPo9L=t&D zPNj&aTr7(<>2GI4Rmz_yc{j<7;|IY!th8!nKnlhaEo@N@YOW8j5wZn2yIP?vokOT? zXQNFu3;);niC@PM_ZlcRg%^H}(2#Tnwjls06FCHHfF&qg#*xfXBFAJns@ntRl(K@x zY8~m^52#cOGr(wq!Q~*br`@|p0OWvbyTCC3I?&}Yd(^;ptO3nUreQ3{X3%!l0)xOz z#@UmXXHN)LSTB2jd&|S~rnkR7e|CQEUTJRrwKijL%&&Bi-Ruok1XF@#a)a}GAM)Zk z{qu`+T5P6EV?|5wVFU>zZfq*hi{v*+Caee%P+i(k%zysceKaC zfr4eK=6hfTzbdplQQWaZ)dzjG+nMi9*c!CL19jw+BreElTH$t?VeUU|1`1|&pu+?@ z9|JS0;ys3Z$CN1_KWYI%rjb&Tsz6q;$gXZL_QbmNMJfWZ)_2OP?NCc{quq5}&U4TX zYz~Vo$W^$7dDf}jAHh&1CEM>-DeZmPFe8qA*+Cl%l?+-WU4`OOX54^6M5^3!ypAw7 zxm6`dGeF$b(@~2I1i_Lv^hsNDJ=Vwz4iQ5VuukY``lqoriDHH1u!a2sdy50000 Date: Mon, 11 May 2015 12:39:37 +0200 Subject: [PATCH 109/461] Coding Standards fix --- test/libp2p/capability.cpp | 50 +++++++++++++++++--------------------- 1 file changed, 22 insertions(+), 28 deletions(-) diff --git a/test/libp2p/capability.cpp b/test/libp2p/capability.cpp index 2dcf9b4ba..2f1509e80 100644 --- a/test/libp2p/capability.cpp +++ b/test/libp2p/capability.cpp @@ -40,49 +40,43 @@ struct P2PFixture struct VerbosityHolder { - int m_oldLogVerbosity; - VerbosityHolder() : m_oldLogVerbosity(g_logVerbosity) { g_logVerbosity = 10; } - ~VerbosityHolder() { g_logVerbosity = m_oldLogVerbosity; } + int oldLogVerbosity; + VerbosityHolder(): oldLogVerbosity(g_logVerbosity) { g_logVerbosity = 10; } + ~VerbosityHolder() { g_logVerbosity = oldLogVerbosity; } }; -class TestCapability : public Capability +class TestCapability: public Capability { - int m_cntReceivedMessages; - int m_testSum; - public: - TestCapability(Session* _s, HostCapabilityFace* _h, unsigned _idOffset) : Capability(_s, _h, _idOffset), m_cntReceivedMessages(0), m_testSum(0) {} + TestCapability(Session* _s, HostCapabilityFace* _h, unsigned _idOffset): Capability(_s, _h, _idOffset), m_cntReceivedMessages(0), m_testSum(0) {} virtual ~TestCapability() {} int countReceivedMessages() { return m_cntReceivedMessages; } int testSum() { return m_testSum; } static std::string name() { return "test"; } static u256 version() { return 2; } static unsigned messageCount() { return UserPacket + 1; } - - void sendTestMessage(int _i) - { - RLPStream s; - prep(s, UserPacket, 1); - s << _i; - sealAndSend(s); - } + void sendTestMessage(int _i) { RLPStream s; sealAndSend(prep(s, UserPacket, 1) << _i); } protected: - virtual bool interpret(unsigned _id, RLP const& _r) override - { - cnote << "Capability::interpret(): custom message received"; - BOOST_REQUIRE_EQUAL(_id, UserPacket); - ++m_cntReceivedMessages; - int i = _r[0].toInt(); - m_testSum += i; - return true; - } + virtual bool interpret(unsigned _id, RLP const& _r) override; + + int m_cntReceivedMessages; + int m_testSum; }; -class TestHostCapability : public HostCapability, public Worker +bool TestCapability::interpret(unsigned _id, RLP const& _r) +{ + cnote << "Capability::interpret(): custom message received"; + BOOST_ASSERT(_id == UserPacket); + ++m_cntReceivedMessages; + m_testSum += _r[0].toInt(); + return true; +} + +class TestHostCapability: public HostCapability, public Worker { public: - TestHostCapability() : Worker("test") {} + TestHostCapability(): Worker("test") {} virtual ~TestHostCapability() {} void sendTestMessage(NodeId const& _id, int _x) @@ -96,7 +90,7 @@ public: { int cnt = 0; int checksum = 0; - for (auto i : peerSessions()) + for (auto i: peerSessions()) if (_id == i.second->id) { cnt += i.first->cap().get()->countReceivedMessages(); From 979c5851f9f846b7dfbde0be8e9c8a92b873083f Mon Sep 17 00:00:00 2001 From: chriseth Date: Wed, 6 May 2015 19:15:14 +0200 Subject: [PATCH 110/461] Reuse state during common subexpression elimination. --- libevmasm/Assembly.cpp | 80 ++++++++++----------- libevmasm/CommonSubexpressionEliminator.cpp | 51 +++++++++---- libevmasm/CommonSubexpressionEliminator.h | 14 ++-- libevmasm/ControlFlowGraph.cpp | 22 ++++-- 4 files changed, 94 insertions(+), 73 deletions(-) diff --git a/libevmasm/Assembly.cpp b/libevmasm/Assembly.cpp index 9530ded49..abcd44516 100644 --- a/libevmasm/Assembly.cpp +++ b/libevmasm/Assembly.cpp @@ -311,54 +311,45 @@ Assembly& Assembly::optimise(bool _enable) copt << toString(*this); count = 0; - //@todo CFG interface should be a generator, that returns an item and a pointer to a - // knownstate, which has to replace the current state if it is not null. - // Feed these items to the CSE, but also store them and replace the stored version - // if the items generated by the CSE are shorter. (or even use less gas?) - copt << "Performing control flow analysis..."; + copt << "Performing optimisation..."; { ControlFlowGraph cfg(m_items); - AssemblyItems optItems; + AssemblyItems optimisedItems; for (BasicBlock const& block: cfg.optimisedBlocks()) - copy(m_items.begin() + block.begin, m_items.begin() + block.end, - back_inserter(optItems)); - if (optItems.size() < m_items.size()) { - copt << "Old size: " << m_items.size() << ", new size: " << optItems.size(); - m_items = move(optItems); - count++; - } - } - - copt << "Performing common subexpression elimination..."; - for (auto iter = m_items.begin(); iter != m_items.end();) - { - //@todo use only a single state / expression classes instance. - KnownState state(make_shared()); - CommonSubexpressionEliminator eliminator(state); - auto orig = iter; - iter = eliminator.feedItems(iter, m_items.end()); - AssemblyItems optItems; - bool shouldReplace = false; - try - { - optItems = eliminator.getOptimizedItems(); - shouldReplace = (optItems.size() < size_t(iter - orig)); - } - catch (StackTooDeepException const&) - { - // This might happen if the opcode reconstruction is not as efficient - // as the hand-crafted code. - } - - if (shouldReplace) - { - copt << "Old size: " << (iter - orig) << ", new size: " << optItems.size(); - count++; - for (auto moveIter = optItems.begin(); moveIter != optItems.end(); ++orig, ++moveIter) - *orig = move(*moveIter); - iter = m_items.erase(orig, iter); + assertThrow(!!block.startState, OptimizerException, ""); + CommonSubexpressionEliminator eliminator(*block.startState); + auto iter = m_items.begin() + block.begin; + auto const end = m_items.begin() + block.end; + while (iter < end) + { + auto orig = iter; + iter = eliminator.feedItems(iter, end); + bool shouldReplace = false; + AssemblyItems optimisedChunk; + try + { + optimisedChunk = eliminator.getOptimizedItems(); + shouldReplace = (optimisedChunk.size() < size_t(iter - orig)); + } + catch (StackTooDeepException const&) + { + // This might happen if the opcode reconstruction is not as efficient + // as the hand-crafted code. + } + + if (shouldReplace) + { + copt << "Old size: " << (iter - orig) << ", new size: " << optimisedChunk.size(); + count++; + optimisedItems += optimisedChunk; + } + else + copy(orig, iter, back_inserter(optimisedItems)); + } } + if (optimisedItems.size() < m_items.size()) + m_items = move(optimisedItems); } } @@ -461,7 +452,8 @@ bytes Assembly::assemble() const for (auto const& i: tagRef) { bytesRef r(ret.data() + i.first, bytesPerTag); - toBigEndian(tagPos[i.second], r); + //@todo in the failure case, we could use the position of the invalid jumpdest + toBigEndian(i.second < tagPos.size() ? tagPos[i.second] : (1 << (8 * bytesPerTag)) - 1, r); } if (!m_data.empty()) diff --git a/libevmasm/CommonSubexpressionEliminator.cpp b/libevmasm/CommonSubexpressionEliminator.cpp index 4b85eba40..5beb7966f 100644 --- a/libevmasm/CommonSubexpressionEliminator.cpp +++ b/libevmasm/CommonSubexpressionEliminator.cpp @@ -45,16 +45,22 @@ vector CommonSubexpressionEliminator::getOptimizedItems() for (int height = minHeight; height <= m_state.stackHeight(); ++height) targetStackContents[height] = m_state.stackElement(height, SourceLocation()); - // Debug info: - //stream(cout, initialStackContents, targetStackContents); - AssemblyItems items = CSECodeGenerator(m_state.expressionClasses(), m_storeOperations).generateCode( m_initialState.stackHeight(), initialStackContents, targetStackContents ); if (m_breakingItem) + { items.push_back(*m_breakingItem); + m_state.feedItem(*m_breakingItem); + } + + // cleanup + m_initialState = m_state; + m_breakingItem = nullptr; + m_storeOperations.clear(); + return items; } @@ -113,6 +119,7 @@ AssemblyItems CSECodeGenerator::generateCode( { m_stackHeight = _initialStackHeight; m_stack = _initialStack; + m_targetStack = _targetStackContents; for (auto const& item: m_stack) if (!m_classPositions.count(item.second)) m_classPositions[item.second] = item.first; @@ -122,7 +129,7 @@ AssemblyItems CSECodeGenerator::generateCode( // generate the dependency graph starting from final storage and memory writes and target stack contents for (auto const& p: m_storeOperations) addDependencies(p.second.back().expression); - for (auto const& targetItem: _targetStackContents) + for (auto const& targetItem: m_targetStack) { m_finalClasses.insert(targetItem.second); addDependencies(targetItem.second); @@ -141,8 +148,10 @@ AssemblyItems CSECodeGenerator::generateCode( generateClassElement(seqAndId.second, true); // generate the target stack elements - for (auto const& targetItem: _targetStackContents) + for (auto const& targetItem: m_targetStack) { + if (m_stack.count(targetItem.first) && m_stack.at(targetItem.first) == targetItem.second) + continue; // already there int position = generateClassElement(targetItem.second); assertThrow(position != c_invalidPosition, OptimizerException, ""); if (position == targetItem.first) @@ -164,21 +173,24 @@ AssemblyItems CSECodeGenerator::generateCode( // check validity int finalHeight = 0; - if (!_targetStackContents.empty()) + if (!m_targetStack.empty()) // have target stack, so its height should be the final height - finalHeight = (--_targetStackContents.end())->first; + finalHeight = (--m_targetStack.end())->first; else if (!_initialStack.empty()) // no target stack, only erase the initial stack finalHeight = _initialStack.begin()->first - 1; else // neither initial no target stack, no change in height - finalHeight = 0; + finalHeight = _initialStackHeight; assertThrow(finalHeight == m_stackHeight, OptimizerException, "Incorrect final stack height."); + return m_generatedItems; } void CSECodeGenerator::addDependencies(Id _c) { + if (m_classPositions.count(_c)) + return; // it is already on the stack if (m_neededBy.count(_c)) return; // we already computed the dependencies for _c ExpressionClasses::Expression expr = m_expressionClasses.representative(_c); @@ -340,7 +352,7 @@ int CSECodeGenerator::generateClassElement(Id _c, bool _allowSequenced) // this will not append a swap but remove the one that is already there appendOrRemoveSwap(m_stackHeight - 1, location); for (auto arg: arguments) - if (canBeRemoved(arg, _c)) + if (m_classPositions[arg] != c_invalidPosition && canBeRemoved(arg, _c)) m_classPositions[arg] = c_invalidPosition; for (size_t i = 0; i < arguments.size(); ++i) m_stack.erase(m_stackHeight - i); @@ -371,13 +383,22 @@ int CSECodeGenerator::classElementPosition(Id _id) const return m_classPositions.at(_id); } -bool CSECodeGenerator::canBeRemoved(Id _element, Id _result) +bool CSECodeGenerator::canBeRemoved(Id _element, Id _result, int _fromPosition) { - // Returns false if _element is finally needed or is needed by a class that has not been - // computed yet. Note that m_classPositions also includes classes that were deleted in the meantime. - if (m_finalClasses.count(_element)) - return false; + // Default for _fromPosition is the canonical position of the element. + if (_fromPosition == c_invalidPosition) + _fromPosition = classElementPosition(_element); + bool isCopy = _fromPosition != classElementPosition(_element); + if (m_finalClasses.count(_element)) + // It is part of the target stack. It can be removed if it is a copy that is not in the target position. + return isCopy && (!m_targetStack.count(_fromPosition) || m_targetStack[_fromPosition] != _element); + else if (isCopy) + // It is only a copy, can be removed. + return true; + + // Can be removed unless it is needed by a class that has not been computed yet. + // Note that m_classPositions also includes classes that were deleted in the meantime. auto range = m_neededBy.equal_range(_element); for (auto it = range.first; it != range.second; ++it) if (it->second != _result && !m_classPositions.count(it->second)) @@ -391,7 +412,7 @@ bool CSECodeGenerator::removeStackTopIfPossible() return false; assertThrow(m_stack.count(m_stackHeight) > 0, OptimizerException, ""); Id top = m_stack[m_stackHeight]; - if (!canBeRemoved(top)) + if (!canBeRemoved(top, Id(-1), m_stackHeight)) return false; m_generatedItems.push_back(AssemblyItem(Instruction::POP)); m_stack.erase(m_stackHeight); diff --git a/libevmasm/CommonSubexpressionEliminator.h b/libevmasm/CommonSubexpressionEliminator.h index 6e1ba40b3..2a9a31255 100644 --- a/libevmasm/CommonSubexpressionEliminator.h +++ b/libevmasm/CommonSubexpressionEliminator.h @@ -71,13 +71,6 @@ public: /// @returns the resulting items after optimization. AssemblyItems getOptimizedItems(); - /// Streams debugging information to @a _out. - std::ostream& stream( - std::ostream& _out, - std::map _initialStack = std::map(), - std::map _targetStack = std::map() - ) const; - private: /// Feeds the item into the system for analysis. void feedItem(AssemblyItem const& _item, bool _copyItem = false); @@ -134,8 +127,9 @@ private: /// @note throws an exception if it is not on the stack. int classElementPosition(Id _id) const; - /// @returns true if @a _element can be removed - in general or, if given, while computing @a _result. - bool canBeRemoved(Id _element, Id _result = Id(-1)); + /// @returns true if the copy of @a _element can be removed from stack position _fromPosition + /// - in general or, if given, while computing @a _result. + bool canBeRemoved(Id _element, Id _result = Id(-1), int _fromPosition = c_invalidPosition); /// Appends code to remove the topmost stack element if it can be removed. bool removeStackTopIfPossible(); @@ -167,6 +161,7 @@ private: std::map, StoreOperations> m_storeOperations; /// The set of equivalence classes that should be present on the stack at the end. std::set m_finalClasses; + std::map m_targetStack; }; template @@ -175,6 +170,7 @@ _AssemblyItemIterator CommonSubexpressionEliminator::feedItems( _AssemblyItemIterator _end ) { + assertThrow(!m_breakingItem, OptimizerException, "Invalid use of CommonSubexpressionEliminator."); for (; _iterator != _end && !SemanticInformation::breaksCSEAnalysisBlock(*_iterator); ++_iterator) feedItem(*_iterator); if (_iterator != _end) diff --git a/libevmasm/ControlFlowGraph.cpp b/libevmasm/ControlFlowGraph.cpp index 2e28317a3..7ed56ff1a 100644 --- a/libevmasm/ControlFlowGraph.cpp +++ b/libevmasm/ControlFlowGraph.cpp @@ -142,7 +142,7 @@ void ControlFlowGraph::removeUnusedBlocks() BasicBlock const& block = m_blocks.at(blocksToProcess.back()); blocksToProcess.pop_back(); for (BlockId tag: block.pushedTags) - if (!neededBlocks.count(tag)) + if (!neededBlocks.count(tag) && m_blocks.count(tag)) { neededBlocks.insert(tag); blocksToProcess.push_back(tag); @@ -191,12 +191,12 @@ void ControlFlowGraph::setPrevLinks() if (push.type() != PushTag) continue; BlockId nextId(push.data()); - if (m_blocks.at(nextId).prev) + if (m_blocks.count(nextId) && m_blocks.at(nextId).prev) continue; bool hasLoop = false; - for (BlockId id = nextId; id && !hasLoop; id = m_blocks.at(id).next) + for (BlockId id = nextId; id && m_blocks.count(id) && !hasLoop; id = m_blocks.at(id).next) hasLoop = (id == blockId); - if (hasLoop) + if (hasLoop || !m_blocks.count(nextId)) continue; m_blocks[nextId].prev = blockId; @@ -225,6 +225,8 @@ void ControlFlowGraph::gatherKnowledge() { //@todo we might have to do something like incrementing the sequence number for each JUMPDEST assertThrow(!!workQueue.back().first, OptimizerException, ""); + if (!m_blocks.count(workQueue.back().first)) + continue; // too bad, we do not know the tag, probably an invalid jump BasicBlock& block = m_blocks.at(workQueue.back().first); KnownStatePointer state = workQueue.back().second; workQueue.pop_back(); @@ -281,6 +283,15 @@ void ControlFlowGraph::gatherKnowledge() ) workQueue.push_back(make_pair(block.next, state->copy())); } + + // Remove all blocks we never visited here. This might happen because a tag is pushed but + // never used for a JUMP. + // Note that this invalidates some contents of pushedTags + for (auto it = m_blocks.begin(); it != m_blocks.end();) + if (!it->second.startState) + m_blocks.erase(it++); + else + it++; } BasicBlocks ControlFlowGraph::rebuildCode() @@ -288,7 +299,8 @@ BasicBlocks ControlFlowGraph::rebuildCode() map pushes; for (auto& idAndBlock: m_blocks) for (BlockId ref: idAndBlock.second.pushedTags) - pushes[ref]++; + if (m_blocks.count(ref)) + pushes[ref]++; set blocksToAdd; for (auto it: m_blocks) From 1492fe2a88a67c12a544ef48857e94c2f10e1892 Mon Sep 17 00:00:00 2001 From: chriseth Date: Thu, 7 May 2015 18:31:21 +0200 Subject: [PATCH 111/461] Store alternative stack locations during code generation. --- libevmasm/CommonSubexpressionEliminator.cpp | 80 +++++++++++---------- libevmasm/CommonSubexpressionEliminator.h | 8 +-- 2 files changed, 45 insertions(+), 43 deletions(-) diff --git a/libevmasm/CommonSubexpressionEliminator.cpp b/libevmasm/CommonSubexpressionEliminator.cpp index 5beb7966f..e369c9dbc 100644 --- a/libevmasm/CommonSubexpressionEliminator.cpp +++ b/libevmasm/CommonSubexpressionEliminator.cpp @@ -121,10 +121,7 @@ AssemblyItems CSECodeGenerator::generateCode( m_stack = _initialStack; m_targetStack = _targetStackContents; for (auto const& item: m_stack) - if (!m_classPositions.count(item.second)) - m_classPositions[item.second] = item.first; - - // @todo: provide information about the positions of copies of class elements + m_classPositions[item.second].insert(item.first); // generate the dependency graph starting from final storage and memory writes and target stack contents for (auto const& p: m_storeOperations) @@ -152,11 +149,12 @@ AssemblyItems CSECodeGenerator::generateCode( { if (m_stack.count(targetItem.first) && m_stack.at(targetItem.first) == targetItem.second) continue; // already there - int position = generateClassElement(targetItem.second); - assertThrow(position != c_invalidPosition, OptimizerException, ""); - if (position == targetItem.first) + generateClassElement(targetItem.second); + assertThrow(!m_classPositions[targetItem.second].empty(), OptimizerException, ""); + if (m_classPositions[targetItem.second].count(targetItem.first)) continue; SourceLocation const& location = m_expressionClasses.representative(targetItem.second).item->getLocation(); + int position = classElementPosition(targetItem.second); if (position < targetItem.first) // it is already at its target, we need another copy appendDup(position, location); @@ -266,19 +264,23 @@ void CSECodeGenerator::addDependencies(Id _c) } } -int CSECodeGenerator::generateClassElement(Id _c, bool _allowSequenced) +void CSECodeGenerator::generateClassElement(Id _c, bool _allowSequenced) { + for (auto it: m_classPositions) + for (auto p: it.second) + if (p > m_stackHeight) + assertThrow(false, OptimizerException, ""); // do some cleanup removeStackTopIfPossible(); if (m_classPositions.count(_c)) { assertThrow( - m_classPositions[_c] != c_invalidPosition, + !m_classPositions[_c].empty(), OptimizerException, "Element already removed but still needed." ); - return m_classPositions[_c]; + return; } ExpressionClasses::Expression const& expr = m_expressionClasses.representative(_c); assertThrow( @@ -351,16 +353,16 @@ int CSECodeGenerator::generateClassElement(Id _c, bool _allowSequenced) m_generatedItems.back() == AssemblyItem(Instruction::SWAP1)) // this will not append a swap but remove the one that is already there appendOrRemoveSwap(m_stackHeight - 1, location); - for (auto arg: arguments) - if (m_classPositions[arg] != c_invalidPosition && canBeRemoved(arg, _c)) - m_classPositions[arg] = c_invalidPosition; for (size_t i = 0; i < arguments.size(); ++i) + { + m_classPositions[m_stack[m_stackHeight - i]].erase(m_stackHeight - i); m_stack.erase(m_stackHeight - i); + } appendItem(*expr.item); if (expr.item->type() != Operation || instructionInfo(expr.item->instruction()).ret == 1) { m_stack[m_stackHeight] = _c; - return m_classPositions[_c] = m_stackHeight; + m_classPositions[_c].insert(m_stackHeight); } else { @@ -369,18 +371,18 @@ int CSECodeGenerator::generateClassElement(Id _c, bool _allowSequenced) OptimizerException, "Invalid number of return values." ); - return m_classPositions[_c] = c_invalidPosition; + m_classPositions[_c]; // ensure it is created to mark the expression as generated } } int CSECodeGenerator::classElementPosition(Id _id) const { assertThrow( - m_classPositions.count(_id) && m_classPositions.at(_id) != c_invalidPosition, + m_classPositions.count(_id) && !m_classPositions.at(_id).empty(), OptimizerException, "Element requested but is not present." ); - return m_classPositions.at(_id); + return *max_element(m_classPositions.at(_id).begin(), m_classPositions.at(_id).end()); } bool CSECodeGenerator::canBeRemoved(Id _element, Id _result, int _fromPosition) @@ -389,20 +391,19 @@ bool CSECodeGenerator::canBeRemoved(Id _element, Id _result, int _fromPosition) if (_fromPosition == c_invalidPosition) _fromPosition = classElementPosition(_element); - bool isCopy = _fromPosition != classElementPosition(_element); + bool haveCopy = m_classPositions.at(_element).size() > 1; if (m_finalClasses.count(_element)) // It is part of the target stack. It can be removed if it is a copy that is not in the target position. - return isCopy && (!m_targetStack.count(_fromPosition) || m_targetStack[_fromPosition] != _element); - else if (isCopy) - // It is only a copy, can be removed. - return true; - - // Can be removed unless it is needed by a class that has not been computed yet. - // Note that m_classPositions also includes classes that were deleted in the meantime. - auto range = m_neededBy.equal_range(_element); - for (auto it = range.first; it != range.second; ++it) - if (it->second != _result && !m_classPositions.count(it->second)) - return false; + return haveCopy && (!m_targetStack.count(_fromPosition) || m_targetStack[_fromPosition] != _element); + else if (!haveCopy) + { + // Can be removed unless it is needed by a class that has not been computed yet. + // Note that m_classPositions also includes classes that were deleted in the meantime. + auto range = m_neededBy.equal_range(_element); + for (auto it = range.first; it != range.second; ++it) + if (it->second != _result && !m_classPositions.count(it->second)) + return false; + } return true; } @@ -414,9 +415,9 @@ bool CSECodeGenerator::removeStackTopIfPossible() Id top = m_stack[m_stackHeight]; if (!canBeRemoved(top, Id(-1), m_stackHeight)) return false; - m_generatedItems.push_back(AssemblyItem(Instruction::POP)); + m_classPositions[m_stack[m_stackHeight]].erase(m_stackHeight); m_stack.erase(m_stackHeight); - m_stackHeight--; + appendItem(AssemblyItem(Instruction::POP)); return true; } @@ -428,6 +429,7 @@ void CSECodeGenerator::appendDup(int _fromPosition, SourceLocation const& _locat assertThrow(1 <= instructionNum, OptimizerException, "Invalid stack access."); appendItem(AssemblyItem(dupInstruction(instructionNum), _location)); m_stack[m_stackHeight] = m_stack[_fromPosition]; + m_classPositions[m_stack[m_stackHeight]].insert(m_stackHeight); } void CSECodeGenerator::appendOrRemoveSwap(int _fromPosition, SourceLocation const& _location) @@ -439,13 +441,15 @@ void CSECodeGenerator::appendOrRemoveSwap(int _fromPosition, SourceLocation cons assertThrow(instructionNum <= 16, StackTooDeepException, "Stack too deep."); assertThrow(1 <= instructionNum, OptimizerException, "Invalid stack access."); appendItem(AssemblyItem(swapInstruction(instructionNum), _location)); - // The value of a class can be present in multiple locations on the stack. We only update the - // "canonical" one that is tracked by m_classPositions - if (m_classPositions[m_stack[m_stackHeight]] == m_stackHeight) - m_classPositions[m_stack[m_stackHeight]] = _fromPosition; - if (m_classPositions[m_stack[_fromPosition]] == _fromPosition) - m_classPositions[m_stack[_fromPosition]] = m_stackHeight; - swap(m_stack[m_stackHeight], m_stack[_fromPosition]); + + if (m_stack[m_stackHeight] != m_stack[_fromPosition]) + { + m_classPositions[m_stack[m_stackHeight]].erase(m_stackHeight); + m_classPositions[m_stack[m_stackHeight]].insert(_fromPosition); + m_classPositions[m_stack[_fromPosition]].erase(_fromPosition); + m_classPositions[m_stack[_fromPosition]].insert(m_stackHeight); + swap(m_stack[m_stackHeight], m_stack[_fromPosition]); + } if (m_generatedItems.size() >= 2 && SemanticInformation::isSwapInstruction(m_generatedItems.back()) && *(m_generatedItems.end() - 2) == m_generatedItems.back()) diff --git a/libevmasm/CommonSubexpressionEliminator.h b/libevmasm/CommonSubexpressionEliminator.h index 2a9a31255..a35e31d90 100644 --- a/libevmasm/CommonSubexpressionEliminator.h +++ b/libevmasm/CommonSubexpressionEliminator.h @@ -119,10 +119,8 @@ private: void addDependencies(Id _c); /// Produce code that generates the given element if it is not yet present. - /// @returns the stack position of the element or c_invalidPosition if it does not actually - /// generate a value on the stack. /// @param _allowSequenced indicates that sequence-constrained operations are allowed - int generateClassElement(Id _c, bool _allowSequenced = false); + void generateClassElement(Id _c, bool _allowSequenced = false); /// @returns the position of the representative of the given id on the stack. /// @note throws an exception if it is not on the stack. int classElementPosition(Id _id) const; @@ -151,8 +149,8 @@ private: std::multimap m_neededBy; /// Current content of the stack. std::map m_stack; - /// Current positions of equivalence classes, equal to c_invalidPosition if already deleted. - std::map m_classPositions; + /// Current positions of equivalence classes, equal to the empty set if already deleted. + std::map> m_classPositions; /// The actual eqivalence class items and how to compute them. ExpressionClasses& m_expressionClasses; From 12f3446bf9f87b1e3450dfb551b3039fe578e638 Mon Sep 17 00:00:00 2001 From: chriseth Date: Fri, 8 May 2015 12:40:11 +0200 Subject: [PATCH 112/461] Tests. --- test/libsolidity/SolidityOptimizer.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/test/libsolidity/SolidityOptimizer.cpp b/test/libsolidity/SolidityOptimizer.cpp index 3cb6a536a..4986b1469 100644 --- a/test/libsolidity/SolidityOptimizer.cpp +++ b/test/libsolidity/SolidityOptimizer.cpp @@ -251,6 +251,27 @@ BOOST_AUTO_TEST_CASE(function_calls) compareVersions("f(uint256)", 36); } +BOOST_AUTO_TEST_CASE(storage_write_in_loops) +{ + char const* sourceCode = R"( + contract test { + uint d; + function f(uint a) returns (uint r) { + var x = d; + for (uint i = 1; i < a * a; i++) { + r = d; + d = i; + } + + } + } + )"; + compileBothVersions(sourceCode); + compareVersions("f(uint256)", 0); + compareVersions("f(uint256)", 10); + compareVersions("f(uint256)", 36); +} + BOOST_AUTO_TEST_CASE(cse_intermediate_swap) { eth::KnownState state; From 6cf597651533d66759e00f69f8a3abe3d0d75d38 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Mon, 11 May 2015 14:07:27 +0200 Subject: [PATCH 113/461] Remove gas counter from VM interface (VMFace) --- evmjit/libevmjit-cpp/JitVM.cpp | 16 +++++----- evmjit/libevmjit-cpp/JitVM.h | 3 +- libethereum/Executive.cpp | 42 ++++++++++++------------- libethereum/Executive.h | 8 ++--- libethereum/ExtVM.cpp | 4 +-- libevm/VM.cpp | 23 +++++++------- libevm/VM.h | 9 ++---- libevm/VMFace.h | 10 ++---- libevm/VMFactory.cpp | 6 ++-- libevm/VMFactory.h | 2 +- test/fuzzTesting/checkRandomVMTest.cpp | 8 ++--- test/fuzzTesting/createRandomVMTest.cpp | 8 ++--- test/libevm/vm.cpp | 10 +++--- 13 files changed, 64 insertions(+), 85 deletions(-) diff --git a/evmjit/libevmjit-cpp/JitVM.cpp b/evmjit/libevmjit-cpp/JitVM.cpp index 84cc41dd1..717d70958 100644 --- a/evmjit/libevmjit-cpp/JitVM.cpp +++ b/evmjit/libevmjit-cpp/JitVM.cpp @@ -18,29 +18,27 @@ namespace eth extern "C" void env_sload(); // fake declaration for linker symbol stripping workaround, see a call below -bytesConstRef JitVM::go(ExtVMFace& _ext, OnOpFunc const& _onOp, uint64_t _step) +bytesConstRef JitVM::go(u256& io_gas, ExtVMFace& _ext, OnOpFunc const& _onOp, uint64_t _step) { using namespace jit; auto rejected = false; // TODO: Rejecting transactions with gas limit > 2^63 can be used by attacker to take JIT out of scope - rejected |= m_gas > std::numeric_limits::max(); // Do not accept requests with gas > 2^63 (int64 max) + rejected |= io_gas > std::numeric_limits::max(); // Do not accept requests with gas > 2^63 (int64 max) rejected |= _ext.gasPrice > std::numeric_limits::max(); rejected |= _ext.currentBlock.number > std::numeric_limits::max(); rejected |= _ext.currentBlock.timestamp > std::numeric_limits::max(); if (rejected) { - cwarn << "Execution rejected by EVM JIT (gas limit: " << m_gas << "), executing with interpreter"; + cwarn << "Execution rejected by EVM JIT (gas limit: " << io_gas << "), executing with interpreter"; VMFactory::setKind(VMKind::Interpreter); - m_fallbackVM = VMFactory::create(m_gas); + m_fallbackVM = VMFactory::create(); VMFactory::setKind(VMKind::JIT); - auto&& output = m_fallbackVM->go(_ext, _onOp, _step); - m_gas = m_fallbackVM->gas(); // copy remaining gas, Executive expects it - return output; + return m_fallbackVM->go(io_gas, _ext, _onOp, _step); } - m_data.gas = static_cast(m_gas); + m_data.gas = static_cast(io_gas); m_data.gasPrice = static_cast(_ext.gasPrice); m_data.callData = _ext.data.data(); m_data.callDataSize = _ext.data.size(); @@ -80,7 +78,7 @@ bytesConstRef JitVM::go(ExtVMFace& _ext, OnOpFunc const& _onOp, uint64_t _step) break; } - m_gas = m_data.gas; // TODO: Remove m_gas field + io_gas = m_data.gas; return {std::get<0>(m_engine.returnData), std::get<1>(m_engine.returnData)}; } diff --git a/evmjit/libevmjit-cpp/JitVM.h b/evmjit/libevmjit-cpp/JitVM.h index 58caa3648..797fe7e1c 100644 --- a/evmjit/libevmjit-cpp/JitVM.h +++ b/evmjit/libevmjit-cpp/JitVM.h @@ -10,11 +10,10 @@ namespace eth class JitVM: public VMFace { - virtual bytesConstRef go(ExtVMFace& _ext, OnOpFunc const& _onOp = {}, uint64_t _steps = (uint64_t)-1) override final; + virtual bytesConstRef go(u256& io_gas, ExtVMFace& _ext, OnOpFunc const& _onOp = {}, uint64_t _steps = (uint64_t)-1) override final; private: friend class VMFactory; - explicit JitVM(u256 _gas = 0) : VMFace(_gas) {} jit::RuntimeData m_data; jit::ExecutionEngine m_engine; diff --git a/libethereum/Executive.cpp b/libethereum/Executive.cpp index 2d8dbdc16..a856b9ef4 100644 --- a/libethereum/Executive.cpp +++ b/libethereum/Executive.cpp @@ -41,7 +41,7 @@ Executive::Executive(State& _s, BlockChain const& _bc, unsigned _level): u256 Executive::gasUsed() const { - return m_t.gas() - m_endGas; + return m_t.gas() - m_gas; } ExecutionResult Executive::executionResult() const @@ -133,26 +133,27 @@ bool Executive::call(Address _receiveAddress, Address _codeAddress, Address _sen bigint g = it->second.gas(_data); if (_gas < g) { - m_endGas = 0; m_excepted = TransactionException::OutOfGasBase; // Bail from exception. return true; // true actually means "all finished - nothing more to be done regarding go(). } else { - m_endGas = (u256)(_gas - g); + m_gas = (u256)(_gas - g); m_precompiledOut = it->second.exec(_data); m_out = &m_precompiledOut; } } - else if (m_s.addressHasCode(_codeAddress)) + else { - m_vm = VMFactory::create(_gas); - bytes const& c = m_s.code(_codeAddress); - m_ext = make_shared(m_s, m_lastHashes, _receiveAddress, _senderAddress, _originAddress, _value, _gasPrice, _data, &c, m_depth); + m_gas = _gas; + if (m_s.addressHasCode(_codeAddress)) + { + m_vm = VMFactory::create(); + bytes const& c = m_s.code(_codeAddress); + m_ext = make_shared(m_s, m_lastHashes, _receiveAddress, _senderAddress, _originAddress, _value, _gasPrice, _data, &c, m_depth); + } } - else - m_endGas = _gas; m_s.transferBalance(_senderAddress, _receiveAddress, _value); @@ -166,11 +167,12 @@ bool Executive::create(Address _sender, u256 _endowment, u256 _gasPrice, u256 _g // We can allow for the reverted state (i.e. that with which m_ext is constructed) to contain the m_newAddress, since // we delete it explicitly if we decide we need to revert. m_newAddress = right160(sha3(rlpList(_sender, m_s.transactionsFrom(_sender) - 1))); + m_gas = _gas; // Execute _init. if (!_init.empty()) { - m_vm = VMFactory::create(_gas); + m_vm = VMFactory::create(); m_ext = make_shared(m_s, m_lastHashes, m_newAddress, _sender, _origin, _endowment, _gasPrice, bytesConstRef(), _init, m_depth); } @@ -178,10 +180,7 @@ bool Executive::create(Address _sender, u256 _endowment, u256 _gasPrice, u256 _g m_s.transferBalance(_sender, m_newAddress, _endowment); if (_init.empty()) - { m_s.m_cache[m_newAddress].setCode({}); - m_endGas = _gas; - } return !m_ext; } @@ -215,17 +214,16 @@ bool Executive::go(OnOpFunc const& _onOp) #endif try { - m_out = m_vm->go(*m_ext, _onOp); - m_endGas = m_vm->gas(); + m_out = m_vm->go(m_gas, *m_ext, _onOp); if (m_isCreation) { - m_gasForDeposit = m_endGas; + m_gasForDeposit = m_gas; m_depositSize = m_out.size(); - if (m_out.size() * c_createDataGas <= m_endGas) + if (m_out.size() * c_createDataGas <= m_gas) { m_codeDeposit = CodeDeposit::Success; - m_endGas -= m_out.size() * c_createDataGas; + m_gas -= m_out.size() * c_createDataGas; } else { @@ -243,7 +241,7 @@ bool Executive::go(OnOpFunc const& _onOp) catch (VMException const& _e) { clog(StateSafeExceptions) << "Safe VM Exception. " << diagnostic_information(_e); - m_endGas = 0; + m_gas = 0; m_excepted = toTransactionException(_e); m_ext->revert(); } @@ -273,12 +271,12 @@ void Executive::finalize() // SSTORE refunds... // must be done before the miner gets the fees. if (m_ext) - m_endGas += min((m_t.gas() - m_endGas) / 2, m_ext->sub.refunds); + m_gas += min((m_t.gas() - m_gas) / 2, m_ext->sub.refunds); // cnote << "Refunding" << formatBalance(m_endGas * m_ext->gasPrice) << "to origin (=" << m_endGas << "*" << formatBalance(m_ext->gasPrice) << ")"; - m_s.addBalance(m_t.sender(), m_endGas * m_t.gasPrice()); + m_s.addBalance(m_t.sender(), m_gas * m_t.gasPrice()); - u256 feesEarned = (m_t.gas() - m_endGas) * m_t.gasPrice(); + u256 feesEarned = (m_t.gas() - m_gas) * m_t.gasPrice(); m_s.addBalance(m_s.m_currentBlock.coinbaseAddress, feesEarned); // Suicides... diff --git a/libethereum/Executive.h b/libethereum/Executive.h index 8903fd464..6057659fa 100644 --- a/libethereum/Executive.h +++ b/libethereum/Executive.h @@ -99,14 +99,14 @@ public: void accrueSubState(SubState& _parentContext); /// Executes (or continues execution of) the VM. - /// @returns false iff go() must be called again to finish the transction. + /// @returns false iff go() must be called again to finish the transaction. bool go(OnOpFunc const& _onOp = OnOpFunc()); /// Operation function for providing a simple trace of the VM execution. static OnOpFunc simpleTrace(); - /// @returns gas remaining after the transaction/operation. - u256 endGas() const { return m_endGas; } + /// @returns gas remaining after the transaction/operation. Valid after the transaction has been executed. + u256 gas() const { return m_gas; } /// @returns output data of the transaction/operation. bytesConstRef out() const { return m_out; } /// @returns the new address for the created contract in the CREATE operation. @@ -132,7 +132,7 @@ private: u256 m_gasForDeposit; ///< Amount of gas remaining for the code deposit phase. CodeDeposit m_codeDeposit = CodeDeposit::None; ///< True if an attempted deposit failed due to lack of gas. TransactionException m_excepted = TransactionException::None; ///< Details if the VM's execution resulted in an exception. - u256 m_endGas; ///< The final amount of gas for the transaction. + u256 m_gas = 0; ///< The gas for EVM code execution. Initial amount before go() execution, final amount after go() execution. Transaction m_t; ///< The original transaction. Set by setup(). LogEntries m_logs; ///< The log entries created by this transaction. Set by finalize(). diff --git a/libethereum/ExtVM.cpp b/libethereum/ExtVM.cpp index 68d146ce1..650200059 100644 --- a/libethereum/ExtVM.cpp +++ b/libethereum/ExtVM.cpp @@ -34,7 +34,7 @@ bool ExtVM::call(Address _receiveAddress, u256 _txValue, bytesConstRef _txData, e.go(_onOp); e.accrueSubState(sub); } - io_gas = e.endGas(); + io_gas = e.gas(); e.out().copyTo(_out); return !e.excepted(); @@ -51,7 +51,7 @@ h160 ExtVM::create(u256 _endowment, u256& io_gas, bytesConstRef _code, OnOpFunc e.go(_onOp); e.accrueSubState(sub); } - io_gas = e.endGas(); + io_gas = e.gas(); return e.newAddress(); } diff --git a/libevm/VM.cpp b/libevm/VM.cpp index 853ac25f6..8f1b47c05 100644 --- a/libevm/VM.cpp +++ b/libevm/VM.cpp @@ -25,13 +25,6 @@ using namespace std; using namespace dev; using namespace dev::eth; -void VM::reset(u256 _gas) noexcept -{ - VMFace::reset(_gas); - m_curPC = 0; - m_jumpDests.clear(); -} - struct InstructionMetric { int gasPriceTier; @@ -52,8 +45,14 @@ static array metrics() return s_ret; } -bytesConstRef VM::go(ExtVMFace& _ext, OnOpFunc const& _onOp, uint64_t _steps) +bytesConstRef VM::go(u256& io_gas, ExtVMFace& _ext, OnOpFunc const& _onOp, uint64_t _steps) { + // Reset leftovers from possible previous run + m_curPC = 0; + m_jumpDests.clear(); + + m_gas = io_gas; + m_stack.reserve((unsigned)c_stackLimit); static const array c_metrics = metrics(); @@ -200,11 +199,7 @@ bytesConstRef VM::go(ExtVMFace& _ext, OnOpFunc const& _onOp, uint64_t _steps) // _onOp(osteps - _steps - 1, inst, newTempSize > m_temp.size() ? (newTempSize - m_temp.size()) / 32 : bigint(0), runGas, this, &_ext); if (m_gas < runGas) - { - // Out of gas! - m_gas = 0; BOOST_THROW_EXCEPTION(OutOfGas()); - } m_gas = (u256)((bigint)m_gas - runGas); @@ -655,6 +650,7 @@ bytesConstRef VM::go(ExtVMFace& _ext, OnOpFunc const& _onOp, uint64_t _steps) unsigned s = (unsigned)m_stack.back(); m_stack.pop_back(); + io_gas = m_gas; return bytesConstRef(m_temp.data() + b, s); } case Instruction::SUICIDE: @@ -664,9 +660,12 @@ bytesConstRef VM::go(ExtVMFace& _ext, OnOpFunc const& _onOp, uint64_t _steps) // ...follow through to... } case Instruction::STOP: + io_gas = m_gas; return bytesConstRef(); } } + + io_gas = m_gas; if (_steps == (uint64_t)-1) BOOST_THROW_EXCEPTION(StepsDone()); return bytesConstRef(); diff --git a/libevm/VM.h b/libevm/VM.h index 30007e0b3..a73142dad 100644 --- a/libevm/VM.h +++ b/libevm/VM.h @@ -52,14 +52,13 @@ inline u256 fromAddress(Address _a) class VM: public VMFace { public: - virtual void reset(u256 _gas = 0) noexcept override final; - - virtual bytesConstRef go(ExtVMFace& _ext, OnOpFunc const& _onOp = {}, uint64_t _steps = (uint64_t)-1) override final; + virtual bytesConstRef go(u256& io_gas, ExtVMFace& _ext, OnOpFunc const& _onOp = {}, uint64_t _steps = (uint64_t)-1) override final; void require(u256 _n, u256 _d) { if (m_stack.size() < _n) { if (m_onFail) m_onFail(); BOOST_THROW_EXCEPTION(StackUnderflow() << RequirementError((bigint)_n, (bigint)m_stack.size())); } if (m_stack.size() - _n + _d > c_stackLimit) { if (m_onFail) m_onFail(); BOOST_THROW_EXCEPTION(OutOfStack() << RequirementError((bigint)(_d - _n), (bigint)m_stack.size())); } } void requireMem(unsigned _n) { if (m_temp.size() < _n) { m_temp.resize(_n); } } u256 curPC() const { return m_curPC; } + u256 gas() const { return m_gas; } bytes const& memory() const { return m_temp; } u256s const& stack() const { return m_stack; } @@ -67,10 +66,8 @@ public: private: friend class VMFactory; - /// Construct VM object. - explicit VM(u256 _gas): VMFace(_gas) {} - u256 m_curPC = 0; + u256 m_gas = 0; bytes m_temp; u256s m_stack; std::set m_jumpDests; diff --git a/libevm/VMFace.h b/libevm/VMFace.h index d2689d13e..d2a12e0ca 100644 --- a/libevm/VMFace.h +++ b/libevm/VMFace.h @@ -38,18 +38,12 @@ struct StackUnderflow: virtual VMException {}; class VMFace { public: - explicit VMFace(u256 _gas): m_gas(_gas) {} + VMFace() = default; virtual ~VMFace() = default; VMFace(VMFace const&) = delete; VMFace& operator=(VMFace const&) = delete; - virtual void reset(u256 _gas = 0) noexcept { m_gas = _gas; } - u256 gas() const noexcept { return m_gas; } - - virtual bytesConstRef go(ExtVMFace& _ext, OnOpFunc const& _onOp = {}, uint64_t _steps = (uint64_t)-1) = 0; - -protected: - u256 m_gas = 0; + virtual bytesConstRef go(u256& io_gas, ExtVMFace& _ext, OnOpFunc const& _onOp = {}, uint64_t _steps = (uint64_t)-1) = 0; }; } diff --git a/libevm/VMFactory.cpp b/libevm/VMFactory.cpp index 1092906e4..4b9df6a73 100644 --- a/libevm/VMFactory.cpp +++ b/libevm/VMFactory.cpp @@ -37,13 +37,13 @@ void VMFactory::setKind(VMKind _kind) g_kind = _kind; } -std::unique_ptr VMFactory::create(u256 _gas) +std::unique_ptr VMFactory::create() { #if ETH_EVMJIT - return std::unique_ptr(g_kind == VMKind::JIT ? static_cast(new JitVM(_gas)) : static_cast(new VM(_gas))); + return std::unique_ptr(g_kind == VMKind::JIT ? static_cast(new JitVM) : static_cast(new VM)); #else asserts(g_kind == VMKind::Interpreter && "JIT disabled in build configuration"); - return std::unique_ptr(new VM(_gas)); + return std::unique_ptr(new VM); #endif } diff --git a/libevm/VMFactory.h b/libevm/VMFactory.h index d0d02e0c4..6d2762dfc 100644 --- a/libevm/VMFactory.h +++ b/libevm/VMFactory.h @@ -34,7 +34,7 @@ class VMFactory public: VMFactory() = delete; - static std::unique_ptr create(u256 _gas); + static std::unique_ptr create(); static void setKind(VMKind _kind); }; diff --git a/test/fuzzTesting/checkRandomVMTest.cpp b/test/fuzzTesting/checkRandomVMTest.cpp index e22cb9361..13d677e17 100644 --- a/test/fuzzTesting/checkRandomVMTest.cpp +++ b/test/fuzzTesting/checkRandomVMTest.cpp @@ -94,13 +94,11 @@ bool doVMTest(mValue& _v) } bytes output; - u256 gas; bool vmExceptionOccured = false; try { - auto vm = eth::VMFactory::create(fev.gas); - output = vm->go(fev, fev.simpleTrace()).toBytes(); - gas = vm->gas(); + auto vm = eth::VMFactory::create(); + output = vm->go(fev.gas, fev, fev.simpleTrace()).toBytes(); } catch (eth::VMException) { @@ -168,7 +166,7 @@ bool doVMTest(mValue& _v) return 1; } - if (asserts(toInt(o["gas"]) == gas)) + if (asserts(toInt(o["gas"]) == fev.gas)) return 1; auto& expectedAddrs = test.addresses; diff --git a/test/fuzzTesting/createRandomVMTest.cpp b/test/fuzzTesting/createRandomVMTest.cpp index bad854718..3196590d4 100644 --- a/test/fuzzTesting/createRandomVMTest.cpp +++ b/test/fuzzTesting/createRandomVMTest.cpp @@ -155,14 +155,12 @@ void doMyTests(json_spirit::mValue& _v) } bytes output; - auto vm = eth::VMFactory::create(fev.gas); + auto vm = eth::VMFactory::create(); - u256 gas; bool vmExceptionOccured = false; try { - output = vm->go(fev, fev.simpleTrace()).toBytes(); - gas = vm->gas(); + output = vm->go(fev.gas, fev, fev.simpleTrace()).toBytes(); } catch (eth::VMException const& _e) { @@ -201,7 +199,7 @@ void doMyTests(json_spirit::mValue& _v) o["post"] = mValue(fev.exportState()); o["callcreates"] = fev.exportCallCreates(); o["out"] = toHex(output, 2, HexPrefix::Add); - o["gas"] = toCompactHex(gas, HexPrefix::Add, 1); + o["gas"] = toCompactHex(fev.gas, HexPrefix::Add, 1); o["logs"] = test::exportLog(fev.sub.logs); } } diff --git a/test/libevm/vm.cpp b/test/libevm/vm.cpp index 8b5a7c5d3..53a49f5c4 100644 --- a/test/libevm/vm.cpp +++ b/test/libevm/vm.cpp @@ -322,19 +322,17 @@ void doVMTests(json_spirit::mValue& v, bool _fillin) } bytes output; - u256 gas; bool vmExceptionOccured = false; try { - auto vm = eth::VMFactory::create(fev.gas); + auto vm = eth::VMFactory::create(); auto vmtrace = Options::get().vmtrace ? fev.simpleTrace() : OnOpFunc{}; auto outputRef = bytesConstRef{}; { Listener::ExecTimeGuard guard{i.first}; - outputRef = vm->go(fev, vmtrace); + outputRef = vm->go(fev.gas, fev, vmtrace); } output = outputRef.toBytes(); - gas = vm->gas(); } catch (VMException const&) { @@ -389,7 +387,7 @@ void doVMTests(json_spirit::mValue& v, bool _fillin) o["callcreates"] = fev.exportCallCreates(); o["out"] = toHex(output, 2, HexPrefix::Add); - o["gas"] = toCompactHex(gas, HexPrefix::Add, 1); + o["gas"] = toCompactHex(fev.gas, HexPrefix::Add, 1); o["logs"] = exportLog(fev.sub.logs); } } @@ -412,7 +410,7 @@ void doVMTests(json_spirit::mValue& v, bool _fillin) checkOutput(output, o); - BOOST_CHECK_EQUAL(toInt(o["gas"]), gas); + BOOST_CHECK_EQUAL(toInt(o["gas"]), fev.gas); State postState, expectState; mObject mPostState = fev.exportState(); From be75f4872bbb5b07926e54290e8100f4e0fb6d74 Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Mon, 11 May 2015 14:26:27 +0200 Subject: [PATCH 114/461] reorganize inout Limits tests --- test/libevm/vm.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/test/libevm/vm.cpp b/test/libevm/vm.cpp index 8b5a7c5d3..4c666dbba 100644 --- a/test/libevm/vm.cpp +++ b/test/libevm/vm.cpp @@ -492,16 +492,10 @@ BOOST_AUTO_TEST_CASE(vmPerformanceTest) dev::test::executeTests("vmPerformanceTest", "/VMTests",dev::test::getFolder(__FILE__) + "/VMTestsFiller", dev::test::doVMTests); } -BOOST_AUTO_TEST_CASE(vmInputLimitsTest1) +BOOST_AUTO_TEST_CASE(vmInputLimitsTest) { if (test::Options::get().inputLimits) - dev::test::executeTests("vmInputLimits1", "/VMTests",dev::test::getFolder(__FILE__) + "/VMTestsFiller", dev::test::doVMTests); -} - -BOOST_AUTO_TEST_CASE(vmInputLimitsTest2) -{ - if (test::Options::get().inputLimits) - dev::test::executeTests("vmInputLimits2", "/VMTests",dev::test::getFolder(__FILE__) + "/VMTestsFiller", dev::test::doVMTests); + dev::test::executeTests("vmInputLimits", "/VMTests",dev::test::getFolder(__FILE__) + "/VMTestsFiller", dev::test::doVMTests); } BOOST_AUTO_TEST_CASE(vmInputLimitsLightTest) From a62174b3ac4c9714f73b6860859e304b858f232b Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 11 May 2015 15:09:47 +0200 Subject: [PATCH 115/461] - Remove contract source. - Bug fix when when removing a project file. --- mix/ClientModel.cpp | 1 - mix/CodeModel.cpp | 13 +++++++++++++ mix/CodeModel.h | 2 ++ mix/FileIo.cpp | 6 ++++++ mix/FileIo.h | 2 ++ mix/qml/CodeEditorView.qml | 19 ++++++++++++++++--- mix/qml/FilesSection.qml | 20 ++++++++++++++++++-- mix/qml/js/ProjectModel.js | 16 +++++++++++----- mix/test/qml/TestMain.qml | 1 + mix/test/qml/js/TestProject.js | 14 ++++++++++++++ 10 files changed, 83 insertions(+), 11 deletions(-) diff --git a/mix/ClientModel.cpp b/mix/ClientModel.cpp index c558c71f3..9da294458 100644 --- a/mix/ClientModel.cpp +++ b/mix/ClientModel.cpp @@ -315,7 +315,6 @@ void ClientModel::executeSequence(vector const& _sequence, TransactionSettings stdTransaction = transaction; stdTransaction.gasAuto = true; Address address = deployContract(stdContractCode, stdTransaction); - deployedContracts.push_back(address); m_stdContractAddresses[stdTransaction.contractId] = address; m_stdContractNames[address] = stdTransaction.contractId; } diff --git a/mix/CodeModel.cpp b/mix/CodeModel.cpp index 636a665e6..5c6ec07c0 100644 --- a/mix/CodeModel.cpp +++ b/mix/CodeModel.cpp @@ -219,6 +219,19 @@ void CodeModel::reset(QVariantMap const& _documents) emit scheduleCompilationJob(++m_backgroundJobId); } +void CodeModel::unregisterContractSrc(QString const& _documentId) +{ + { + Guard pl(x_pendingContracts); + m_pendingContracts.erase(_documentId); + } + + // launch the background thread + m_compiling = true; + emit stateChanged(); + emit scheduleCompilationJob(++m_backgroundJobId); +} + void CodeModel::registerCodeChange(QString const& _documentId, QString const& _code) { { diff --git a/mix/CodeModel.h b/mix/CodeModel.h index 3f713a17b..a0b03951f 100644 --- a/mix/CodeModel.h +++ b/mix/CodeModel.h @@ -160,6 +160,8 @@ public: Q_INVOKABLE CompiledContract* contractByDocumentId(QString const& _documentId) const; /// Reset code model Q_INVOKABLE void reset() { reset(QVariantMap()); } + /// Delete a contract source + Q_INVOKABLE void unregisterContractSrc(QString const& _documentId); /// Convert solidity type info to mix type static SolidityType nodeType(dev::solidity::Type const* _type); /// Check if given location belongs to contract or function diff --git a/mix/FileIo.cpp b/mix/FileIo.cpp index 0991aa63d..22538194c 100644 --- a/mix/FileIo.cpp +++ b/mix/FileIo.cpp @@ -210,3 +210,9 @@ void FileIo::stopWatching(QString const& _path) { m_watcher->removePath(pathFromUrl(_path)); } + +void FileIo::deleteFile(QString const& _path) +{ + QFile file(pathFromUrl(_path)); + file.remove(); +} diff --git a/mix/FileIo.h b/mix/FileIo.h index 33c2bd5fd..90a143120 100644 --- a/mix/FileIo.h +++ b/mix/FileIo.h @@ -66,6 +66,8 @@ public: Q_INVOKABLE void watchFileChanged(QString const& _path); /// Stop Listenning for files change in @arg _path. Q_INVOKABLE void stopWatching(QString const& _path); + /// Delete a file + Q_INVOKABLE void deleteFile(QString const& _path); private: QString getHomePath() const; diff --git a/mix/qml/CodeEditorView.qml b/mix/qml/CodeEditorView.qml index e4d62ed81..bb7e203bf 100644 --- a/mix/qml/CodeEditorView.qml +++ b/mix/qml/CodeEditorView.qml @@ -190,9 +190,12 @@ Item { for (var i = 0; i < openDocCount; i++) { var doc = editorListModel.get(i); - var editor = editors.itemAt(i).item; - if (editor) - fileIo.writeFile(doc.path, editor.getText()); + if (editors.itemAt(i)) + { + var editor = editors.itemAt(i).item; + if (editor) + fileIo.writeFile(doc.path, editor.getText()); + } } } @@ -315,6 +318,16 @@ Item { break; } } + + onDocumentRemoved: { + for (var i = 0; i < editorListModel.count; i++) + if (editorListModel.get(i).documentId === documentId) + { + editorListModel.remove(i); + openDocCount--; + break; + } + } } function loadIfNotLoaded () { diff --git a/mix/qml/FilesSection.qml b/mix/qml/FilesSection.qml index d89875583..05ba5f897 100644 --- a/mix/qml/FilesSection.qml +++ b/mix/qml/FilesSection.qml @@ -241,8 +241,13 @@ Rectangle anchors.fill: parent acceptedButtons: Qt.LeftButton | Qt.RightButton onClicked:{ - if (mouse.button === Qt.RightButton && !isContract) - contextMenu.popup(); + if (mouse.button === Qt.RightButton) + { + if (isContract) + contextMenuContract.popup(); + else + contextMenu.popup(); + } else if (mouse.button === Qt.LeftButton) { rootItem.isSelected = true; @@ -268,6 +273,17 @@ Rectangle } } } + + Menu { + id: contextMenuContract + MenuItem { + text: qsTr("Delete") + onTriggered: { + projectModel.removeDocument(documentId); + wrapperItem.removeDocument(documentId); + } + } + } } } } diff --git a/mix/qml/js/ProjectModel.js b/mix/qml/js/ProjectModel.js index 6ec906996..51036f9c2 100644 --- a/mix/qml/js/ProjectModel.js +++ b/mix/qml/js/ProjectModel.js @@ -294,7 +294,10 @@ function renameDocument(documentId, newName) { function getDocument(documentId) { var i = getDocumentIndex(documentId); - return projectListModel.get(i); + if (i === -1) + return null; + else + return projectListModel.get(i); } function getDocumentIdByName(fileName) @@ -308,10 +311,13 @@ function getDocumentIdByName(fileName) function removeDocument(documentId) { var i = getDocumentIndex(documentId); var document = projectListModel.get(i); - if (!document.isContract) { - projectListModel.remove(i); - documentRemoved(documentId); - } + fileIo.stopWatching(document.path); + fileIo.deleteFile(document.path); + if (document.isContract) + codeModel.unregisterContractSrc(documentId); + projectListModel.remove(i); + saveProjectFile(); + documentRemoved(documentId); } function newHtmlFile() { diff --git a/mix/test/qml/TestMain.qml b/mix/test/qml/TestMain.qml index 829364a99..727d90b25 100644 --- a/mix/test/qml/TestMain.qml +++ b/mix/test/qml/TestMain.qml @@ -113,5 +113,6 @@ TestCase function test_project_contractRename() { TestProject.test_contractRename(); } function test_project_multipleWebPages() { TestProject.test_multipleWebPages(); } function test_project_multipleContractsSameFile() { TestProject.test_multipleContractsSameFile(); } + function test_project_deleteFile() { TestProject.test_deleteFile(); } } diff --git a/mix/test/qml/js/TestProject.js b/mix/test/qml/js/TestProject.js index 49b5ea51f..7ff482c58 100644 --- a/mix/test/qml/js/TestProject.js +++ b/mix/test/qml/js/TestProject.js @@ -44,3 +44,17 @@ function test_multipleContractsSameFile() tryCompare(mainApplication.mainContent.rightPane.transactionLog.transactionModel.get(3), "contract", "C2"); tryCompare(mainApplication.mainContent.rightPane.transactionLog.transactionModel.get(4), "contract", "C3"); } + +function test_deleteFile() +{ + /*newProject(); + var path = mainApplication.projectModel.projectPath; + createHtml("page1.html", "
Fail
"); + createHtml("page2.html", "
Fail
"); + createHtml("page3.html", "
Fail
"); + mainApplication.projectModel.removeDocument("page2.html"); + mainApplication.projectModel.closeProject(function(){}); + mainApplication.projectModel.loadProject(path); + var doc = mainApplication.projectModel.getDocument("page2.html"); + verify(doc, null)*/ +} From 5b4a3e1f60af0447ef0bd89b6898d7d6977c1f41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Mon, 11 May 2015 15:47:34 +0200 Subject: [PATCH 116/461] Remove gas counter from interpreter VM. OnOp callback signature changed. --- alethzero/Debugger.cpp | 4 ++-- eth/main.cpp | 12 ++++++------ libethereum/Executive.cpp | 4 ++-- libevm/ExtVMFace.h | 2 +- libevm/VM.cpp | 20 ++++++-------------- libevm/VM.h | 2 -- mix/MixClient.cpp | 4 ++-- test/libevm/vm.cpp | 6 +++--- 8 files changed, 22 insertions(+), 32 deletions(-) diff --git a/alethzero/Debugger.cpp b/alethzero/Debugger.cpp index a1d246a21..21ef3b711 100644 --- a/alethzero/Debugger.cpp +++ b/alethzero/Debugger.cpp @@ -82,7 +82,7 @@ bool DebugSession::populate(dev::eth::Executive& _executive, dev::eth::Transacti bytesConstRef lastData; h256 lastHash; h256 lastDataHash; - auto onOp = [&](uint64_t steps, Instruction inst, dev::bigint newMemSize, dev::bigint gasCost, VM* voidVM, ExtVMFace const* voidExt) + auto onOp = [&](uint64_t steps, Instruction inst, bigint newMemSize, bigint gasCost, bigint gas, VM* voidVM, ExtVMFace const* voidExt) { VM& vm = *voidVM; ExtVM const& ext = *static_cast(voidExt); @@ -104,7 +104,7 @@ bool DebugSession::populate(dev::eth::Executive& _executive, dev::eth::Transacti levels.push_back(&history.back()); else levels.resize(ext.depth); - history.append(WorldState({steps, ext.myAddress, vm.curPC(), inst, newMemSize, vm.gas(), lastHash, lastDataHash, vm.stack(), vm.memory(), gasCost, ext.state().storage(ext.myAddress), levels})); + history.append(WorldState({steps, ext.myAddress, vm.curPC(), inst, newMemSize, (u256)gas, lastHash, lastDataHash, vm.stack(), vm.memory(), gasCost, ext.state().storage(ext.myAddress), levels})); }; _executive.go(onOp); _executive.finalize(); diff --git a/eth/main.cpp b/eth/main.cpp index cb051aad1..807fd4c50 100644 --- a/eth/main.cpp +++ b/eth/main.cpp @@ -1462,7 +1462,7 @@ int main(int argc, char** argv) { OnOpFunc oof; if (format == "pretty") - oof = [&](uint64_t steps, Instruction instr, bigint newMemSize, bigint gasCost, dev::eth::VM* vvm, dev::eth::ExtVMFace const* vextVM) + oof = [&](uint64_t steps, Instruction instr, bigint newMemSize, bigint gasCost, bigint gas, dev::eth::VM* vvm, dev::eth::ExtVMFace const* vextVM) { dev::eth::VM* vm = vvm; dev::eth::ExtVM const* ext = static_cast(vextVM); @@ -1473,24 +1473,24 @@ int main(int argc, char** argv) f << " STORAGE" << endl; for (auto const& i: ext->state().storage(ext->myAddress)) f << showbase << hex << i.first << ": " << i.second << endl; - f << dec << ext->depth << " | " << ext->myAddress << " | #" << steps << " | " << hex << setw(4) << setfill('0') << vm->curPC() << " : " << dev::eth::instructionInfo(instr).name << " | " << dec << vm->gas() << " | -" << dec << gasCost << " | " << newMemSize << "x32"; + f << dec << ext->depth << " | " << ext->myAddress << " | #" << steps << " | " << hex << setw(4) << setfill('0') << vm->curPC() << " : " << dev::eth::instructionInfo(instr).name << " | " << dec << gas << " | -" << dec << gasCost << " | " << newMemSize << "x32"; }; else if (format == "standard") - oof = [&](uint64_t, Instruction instr, bigint, bigint, dev::eth::VM* vvm, dev::eth::ExtVMFace const* vextVM) + oof = [&](uint64_t, Instruction instr, bigint, bigint, bigint gas, dev::eth::VM* vvm, dev::eth::ExtVMFace const* vextVM) { dev::eth::VM* vm = vvm; dev::eth::ExtVM const* ext = static_cast(vextVM); - f << ext->myAddress << " " << hex << toHex(dev::toCompactBigEndian(vm->curPC(), 1)) << " " << hex << toHex(dev::toCompactBigEndian((int)(byte)instr, 1)) << " " << hex << toHex(dev::toCompactBigEndian((uint64_t)vm->gas(), 1)) << endl; + f << ext->myAddress << " " << hex << toHex(dev::toCompactBigEndian(vm->curPC(), 1)) << " " << hex << toHex(dev::toCompactBigEndian((int)(byte)instr, 1)) << " " << hex << toHex(dev::toCompactBigEndian((uint64_t)gas, 1)) << endl; }; else if (format == "standard+") - oof = [&](uint64_t, Instruction instr, bigint, bigint, dev::eth::VM* vvm, dev::eth::ExtVMFace const* vextVM) + oof = [&](uint64_t, Instruction instr, bigint, bigint, bigint gas, dev::eth::VM* vvm, dev::eth::ExtVMFace const* vextVM) { dev::eth::VM* vm = vvm; dev::eth::ExtVM const* ext = static_cast(vextVM); if (instr == Instruction::STOP || instr == Instruction::RETURN || instr == Instruction::SUICIDE) for (auto const& i: ext->state().storage(ext->myAddress)) f << toHex(dev::toCompactBigEndian(i.first, 1)) << " " << toHex(dev::toCompactBigEndian(i.second, 1)) << endl; - f << ext->myAddress << " " << hex << toHex(dev::toCompactBigEndian(vm->curPC(), 1)) << " " << hex << toHex(dev::toCompactBigEndian((int)(byte)instr, 1)) << " " << hex << toHex(dev::toCompactBigEndian((uint64_t)vm->gas(), 1)) << endl; + f << ext->myAddress << " " << hex << toHex(dev::toCompactBigEndian(vm->curPC(), 1)) << " " << hex << toHex(dev::toCompactBigEndian((int)(byte)instr, 1)) << " " << hex << toHex(dev::toCompactBigEndian((uint64_t)gas, 1)) << endl; }; e.initialize(t); if (!e.execute()) diff --git a/libethereum/Executive.cpp b/libethereum/Executive.cpp index a856b9ef4..ecfdd7721 100644 --- a/libethereum/Executive.cpp +++ b/libethereum/Executive.cpp @@ -187,7 +187,7 @@ bool Executive::create(Address _sender, u256 _endowment, u256 _gasPrice, u256 _g OnOpFunc Executive::simpleTrace() { - return [](uint64_t steps, Instruction inst, bigint newMemSize, bigint gasCost, VM* voidVM, ExtVMFace const* voidExt) + return [](uint64_t steps, Instruction inst, bigint newMemSize, bigint gasCost, bigint gas, VM* voidVM, ExtVMFace const* voidExt) { ExtVM const& ext = *static_cast(voidExt); VM& vm = *voidVM; @@ -201,7 +201,7 @@ OnOpFunc Executive::simpleTrace() for (auto const& i: ext.state().storage(ext.myAddress)) o << showbase << hex << i.first << ": " << i.second << endl; dev::LogOutputStream() << o.str(); - dev::LogOutputStream() << " < " << dec << ext.depth << " : " << ext.myAddress << " : #" << steps << " : " << hex << setw(4) << setfill('0') << vm.curPC() << " : " << instructionInfo(inst).name << " : " << dec << vm.gas() << " : -" << dec << gasCost << " : " << newMemSize << "x32" << " >"; + dev::LogOutputStream() << " < " << dec << ext.depth << " : " << ext.myAddress << " : #" << steps << " : " << hex << setw(4) << setfill('0') << vm.curPC() << " : " << instructionInfo(inst).name << " : " << dec << gas << " : -" << dec << gasCost << " : " << newMemSize << "x32" << " >"; }; } diff --git a/libevm/ExtVMFace.h b/libevm/ExtVMFace.h index 48fbd0b01..4bbdb36ac 100644 --- a/libevm/ExtVMFace.h +++ b/libevm/ExtVMFace.h @@ -106,7 +106,7 @@ class VM; using LastHashes = std::vector; -using OnOpFunc = std::function; +using OnOpFunc = std::function; /** * @brief Interface and null implementation of the class for specifying VM externalities. diff --git a/libevm/VM.cpp b/libevm/VM.cpp index 8f1b47c05..695b556dd 100644 --- a/libevm/VM.cpp +++ b/libevm/VM.cpp @@ -51,8 +51,6 @@ bytesConstRef VM::go(u256& io_gas, ExtVMFace& _ext, OnOpFunc const& _onOp, uint6 m_curPC = 0; m_jumpDests.clear(); - m_gas = io_gas; - m_stack.reserve((unsigned)c_stackLimit); static const array c_metrics = metrics(); @@ -97,7 +95,7 @@ bytesConstRef VM::go(u256& io_gas, ExtVMFace& _ext, OnOpFunc const& _onOp, uint6 auto onOperation = [&]() { if (_onOp) - _onOp(osteps - _steps - 1, inst, newTempSize > m_temp.size() ? (newTempSize - m_temp.size()) / 32 : bigint(0), runGas, this, &_ext); + _onOp(osteps - _steps - 1, inst, newTempSize > m_temp.size() ? (newTempSize - m_temp.size()) / 32 : bigint(0), runGas, io_gas, this, &_ext); }; switch (inst) @@ -195,13 +193,11 @@ bytesConstRef VM::go(u256& io_gas, ExtVMFace& _ext, OnOpFunc const& _onOp, uint6 runGas += c_copyGas * ((copySize + 31) / 32); onOperation(); -// if (_onOp) -// _onOp(osteps - _steps - 1, inst, newTempSize > m_temp.size() ? (newTempSize - m_temp.size()) / 32 : bigint(0), runGas, this, &_ext); - if (m_gas < runGas) + if (io_gas < runGas) BOOST_THROW_EXCEPTION(OutOfGas()); - m_gas = (u256)((bigint)m_gas - runGas); + io_gas = (u256)((bigint)io_gas - runGas); if (newTempSize > m_temp.size()) m_temp.resize((size_t)newTempSize); @@ -560,7 +556,7 @@ bytesConstRef VM::go(u256& io_gas, ExtVMFace& _ext, OnOpFunc const& _onOp, uint6 m_stack.push_back(m_temp.size()); break; case Instruction::GAS: - m_stack.push_back(m_gas); + m_stack.push_back(io_gas); break; case Instruction::JUMPDEST: break; @@ -609,7 +605,7 @@ bytesConstRef VM::go(u256& io_gas, ExtVMFace& _ext, OnOpFunc const& _onOp, uint6 m_stack.pop_back(); if (_ext.balance(_ext.myAddress) >= endowment && _ext.depth < 1024) - m_stack.push_back((u160)_ext.create(endowment, m_gas, bytesConstRef(m_temp.data() + initOff, initSize), _onOp)); + m_stack.push_back((u160)_ext.create(endowment, io_gas, bytesConstRef(m_temp.data() + initOff, initSize), _onOp)); else m_stack.push_back(0); break; @@ -640,7 +636,7 @@ bytesConstRef VM::go(u256& io_gas, ExtVMFace& _ext, OnOpFunc const& _onOp, uint6 else m_stack.push_back(0); - m_gas += gas; + io_gas += gas; break; } case Instruction::RETURN: @@ -649,8 +645,6 @@ bytesConstRef VM::go(u256& io_gas, ExtVMFace& _ext, OnOpFunc const& _onOp, uint6 m_stack.pop_back(); unsigned s = (unsigned)m_stack.back(); m_stack.pop_back(); - - io_gas = m_gas; return bytesConstRef(m_temp.data() + b, s); } case Instruction::SUICIDE: @@ -660,12 +654,10 @@ bytesConstRef VM::go(u256& io_gas, ExtVMFace& _ext, OnOpFunc const& _onOp, uint6 // ...follow through to... } case Instruction::STOP: - io_gas = m_gas; return bytesConstRef(); } } - io_gas = m_gas; if (_steps == (uint64_t)-1) BOOST_THROW_EXCEPTION(StepsDone()); return bytesConstRef(); diff --git a/libevm/VM.h b/libevm/VM.h index a73142dad..755d820fa 100644 --- a/libevm/VM.h +++ b/libevm/VM.h @@ -58,7 +58,6 @@ public: void requireMem(unsigned _n) { if (m_temp.size() < _n) { m_temp.resize(_n); } } u256 curPC() const { return m_curPC; } - u256 gas() const { return m_gas; } bytes const& memory() const { return m_temp; } u256s const& stack() const { return m_stack; } @@ -67,7 +66,6 @@ private: friend class VMFactory; u256 m_curPC = 0; - u256 m_gas = 0; bytes m_temp; u256s m_stack; std::set m_jumpDests; diff --git a/mix/MixClient.cpp b/mix/MixClient.cpp index b1d8f889e..853441490 100644 --- a/mix/MixClient.cpp +++ b/mix/MixClient.cpp @@ -132,7 +132,7 @@ void MixClient::executeTransaction(Transaction const& _t, State& _state, bool _c bytesConstRef const* lastData = nullptr; unsigned codeIndex = 0; unsigned dataIndex = 0; - auto onOp = [&](uint64_t steps, Instruction inst, dev::bigint newMemSize, dev::bigint gasCost, void* voidVM, void const* voidExt) + auto onOp = [&](uint64_t steps, Instruction inst, bigint newMemSize, bigint gasCost, bigint gas, void* voidVM, void const* voidExt) { VM& vm = *static_cast(voidVM); ExtVM const& ext = *static_cast(voidExt); @@ -169,7 +169,7 @@ void MixClient::executeTransaction(Transaction const& _t, State& _state, bool _c else levels.resize(ext.depth); - machineStates.emplace_back(MachineState({steps, vm.curPC(), inst, newMemSize, vm.gas(), + machineStates.emplace_back(MachineState({steps, vm.curPC(), inst, newMemSize, (u256)gas, vm.stack(), vm.memory(), gasCost, ext.state().storage(ext.myAddress), levels, codeIndex, dataIndex})); }; diff --git a/test/libevm/vm.cpp b/test/libevm/vm.cpp index 53a49f5c4..222a012f4 100644 --- a/test/libevm/vm.cpp +++ b/test/libevm/vm.cpp @@ -234,7 +234,7 @@ void FakeExtVM::importCallCreates(mArray& _callcreates) eth::OnOpFunc FakeExtVM::simpleTrace() { - return [](uint64_t steps, eth::Instruction inst, bigint newMemSize, bigint gasCost, dev::eth::VM* voidVM, dev::eth::ExtVMFace const* voidExt) + return [](uint64_t steps, eth::Instruction inst, bigint newMemSize, bigint gasCost, bigint gas, dev::eth::VM* voidVM, dev::eth::ExtVMFace const* voidExt) { FakeExtVM const& ext = *static_cast(voidExt); eth::VM& vm = *voidVM; @@ -250,7 +250,7 @@ eth::OnOpFunc FakeExtVM::simpleTrace() o << std::showbase << std::hex << i.first << ": " << i.second << std::endl; dev::LogOutputStream() << o.str(); - dev::LogOutputStream() << " | " << std::dec << ext.depth << " | " << ext.myAddress << " | #" << steps << " | " << std::hex << std::setw(4) << std::setfill('0') << vm.curPC() << " : " << instructionInfo(inst).name << " | " << std::dec << vm.gas() << " | -" << std::dec << gasCost << " | " << newMemSize << "x32" << " ]"; + dev::LogOutputStream() << " | " << std::dec << ext.depth << " | " << ext.myAddress << " | #" << steps << " | " << std::hex << std::setw(4) << std::setfill('0') << vm.curPC() << " : " << instructionInfo(inst).name << " | " << std::dec << gas << " | -" << std::dec << gasCost << " | " << newMemSize << "x32" << " ]"; /*creates json stack trace*/ if (eth::VMTraceChannel::verbosity <= g_logVerbosity) @@ -279,7 +279,7 @@ eth::OnOpFunc FakeExtVM::simpleTrace() /*add all the other details*/ o_step.push_back(Pair("storage", storage)); o_step.push_back(Pair("depth", to_string(ext.depth))); - o_step.push_back(Pair("gas", (string)vm.gas())); + o_step.push_back(Pair("gas", (string)gas)); o_step.push_back(Pair("address", toString(ext.myAddress ))); o_step.push_back(Pair("step", steps )); o_step.push_back(Pair("pc", (int)vm.curPC())); From 8523e9cce5a74b6f16f35416c4d6f1b45c4e8e1a Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Mon, 11 May 2015 15:59:57 +0200 Subject: [PATCH 117/461] add identity contract tests --- .../stPreCompiledContractsFiller.json | 379 ++++++++++++++++++ 1 file changed, 379 insertions(+) diff --git a/test/libethereum/StateTestsFiller/stPreCompiledContractsFiller.json b/test/libethereum/StateTestsFiller/stPreCompiledContractsFiller.json index 69e2456fb..41f5bc345 100644 --- a/test/libethereum/StateTestsFiller/stPreCompiledContractsFiller.json +++ b/test/libethereum/StateTestsFiller/stPreCompiledContractsFiller.json @@ -1038,6 +1038,385 @@ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", "data" : "" } + }, + + "CallIdentitiy_0": { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "10000000", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "expect" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "storage" : { + "0x" : "0000000000000000000000000000000000000000000000000000000000000001" + } + } + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "20000000", + "nonce" : "0", + "code" : "0x600160005260206000602060006000600460fff1600051600055", + "storage": {} + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1000000000000000000", + "nonce" : "0", + "code" : "", + "storage": {} + } + }, + "transaction" : { + "nonce" : "0", + "gasPrice" : "1", + "gasLimit" : "365224", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "100000", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "data" : "" + } + }, + + "CallIdentitiy_1": { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "10000000", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "expect" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "storage" : { + "0x" : "0x00", + "0x02" : "0x01" + } + } + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "20000000", + "nonce" : "0", + "code" : "{ [[ 2 ]] (CALL 500 4 0 0 0 0 32) [[ 0 ]] (MLOAD 0)}", + "storage": {} + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1000000000000000000", + "nonce" : "0", + "code" : "", + "storage": {} + } + }, + "transaction" : { + "nonce" : "0", + "gasPrice" : "1", + "gasLimit" : "365224", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "100000", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "data" : "" + } + }, + + "CallIdentity_1_nonzeroValue": { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "100000000", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "expect" : { + "0000000000000000000000000000000000000004" : { + "balance" : "19" + }, + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "storage" : { + "0x" : "0x00", + "0x02" : "0x01" + } + } + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "200000000", + "nonce" : "0", + "code" : "{ [[ 2 ]] (CALL 200000 4 0x13 0 0 0 32) [[ 0 ]] (MLOAD 0)}", + "storage": {} + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1000000000000000000", + "nonce" : "0", + "code" : "", + "storage": {} + } + }, + "transaction" : { + "nonce" : "0", + "gasPrice" : "1", + "gasLimit" : "365224", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "100000", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "data" : "" + } + }, + + "CallIdentity_2": { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "10000000", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "expect" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "storage" : { + "0x" : "0x000000000000000000000000000000000000000000000000000000f34578907f", + "0x02" : "0x01" + } + } + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "20000000", + "nonce" : "0", + "code" : "{ (MSTORE 0 0xf34578907f) [[ 2 ]] (CALL 500 4 0 0 37 0 32) [[ 0 ]] (MLOAD 0)}", + "storage": {} + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1000000000000000000", + "nonce" : "0", + "code" : "", + "storage": {} + } + }, + "transaction" : { + "nonce" : "0", + "gasPrice" : "1", + "gasLimit" : "365224", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "100000", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "data" : "" + } + }, + + "CallIdentity_3": { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "10000000", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "expect" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "storage" : { + "0x" : "0x000000000000000000000000000000000000000000000000000000f34578907f", + "0x02" : "0x01" + } + } + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "20000000", + "nonce" : "0", + "code" : "{ (MSTORE 0 0xf34578907f) [[ 2 ]] (CALL 500 4 0 0 37 0 32) [[ 0 ]] (MLOAD 0)}", + "storage": {} + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1000000000000000000", + "nonce" : "0", + "code" : "", + "storage": {} + } + }, + "transaction" : { + "nonce" : "0", + "gasPrice" : "1", + "gasLimit" : "365224", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "100000", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "data" : "" + } + }, + + "CallIdentity_4": { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "10000000", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "expect" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "storage" : { + "0x" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "0x02" : "0x01" + } + } + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "20000000", + "nonce" : "0", + "code" : "{ (MSTORE 0 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) [[ 2 ]] (CALL 100 4 0 0 32 0 32) [[ 0 ]] (MLOAD 0)}", + "storage": {} + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1000000000000000000", + "nonce" : "0", + "code" : "", + "storage": {} + } + }, + "transaction" : { + "nonce" : "0", + "gasPrice" : "1", + "gasLimit" : "365224", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "100000", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "data" : "" + } + }, + + "CallIdentity_4_gas18": { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "10000000", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "expect" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "storage" : { + "0x" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "0x02" : "0x01" + } + } + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "20000000", + "nonce" : "0", + "code" : "{ (MSTORE 0 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) [[ 2 ]] (CALL 18 4 0 0 32 0 32) [[ 0 ]] (MLOAD 0)}", + "storage": {} + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1000000000000000000", + "nonce" : "0", + "code" : "", + "storage": {} + } + }, + "transaction" : { + "nonce" : "0", + "gasPrice" : "1", + "gasLimit" : "365224", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "100000", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "data" : "" + } + }, + + "CallIdentity_4_gas17": { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "10000000", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "expect" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "storage" : { + "0x" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", + "0x02" : "0x00" + } + } + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "20000000", + "nonce" : "0", + "code" : "{ (MSTORE 0 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) [[ 2 ]] (CALL 17 4 0 0 32 0 32) [[ 0 ]] (MLOAD 0)}", + "storage": {} + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1000000000000000000", + "nonce" : "0", + "code" : "", + "storage": {} + } + }, + "transaction" : { + "nonce" : "0", + "gasPrice" : "1", + "gasLimit" : "365224", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "100000", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "data" : "" + } + }, + + "CallIdentity_5": { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "10000000", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "expect" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "storage" : { + "0x" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" + } + } + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "20000000", + "nonce" : "0", + "code" : "{ (MSTORE 0 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) [[ 2 ]] (CALL 600 4 0 0 1000000 0 32) [[ 0 ]] (MLOAD 0)}", + "storage": {} + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1000000000000000000", + "nonce" : "0", + "code" : "", + "storage": {} + } + }, + "transaction" : { + "nonce" : "0", + "gasPrice" : "1", + "gasLimit" : "10000000", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "100000", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "data" : "" + } } } From 579d6f4e32263c7da41931a4b2aec36aee21d683 Mon Sep 17 00:00:00 2001 From: chriseth Date: Mon, 11 May 2015 16:40:28 +0200 Subject: [PATCH 118/461] Compute state intersection. --- libevmasm/KnownState.cpp | 47 +++++++++++++++++++------- test/libsolidity/SolidityOptimizer.cpp | 36 ++++++++++++++++++++ 2 files changed, 71 insertions(+), 12 deletions(-) diff --git a/libevmasm/KnownState.cpp b/libevmasm/KnownState.cpp index 41ac4802b..d6fbde2d9 100644 --- a/libevmasm/KnownState.cpp +++ b/libevmasm/KnownState.cpp @@ -160,23 +160,46 @@ KnownState::StoreOperation KnownState::feedItem(AssemblyItem const& _item, bool return op; } -void KnownState::reduceToCommonKnowledge(KnownState const& /*_other*/) +/// Helper function for KnownState::reduceToCommonKnowledge, removes everything from +/// _this which is not in or not equal to the value in _other. +template void intersect( + _Mapping& _this, + _Mapping const& _other, + function<_KeyType(_KeyType)> const& _keyTrans = [](_KeyType _k) { return _k; } +) +{ + for (auto it = _this.begin(); it != _this.end();) + if (_other.count(_keyTrans(it->first)) && _other.at(_keyTrans(it->first)) == it->second) + ++it; + else + it = _this.erase(it); +} + +void KnownState::reduceToCommonKnowledge(KnownState const& _other) { - //@todo - *this = KnownState(m_expressionClasses); + int stackDiff = m_stackHeight - _other.m_stackHeight; + function stackKeyTransform = [=](int _key) -> int { return _key - stackDiff; }; + intersect(m_stackElements, _other.m_stackElements, stackKeyTransform); + // Use the smaller stack height. Essential to terminate in case of loops. + if (m_stackHeight > _other.m_stackHeight) + { + map shiftedStack; + for (auto const& stackElement: m_stackElements) + shiftedStack[stackElement.first - stackDiff] = stackElement.second; + m_stackElements = move(shiftedStack); + m_stackHeight = _other.m_stackHeight; + } + + intersect(m_storageContent, _other.m_storageContent); + intersect(m_memoryContent, _other.m_memoryContent); } bool KnownState::operator==(const KnownState& _other) const { - //@todo - return ( - m_stackElements.empty() && - _other.m_stackElements.empty() && - m_storageContent.empty() && - _other.m_storageContent.empty() && - m_memoryContent.empty() && - _other.m_memoryContent.empty() - ); + return m_storageContent == _other.m_storageContent && + m_memoryContent == _other.m_memoryContent && + m_stackHeight == _other.m_stackHeight && + m_stackElements == _other.m_stackElements; } ExpressionClasses::Id KnownState::stackElement(int _stackHeight, SourceLocation const& _location) diff --git a/test/libsolidity/SolidityOptimizer.cpp b/test/libsolidity/SolidityOptimizer.cpp index 4986b1469..e50469dd6 100644 --- a/test/libsolidity/SolidityOptimizer.cpp +++ b/test/libsolidity/SolidityOptimizer.cpp @@ -272,6 +272,42 @@ BOOST_AUTO_TEST_CASE(storage_write_in_loops) compareVersions("f(uint256)", 36); } +BOOST_AUTO_TEST_CASE(retain_information_in_branches) +{ + // This tests that the optimizer knows that we already have "z == sha3(y)" inside both branches. + char const* sourceCode = R"( + contract c { + bytes32 d; + uint a; + function f(uint x, bytes32 y) returns (uint r_a, bytes32 r_d) { + bytes32 z = sha3(y); + if (x > 8) { + z = sha3(y); + a = x; + } else { + z = sha3(y); + a = x; + } + r_a = a; + r_d = d; + } + } + )"; + compileBothVersions(sourceCode); + compareVersions("f(uint256,bytes32)", 0, "abc"); + compareVersions("f(uint256,bytes32)", 8, "def"); + compareVersions("f(uint256,bytes32)", 10, "ghi"); + + m_optimize = true; + bytes optimizedBytecode = compileAndRun(sourceCode, 0, "c"); + size_t numSHA3s = 0; + eth::eachInstruction(optimizedBytecode, [&](Instruction _instr, u256 const&) { + if (_instr == eth::Instruction::SHA3) + numSHA3s++; + }); + BOOST_CHECK_EQUAL(1, numSHA3s); +} + BOOST_AUTO_TEST_CASE(cse_intermediate_swap) { eth::KnownState state; From ef6c1588059900fb536948ff6a8276610e7b39b3 Mon Sep 17 00:00:00 2001 From: Liana Husikyan Date: Mon, 11 May 2015 13:47:21 +0200 Subject: [PATCH 119/461] bug in abi. fixed external type for return parameters --- libsolidity/InterfaceHandler.cpp | 10 ++-- test/libsolidity/SolidityABIJSON.cpp | 48 ++++++++++++++++++- .../SolidityNameAndTypeResolution.cpp | 22 +++++++++ 3 files changed, 74 insertions(+), 6 deletions(-) diff --git a/libsolidity/InterfaceHandler.cpp b/libsolidity/InterfaceHandler.cpp index d4958475b..e266f8d61 100644 --- a/libsolidity/InterfaceHandler.cpp +++ b/libsolidity/InterfaceHandler.cpp @@ -55,15 +55,15 @@ std::unique_ptr InterfaceHandler::getABIInterface(ContractDefinitio for (auto it: _contractDef.getInterfaceFunctions()) { - + auto externalFunctionType = it.second->externalFunctionType(); Json::Value method; method["type"] = "function"; method["name"] = it.second->getDeclaration().getName(); method["constant"] = it.second->isConstant(); - method["inputs"] = populateParameters(it.second->getParameterNames(), - it.second->getParameterTypeNames()); - method["outputs"] = populateParameters(it.second->getReturnParameterNames(), - it.second->getReturnParameterTypeNames()); + method["inputs"] = populateParameters(externalFunctionType->getParameterNames(), + externalFunctionType->getParameterTypeNames()); + method["outputs"] = populateParameters(externalFunctionType->getReturnParameterNames(), + externalFunctionType->getReturnParameterTypeNames()); abi.append(method); } if (_contractDef.getConstructor()) diff --git a/test/libsolidity/SolidityABIJSON.cpp b/test/libsolidity/SolidityABIJSON.cpp index 26d0110b8..6c1025d6a 100644 --- a/test/libsolidity/SolidityABIJSON.cpp +++ b/test/libsolidity/SolidityABIJSON.cpp @@ -499,7 +499,8 @@ BOOST_AUTO_TEST_CASE(constructor_abi) { char const* sourceCode = R"( contract test { - function test(uint param1, test param2, bool param3) {} + enum ActionChoices { GoLeft, GoRight, GoStraight, Sit } + function test(uint param1, test param2, bool param3, ActionChoices param4) {} } )"; @@ -517,6 +518,51 @@ BOOST_AUTO_TEST_CASE(constructor_abi) { "name": "param3", "type": "bool" + }, + { + "name": "param4", + "type": "uint8" + } + ], + "type": "constructor" + } + ])"; + checkInterface(sourceCode, interface); +} + + +BOOST_AUTO_TEST_CASE(return_param_in_abi) +{ + // bug #1801 + char const* sourceCode = R"( + contract test { + enum ActionChoices { GoLeft, GoRight, GoStraight, Sit } + function test(ActionChoices param) {} + function ret() returns(ActionChoices){ + ActionChoices action = ActionChoices.GoLeft; + return action; + } + } + )"; + + char const* interface = R"([ + { + "constant" : false, + "inputs" : [], + "name" : "ret", + "outputs" : [ + { + "name" : "", + "type" : "uint8" + } + ], + "type" : "function" + }, + { + "inputs": [ + { + "name": "param", + "type": "uint8" } ], "type": "constructor" diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp index c317dad97..c59c1f56f 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -508,6 +508,28 @@ BOOST_AUTO_TEST_CASE(function_external_types) } } +BOOST_AUTO_TEST_CASE(enum_external_type) +{ + // bug #1801 + ASTPointer sourceUnit; + char const* text = R"( + contract Test { + enum ActionChoices { GoLeft, GoRight, GoStraight, Sit } + function boo(ActionChoices enumArg) external returns (uint ret) { + ret = 5; + } + })"; + ETH_TEST_REQUIRE_NO_THROW(sourceUnit = parseTextAndResolveNames(text), "Parsing and name Resolving failed"); + for (ASTPointer const& node: sourceUnit->getNodes()) + if (ContractDefinition* contract = dynamic_cast(node.get())) + { + auto functions = contract->getDefinedFunctions(); + if (functions.empty()) + continue; + BOOST_CHECK_EQUAL("boo(uint8)", functions[0]->externalSignature()); + } +} + BOOST_AUTO_TEST_CASE(function_external_call_allowed_conversion) { char const* text = R"( From dba2756da8a5e8cebd5ee5457d8046c252cf0f3c Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 11 May 2015 16:49:52 +0200 Subject: [PATCH 120/461] add test --- mix/qml/js/ProjectModel.js | 2 +- mix/test/qml/js/TestDebugger.js | 7 +++++-- mix/test/qml/js/TestProject.js | 4 ++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/mix/qml/js/ProjectModel.js b/mix/qml/js/ProjectModel.js index 51036f9c2..6fce7686d 100644 --- a/mix/qml/js/ProjectModel.js +++ b/mix/qml/js/ProjectModel.js @@ -295,7 +295,7 @@ function renameDocument(documentId, newName) { function getDocument(documentId) { var i = getDocumentIndex(documentId); if (i === -1) - return null; + return undefined; else return projectListModel.get(i); } diff --git a/mix/test/qml/js/TestDebugger.js b/mix/test/qml/js/TestDebugger.js index 4933136ff..4e295c46f 100644 --- a/mix/test/qml/js/TestDebugger.js +++ b/mix/test/qml/js/TestDebugger.js @@ -223,13 +223,16 @@ function test_ctrTypeAsParam() "}"); mainApplication.projectModel.stateListModel.editState(0); //C1 ctor already added var transactionDialog = mainApplication.projectModel.stateDialog.transactionDialog; + mainApplication.projectModel.stateDialog.model.editTransaction(3); + ts.waitForRendering(transactionDialog, 3000); + clickElement(transactionDialog, 200, 300); + ts.typeString("", transactionDialog); + transactionDialog.acceptAndClose(); mainApplication.projectModel.stateDialog.model.addTransaction(); transactionDialog = mainApplication.projectModel.stateDialog.transactionDialog; ts.waitForRendering(transactionDialog, 3000); transactionDialog.selectContract("C2"); transactionDialog.selectFunction("getFromC1"); - clickElement(transactionDialog, 406, 340); - clickElement(transactionDialog, 406, 366); transactionDialog.acceptAndClose(); mainApplication.projectModel.stateDialog.acceptAndClose(); mainApplication.mainContent.startQuickDebugging(); diff --git a/mix/test/qml/js/TestProject.js b/mix/test/qml/js/TestProject.js index 7ff482c58..fe1023f05 100644 --- a/mix/test/qml/js/TestProject.js +++ b/mix/test/qml/js/TestProject.js @@ -47,7 +47,7 @@ function test_multipleContractsSameFile() function test_deleteFile() { - /*newProject(); + newProject(); var path = mainApplication.projectModel.projectPath; createHtml("page1.html", "
Fail
"); createHtml("page2.html", "
Fail
"); @@ -56,5 +56,5 @@ function test_deleteFile() mainApplication.projectModel.closeProject(function(){}); mainApplication.projectModel.loadProject(path); var doc = mainApplication.projectModel.getDocument("page2.html"); - verify(doc, null)*/ + verify(!doc, "page2.html has not been removed"); } From 4f855b5de31d3e10864599f41e42941b206dfd1f Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Mon, 11 May 2015 17:08:57 +0200 Subject: [PATCH 121/461] Add simple callback for DAG generation progress reporting --- libethcore/EthashAux.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/libethcore/EthashAux.cpp b/libethcore/EthashAux.cpp index 5a1741070..210f70c78 100644 --- a/libethcore/EthashAux.cpp +++ b/libethcore/EthashAux.cpp @@ -131,6 +131,14 @@ EthashAux::FullType EthashAux::full(BlockInfo const& _header) return full((uint64_t) _header.number); } +struct DAGChannel: public LogChannel { static const char* name(); static const int verbosity = 0; }; +const char* DAGChannel::name() { return EthGreen "DAG"; } +static int ethash_callback(unsigned int _progress) +{ + clog(DAGChannel) << "Generating DAG file. Progress: " << toString(_progress) << "%"; + return 0; +} + EthashAux::FullType EthashAux::full(uint64_t _blockNumber) { RecursiveGuard l(get()->x_this); @@ -141,7 +149,7 @@ EthashAux::FullType EthashAux::full(uint64_t _blockNumber) get()->m_lastUsedFull = ret; return ret; } - ret = get()->m_lastUsedFull = make_shared(light(_blockNumber)->light, nullptr); + ret = get()->m_lastUsedFull = make_shared(light(_blockNumber)->light, ethash_callback); get()->m_fulls[seedHash] = ret; return ret; } From 30ca78aa0b2f73999731c15d153ec629e20eea7e Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 11 May 2015 17:16:07 +0200 Subject: [PATCH 122/461] small changes --- mix/ClientModel.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mix/ClientModel.cpp b/mix/ClientModel.cpp index 87230664f..5f6a6c26c 100644 --- a/mix/ClientModel.cpp +++ b/mix/ClientModel.cpp @@ -256,9 +256,7 @@ void ClientModel::setupState(QVariantMap _state) u256 gasPrice = (qvariant_cast(transaction.value("gasPrice")))->toU256Wei(); QString sender = transaction.value("sender").toString(); bool isStdContract = transaction.value("stdContract").toBool(); - bool isContractCreation; - if (!transaction.value("isContractCreation").isNull()) - isContractCreation = transaction.value("isContractCreation").toBool(); + bool isContractCreation = transaction.value("isContractCreation").toBool(); if (isStdContract) { if (contractId.isEmpty()) //TODO: This is to support old project files, remove later From 6cc7bb915a217d359c2091fb8875880071371a37 Mon Sep 17 00:00:00 2001 From: Liana Husikyan Date: Mon, 11 May 2015 16:24:04 +0200 Subject: [PATCH 123/461] updated unit test --- libsolidity/InterfaceHandler.cpp | 12 ++-- test/libsolidity/SolidityABIJSON.cpp | 55 +++++++++---------- .../SolidityNameAndTypeResolution.cpp | 2 +- 3 files changed, 35 insertions(+), 34 deletions(-) diff --git a/libsolidity/InterfaceHandler.cpp b/libsolidity/InterfaceHandler.cpp index e266f8d61..a49c4dc3f 100644 --- a/libsolidity/InterfaceHandler.cpp +++ b/libsolidity/InterfaceHandler.cpp @@ -60,10 +60,14 @@ std::unique_ptr InterfaceHandler::getABIInterface(ContractDefinitio method["type"] = "function"; method["name"] = it.second->getDeclaration().getName(); method["constant"] = it.second->isConstant(); - method["inputs"] = populateParameters(externalFunctionType->getParameterNames(), - externalFunctionType->getParameterTypeNames()); - method["outputs"] = populateParameters(externalFunctionType->getReturnParameterNames(), - externalFunctionType->getReturnParameterTypeNames()); + method["inputs"] = populateParameters( + externalFunctionType->getParameterNames(), + externalFunctionType->getParameterTypeNames() + ); + method["outputs"] = populateParameters( + externalFunctionType->getReturnParameterNames(), + externalFunctionType->getReturnParameterTypeNames() + ); abi.append(method); } if (_contractDef.getConstructor()) diff --git a/test/libsolidity/SolidityABIJSON.cpp b/test/libsolidity/SolidityABIJSON.cpp index 6c1025d6a..fe8b791c5 100644 --- a/test/libsolidity/SolidityABIJSON.cpp +++ b/test/libsolidity/SolidityABIJSON.cpp @@ -499,8 +499,7 @@ BOOST_AUTO_TEST_CASE(constructor_abi) { char const* sourceCode = R"( contract test { - enum ActionChoices { GoLeft, GoRight, GoStraight, Sit } - function test(uint param1, test param2, bool param3, ActionChoices param4) {} + function test(uint param1, test param2, bool param3) {} } )"; @@ -518,10 +517,6 @@ BOOST_AUTO_TEST_CASE(constructor_abi) { "name": "param3", "type": "bool" - }, - { - "name": "param4", - "type": "uint8" } ], "type": "constructor" @@ -545,29 +540,31 @@ BOOST_AUTO_TEST_CASE(return_param_in_abi) } )"; - char const* interface = R"([ - { - "constant" : false, - "inputs" : [], - "name" : "ret", - "outputs" : [ - { - "name" : "", - "type" : "uint8" - } - ], - "type" : "function" - }, - { - "inputs": [ - { - "name": "param", - "type": "uint8" - } - ], - "type": "constructor" - } - ])"; + char const* interface = R"( + [ + { + "constant" : false, + "inputs" : [], + "name" : "ret", + "outputs" : [ + { + "name" : "", + "type" : "uint8" + } + ], + "type" : "function" + }, + { + "inputs": [ + { + "name": "param", + "type": "uint8" + } + ], + "type": "constructor" + } + ] + )"; checkInterface(sourceCode, interface); } diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp index c59c1f56f..4ec7b8bda 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -516,7 +516,7 @@ BOOST_AUTO_TEST_CASE(enum_external_type) contract Test { enum ActionChoices { GoLeft, GoRight, GoStraight, Sit } function boo(ActionChoices enumArg) external returns (uint ret) { - ret = 5; + ret = 5; } })"; ETH_TEST_REQUIRE_NO_THROW(sourceUnit = parseTextAndResolveNames(text), "Parsing and name Resolving failed"); From d3e0b74f0c605a940ebb3bdc5542f9558c090850 Mon Sep 17 00:00:00 2001 From: Liana Husikyan Date: Mon, 11 May 2015 17:17:50 +0200 Subject: [PATCH 124/461] Update SolidityABIJSON.cpp --- test/libsolidity/SolidityABIJSON.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/libsolidity/SolidityABIJSON.cpp b/test/libsolidity/SolidityABIJSON.cpp index fe8b791c5..f9bf78d0a 100644 --- a/test/libsolidity/SolidityABIJSON.cpp +++ b/test/libsolidity/SolidityABIJSON.cpp @@ -546,7 +546,7 @@ BOOST_AUTO_TEST_CASE(return_param_in_abi) "constant" : false, "inputs" : [], "name" : "ret", - "outputs" : [ + "outputs" : [ { "name" : "", "type" : "uint8" From 23d4ac1adb11e6b1689117fe7ddf432d57b2f836 Mon Sep 17 00:00:00 2001 From: Vlad Gluhovsky Date: Mon, 11 May 2015 17:27:11 +0200 Subject: [PATCH 125/461] Coding Standards fix --- test/libp2p/capability.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/test/libp2p/capability.cpp b/test/libp2p/capability.cpp index 2f1509e80..e4d0d910c 100644 --- a/test/libp2p/capability.cpp +++ b/test/libp2p/capability.cpp @@ -40,9 +40,10 @@ struct P2PFixture struct VerbosityHolder { - int oldLogVerbosity; VerbosityHolder(): oldLogVerbosity(g_logVerbosity) { g_logVerbosity = 10; } ~VerbosityHolder() { g_logVerbosity = oldLogVerbosity; } + + int oldLogVerbosity; }; class TestCapability: public Capability @@ -122,16 +123,14 @@ BOOST_AUTO_TEST_CASE(capability) int const step = 10; - for (int i = 0; i < 3000; i += step) - if (!host1.isStarted() || !host2.isStarted()) - this_thread::sleep_for(chrono::milliseconds(step)); + for (int i = 0; i < 3000 && (!host1.isStarted() || !host2.isStarted()); i += step) + this_thread::sleep_for(chrono::milliseconds(step)); BOOST_REQUIRE(host1.isStarted() && host2.isStarted()); host1.requirePeer(host2.id(), NodeIPEndpoint(bi::address::from_string(localhost), prefs2.listenPort, prefs2.listenPort)); - for (int i = 0; i < 3000; i += step) - if (!host1.peerCount() || !host2.peerCount()) - this_thread::sleep_for(chrono::milliseconds(step)); + for (int i = 0; i < 3000 && (!host1.peerCount() || !host2.peerCount()); i += step) + this_thread::sleep_for(chrono::milliseconds(step)); BOOST_REQUIRE(host1.peerCount() > 0 && host2.peerCount() > 0); From 3323ebbd1dcbbb38ba6a86aa5b07c0aed8d6d7d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Mon, 11 May 2015 17:40:00 +0200 Subject: [PATCH 126/461] Create symlink to old testeth location to make bildbot happy --- test/CMakeLists.txt | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 39a235c58..bedbe42f3 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -95,6 +95,12 @@ if (JSONRPC) target_link_libraries(testeth ${JSON_RPC_CPP_CLIENT_LIBRARIES}) endif() +if (UNIX) # Create symlink to old testeth location to make bildbot happy + add_custom_command(TARGET testeth POST_BUILD + COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_BINARY_DIR}/bin/testeth ${CMAKE_BINARY_DIR}/test/testeth + ) +endif() + enable_testing() set(CTEST_OUTPUT_ON_FAILURE TRUE) @@ -110,7 +116,6 @@ eth_add_test(ClientBase ) eth_add_test(JsonRpc - ARGS --eth_testfile=BlockTests/bcJS_API_Test + ARGS --eth_testfile=BlockTests/bcJS_API_Test ARGS --eth_testfile=BlockTests/bcValidBlockTest ) - From 6f198955dac792873cc427885ee424c9a4ecb646 Mon Sep 17 00:00:00 2001 From: chriseth Date: Mon, 11 May 2015 19:44:45 +0200 Subject: [PATCH 127/461] Use returning erase variant. --- libevmasm/ControlFlowGraph.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libevmasm/ControlFlowGraph.cpp b/libevmasm/ControlFlowGraph.cpp index 7ed56ff1a..cc68b2af8 100644 --- a/libevmasm/ControlFlowGraph.cpp +++ b/libevmasm/ControlFlowGraph.cpp @@ -289,7 +289,7 @@ void ControlFlowGraph::gatherKnowledge() // Note that this invalidates some contents of pushedTags for (auto it = m_blocks.begin(); it != m_blocks.end();) if (!it->second.startState) - m_blocks.erase(it++); + it = m_blocks.erase(it); else it++; } From fda1fe5d37af63827c51d0374b183ee4cbb99b50 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Sun, 10 May 2015 18:22:33 +0300 Subject: [PATCH 128/461] Threading fixes & cleanup. --- libp2p/NodeTable.cpp | 78 +++++++++++++++++++++++--------------------- libp2p/NodeTable.h | 4 ++- 2 files changed, 44 insertions(+), 38 deletions(-) diff --git a/libp2p/NodeTable.cpp b/libp2p/NodeTable.cpp index e926356b7..fe2940b30 100644 --- a/libp2p/NodeTable.cpp +++ b/libp2p/NodeTable.cpp @@ -127,20 +127,19 @@ void NodeTable::discover() list NodeTable::nodes() const { list nodes; - Guard l(x_nodes); - for (auto& i: m_nodes) - nodes.push_back(i.second->id); + DEV_GUARDED(x_nodes) + for (auto& i: m_nodes) + nodes.push_back(i.second->id); return move(nodes); } list NodeTable::snapshot() const { list ret; - Guard l(x_state); - for (auto s: m_state) - for (auto np: s.nodes) - if (auto n = np.lock()) - if (!!n) + DEV_GUARDED(x_state) + for (auto const& s: m_state) + for (auto const& np: s.nodes) + if (auto n = np.lock()) ret.push_back(*n); return move(ret); } @@ -151,8 +150,7 @@ Node NodeTable::node(NodeId const& _id) if (m_nodes.count(_id)) { auto entry = m_nodes[_id]; - Node n(_id, entry->endpoint, entry->required); - return move(n); + return Node(_id, entry->endpoint, entry->required); } return UnspecifiedNode; } @@ -173,7 +171,7 @@ void NodeTable::discover(NodeId _node, unsigned _round, shared_ptr>()); @@ -228,7 +226,7 @@ vector> NodeTable::nearestNodeEntries(NodeId _target) while (head != tail && head < s_bins && count < s_bucketSize) { Guard l(x_state); - for (auto n: m_state[head].nodes) + for (auto const& n: m_state[head].nodes) if (auto p = n.lock()) { if (count < s_bucketSize) @@ -238,7 +236,7 @@ vector> NodeTable::nearestNodeEntries(NodeId _target) } if (count < s_bucketSize && tail) - for (auto n: m_state[tail].nodes) + for (auto const& n: m_state[tail].nodes) if (auto p = n.lock()) { if (count < s_bucketSize) @@ -255,7 +253,7 @@ vector> NodeTable::nearestNodeEntries(NodeId _target) while (head < s_bins && count < s_bucketSize) { Guard l(x_state); - for (auto n: m_state[head].nodes) + for (auto const& n: m_state[head].nodes) if (auto p = n.lock()) { if (count < s_bucketSize) @@ -269,7 +267,7 @@ vector> NodeTable::nearestNodeEntries(NodeId _target) while (tail > 0 && count < s_bucketSize) { Guard l(x_state); - for (auto n: m_state[tail].nodes) + for (auto const& n: m_state[tail].nodes) if (auto p = n.lock()) { if (count < s_bucketSize) @@ -282,7 +280,7 @@ vector> NodeTable::nearestNodeEntries(NodeId _target) vector> ret; for (auto& nodes: found) - for (auto n: nodes.second) + for (auto const& n: nodes.second) if (ret.size() < s_bucketSize && !!n->endpoint && n->endpoint.isAllowed()) ret.push_back(n); return move(ret); @@ -306,12 +304,15 @@ void NodeTable::evict(shared_ptr _leastSeen, shared_ptr _n if (!m_socketPointer->isOpen()) return; + unsigned ec; + DEV_GUARDED(x_evictions) { - Guard l(x_evictions); m_evictions.push_back(EvictionTimeout(make_pair(_leastSeen->id,chrono::steady_clock::now()), _new->id)); - if (m_evictions.size() == 1) - doCheckEvictions(boost::system::error_code()); + ec = m_evictions.size(); } + + if (ec == 1) + doCheckEvictions(boost::system::error_code()); ping(_leastSeen.get()); } @@ -428,24 +429,27 @@ void NodeTable::onReceived(UDPSocketFace*, bi::udp::endpoint const& _from, bytes Pong in = Pong::fromBytesConstRef(_from, rlpBytes); // whenever a pong is received, check if it's in m_evictions - Guard le(x_evictions); - bool evictionEntry = false; - for (auto it = m_evictions.begin(); it != m_evictions.end(); it++) - if (it->first.first == nodeid && it->first.second > std::chrono::steady_clock::now()) - { - evictionEntry = true; - if (auto n = nodeEntry(it->second)) - dropNode(n); - - if (auto n = nodeEntry(it->first.first)) - n->pending = false; - - it = m_evictions.erase(it); - } - - // if not, check if it's known/pending or a pubk discovery ping - if (!evictionEntry) + bool found = false; + EvictionTimeout evictionEntry; + DEV_GUARDED(x_evictions) + for (auto it = m_evictions.begin(); it != m_evictions.end();) + if (it->first.first == nodeid && it->first.second > std::chrono::steady_clock::now()) + { + found = true; + evictionEntry = *it; + m_evictions.erase(it); + break; + } + if (found) + { + if (auto n = nodeEntry(evictionEntry.second)) + dropNode(n); + if (auto n = nodeEntry(evictionEntry.first.first)) + n->pending = false; + } + else { + // if not, check if it's known/pending or a pubk discovery ping if (auto n = nodeEntry(nodeid)) n->pending = false; else @@ -584,7 +588,7 @@ void NodeTable::doCheckEvictions(boost::system::error_code const& _ec) if (chrono::steady_clock::now() - e.first.second > c_reqTimeout) if (m_nodes.count(e.second)) drop.push_back(m_nodes[e.second]); - evictionsRemain = m_evictions.size() - drop.size() > 0; + evictionsRemain = (m_evictions.size() - drop.size() > 0); } drop.unique(); diff --git a/libp2p/NodeTable.h b/libp2p/NodeTable.h index 92bf17f79..2e10dd891 100644 --- a/libp2p/NodeTable.h +++ b/libp2p/NodeTable.h @@ -45,10 +45,12 @@ struct NodeEntry: public Node bool pending = true; ///< Node will be ignored until Pong is received }; -enum NodeTableEventType { +enum NodeTableEventType +{ NodeEntryAdded, NodeEntryDropped }; + class NodeTable; class NodeTableEventHandler { From 68714c59f8ca491be57f6b0077ef0cf793588c92 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Sun, 10 May 2015 18:22:45 +0300 Subject: [PATCH 129/461] Integrate KeyManager. --- alethzero/MainWin.cpp | 39 +++++++++-- alethzero/MainWin.h | 4 ++ alethzero/OurWebThreeStubServer.cpp | 69 +++++++++++++----- alethzero/OurWebThreeStubServer.h | 43 +++++++++--- eth/main.cpp | 56 +++++++++++++-- exp/main.cpp | 2 +- libdevcore/Common.cpp | 2 + libdevcore/Common.h | 2 + libdevcore/FixedHash.h | 1 + libdevcrypto/SecretStore.h | 5 +- libethcore/Common.h | 11 +++ libethcore/CommonJS.cpp | 2 - libethcore/CommonJS.h | 14 ---- libethereum/ClientBase.h | 1 + libethereum/Interface.h | 4 ++ libethereum/KeyManager.cpp | 14 +++- libethereum/KeyManager.h | 15 ++-- libtestutils/FixedWebThreeServer.cpp | 5 ++ libtestutils/FixedWebThreeServer.h | 6 +- libweb3jsonrpc/AccountHolder.cpp | 51 +++++++++----- libweb3jsonrpc/AccountHolder.h | 85 +++++++++++++++++++---- libweb3jsonrpc/WebThreeStubServer.cpp | 4 +- libweb3jsonrpc/WebThreeStubServer.h | 2 +- libweb3jsonrpc/WebThreeStubServerBase.cpp | 43 +++--------- libweb3jsonrpc/WebThreeStubServerBase.h | 10 +-- mix/ClientModel.cpp | 5 +- mix/ClientModel.h | 3 +- mix/Web3Server.cpp | 5 +- mix/Web3Server.h | 3 +- test/libweb3jsonrpc/AccountHolder.cpp | 28 ++++---- 30 files changed, 373 insertions(+), 161 deletions(-) diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index 437e75576..06f5f5283 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -143,6 +143,38 @@ Main::Main(QWidget *parent) : // ui->log->addItem(QString::fromStdString(s)); }; + // Open Key Store + bool opened = false; + if (m_keyManager.exists()) + while (!opened) + { + QString s = QInputDialog::getText(nullptr, "Master password", "Enter your MASTER account password.", QLineEdit::Password, QString()); + if (m_keyManager.load(s.toStdString())) + opened = true; + else if (QMessageBox::question( + nullptr, + "Invalid password entered", + "The password you entered is incorrect. If you have forgotten your password, and you wish to start afresh, manually remove the file: " + QString::fromStdString(getDataDir("ethereum")) + "/keys.info", + QMessageBox::Retry, + QMessageBox::Abort) + == QMessageBox::Abort) + exit(0); + } + if (!opened) + { + QString password; + while (true) + { + password = QInputDialog::getText(nullptr, "Master password", "Enter a MASTER password for your key store. Make it strong. You probably want to write it down somewhere and keep it safe and secure; your identity will rely on this - you never want to lose it.", QLineEdit::Password, QString()); + QString confirm = QInputDialog::getText(nullptr, "Master password", "Confirm this password by typing it again", QLineEdit::Password, QString()); + if (password == confirm) + break; + QMessageBox::warning(nullptr, "Try again", "You entered two different passwords - please enter the same password twice.", QMessageBox::Ok); + } + m_keyManager.create(password.toStdString()); + m_keyManager.import(Secret::random(), "{\"name\":\"Default identity\"}"); + } + #if ETH_DEBUG m_servers.append("127.0.0.1:30300"); #endif @@ -176,7 +208,7 @@ Main::Main(QWidget *parent) : m_webThree.reset(new WebThreeDirect(string("AlethZero/v") + dev::Version + "/" DEV_QUOTED(ETH_BUILD_TYPE) "/" DEV_QUOTED(ETH_BUILD_PLATFORM), getDataDir(), WithExisting::Trust, {"eth", "shh"}, p2p::NetworkPreferences(), network)); m_httpConnector.reset(new jsonrpc::HttpServer(SensibleHttpPort, "", "", dev::SensibleHttpThreads)); - m_server.reset(new OurWebThreeStubServer(*m_httpConnector, *web3(), keysAsVector(m_myKeys), this)); + m_server.reset(new OurWebThreeStubServer(*m_httpConnector, *web3(), this)); connect(&*m_server, SIGNAL(onNewId(QString)), SLOT(addNewId(QString))); m_server->setIdentities(keysAsVector(owned())); m_server->StartListening(); @@ -690,7 +722,6 @@ void Main::readSettings(bool _skipGeometry) } } ethereum()->setAddress(m_myKeys.back().address()); - m_server->setAccounts(keysAsVector(m_myKeys)); } { @@ -1397,9 +1428,6 @@ void Main::ourAccountsRowsMoved() myKeys.push_back(i); } m_myKeys = myKeys; - - if (m_server.get()) - m_server->setAccounts(keysAsVector(m_myKeys)); } void Main::on_inject_triggered() @@ -1837,7 +1865,6 @@ void Main::on_mine_triggered() void Main::keysChanged() { onBalancesChange(); - m_server->setAccounts(keysAsVector(m_myKeys)); } bool beginsWith(Address _a, bytes const& _b) diff --git a/alethzero/MainWin.h b/alethzero/MainWin.h index 127b174c6..6b2ede715 100644 --- a/alethzero/MainWin.h +++ b/alethzero/MainWin.h @@ -35,6 +35,7 @@ #include #include #include +#include #include #include #include "Context.h" @@ -90,6 +91,8 @@ public: dev::u256 gasPrice() const { return 10 * dev::eth::szabo; } + dev::eth::KeyManager& keyManager() { return m_keyManager; } + public slots: void load(QString _file); void note(QString _entry); @@ -249,6 +252,7 @@ private: QStringList m_servers; QList m_myKeys; QList m_myIdentities; + dev::eth::KeyManager m_keyManager; QString m_privateChain; dev::Address m_nameReg; diff --git a/alethzero/OurWebThreeStubServer.cpp b/alethzero/OurWebThreeStubServer.cpp index 161bb4926..da645766a 100644 --- a/alethzero/OurWebThreeStubServer.cpp +++ b/alethzero/OurWebThreeStubServer.cpp @@ -20,23 +20,23 @@ */ #include "OurWebThreeStubServer.h" - #include #include #include #include - #include "MainWin.h" - using namespace std; using namespace dev; using namespace dev::eth; -OurWebThreeStubServer::OurWebThreeStubServer(jsonrpc::AbstractServerConnector& _conn, WebThreeDirect& _web3, - vector const& _accounts, Main* _main): - WebThreeStubServer(_conn, _web3, _accounts), m_web3(&_web3), m_main(_main) +OurWebThreeStubServer::OurWebThreeStubServer( + jsonrpc::AbstractServerConnector& _conn, + WebThreeDirect& _web3, + Main* _main +): + WebThreeStubServer(_conn, _web3, make_shared(_web3, _main), _main->owned().toVector().toStdVector()), + m_main(_main) { - connect(_main, SIGNAL(poll()), this, SLOT(doValidations())); } string OurWebThreeStubServer::shh_newIdentity() @@ -46,7 +46,18 @@ string OurWebThreeStubServer::shh_newIdentity() return toJS(kp.pub()); } -bool OurWebThreeStubServer::showAuthenticationPopup(string const& _title, string const& _text) +OurAccountHolder::OurAccountHolder( + WebThreeDirect& _web3, + Main* _main +): + AccountHolder([=](){ return m_web3->ethereum(); }), + m_web3(&_web3), + m_main(_main) +{ + connect(_main, SIGNAL(poll()), this, SLOT(doValidations())); +} + +bool OurAccountHolder::showAuthenticationPopup(string const& _title, string const& _text) { if (!m_main->confirm()) { @@ -66,18 +77,18 @@ bool OurWebThreeStubServer::showAuthenticationPopup(string const& _title, string //return button == QMessageBox::Ok; } -bool OurWebThreeStubServer::showCreationNotice(TransactionSkeleton const& _t, bool _toProxy) +bool OurAccountHolder::showCreationNotice(TransactionSkeleton const& _t, bool _toProxy) { return showAuthenticationPopup("Contract Creation Transaction", string("ÐApp is attemping to create a contract; ") + (_toProxy ? "(this transaction is not executed directly, but forwarded to another ÐApp) " : "") + "to be endowed with " + formatBalance(_t.value) + ", with additional network fees of up to " + formatBalance(_t.gas * _t.gasPrice) + ".\n\nMaximum total cost is " + formatBalance(_t.value + _t.gas * _t.gasPrice) + "."); } -bool OurWebThreeStubServer::showSendNotice(TransactionSkeleton const& _t, bool _toProxy) +bool OurAccountHolder::showSendNotice(TransactionSkeleton const& _t, bool _toProxy) { return showAuthenticationPopup("Fund Transfer Transaction", "ÐApp is attempting to send " + formatBalance(_t.value) + " to a recipient " + m_main->pretty(_t.to) + (_toProxy ? " (this transaction is not executed directly, but forwarded to another ÐApp)" : "") + ", with additional network fees of up to " + formatBalance(_t.gas * _t.gasPrice) + ".\n\nMaximum total cost is " + formatBalance(_t.value + _t.gas * _t.gasPrice) + "."); } -bool OurWebThreeStubServer::showUnknownCallNotice(TransactionSkeleton const& _t, bool _toProxy) +bool OurAccountHolder::showUnknownCallNotice(TransactionSkeleton const& _t, bool _toProxy) { return showAuthenticationPopup("DANGEROUS! Unknown Contract Transaction!", "ÐApp is attempting to call into an unknown contract at address " + @@ -93,25 +104,47 @@ bool OurWebThreeStubServer::showUnknownCallNotice(TransactionSkeleton const& _t, "REJECT UNLESS YOU REALLY KNOW WHAT YOU ARE DOING!"); } -void OurWebThreeStubServer::authenticate(TransactionSkeleton const& _t, bool _toProxy) +void OurAccountHolder::authenticate(TransactionSkeleton const& _t) { Guard l(x_queued); - m_queued.push(make_pair(_t, _toProxy)); + m_queued.push(_t); } -void OurWebThreeStubServer::doValidations() +void OurAccountHolder::doValidations() { Guard l(x_queued); while (!m_queued.empty()) { - auto q = m_queued.front(); + auto t = m_queued.front(); m_queued.pop(); - if (validateTransaction(q.first, q.second)) - WebThreeStubServerBase::authenticate(q.first, q.second); + + bool proxy = isProxyAccount(t.from); + if (!proxy && !isRealAccount(t.from)) + { + cwarn << "Trying to send from non-existant account" << t.from; + return; + } + + // TODO: determine gas price. + + if (!validateTransaction(t, proxy)) + return; + + if (proxy) + queueTransaction(t); + else + // sign and submit. + if (Secret s = m_main->keyManager().secret(t.from)) + m_web3->ethereum()->submitTransaction(s, t); } } -bool OurWebThreeStubServer::validateTransaction(TransactionSkeleton const& _t, bool _toProxy) +AddressHash OurAccountHolder::realAccounts() const +{ + return m_main->keyManager().accounts(); +} + +bool OurAccountHolder::validateTransaction(TransactionSkeleton const& _t, bool _toProxy) { if (_t.creation) { diff --git a/alethzero/OurWebThreeStubServer.h b/alethzero/OurWebThreeStubServer.h index 95cf70438..a07188b2d 100644 --- a/alethzero/OurWebThreeStubServer.h +++ b/alethzero/OurWebThreeStubServer.h @@ -25,26 +25,29 @@ #include #include #include +#include class Main; -class OurWebThreeStubServer: public QObject, public WebThreeStubServer +class OurAccountHolder: public QObject, public dev::eth::AccountHolder { Q_OBJECT public: - OurWebThreeStubServer(jsonrpc::AbstractServerConnector& _conn, dev::WebThreeDirect& _web3, - std::vector const& _accounts, Main* main); - - virtual std::string shh_newIdentity() override; - virtual void authenticate(dev::eth::TransactionSkeleton const& _t, bool _toProxy); - -signals: - void onNewId(QString _s); + OurAccountHolder( + dev::WebThreeDirect& _web3, + Main* _main + ); public slots: void doValidations(); +protected: + // easiest to return keyManager.addresses(); + virtual dev::AddressHash realAccounts() const override; + // use web3 to submit a signed transaction to accept + virtual void authenticate(dev::eth::TransactionSkeleton const& _t) override; + private: bool showAuthenticationPopup(std::string const& _title, std::string const& _text); bool showCreationNotice(dev::eth::TransactionSkeleton const& _t, bool _toProxy); @@ -53,9 +56,29 @@ private: bool validateTransaction(dev::eth::TransactionSkeleton const& _t, bool _toProxy); - std::queue> m_queued; + std::queue m_queued; dev::Mutex x_queued; dev::WebThreeDirect* m_web3; Main* m_main; }; + +class OurWebThreeStubServer: public QObject, public WebThreeStubServer +{ + Q_OBJECT + +public: + OurWebThreeStubServer( + jsonrpc::AbstractServerConnector& _conn, + dev::WebThreeDirect& _web3, + Main* main + ); + + virtual std::string shh_newIdentity() override; + +signals: + void onNewId(QString _s); + +private: + Main* m_main; +}; diff --git a/eth/main.cpp b/eth/main.cpp index a5db1eecb..04ac5bc7e 100644 --- a/eth/main.cpp +++ b/eth/main.cpp @@ -37,6 +37,7 @@ #include #include #include +#include #include #if ETH_JSCONSOLE || !ETH_TRUE #include @@ -46,6 +47,7 @@ #include #endif #if ETH_JSONRPC || !ETH_TRUE +#include #include #include #include @@ -1086,13 +1088,53 @@ int main(int argc, char** argv) if (remoteHost.size()) web3.addNode(p2p::NodeId(), remoteHost + ":" + toString(remotePort)); -#if ETH_JSONRPC + KeyManager keyManager; + if (keyManager.exists()) + { + while (masterPassword.empty()) + { + cout << "Please enter your MASTER password:" << flush; + getline(cin, masterPassword); + if (!keyManager.load(masterPassword)) + { + cout << "Password invalid. Try again." << endl; + masterPassword.clear(); + } + } + } + else + { + while (masterPassword.empty()) + { + cout << "Please enter a MASTER password to protect your key store. Make it strong." << flush; + getline(cin, masterPassword); + string confirm; + cout << "Please confirm the password by entering it again." << flush; + getline(cin, confirm); + if (masterPassword != confirm) + { + cout << "Passwords were different. Try again." << endl; + masterPassword.clear(); + } + } + keyManager.create(masterPassword); + } + + string logbuf; + bool silence = false; + std::string additional; + g_logPost = [&](std::string const& a, char const*) { if (silence) logbuf += a + "\n"; else cout << "\r \r" << a << endl << additional << flush; }; + + // TODO: give hints &c. + auto getPassword = [&](Address const& a){ auto s = silence; silence = true; string ret; cout << endl << "Enter password for address " << a.abridged() << ": " << flush; std::getline(cin, ret); silence = s; return ret; }; + +#if ETH_JSONRPC || !ETH_TRUE shared_ptr jsonrpcServer; unique_ptr jsonrpcConnector; if (jsonrpc > -1) { jsonrpcConnector = unique_ptr(new jsonrpc::HttpServer(jsonrpc, "", "", SensibleHttpThreads)); - jsonrpcServer = shared_ptr(new WebThreeStubServer(*jsonrpcConnector.get(), web3, vector({sigKey}))); + jsonrpcServer = shared_ptr(new WebThreeStubServer(*jsonrpcConnector.get(), web3, make_shared([&](){return web3.ethereum();}, getPassword, keyManager), vector({sigKey}))); jsonrpcServer->StartListening(); } #endif @@ -1103,15 +1145,15 @@ int main(int argc, char** argv) if (interactive) { - string logbuf; + additional = "Press Enter"; string l; while (!g_exit) { - g_logPost = [](std::string const& a, char const*) { cout << "\r \r" << a << endl << "Press Enter" << flush; }; + silence = false; cout << logbuf << "Press Enter" << flush; std::getline(cin, l); logbuf.clear(); - g_logPost = [&](std::string const& a, char const*) { logbuf += a + "\n"; }; + silence = true; #if ETH_READLINE if (l.size()) @@ -1224,7 +1266,7 @@ int main(int argc, char** argv) iss >> g_logVerbosity; cout << "Verbosity: " << g_logVerbosity << endl; } -#if ETH_JSONRPC +#if ETH_JSONRPC || !ETH_TRUE else if (cmd == "jsonport") { if (iss.peek() != -1) @@ -1236,7 +1278,7 @@ int main(int argc, char** argv) if (jsonrpc < 0) jsonrpc = SensibleHttpPort; jsonrpcConnector = unique_ptr(new jsonrpc::HttpServer(jsonrpc, "", "", SensibleHttpThreads)); - jsonrpcServer = shared_ptr(new WebThreeStubServer(*jsonrpcConnector.get(), web3, vector({sigKey}))); + jsonrpcServer = shared_ptr(new WebThreeStubServer(*jsonrpcConnector.get(), web3, make_shared([&](){return web3.ethereum();}, getPassword, keyManager), vector({sigKey}))); jsonrpcServer->StartListening(); } else if (cmd == "jsonstop") diff --git a/exp/main.cpp b/exp/main.cpp index 5fee5cbee..2bd0a741e 100644 --- a/exp/main.cpp +++ b/exp/main.cpp @@ -81,7 +81,7 @@ int main() // cdebug << toString(a2); Address a2("19c486071651b2650449ba3c6a807f316a73e8fe"); - cdebug << keyman.keys(); + cdebug << keyman.accountDetails(); cdebug << "Secret key for " << a << "is" << keyman.secret(a, [](){ return "bar"; }); cdebug << "Secret key for " << a2 << "is" << keyman.secret(a2); diff --git a/libdevcore/Common.cpp b/libdevcore/Common.cpp index 5f3658030..5f15902e2 100644 --- a/libdevcore/Common.cpp +++ b/libdevcore/Common.cpp @@ -30,6 +30,8 @@ namespace dev char const* Version = "0.9.17"; +const u256 UndefinedU256 = ~(u256)0; + void HasInvariants::checkInvariants() const { if (!invariants()) diff --git a/libdevcore/Common.h b/libdevcore/Common.h index 36e57c44f..41f1b1d49 100644 --- a/libdevcore/Common.h +++ b/libdevcore/Common.h @@ -82,6 +82,8 @@ using u160s = std::vector; using u256Set = std::set; using u160Set = std::set; +extern const u256 UndefinedU256; + // Map types. using StringMap = std::map; using u256Map = std::map; diff --git a/libdevcore/FixedHash.h b/libdevcore/FixedHash.h index 14bc500e6..9b25837af 100644 --- a/libdevcore/FixedHash.h +++ b/libdevcore/FixedHash.h @@ -282,6 +282,7 @@ namespace std { /// Forward std::hash to dev::FixedHash::hash. template<> struct hash: dev::h64::hash {}; + template<> struct hash: dev::h128::hash {}; template<> struct hash: dev::h160::hash {}; template<> struct hash: dev::h256::hash {}; template<> struct hash: dev::h512::hash {}; diff --git a/libdevcrypto/SecretStore.h b/libdevcrypto/SecretStore.h index 7f4ae08f1..1fb6adf4a 100644 --- a/libdevcrypto/SecretStore.h +++ b/libdevcrypto/SecretStore.h @@ -23,6 +23,7 @@ #include #include +#include #include "Common.h" #include "FileSystem.h" @@ -48,8 +49,8 @@ private: static std::string encrypt(bytes const& _v, std::string const& _pass); static bytes decrypt(std::string const& _v, std::string const& _pass); - mutable std::map m_cached; - std::map> m_keys; + mutable std::unordered_map m_cached; + std::unordered_map> m_keys; }; } diff --git a/libethcore/Common.h b/libethcore/Common.h index 84459c6bf..8855bc3a7 100644 --- a/libethcore/Common.h +++ b/libethcore/Common.h @@ -136,5 +136,16 @@ private: using Handler = std::shared_ptr; +struct TransactionSkeleton +{ + bool creation = false; + Address from; + Address to; + u256 value; + bytes data; + u256 gas = UndefinedU256; + u256 gasPrice = UndefinedU256; +}; + } } diff --git a/libethcore/CommonJS.cpp b/libethcore/CommonJS.cpp index 286641bc3..167879db3 100644 --- a/libethcore/CommonJS.cpp +++ b/libethcore/CommonJS.cpp @@ -26,8 +26,6 @@ namespace dev { -const u256 UndefinedU256 = ~(u256)0; - Address toAddress(std::string const& _sn) { if (_sn.size() == 40) diff --git a/libethcore/CommonJS.h b/libethcore/CommonJS.h index 72625122d..0ff21afdf 100644 --- a/libethcore/CommonJS.h +++ b/libethcore/CommonJS.h @@ -48,8 +48,6 @@ inline Address jsToAddress(std::string const& _s) { return jsToFixed using namespace std; using namespace dev; +using namespace eth; namespace fs = boost::filesystem; KeyManager::KeyManager(std::string const& _keysFile): @@ -151,9 +152,18 @@ void KeyManager::kill(Address const& _a) m_store.kill(id); } -std::map> KeyManager::keys() const +AddressHash KeyManager::accounts() const { - std::map> ret; + AddressHash ret; + for (auto const& i: m_addrLookup) + if (m_keyInfo.count(i.second) > 0) + ret.insert(i.first); + return ret; +} + +std::unordered_map> KeyManager::accountDetails() const +{ + std::unordered_map> ret; for (auto const& i: m_addrLookup) if (m_keyInfo.count(i.second) > 0) ret[i.first] = make_pair(m_keyInfo.at(i.second).info, m_passwordInfo.at(m_keyInfo.at(i.second).passHash)); diff --git a/libethereum/KeyManager.h b/libethereum/KeyManager.h index 9cb22e5b3..391121b1c 100644 --- a/libethereum/KeyManager.h +++ b/libethereum/KeyManager.h @@ -28,7 +28,8 @@ namespace dev { - +namespace eth +{ class UnknownPassword: public Exception {}; struct KeyInfo @@ -65,7 +66,8 @@ public: bool load(std::string const& _pass); void save(std::string const& _pass) const { write(_pass, m_keysFile); } - std::map> keys() const; + AddressHash accounts() const; + std::unordered_map> accountDetails() const; h128 uuid(Address const& _a) const; Address address(h128 const& _uuid) const; @@ -92,12 +94,12 @@ private: void write(h128 const& _key, std::string const& _keysFile) const; // Ethereum keys. - std::map m_addrLookup; - std::map m_keyInfo; - std::map m_passwordInfo; + std::unordered_map m_addrLookup; + std::unordered_map m_keyInfo; + std::unordered_map m_passwordInfo; // Passwords that we're storing. - mutable std::map m_cachedPasswords; + mutable std::unordered_map m_cachedPasswords; // The default password for keys in the keystore - protected by the master password. std::string m_password; @@ -108,3 +110,4 @@ private: }; } +} diff --git a/libtestutils/FixedWebThreeServer.cpp b/libtestutils/FixedWebThreeServer.cpp index c72a106c6..0be34cc93 100644 --- a/libtestutils/FixedWebThreeServer.cpp +++ b/libtestutils/FixedWebThreeServer.cpp @@ -16,7 +16,12 @@ */ /** @file FixedWebThreeStubServer.cpp * @author Marek Kotewicz + * @author Gav Wood * @date 2015 */ #include "FixedWebThreeServer.h" +#include +using namespace std; +using namespace dev; +using namespace eth; diff --git a/libtestutils/FixedWebThreeServer.h b/libtestutils/FixedWebThreeServer.h index 33ccbf71e..bcaacecd8 100644 --- a/libtestutils/FixedWebThreeServer.h +++ b/libtestutils/FixedWebThreeServer.h @@ -23,6 +23,7 @@ #include #include +#include /** * @brief dummy JSON-RPC api implementation @@ -33,7 +34,10 @@ class FixedWebThreeServer: public dev::WebThreeStubServerBase, public dev::WebThreeStubDatabaseFace { public: - FixedWebThreeServer(jsonrpc::AbstractServerConnector& _conn, std::vector const& _accounts, dev::eth::Interface* _client): WebThreeStubServerBase(_conn, _accounts), m_client(_client) {}; + FixedWebThreeServer(jsonrpc::AbstractServerConnector& _conn, std::vector const& _allAccounts, dev::eth::Interface* _client): + WebThreeStubServerBase(_conn, std::make_shared([=](){return _client;}, _allAccounts), _allAccounts), + m_client(_client) + {} private: dev::eth::Interface* client() override { return m_client; } diff --git a/libweb3jsonrpc/AccountHolder.cpp b/libweb3jsonrpc/AccountHolder.cpp index b88397953..a73f20680 100644 --- a/libweb3jsonrpc/AccountHolder.cpp +++ b/libweb3jsonrpc/AccountHolder.cpp @@ -26,6 +26,7 @@ #include #include #include +#include using namespace std; using namespace dev; @@ -35,31 +36,23 @@ vector g_emptyQueue; static std::mt19937 g_randomNumberGenerator(time(0)); static Mutex x_rngMutex; -void AccountHolder::setAccounts(vector const& _accounts) +vector
AccountHolder::allAccounts() const { - m_accounts.clear(); - for (auto const& keyPair: _accounts) - { - m_accounts.push_back(keyPair.address()); - m_keyPairs[keyPair.address()] = keyPair; - } -} - -vector
AccountHolder::getAllAccounts() const -{ - vector
accounts = m_accounts; + vector
accounts; + accounts += realAccounts(); for (auto const& pair: m_proxyAccounts) if (!isRealAccount(pair.first)) accounts.push_back(pair.first); return accounts; } -Address const& AccountHolder::getDefaultTransactAccount() const +Address const& AccountHolder::defaultTransactAccount() const { - if (m_accounts.empty()) + auto accounts = realAccounts(); + if (accounts.empty()) return ZeroAddress; - Address const* bestMatch = &m_accounts.front(); - for (auto const& account: m_accounts) + Address const* bestMatch = &*accounts.begin(); + for (auto const& account: accounts) if (m_client()->balanceAt(account) > m_client()->balanceAt(*bestMatch)) bestMatch = &account; return *bestMatch; @@ -94,7 +87,7 @@ void AccountHolder::queueTransaction(TransactionSkeleton const& _transaction) m_transactionQueues[id].second.push_back(_transaction); } -vector const& AccountHolder::getQueuedTransactions(int _id) const +vector const& AccountHolder::queuedTransactions(int _id) const { if (!m_transactionQueues.count(_id)) return g_emptyQueue; @@ -106,3 +99,27 @@ void AccountHolder::clearQueue(int _id) if (m_transactionQueues.count(_id)) m_transactionQueues.at(_id).second.clear(); } + +AddressHash SimpleAccountHolder::realAccounts() const +{ + return m_keyManager.accounts(); +} + +void SimpleAccountHolder::authenticate(dev::eth::TransactionSkeleton const& _t) +{ + if (isRealAccount(_t.from)) + m_client()->submitTransaction(m_keyManager.secret(_t.from, [&](){ return m_getPassword(_t.from); }), _t); + else if (isProxyAccount(_t.from)) + queueTransaction(_t); +} + +void FixedAccountHolder::authenticate(dev::eth::TransactionSkeleton const& _t) +{ + if (isRealAccount(_t.from)) + m_client()->submitTransaction(m_accounts[_t.from], _t); + else if (isProxyAccount(_t.from)) + queueTransaction(_t); +} + + + diff --git a/libweb3jsonrpc/AccountHolder.h b/libweb3jsonrpc/AccountHolder.h index 52005b51f..10b036226 100644 --- a/libweb3jsonrpc/AccountHolder.h +++ b/libweb3jsonrpc/AccountHolder.h @@ -24,17 +24,20 @@ #pragma once #include +#include #include #include #include #include +#include namespace dev { namespace eth { + +class KeyManager; class Interface; -} /** * Manages real accounts (where we know the secret key) and proxy accounts (where transactions @@ -43,32 +46,84 @@ class Interface; class AccountHolder { public: - explicit AccountHolder(std::function const& _client): m_client(_client) {} + explicit AccountHolder(std::function const& _client): m_client(_client) {} + + // easiest to return keyManager.addresses(); + virtual AddressHash realAccounts() const = 0; + // use m_web3's submitTransaction + // or use AccountHolder::queueTransaction(_t) to accept + virtual void authenticate(dev::eth::TransactionSkeleton const& _t) = 0; - /// Sets or resets the list of real accounts. - void setAccounts(std::vector const& _accounts); - std::vector
const& getRealAccounts() const { return m_accounts; } - bool isRealAccount(Address const& _account) const { return m_keyPairs.count(_account) > 0; } + Addresses allAccounts() const; + bool isRealAccount(Address const& _account) const { return realAccounts().count(_account) > 0; } bool isProxyAccount(Address const& _account) const { return m_proxyAccounts.count(_account) > 0; } - Secret const& secretKey(Address const& _account) const { return m_keyPairs.at(_account).secret(); } - std::vector
getAllAccounts() const; - Address const& getDefaultTransactAccount() const; + Address const& defaultTransactAccount() const; int addProxyAccount(Address const& _account); bool removeProxyAccount(unsigned _id); void queueTransaction(eth::TransactionSkeleton const& _transaction); - std::vector const& getQueuedTransactions(int _id) const; + std::vector const& queuedTransactions(int _id) const; void clearQueue(int _id); +protected: + std::function m_client; + private: using TransactionQueue = std::vector; - std::map m_keyPairs; - std::vector
m_accounts; - std::map m_proxyAccounts; - std::map> m_transactionQueues; - std::function m_client; + std::unordered_map m_proxyAccounts; + std::unordered_map> m_transactionQueues; +}; + +class SimpleAccountHolder: public AccountHolder +{ +public: + SimpleAccountHolder(std::function const& _client, std::function const& _getPassword, KeyManager& _keyman): + AccountHolder(_client), + m_getPassword(_getPassword), + m_keyManager(_keyman) + {} + + AddressHash realAccounts() const override; + void authenticate(dev::eth::TransactionSkeleton const& _t) override; + +private: + std::function m_getPassword; + KeyManager& m_keyManager; +}; + +class FixedAccountHolder: public AccountHolder +{ +public: + FixedAccountHolder(std::function const& _client, std::vector const& _accounts): + AccountHolder(_client) + { + setAccounts(_accounts); + } + + void setAccounts(std::vector const& _accounts) + { + for (auto const& i: _accounts) + m_accounts[i.address()] = i.secret(); + } + + dev::AddressHash realAccounts() const override + { + dev::AddressHash ret; + for (auto const& i: m_accounts) + ret.insert(i.first); + return ret; + } + + // use m_web3's submitTransaction + // or use AccountHolder::queueTransaction(_t) to accept + void authenticate(dev::eth::TransactionSkeleton const& _t) override; + +private: + std::unordered_map m_accounts; }; + +} } diff --git a/libweb3jsonrpc/WebThreeStubServer.cpp b/libweb3jsonrpc/WebThreeStubServer.cpp index 30a634b3d..5235b0c4f 100644 --- a/libweb3jsonrpc/WebThreeStubServer.cpp +++ b/libweb3jsonrpc/WebThreeStubServer.cpp @@ -33,8 +33,8 @@ using namespace std; using namespace dev; using namespace dev::eth; -WebThreeStubServer::WebThreeStubServer(jsonrpc::AbstractServerConnector& _conn, WebThreeDirect& _web3, std::vector const& _accounts): - WebThreeStubServerBase(_conn, _accounts), +WebThreeStubServer::WebThreeStubServer(jsonrpc::AbstractServerConnector& _conn, WebThreeDirect& _web3, shared_ptr const& _ethAccounts, std::vector const& _shhAccounts): + WebThreeStubServerBase(_conn, _ethAccounts, _shhAccounts), m_web3(_web3) { auto path = getDataDir() + "/.web3"; diff --git a/libweb3jsonrpc/WebThreeStubServer.h b/libweb3jsonrpc/WebThreeStubServer.h index 08991d2f5..35c35c3f0 100644 --- a/libweb3jsonrpc/WebThreeStubServer.h +++ b/libweb3jsonrpc/WebThreeStubServer.h @@ -41,7 +41,7 @@ class WebThreeDirect; class WebThreeStubServer: public dev::WebThreeStubServerBase, public dev::WebThreeStubDatabaseFace { public: - WebThreeStubServer(jsonrpc::AbstractServerConnector& _conn, dev::WebThreeDirect& _web3, std::vector const& _accounts); + WebThreeStubServer(jsonrpc::AbstractServerConnector& _conn, dev::WebThreeDirect& _web3, std::shared_ptr const& _ethAccounts, std::vector const& _shhAccounts); virtual std::string web3_clientVersion(); diff --git a/libweb3jsonrpc/WebThreeStubServerBase.cpp b/libweb3jsonrpc/WebThreeStubServerBase.cpp index 12486d529..cac634a61 100644 --- a/libweb3jsonrpc/WebThreeStubServerBase.cpp +++ b/libweb3jsonrpc/WebThreeStubServerBase.cpp @@ -297,10 +297,11 @@ static Json::Value toJson(h256 const& _h, shh::Envelope const& _e, shh::Message return res; } -WebThreeStubServerBase::WebThreeStubServerBase(AbstractServerConnector& _conn, vector const& _accounts): - AbstractWebThreeStubServer(_conn), m_ethAccounts(make_shared(bind(&WebThreeStubServerBase::client, this))) +WebThreeStubServerBase::WebThreeStubServerBase(AbstractServerConnector& _conn, std::shared_ptr const& _ethAccounts, vector const& _sshAccounts): + AbstractWebThreeStubServer(_conn), + m_ethAccounts(_ethAccounts) { - m_ethAccounts->setAccounts(_accounts); + setIdentities(_sshAccounts); } void WebThreeStubServerBase::setIdentities(vector const& _ids) @@ -353,7 +354,7 @@ string WebThreeStubServerBase::eth_gasPrice() Json::Value WebThreeStubServerBase::eth_accounts() { Json::Value ret(Json::arrayValue); - for (auto const& i: m_ethAccounts->getAllAccounts()) + for (auto const& i: m_ethAccounts->allAccounts()) ret.append(toJS(i)); return ret; } @@ -499,7 +500,7 @@ string WebThreeStubServerBase::eth_sendTransaction(Json::Value const& _json) TransactionSkeleton t = toTransaction(_json); if (!t.from) - t.from = m_ethAccounts->getDefaultTransactAccount(); + t.from = m_ethAccounts->defaultTransactAccount(); if (t.creation) ret = toJS(right160(sha3(rlpList(t.from, client()->countAt(t.from)))));; if (t.gasPrice == UndefinedU256) @@ -507,10 +508,7 @@ string WebThreeStubServerBase::eth_sendTransaction(Json::Value const& _json) if (t.gas == UndefinedU256) t.gas = min(client()->gasLimitRemaining() / 5, client()->balanceAt(t.from) / t.gasPrice); - if (m_ethAccounts->isRealAccount(t.from)) - authenticate(t, false); - else if (m_ethAccounts->isProxyAccount(t.from)) - authenticate(t, true); + m_ethAccounts->authenticate(t); return ret; } @@ -528,7 +526,7 @@ string WebThreeStubServerBase::eth_signTransaction(Json::Value const& _json) TransactionSkeleton t = toTransaction(_json); if (!t.from) - t.from = m_ethAccounts->getDefaultTransactAccount(); + t.from = m_ethAccounts->defaultTransactAccount(); if (t.creation) ret = toJS(right160(sha3(rlpList(t.from, client()->countAt(t.from)))));; if (t.gasPrice == UndefinedU256) @@ -536,10 +534,7 @@ string WebThreeStubServerBase::eth_signTransaction(Json::Value const& _json) if (t.gas == UndefinedU256) t.gas = min(client()->gasLimitRemaining() / 5, client()->balanceAt(t.from) / t.gasPrice); - if (m_ethAccounts->isRealAccount(t.from)) - authenticate(t, false); - else if (m_ethAccounts->isProxyAccount(t.from)) - authenticate(t, true); + m_ethAccounts->authenticate(t); return toJS((t.creation ? Transaction(t.value, t.gasPrice, t.gas, t.data) : Transaction(t.value, t.gasPrice, t.gas, t.to, t.data)).sha3(WithoutSignature)); } @@ -579,7 +574,7 @@ string WebThreeStubServerBase::eth_call(Json::Value const& _json, string const& { TransactionSkeleton t = toTransaction(_json); if (!t.from) - t.from = m_ethAccounts->getDefaultTransactAccount(); + t.from = m_ethAccounts->defaultTransactAccount(); // if (!m_accounts->isRealAccount(t.from)) // return ret; if (t.gasPrice == UndefinedU256) @@ -593,7 +588,6 @@ string WebThreeStubServerBase::eth_call(Json::Value const& _json, string const& { BOOST_THROW_EXCEPTION(JsonRpcException(Errors::ERROR_RPC_INVALID_PARAMS)); } - } bool WebThreeStubServerBase::eth_flush() @@ -906,7 +900,7 @@ Json::Value WebThreeStubServerBase::eth_fetchQueuedTransactions(string const& _a auto id = jsToInt(_accountId); Json::Value ret(Json::arrayValue); // TODO: throw an error on no account with given id - for (TransactionSkeleton const& t: m_ethAccounts->getQueuedTransactions(id)) + for (TransactionSkeleton const& t: m_ethAccounts->queuedTransactions(id)) ret.append(toJson(t)); m_ethAccounts->clearQueue(id); return ret; @@ -1077,18 +1071,3 @@ Json::Value WebThreeStubServerBase::shh_getMessages(string const& _filterId) BOOST_THROW_EXCEPTION(JsonRpcException(Errors::ERROR_RPC_INVALID_PARAMS)); } } - -void WebThreeStubServerBase::authenticate(TransactionSkeleton const& _t, bool _toProxy) -{ - if (_toProxy) - m_ethAccounts->queueTransaction(_t); - else if (_t.to) - client()->submitTransaction(m_ethAccounts->secretKey(_t.from), _t.value, _t.to, _t.data, _t.gas, _t.gasPrice); - else - client()->submitTransaction(m_ethAccounts->secretKey(_t.from), _t.value, _t.data, _t.gas, _t.gasPrice); -} - -void WebThreeStubServerBase::setAccounts(const vector& _accounts) -{ - m_ethAccounts->setAccounts(_accounts); -} diff --git a/libweb3jsonrpc/WebThreeStubServerBase.h b/libweb3jsonrpc/WebThreeStubServerBase.h index 425e6567e..f3f7edfe7 100644 --- a/libweb3jsonrpc/WebThreeStubServerBase.h +++ b/libweb3jsonrpc/WebThreeStubServerBase.h @@ -36,10 +36,10 @@ namespace dev { class WebThreeNetworkFace; -class AccountHolder; class KeyPair; namespace eth { +class AccountHolder; struct TransactionSkeleton; class Interface; } @@ -68,7 +68,7 @@ public: class WebThreeStubServerBase: public AbstractWebThreeStubServer { public: - WebThreeStubServerBase(jsonrpc::AbstractServerConnector& _conn, std::vector const& _accounts); + WebThreeStubServerBase(jsonrpc::AbstractServerConnector& _conn, std::shared_ptr const& _ethAccounts, std::vector const& _sshAccounts); virtual std::string web3_sha3(std::string const& _param1); virtual std::string web3_clientVersion() { return "C++ (ethereum-cpp)"; } @@ -134,20 +134,16 @@ public: virtual Json::Value shh_getFilterChanges(std::string const& _filterId); virtual Json::Value shh_getMessages(std::string const& _filterId); - void setAccounts(std::vector const& _accounts); void setIdentities(std::vector const& _ids); std::map const& ids() const { return m_shhIds; } -protected: - virtual void authenticate(dev::eth::TransactionSkeleton const& _t, bool _toProxy); - protected: virtual dev::eth::Interface* client() = 0; virtual std::shared_ptr face() = 0; virtual dev::WebThreeNetworkFace* network() = 0; virtual dev::WebThreeStubDatabaseFace* db() = 0; - std::shared_ptr m_ethAccounts; + std::shared_ptr m_ethAccounts; std::map m_shhIds; std::map m_shhWatches; diff --git a/mix/ClientModel.cpp b/mix/ClientModel.cpp index c558c71f3..b355c336f 100644 --- a/mix/ClientModel.cpp +++ b/mix/ClientModel.cpp @@ -85,7 +85,8 @@ ClientModel::ClientModel(): connect(this, &ClientModel::runComplete, this, &ClientModel::showDebugger, Qt::QueuedConnection); m_client.reset(new MixClient(QStandardPaths::writableLocation(QStandardPaths::TempLocation).toStdString())); - m_web3Server.reset(new Web3Server(*m_rpcConnector.get(), std::vector(), m_client.get())); + m_ethAccounts = make_shared([=](){return m_client.get();}, std::vector()); + m_web3Server.reset(new Web3Server(*m_rpcConnector.get(), m_ethAccounts, std::vector(), m_client.get())); connect(m_web3Server.get(), &Web3Server::newTransaction, this, &ClientModel::onNewTransaction, Qt::DirectConnection); } @@ -280,7 +281,7 @@ void ClientModel::setupState(QVariantMap _state) transactionSequence.push_back(transactionSettings); } } - m_web3Server->setAccounts(userAccounts); + m_ethAccounts->setAccounts(userAccounts); executeSequence(transactionSequence, accounts, Secret(_state.value("miner").toMap().value("secret").toString().toStdString())); } diff --git a/mix/ClientModel.h b/mix/ClientModel.h index b88ae8511..910c0ed01 100644 --- a/mix/ClientModel.h +++ b/mix/ClientModel.h @@ -35,7 +35,7 @@ namespace dev { -namespace eth { class Account; } +namespace eth { class Account; class FixedAccountHolder; } namespace mix { @@ -235,6 +235,7 @@ private: std::unique_ptr m_client; std::unique_ptr m_rpcConnector; std::unique_ptr m_web3Server; + std::shared_ptr m_ethAccounts; QList m_gasCosts; std::map m_contractAddresses; std::map m_contractNames; diff --git a/mix/Web3Server.cpp b/mix/Web3Server.cpp index 7edc73060..855f33ca5 100644 --- a/mix/Web3Server.cpp +++ b/mix/Web3Server.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include "Web3Server.h" using namespace dev::mix; @@ -108,8 +109,8 @@ class EmptyNetwork : public dev::WebThreeNetworkFace } -Web3Server::Web3Server(jsonrpc::AbstractServerConnector& _conn, std::vector const& _accounts, dev::eth::Interface* _client): - WebThreeStubServerBase(_conn, _accounts), +Web3Server::Web3Server(jsonrpc::AbstractServerConnector& _conn, std::shared_ptr const& _ethAccounts, std::vector const& _shhAccounts, dev::eth::Interface* _client): + WebThreeStubServerBase(_conn, _ethAccounts, _shhAccounts), m_client(_client), m_network(new EmptyNetwork()) { diff --git a/mix/Web3Server.h b/mix/Web3Server.h index b8a059295..2383a0a3c 100644 --- a/mix/Web3Server.h +++ b/mix/Web3Server.h @@ -25,6 +25,7 @@ #include #include #include +#include #include namespace dev @@ -38,7 +39,7 @@ class Web3Server: public QObject, public dev::WebThreeStubServerBase, public dev Q_OBJECT public: - Web3Server(jsonrpc::AbstractServerConnector& _conn, std::vector const& _accounts, dev::eth::Interface* _client); + Web3Server(jsonrpc::AbstractServerConnector& _conn, std::shared_ptr const& _ethAccounts, std::vector const& _shhAccounts, dev::eth::Interface* _client); virtual ~Web3Server(); signals: diff --git a/test/libweb3jsonrpc/AccountHolder.cpp b/test/libweb3jsonrpc/AccountHolder.cpp index e8e42ff18..c9500a6ef 100644 --- a/test/libweb3jsonrpc/AccountHolder.cpp +++ b/test/libweb3jsonrpc/AccountHolder.cpp @@ -22,6 +22,9 @@ #include #include +using namespace std; +using namespace dev; +using namespace eth; namespace dev { @@ -32,16 +35,17 @@ BOOST_AUTO_TEST_SUITE(AccountHolderTest) BOOST_AUTO_TEST_CASE(ProxyAccountUseCase) { - AccountHolder h = AccountHolder(std::function()); - BOOST_CHECK(h.getAllAccounts().empty()); - BOOST_CHECK(h.getRealAccounts().empty()); + FixedAccountHolder h = FixedAccountHolder(function(), vector()); + + BOOST_CHECK(h.allAccounts().empty()); + BOOST_CHECK(h.realAccounts().empty()); Address addr("abababababababababababababababababababab"); Address addr2("abababababababababababababababababababab"); int id = h.addProxyAccount(addr); - BOOST_CHECK(h.getQueuedTransactions(id).empty()); + BOOST_CHECK(h.queuedTransactions(id).empty()); // register it again int secondID = h.addProxyAccount(addr); - BOOST_CHECK(h.getQueuedTransactions(secondID).empty()); + BOOST_CHECK(h.queuedTransactions(secondID).empty()); eth::TransactionSkeleton t1; eth::TransactionSkeleton t2; @@ -49,20 +53,20 @@ BOOST_AUTO_TEST_CASE(ProxyAccountUseCase) t1.data = fromHex("12345678"); t2.from = addr; t2.data = fromHex("abcdef"); - BOOST_CHECK(h.getQueuedTransactions(id).empty()); + BOOST_CHECK(h.queuedTransactions(id).empty()); h.queueTransaction(t1); - BOOST_CHECK_EQUAL(1, h.getQueuedTransactions(id).size()); + BOOST_CHECK_EQUAL(1, h.queuedTransactions(id).size()); h.queueTransaction(t2); - BOOST_REQUIRE_EQUAL(2, h.getQueuedTransactions(id).size()); + BOOST_REQUIRE_EQUAL(2, h.queuedTransactions(id).size()); // second proxy should not see transactions - BOOST_CHECK(h.getQueuedTransactions(secondID).empty()); + BOOST_CHECK(h.queuedTransactions(secondID).empty()); - BOOST_CHECK(h.getQueuedTransactions(id)[0].data == t1.data); - BOOST_CHECK(h.getQueuedTransactions(id)[1].data == t2.data); + BOOST_CHECK(h.queuedTransactions(id)[0].data == t1.data); + BOOST_CHECK(h.queuedTransactions(id)[1].data == t2.data); h.clearQueue(id); - BOOST_CHECK(h.getQueuedTransactions(id).empty()); + BOOST_CHECK(h.queuedTransactions(id).empty()); // removing fails because it never existed BOOST_CHECK(!h.removeProxyAccount(secondID)); BOOST_CHECK(h.removeProxyAccount(id)); From 69328f1dbf9abeaa3c161bccee796915f18215b4 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Mon, 11 May 2015 16:36:33 +0300 Subject: [PATCH 130/461] Compiles and tested basically ok. --- alethzero/Context.h | 2 + alethzero/MainWin.cpp | 166 +++++++++++++++++----------- alethzero/MainWin.h | 13 ++- alethzero/OurWebThreeStubServer.cpp | 2 +- alethzero/Transact.cpp | 23 ++-- alethzero/Transact.h | 4 +- 6 files changed, 130 insertions(+), 80 deletions(-) diff --git a/alethzero/Context.h b/alethzero/Context.h index 20c9696f9..3ed7cf7b3 100644 --- a/alethzero/Context.h +++ b/alethzero/Context.h @@ -64,5 +64,7 @@ public: virtual std::pair fromString(std::string const& _a) const = 0; virtual std::string renderDiff(dev::eth::StateDiff const& _d) const = 0; virtual std::string render(dev::Address const& _a) const = 0; + virtual dev::Secret retrieveSecret(dev::Address const& _a) const = 0; + }; diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index 06f5f5283..8a2fca714 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -31,6 +31,7 @@ #include #include #include +#include #include #include #include @@ -200,8 +201,6 @@ Main::Main(QWidget *parent) : ui->blockCount->setText(QString("PV%1.%2 D%3 %4-%5 v%6").arg(eth::c_protocolVersion).arg(eth::c_minorProtocolVersion).arg(c_databaseVersion).arg(QString::fromStdString(ProofOfWork::name())).arg(ProofOfWork::revision()).arg(dev::Version)); - connect(ui->ourAccounts->model(), SIGNAL(rowsMoved(const QModelIndex &, int, int, const QModelIndex &, int)), SLOT(ourAccountsRowsMoved())); - QSettings s("ethereum", "alethzero"); m_networkConfig = s.value("peers").toByteArray(); bytesConstRef network((byte*)m_networkConfig.data(), m_networkConfig.size()); @@ -230,6 +229,7 @@ Main::Main(QWidget *parent) : // ui->webView->page()->settings()->setAttribute(QWebEngineSettings::DeveloperExtrasEnabled, true); // QWebEngineInspector* inspector = new QWebEngineInspector(); // inspector->setPage(page); + setBeneficiary(*m_keyManager.accounts().begin()); readSettings(); #if !ETH_FATDB removeDockWidget(ui->dockWidget_accounts); @@ -390,9 +390,9 @@ void Main::installBalancesWatch() // TODO: Update for new currencies reg. for (unsigned i = 0; i < ethereum()->stateAt(coinsAddr, PendingBlock); ++i) altCoins.push_back(right160(ethereum()->stateAt(coinsAddr, i + 1))); - for (auto i: m_myKeys) + for (auto const& i: m_keyManager.accounts()) for (auto c: altCoins) - tf.address(c).topic(0, h256(i.address(), h256::AlignRight)); + tf.address(c).topic(0, h256(i, h256::AlignRight)); uninstallWatch(m_balancesFilter); m_balancesFilter = installWatch(tf, [=](LocalisedLogEntries const&){ onBalancesChange(); }); @@ -461,7 +461,7 @@ void Main::load(QString _s) void Main::on_newTransaction_triggered() { - m_transact.setEnvironment(m_myKeys, ethereum(), &m_natSpecDB); + m_transact.setEnvironment(m_keyManager.accounts(), ethereum(), &m_natSpecDB); m_transact.exec(); } @@ -648,17 +648,7 @@ void Main::on_paranoia_triggered() void Main::writeSettings() { QSettings s("ethereum", "alethzero"); - { - QByteArray b; - b.resize(sizeof(Secret) * m_myKeys.size()); - auto p = b.data(); - for (auto i: m_myKeys) - { - memcpy(p, &(i.secret()), sizeof(Secret)); - p += sizeof(Secret); - } - s.setValue("address", b); - } + s.remove("address"); { QByteArray b; b.resize(sizeof(Secret) * m_myIdentities.size()); @@ -698,6 +688,20 @@ void Main::writeSettings() s.setValue("windowState", saveState()); } +Secret Main::retrieveSecret(Address const& _a) const +{ + auto info = m_keyManager.accountDetails()[_a]; + while (true) + { + if (Secret s = m_keyManager.secret(_a, [&](){ + return QInputDialog::getText(const_cast(this), "Import Account Key", QString("Enter the password for the account %2 (%1). The hint is:\n%3").arg(QString::fromStdString(_a.abridged())).arg(QString::fromStdString(info.first)).arg(QString::fromStdString(info.second)), QLineEdit::Password).toStdString(); + })) + return s; + else if (QMessageBox::warning(const_cast(this), "Incorrect Password", "The password you gave is incorrect for this key.", QMessageBox::Retry, QMessageBox::Cancel) == QMessageBox::Cancel) + return Secret(); + } +} + void Main::readSettings(bool _skipGeometry) { QSettings s("ethereum", "alethzero"); @@ -707,21 +711,17 @@ void Main::readSettings(bool _skipGeometry) restoreState(s.value("windowState").toByteArray()); { - m_myKeys.clear(); QByteArray b = s.value("address").toByteArray(); - if (b.isEmpty()) - m_myKeys.append(KeyPair::create()); - else + if (!b.isEmpty()) { h256 k; for (unsigned i = 0; i < b.size() / sizeof(Secret); ++i) { memcpy(&k, b.data() + i * sizeof(Secret), sizeof(Secret)); - if (!count(m_myKeys.begin(), m_myKeys.end(), KeyPair(k))) - m_myKeys.append(KeyPair(k)); + if (!m_keyManager.accounts().count(KeyPair(k).address())) + m_keyManager.import(k, "Imported (UNSAFE) key."); } } - ethereum()->setAddress(m_myKeys.back().address()); } { @@ -766,16 +766,38 @@ void Main::readSettings(bool _skipGeometry) on_urlEdit_returnPressed(); } +std::string Main::getPassword(std::string const& _title, std::string const& _for) +{ + QString password; + while (true) + { + password = QInputDialog::getText(nullptr, QString::fromStdString(_title), QString::fromStdString(_for), QLineEdit::Password, QString()); + QString confirm = QInputDialog::getText(nullptr, QString::fromStdString(_title), "Confirm this password by typing it again", QLineEdit::Password, QString()); + if (password == confirm) + break; + QMessageBox::warning(nullptr, QString::fromStdString(_title), "You entered two different passwords - please enter the same password twice.", QMessageBox::Ok); + } + return password.toStdString(); +} + void Main::on_importKey_triggered() { - QString s = QInputDialog::getText(this, "Import Account Key", "Enter account's secret key"); + QString s = QInputDialog::getText(this, "Import Account Key", "Enter account's secret key", QLineEdit::Password); bytes b = fromHex(s.toStdString()); if (b.size() == 32) { auto k = KeyPair(h256(b)); - if (std::find(m_myKeys.begin(), m_myKeys.end(), k) == m_myKeys.end()) + if (!m_keyManager.accounts().count(k.address())) { - m_myKeys.append(k); + QString s = QInputDialog::getText(this, "Import Account Key", "Enter this account's name"); + if (QMessageBox::question(this, "Additional Security?", "Would you like to use additional security for this key? This lets you protect it with a different password to other keys, but also means you must re-enter the key's password every time you wish to use the account.", QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes) + { + std::string password = getPassword("Import Account Key", "Enter the password you would like to use for this key. Don't forget it!"); + std::string hint = QInputDialog::getText(this, "Import Account Key", "Enter a hint to help you remember this password.").toStdString(); + m_keyManager.import(k.secret(), s.toStdString(), password, hint); + } + else + m_keyManager.import(k.secret(), s.toStdString()); keysChanged(); } else @@ -816,15 +838,8 @@ void Main::on_importKeyFile_triggered() } cnote << k.address(); - if (std::find(m_myKeys.begin(), m_myKeys.end(), k) == m_myKeys.end()) - { - if (m_myKeys.empty()) - { - m_myKeys.push_back(KeyPair::create()); - keysChanged(); - } - ethereum()->submitTransaction(k.sec(), ethereum()->balanceAt(k.address()) - gasPrice() * c_txGas, m_myKeys.back().address(), {}, c_txGas, gasPrice()); - } + if (!m_keyManager.accounts().count(k.address())) + ethereum()->submitTransaction(k.sec(), ethereum()->balanceAt(k.address()) - gasPrice() * c_txGas, m_beneficiary, {}, c_txGas, gasPrice()); else QMessageBox::warning(this, "Already Have Key", "Could not import the secret key: we already own this account."); } @@ -843,10 +858,12 @@ void Main::on_importKeyFile_triggered() void Main::on_exportKey_triggered() { - if (ui->ourAccounts->currentRow() >= 0 && ui->ourAccounts->currentRow() < m_myKeys.size()) + if (ui->ourAccounts->currentRow() >= 0) { - auto k = m_myKeys[ui->ourAccounts->currentRow()]; - QMessageBox::information(this, "Export Account Key", "Secret key to account " + QString::fromStdString(render(k.address()) + " is:\n" + toHex(k.sec().ref()))); + auto hba = ui->ourAccounts->currentItem()->data(Qt::UserRole).toByteArray(); + Address h((byte const*)hba.data(), Address::ConstructFromPointer); + Secret s = retrieveSecret(h); + QMessageBox::information(this, "Export Account Key", "Secret key to account " + QString::fromStdString(render(h) + " is:\n" + s.hex())); } } @@ -944,6 +961,24 @@ void Main::refreshMining() */ } +void Main::setBeneficiary(Address const& _b) +{ + for (int i = 0; i < ui->ourAccounts->count(); ++i) + { + auto hba = ui->ourAccounts->item(i)->data(Qt::UserRole).toByteArray(); + auto h = Address((byte const*)hba.data(), Address::ConstructFromPointer); + ui->ourAccounts->item(i)->setCheckState(h == _b ? Qt::Checked : Qt::Unchecked); + } + m_beneficiary = _b; + ethereum()->setAddress(_b); +} + +void Main::on_ourAccounts_itemClicked(QListWidgetItem* _i) +{ + auto hba = _i->data(Qt::UserRole).toByteArray(); + setBeneficiary(Address((byte const*)hba.data(), Address::ConstructFromPointer)); +} + void Main::refreshBalances() { cwatch << "refreshBalances()"; @@ -962,11 +997,13 @@ void Main::refreshBalances() // cdebug << n << addr << denom << sha3(h256(n).asBytes()); altCoins[addr] = make_tuple(fromRaw(n), 0, denom); }*/ - for (auto i: m_myKeys) + for (pair> const& i: m_keyManager.accountDetails()) { - u256 b = ethereum()->balanceAt(i.address()); - (new QListWidgetItem(QString("%2: %1 [%3]").arg(formatBalance(b).c_str()).arg(QString::fromStdString(render(i.address()))).arg((unsigned)ethereum()->countAt(i.address())), ui->ourAccounts)) - ->setData(Qt::UserRole, QByteArray((char const*)i.address().data(), Address::size)); + u256 b = ethereum()->balanceAt(i.first); + QListWidgetItem* li = new QListWidgetItem(QString("%4 %2: %1 [%3]").arg(formatBalance(b).c_str()).arg(QString::fromStdString(render(i.first))).arg((unsigned)ethereum()->countAt(i.first)).arg(QString::fromStdString(i.second.first)), ui->ourAccounts); + li->setData(Qt::UserRole, QByteArray((char const*)i.first.data(), Address::size)); + li->setFlags(Qt::ItemIsUserCheckable); + li->setCheckState(m_beneficiary == i.first ? Qt::Checked : Qt::Unchecked); totalBalance += b; // for (auto& c: altCoins) @@ -1416,20 +1453,6 @@ void Main::on_transactionQueue_currentItemChanged() ui->pendingInfo->moveCursor(QTextCursor::Start); } -void Main::ourAccountsRowsMoved() -{ - QList myKeys; - for (int i = 0; i < ui->ourAccounts->count(); ++i) - { - auto hba = ui->ourAccounts->item(i)->data(Qt::UserRole).toByteArray(); - auto h = Address((byte const*)hba.data(), Address::ConstructFromPointer); - for (auto i: m_myKeys) - if (i.address() == h) - myKeys.push_back(i); - } - m_myKeys = myKeys; -} - void Main::on_inject_triggered() { QString s = QInputDialog::getText(this, "Inject Transaction", "Enter transaction dump in hex"); @@ -1855,7 +1878,7 @@ void Main::on_mine_triggered() { if (ui->mine->isChecked()) { - ethereum()->setAddress(m_myKeys.last().address()); + ethereum()->setAddress(m_beneficiary); ethereum()->startMining(); } else @@ -1928,24 +1951,39 @@ void Main::on_newAccount_triggered() t->join(); delete t; } - m_myKeys.append(p); + + QString s = QInputDialog::getText(this, "Create Account", "Enter this account's name"); + if (QMessageBox::question(this, "Create Account", "Would you like to use additional security for this key? This lets you protect it with a different password to other keys, but also means you must re-enter the key's password every time you wish to use the account.", QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes) + { + std::string password = getPassword("Create Account", "Enter the password you would like to use for this key. Don't forget it!"); + std::string hint = QInputDialog::getText(this, "Create Account", "Enter a hint to help you remember this password.").toStdString(); + m_keyManager.import(p.secret(), s.toStdString(), password, hint); + } + else + m_keyManager.import(p.secret(), s.toStdString()); keysChanged(); } void Main::on_killAccount_triggered() { - if (ui->ourAccounts->currentRow() >= 0 && ui->ourAccounts->currentRow() < m_myKeys.size()) + if (ui->ourAccounts->currentRow() >= 0) { - auto k = m_myKeys[ui->ourAccounts->currentRow()]; + auto hba = ui->accounts->currentItem()->data(Qt::UserRole).toByteArray(); + Address h((byte const*)hba.data(), Address::ConstructFromPointer); + auto k = m_keyManager.accountDetails()[h]; if ( - ethereum()->balanceAt(k.address()) != 0 && - QMessageBox::critical(this, "Kill Account?!", - QString::fromStdString("Account " + render(k.address()) + " has " + formatBalance(ethereum()->balanceAt(k.address())) + " in it. It, and any contract that this account can access, will be lost forever if you continue. Do NOT continue unless you know what you are doing.\n" + ethereum()->balanceAt(h) != 0 && + QMessageBox::critical(this, QString::fromStdString("Kill Account " + k.first + "?!"), + QString::fromStdString("Account " + k.first + " (" + render(h) + ") has " + formatBalance(ethereum()->balanceAt(h)) + " in it. It, and any contract that this account can access, will be lost forever if you continue. Do NOT continue unless you know what you are doing.\n" "Are you sure you want to continue?"), QMessageBox::Yes, QMessageBox::No) == QMessageBox::No) return; - m_myKeys.erase(m_myKeys.begin() + ui->ourAccounts->currentRow()); + m_keyManager.kill(h); + if (m_keyManager.accounts().empty()) + m_keyManager.import(Secret::random(), "Default account"); keysChanged(); + if (m_beneficiary == h) + setBeneficiary(*m_keyManager.accounts().begin()); } } diff --git a/alethzero/MainWin.h b/alethzero/MainWin.h index 6b2ede715..0d5f9808c 100644 --- a/alethzero/MainWin.h +++ b/alethzero/MainWin.h @@ -43,6 +43,8 @@ #include "NatspecHandler.h" #include "Connect.h" +class QListWidgetItem; + namespace Ui { class Main; } @@ -87,12 +89,14 @@ public: std::pair fromString(std::string const& _a) const override; std::string renderDiff(dev::eth::StateDiff const& _d) const override; - QList owned() const { return m_myIdentities + m_myKeys; } + QList owned() const { return m_myIdentities; } dev::u256 gasPrice() const { return 10 * dev::eth::szabo; } dev::eth::KeyManager& keyManager() { return m_keyManager; } + dev::Secret retrieveSecret(dev::Address const& _a) const override; + public slots: void load(QString _file); void note(QString _entry); @@ -147,7 +151,7 @@ private slots: void on_exportState_triggered(); // Stuff concerning the blocks/transactions/accounts panels - void ourAccountsRowsMoved(); + void on_ourAccounts_itemClicked(QListWidgetItem* _i); void on_ourAccounts_doubleClicked(); void on_accounts_doubleClicked(); void on_accounts_currentItemChanged(); @@ -239,6 +243,9 @@ private: void refreshBlockCount(); void refreshBalances(); + void setBeneficiary(dev::Address const& _b); + std::string getPassword(std::string const& _title, std::string const& _for); + std::unique_ptr ui; std::unique_ptr m_webThree; @@ -250,11 +257,11 @@ private: QByteArray m_networkConfig; QStringList m_servers; - QList m_myKeys; QList m_myIdentities; dev::eth::KeyManager m_keyManager; QString m_privateChain; dev::Address m_nameReg; + dev::Address m_beneficiary; QList> m_consoleHistory; QMutex m_logLock; diff --git a/alethzero/OurWebThreeStubServer.cpp b/alethzero/OurWebThreeStubServer.cpp index da645766a..d3ee4f41b 100644 --- a/alethzero/OurWebThreeStubServer.cpp +++ b/alethzero/OurWebThreeStubServer.cpp @@ -134,7 +134,7 @@ void OurAccountHolder::doValidations() queueTransaction(t); else // sign and submit. - if (Secret s = m_main->keyManager().secret(t.from)) + if (Secret s = m_main->retrieveSecret(t.from)) m_web3->ethereum()->submitTransaction(s, t); } } diff --git a/alethzero/Transact.cpp b/alethzero/Transact.cpp index 2041bf39d..5e4493431 100644 --- a/alethzero/Transact.cpp +++ b/alethzero/Transact.cpp @@ -69,9 +69,9 @@ Transact::~Transact() delete ui; } -void Transact::setEnvironment(QList _myKeys, dev::eth::Client* _eth, NatSpecFace* _natSpecDB) +void Transact::setEnvironment(AddressHash const& _accounts, dev::eth::Client* _eth, NatSpecFace* _natSpecDB) { - m_myKeys = _myKeys; + m_accounts = _accounts; m_ethereum = _eth; m_natSpecDB = _natSpecDB; } @@ -126,8 +126,8 @@ void Transact::updateFee() ui->total->setText(QString("Total: %1").arg(formatBalance(totalReq).c_str())); bool ok = false; - for (auto i: m_myKeys) - if (ethereum()->balanceAt(i.address()) >= totalReq) + for (auto const& i: m_accounts) + if (ethereum()->balanceAt(i) >= totalReq) { ok = true; break; @@ -388,17 +388,20 @@ Secret Transact::findSecret(u256 _totalReq) const if (!ethereum()) return Secret(); - Secret best; + Address best; u256 bestBalance = 0; - for (auto const& i: m_myKeys) + for (auto const& i: m_accounts) { - auto b = ethereum()->balanceAt(i.address(), PendingBlock); + auto b = ethereum()->balanceAt(i, PendingBlock); if (b >= _totalReq) - return i.secret(); + { + best = i; + break; + } if (b > bestBalance) - bestBalance = b, best = i.secret(); + bestBalance = b, best = i; } - return best; + return m_context->retrieveSecret(best); } void Transact::on_send_clicked() diff --git a/alethzero/Transact.h b/alethzero/Transact.h index 71bc393b2..d49fea72c 100644 --- a/alethzero/Transact.h +++ b/alethzero/Transact.h @@ -41,7 +41,7 @@ public: explicit Transact(Context* _context, QWidget* _parent = 0); ~Transact(); - void setEnvironment(QList _myKeys, dev::eth::Client* _eth, NatSpecFace* _natSpecDB); + void setEnvironment(dev::AddressHash const& _accounts, dev::eth::Client* _eth, NatSpecFace* _natSpecDB); private slots: void on_destination_currentTextChanged(QString); @@ -76,7 +76,7 @@ private: unsigned m_backupGas = 0; dev::bytes m_data; - QList m_myKeys; + dev::AddressHash m_accounts; dev::eth::Client* m_ethereum = nullptr; Context* m_context = nullptr; NatSpecFace* m_natSpecDB = nullptr; From f64164e88e51b9648b93094657909370aa31b2d6 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Mon, 11 May 2015 17:19:24 +0300 Subject: [PATCH 131/461] Selectable from account in transact dialog. Fixes. --- alethzero/Context.h | 3 +- alethzero/Main.ui | 7 +- alethzero/MainWin.cpp | 2 +- alethzero/MainWin.h | 2 +- alethzero/Transact.cpp | 32 ++++- alethzero/Transact.h | 1 + alethzero/Transact.ui | 261 +++++++++++++++++++++-------------------- 7 files changed, 173 insertions(+), 135 deletions(-) diff --git a/alethzero/Context.h b/alethzero/Context.h index 3ed7cf7b3..4a52366db 100644 --- a/alethzero/Context.h +++ b/alethzero/Context.h @@ -29,7 +29,7 @@ class QComboBox; -namespace dev { namespace eth { struct StateDiff; } } +namespace dev { namespace eth { struct StateDiff; class KeyManager; } } #define Small "font-size: small; " #define Mono "font-family: Ubuntu Mono, Monospace, Lucida Console, Courier New; font-weight: bold; " @@ -65,6 +65,7 @@ public: virtual std::string renderDiff(dev::eth::StateDiff const& _d) const = 0; virtual std::string render(dev::Address const& _a) const = 0; virtual dev::Secret retrieveSecret(dev::Address const& _a) const = 0; + virtual dev::eth::KeyManager& keyManager() = 0; }; diff --git a/alethzero/Main.ui b/alethzero/Main.ui index 736af8684..5b0ad7582 100644 --- a/alethzero/Main.ui +++ b/alethzero/Main.ui @@ -548,12 +548,15 @@ QFrame::NoFrame - - QAbstractItemView::InternalMove + + false true + + true + diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index 8a2fca714..925a04cae 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -1002,7 +1002,7 @@ void Main::refreshBalances() u256 b = ethereum()->balanceAt(i.first); QListWidgetItem* li = new QListWidgetItem(QString("%4 %2: %1 [%3]").arg(formatBalance(b).c_str()).arg(QString::fromStdString(render(i.first))).arg((unsigned)ethereum()->countAt(i.first)).arg(QString::fromStdString(i.second.first)), ui->ourAccounts); li->setData(Qt::UserRole, QByteArray((char const*)i.first.data(), Address::size)); - li->setFlags(Qt::ItemIsUserCheckable); + li->setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled); li->setCheckState(m_beneficiary == i.first ? Qt::Checked : Qt::Unchecked); totalBalance += b; diff --git a/alethzero/MainWin.h b/alethzero/MainWin.h index 0d5f9808c..51d4cc8f4 100644 --- a/alethzero/MainWin.h +++ b/alethzero/MainWin.h @@ -93,7 +93,7 @@ public: dev::u256 gasPrice() const { return 10 * dev::eth::szabo; } - dev::eth::KeyManager& keyManager() { return m_keyManager; } + dev::eth::KeyManager& keyManager() override { return m_keyManager; } dev::Secret retrieveSecret(dev::Address const& _a) const override; diff --git a/alethzero/Transact.cpp b/alethzero/Transact.cpp index 5e4493431..bc37db8ef 100644 --- a/alethzero/Transact.cpp +++ b/alethzero/Transact.cpp @@ -39,6 +39,7 @@ #include #include #include +#include #if ETH_SERPENT #include #include @@ -74,6 +75,15 @@ void Transact::setEnvironment(AddressHash const& _accounts, dev::eth::Client* _e m_accounts = _accounts; m_ethereum = _eth; m_natSpecDB = _natSpecDB; + + ui->from->clear(); + for (auto const& i: m_accounts) + { + auto d = m_context->keyManager().accountDetails()[i]; + u256 b = ethereum()->balanceAt(i, PendingBlock); + QString s = QString("%4 %2: %1").arg(formatBalance(b).c_str()).arg(QString::fromStdString(m_context->render(i))).arg(QString::fromStdString(d.first)); + ui->from->addItem(s); + } } bool Transact::isCreation() const @@ -404,9 +414,17 @@ Secret Transact::findSecret(u256 _totalReq) const return m_context->retrieveSecret(best); } +Address Transact::fromAccount() +{ + auto it = m_accounts.begin(); + std::advance(it, ui->from->currentIndex()); + return *it; +} + void Transact::on_send_clicked() { - Secret s = findSecret(value() + fee()); +// Secret s = findSecret(value() + fee()); + Secret s = m_context->retrieveSecret(fromAccount()); auto b = ethereum()->balanceAt(KeyPair(s).address(), PendingBlock); if (!s || b < value() + fee()) { @@ -443,9 +461,10 @@ void Transact::on_send_clicked() void Transact::on_debug_clicked() { - Secret s = findSecret(value() + fee()); - auto b = ethereum()->balanceAt(KeyPair(s).address(), PendingBlock); - if (!s || b < value() + fee()) +// Secret s = findSecret(value() + fee()); + Address from = fromAccount(); + auto b = ethereum()->balanceAt(from, PendingBlock); + if (!from || b < value() + fee()) { QMessageBox::critical(this, "Transaction Failed", "Couldn't make transaction: no single account contains at least the required amount."); return; @@ -455,8 +474,9 @@ void Transact::on_debug_clicked() { State st(ethereum()->postState()); Transaction t = isCreation() ? - Transaction(value(), gasPrice(), ui->gas->value(), m_data, st.transactionsFrom(dev::toAddress(s)), s) : - Transaction(value(), gasPrice(), ui->gas->value(), m_context->fromString(ui->destination->currentText().toStdString()).first, m_data, st.transactionsFrom(dev::toAddress(s)), s); + Transaction(value(), gasPrice(), ui->gas->value(), m_data, st.transactionsFrom(from)) : + Transaction(value(), gasPrice(), ui->gas->value(), m_context->fromString(ui->destination->currentText().toStdString()).first, m_data, st.transactionsFrom(from)); + t.forceSender(from); Debugger dw(m_context, this); Executive e(st, ethereum()->blockChain(), 0); dw.populate(e, t); diff --git a/alethzero/Transact.h b/alethzero/Transact.h index d49fea72c..cd62c0e20 100644 --- a/alethzero/Transact.h +++ b/alethzero/Transact.h @@ -60,6 +60,7 @@ private: dev::eth::Client* ethereum() const { return m_ethereum; } void rejigData(); + dev::Address fromAccount(); void updateDestination(); void updateFee(); bool isCreation() const; diff --git a/alethzero/Transact.ui b/alethzero/Transact.ui index 75af9ba98..f7a5e7c0e 100644 --- a/alethzero/Transact.ui +++ b/alethzero/Transact.ui @@ -14,91 +14,69 @@ Transact - - - - + + + + + 0 + 0 + - - 430000000 + + D&ata - - 0 + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + data - - + + - &Amount + &Optimise - - value + + true - - - - false + + + + gas - - true + + 1 - - + + 430000000 + + + 10000 - - - - Qt::Vertical + + + + &Cancel + + + Esc - - - QFrame::NoFrame - - - 0 - - - - - Qt::ClickFocus - - - QFrame::NoFrame - - - 0 - - - true - - - - - - - - - - 0 - 0 - - + + - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + &Debug - + @@ -114,53 +92,68 @@ - - - - - + + + + + 0 + 0 + + - &Debug + - - - - &Execute + + + + - - false + + 430000000 + + + 0 + + + - + - &Gas + &Amount - gas + value - - - - gas - - - 1 + + + + &Execute - - 430000000 + + false - - 10000 + + + + + + true + + + (Create Contract) + + - + @ @@ -173,49 +166,63 @@ - - - - &Optimise - - - true + + + + Qt::Vertical + + + QFrame::NoFrame + + + 0 + + + + + Qt::ClickFocus + + + QFrame::NoFrame + + + 0 + + + true + + - - - - 0 - 0 - - + - D&ata - - - Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + &Gas - data + gas - - - + + + + false + + true - - - (Create Contract) - - + + + - - + + + + + 0 @@ -225,18 +232,24 @@ + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + - - + + - &Cancel + &From - - Esc + + from + + + From 4011d4de7123b9cf392537939c66728d7b2915ba Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Mon, 11 May 2015 17:46:28 +0300 Subject: [PATCH 132/461] Don't echo passwords. --- eth/main.cpp | 11 ++++------- libdevcore/CommonIO.cpp | 14 +++++++++++++- libdevcore/CommonIO.h | 2 ++ 3 files changed, 19 insertions(+), 8 deletions(-) diff --git a/eth/main.cpp b/eth/main.cpp index 04ac5bc7e..2514a2a1b 100644 --- a/eth/main.cpp +++ b/eth/main.cpp @@ -1093,8 +1093,7 @@ int main(int argc, char** argv) { while (masterPassword.empty()) { - cout << "Please enter your MASTER password:" << flush; - getline(cin, masterPassword); + masterPassword = getPassword("Please enter your MASTER password: "); if (!keyManager.load(masterPassword)) { cout << "Password invalid. Try again." << endl; @@ -1106,10 +1105,8 @@ int main(int argc, char** argv) { while (masterPassword.empty()) { - cout << "Please enter a MASTER password to protect your key store. Make it strong." << flush; - getline(cin, masterPassword); - string confirm; - cout << "Please confirm the password by entering it again." << flush; + masterPassword = getPassword("Please enter a MASTER password to protect your key store (make it strong!): "); + string confirm = getPassword("Please confirm the password by entering it again: "); getline(cin, confirm); if (masterPassword != confirm) { @@ -1126,7 +1123,7 @@ int main(int argc, char** argv) g_logPost = [&](std::string const& a, char const*) { if (silence) logbuf += a + "\n"; else cout << "\r \r" << a << endl << additional << flush; }; // TODO: give hints &c. - auto getPassword = [&](Address const& a){ auto s = silence; silence = true; string ret; cout << endl << "Enter password for address " << a.abridged() << ": " << flush; std::getline(cin, ret); silence = s; return ret; }; + auto getPassword = [&](Address const& a){ auto s = silence; silence = true; cout << endl; string ret = dev::getPassword("Enter password for address " + a.abridged() + ": "); silence = s; return ret; }; #if ETH_JSONRPC || !ETH_TRUE shared_ptr jsonrpcServer; diff --git a/libdevcore/CommonIO.cpp b/libdevcore/CommonIO.cpp index a1a1056cb..80ad7ecf9 100644 --- a/libdevcore/CommonIO.cpp +++ b/libdevcore/CommonIO.cpp @@ -20,7 +20,8 @@ */ #include "CommonIO.h" - +#include +#include #include #include "Exceptions.h" using namespace std; @@ -117,3 +118,14 @@ void dev::writeFile(std::string const& _file, bytesConstRef _data) ofstream(_file, ios::trunc|ios::binary).write((char const*)_data.data(), _data.size()); } +std::string dev::getPassword(std::string const& _prompt) +{ +#if WIN32 + cout << _prompt << flush; + std::string ret; + std::getline(cin, ret); + return ret; +#else + return getpass(_prompt.c_str()); +#endif +} diff --git a/libdevcore/CommonIO.h b/libdevcore/CommonIO.h index 80334fa31..46a8b80bc 100644 --- a/libdevcore/CommonIO.h +++ b/libdevcore/CommonIO.h @@ -42,6 +42,8 @@ namespace dev { +std::string getPassword(std::string const& _prompt); + /// Retrieve and returns the contents of the given file. If the file doesn't exist or isn't readable, returns an empty bytes. bytes contents(std::string const& _file); std::string contentsString(std::string const& _file); From b3f85187169bb7761c1aaac0ff486b76b3e29f1c Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Mon, 11 May 2015 21:17:23 +0300 Subject: [PATCH 133/461] Structured logger can output to a file. Better support of imports/keys and key manager integration for eth. --- eth/main.cpp | 148 ++++++++++++++++++++++---------- libdevcore/StructuredLogger.cpp | 13 ++- libdevcore/StructuredLogger.h | 14 +-- libethereum/BlockChain.cpp | 39 ++++++--- libethereum/KeyManager.h | 2 + libethereum/State.cpp | 1 + libethereum/State.h | 2 +- 7 files changed, 153 insertions(+), 66 deletions(-) diff --git a/eth/main.cpp b/eth/main.cpp index 2514a2a1b..ba44b15a8 100644 --- a/eth/main.cpp +++ b/eth/main.cpp @@ -91,10 +91,8 @@ void interactiveHelp() << " minestart Starts mining." << endl << " minestop Stops mining." << endl << " mineforce Forces mining, even when there are no transactions." << endl - << " address Gives the current address." << endl - << " secret Gives the current secret" << endl << " block Gives the current block height." << endl - << " balance Gives the current balance." << endl + << " accounts Gives information on all owned accounts (balances, mining beneficiary and default signer)." << endl << " transact Execute a given transaction." << endl << " send Execute a given transaction with current secret." << endl << " contract Create a new contract with current secret." << endl @@ -103,7 +101,7 @@ void interactiveHelp() << " listaccounts List the accounts on the network." << endl << " listcontracts List the contracts on the network." << endl #endif - << " setsecret Set the secret to the hex secret key." << endl + << " setsigningkey Set the address with which to sign transactions." << endl << " setaddress Set the coinbase (mining payout) address." << endl << " exportconfig Export the config (.RLP) to the path provided." << endl << " importconfig Import the config (.RLP) from the path provided." << endl @@ -127,13 +125,18 @@ void help() #endif << " -K,--kill First kill the blockchain." << endl << " -R,--rebuild Rebuild the blockchain from the existing database." << endl - << " -s,--secret Set the secret key for use with send command (default: auto)." << endl - << " -S,--session-secret Set the secret key for use with send command, for this session only." << endl + << " -s,--import-secret Import a secret key into the key store and use as the default." << endl + << " -S,--import-session-secret Import a secret key into the key store and use as the default for this session only." << endl + << " --sign-key
Sign all transactions with the key of the given address." << endl + << " --session-sign-key
Sign all transactions with the key of the given address for this session only." << endl << " --master Give the master password for the key store." << endl + << " --password Give a password for a private key." << endl + << endl << "Client transacting:" << endl << " -B,--block-fees Set the block fee profit in the reference unit e.g. ¢ (default: 15)." << endl << " -e,--ether-price Set the ether price in the reference unit e.g. ¢ (default: 30.679)." << endl << " -P,--priority <0 - 100> Default % priority of a transaction (default: 50)." << endl + << endl << "Client mining:" << endl << " -a,--address Set the coinbase (mining payout) address to addr (default: auto)." << endl << " -m,--mining Enable mining, optionally for a specified number of blocks (default: off)" << endl @@ -143,6 +146,7 @@ void help() << " --opencl-platform When mining using -G/--opencl use OpenCL platform n (default: 0)." << endl << " --opencl-device When mining using -G/--opencl use OpenCL device n (default: 0)." << endl << " -t, --mining-threads Limit number of CPU/GPU miners to n (default: use everything available on selected platform)" << endl + << endl << "Client networking:" << endl << " --client-name Add a name to your client's version string (default: blank)." << endl << " -b,--bootstrap Connect to the default Ethereum peerserver." << endl @@ -155,12 +159,15 @@ void help() << " --network-id Only connect to other hosts with this network id (default:0)." << endl << " --upnp Use UPnP for NAT (default: on)." << endl #if ETH_JSONRPC || !ETH_TRUE + << endl << "Work farming mode:" << endl << " -F,--farm Put into mining farm mode with the work server at URL. Use with -G/--opencl." << endl << " --farm-recheck Leave n ms between checks for changed work (default: 500)." << endl #endif + << endl << "Ethash verify mode:" << endl << " -w,--check-pow Check PoW credentials for validity." << endl + << endl << "Benchmarking mode:" << endl << " -M,--benchmark Benchmark for mining and exit; use with --cpu and --opencl." << endl << " --benchmark-warmup Set the duration of warmup for the benchmark tests (default: 3)." << endl @@ -169,14 +176,17 @@ void help() #if ETH_JSONRPC || !ETH_TRUE << " --phone-home When benchmarking, publish results (default: on)" << endl #endif + << endl << "DAG creation mode:" << endl << " -D,--create-dag Create the DAG in preparation for mining on given block and exit." << endl + << endl << "Import/export modes:" << endl << " -I,--import Import file as a concatenated series of blocks and exit." << endl << " -E,--export Export file as a concatenated series of blocks and exit." << endl << " --from Export only from block n; n may be a decimal, a '0x' prefixed hash, or 'latest'." << endl << " --to Export only to block n (inclusive); n may be a decimal, a '0x' prefixed hash, or 'latest'." << endl << " --only Equivalent to --export-from n --export-to n." << endl + << endl << "General Options:" << endl << " -d,--db-path Load database from path (default: " << getDataDir() << ")" << endl #if ETH_EVMJIT || !ETH_TRUE @@ -539,13 +549,14 @@ int main(int argc, char** argv) /// Mining params unsigned mining = 0; bool forceMining = false; - KeyPair sigKey = KeyPair::create(); - Secret sessionSecret; - Address coinbase = sigKey.address(); + Address signingKey; + Address sessionKey; + Address beneficiary = signingKey; /// Structured logging params bool structuredLogging = false; string structuredLoggingFormat = "%Y-%m-%dT%H:%M:%S"; + string structuredLoggingURL; /// Transaction params TransactionPriority priority = TransactionPriority::Medium; @@ -570,11 +581,20 @@ int main(int argc, char** argv) string configFile = getDataDir() + "/config.rlp"; bytes b = contents(configFile); + + strings passwordsToNote; + Secrets toImport; if (b.size()) { RLP config(b); - sigKey = KeyPair(config[0].toHash()); - coinbase = config[1].toHash
(); + if (config[0].size() == 32) // secret key - import and forget. + { + Secret s = config[0].toHash(); + toImport.push_back(s); + } + else // new format - just use it as an address. + signingKey = config[0].toHash
(); + beneficiary = config[1].toHash
(); } for (int i = 1; i < argc; ++i) @@ -602,6 +622,8 @@ int main(int argc, char** argv) cerr << "-p is DEPRECATED. It will be removed for the Frontier. Use --port instead (or place directly as host:port)." << endl; remotePort = (short)atoi(argv[++i]); } + else if (arg == "--password" && i + 1 < argc) + passwordsToNote.push_back(argv[++i]); else if (arg == "--master" && i + 1 < argc) masterPassword = argv[++i]; else if ((arg == "-I" || arg == "--import") && i + 1 < argc) @@ -744,7 +766,7 @@ int main(int argc, char** argv) } else if ((arg == "-a" || arg == "--address" || arg == "--coinbase-address") && i + 1 < argc) try { - coinbase = h160(fromHex(argv[++i], WhenError::Throw)); + beneficiary = h160(fromHex(argv[++i], WhenError::Throw)); } catch (BadHexCharacter&) { @@ -760,14 +782,32 @@ int main(int argc, char** argv) minerType = MinerType::CPU; else if (arg == "-G" || arg == "--opencl") minerType = MinerType::GPU; - else if ((arg == "-s" || arg == "--secret") && i + 1 < argc) - sigKey = KeyPair(h256(fromHex(argv[++i]))); - else if ((arg == "-S" || arg == "--session-secret") && i + 1 < argc) - sessionSecret = h256(fromHex(argv[++i])); + /*<< " -s,--import-secret Import a secret key into the key store and use as the default." << endl + << " -S,--import-session-secret Import a secret key into the key store and use as the default for this session only." << endl + << " --sign-key
Sign all transactions with the key of the given address." << endl + << " --session-sign-key
Sign all transactions with the key of the given address for this session only." << endl*/ + else if ((arg == "-s" || arg == "--import-secret") && i + 1 < argc) + { + Secret s(fromHex(argv[++i])); + toImport.push_back(s); + signingKey = toAddress(s); + } + else if ((arg == "-S" || arg == "--import-session-secret") && i + 1 < argc) + { + Secret s(fromHex(argv[++i])); + toImport.push_back(s); + sessionKey = toAddress(s); + } + else if ((arg == "--sign-key") && i + 1 < argc) + sessionKey = Address(fromHex(argv[++i])); + else if ((arg == "--session-sign-key") && i + 1 < argc) + sessionKey = Address(fromHex(argv[++i])); else if (arg == "--structured-logging-format" && i + 1 < argc) structuredLoggingFormat = string(argv[++i]); else if (arg == "--structured-logging") structuredLogging = true; + else if (arg == "--structured-logging-destination" && i + 1 < argc) + structuredLoggingURL = argv[++i]; else if ((arg == "-d" || arg == "--path" || arg == "--db-path") && i + 1 < argc) dbPath = argv[++i]; else if ((arg == "-D" || arg == "--create-dag") && i + 1 < argc) @@ -951,16 +991,24 @@ int main(int argc, char** argv) } } + KeyManager keyManager; + for (auto const& s: passwordsToNote) + keyManager.notePassword(s); + for (auto const& s: toImport) + { + keyManager.import(s, "Imported key"); + if (!signingKey) + signingKey = toAddress(s); + } + { RLPStream config(2); - config << sigKey.secret() << coinbase; + config << signingKey << beneficiary; writeFile(configFile, config.out()); } - if (sessionSecret) - sigKey = KeyPair(sessionSecret); - - + if (sessionKey) + signingKey = sessionKey; if (minerType == MinerType::CPU) ProofOfWork::CPUMiner::setNumInstances(miningThreads); @@ -985,7 +1033,7 @@ int main(int argc, char** argv) if (!clientName.empty()) clientName += "/"; - StructuredLogger::get().initialize(structuredLogging, structuredLoggingFormat); + StructuredLogger::get().initialize(structuredLogging, structuredLoggingFormat, structuredLoggingURL); VMFactory::setKind(jit ? VMKind::JIT : VMKind::Interpreter); auto netPrefs = publicIP.empty() ? NetworkPreferences(listenIP ,listenPort, upnp) : NetworkPreferences(publicIP, listenIP ,listenPort, upnp); auto nodesState = contents((dbPath.size() ? dbPath : getDataDir()) + "/network.rlp"); @@ -1074,12 +1122,12 @@ int main(int argc, char** argv) c->setGasPricer(gasPricer); c->setForceMining(forceMining); c->setTurboMining(minerType == MinerType::GPU); - c->setAddress(coinbase); + c->setAddress(beneficiary); c->setNetworkId(networkId); } - cout << "Transaction Signer: " << sigKey.address() << endl; - cout << "Mining Benefactor: " << coinbase << endl; + cout << "Transaction Signer: " << signingKey << endl; + cout << "Mining Benefactor: " << beneficiary << endl; web3.startNetwork(); cout << "Node ID: " << web3.enode() << endl; @@ -1088,9 +1136,7 @@ int main(int argc, char** argv) if (remoteHost.size()) web3.addNode(p2p::NodeId(), remoteHost + ":" + toString(remotePort)); - KeyManager keyManager; if (keyManager.exists()) - { while (masterPassword.empty()) { masterPassword = getPassword("Please enter your MASTER password: "); @@ -1100,14 +1146,12 @@ int main(int argc, char** argv) masterPassword.clear(); } } - } else { while (masterPassword.empty()) { masterPassword = getPassword("Please enter a MASTER password to protect your key store (make it strong!): "); string confirm = getPassword("Please confirm the password by entering it again: "); - getline(cin, confirm); if (masterPassword != confirm) { cout << "Passwords were different. Try again." << endl; @@ -1123,7 +1167,14 @@ int main(int argc, char** argv) g_logPost = [&](std::string const& a, char const*) { if (silence) logbuf += a + "\n"; else cout << "\r \r" << a << endl << additional << flush; }; // TODO: give hints &c. - auto getPassword = [&](Address const& a){ auto s = silence; silence = true; cout << endl; string ret = dev::getPassword("Enter password for address " + a.abridged() + ": "); silence = s; return ret; }; + auto getPassword = [&](Address const& a){ + auto s = silence; + silence = true; + cout << endl; + string ret = dev::getPassword("Enter password for address " + keyManager.accountDetails()[a].first + " (" + a.abridged() + "; hint:" + keyManager.accountDetails()[a].second + "): "); + silence = s; + return ret; + }; #if ETH_JSONRPC || !ETH_TRUE shared_ptr jsonrpcServer; @@ -1131,7 +1182,7 @@ int main(int argc, char** argv) if (jsonrpc > -1) { jsonrpcConnector = unique_ptr(new jsonrpc::HttpServer(jsonrpc, "", "", SensibleHttpThreads)); - jsonrpcServer = shared_ptr(new WebThreeStubServer(*jsonrpcConnector.get(), web3, make_shared([&](){return web3.ethereum();}, getPassword, keyManager), vector({sigKey}))); + jsonrpcServer = shared_ptr(new WebThreeStubServer(*jsonrpcConnector.get(), web3, make_shared([&](){return web3.ethereum();}, getPassword, keyManager), vector())); jsonrpcServer->StartListening(); } #endif @@ -1275,7 +1326,7 @@ int main(int argc, char** argv) if (jsonrpc < 0) jsonrpc = SensibleHttpPort; jsonrpcConnector = unique_ptr(new jsonrpc::HttpServer(jsonrpc, "", "", SensibleHttpThreads)); - jsonrpcServer = shared_ptr(new WebThreeStubServer(*jsonrpcConnector.get(), web3, make_shared([&](){return web3.ethereum();}, getPassword, keyManager), vector({sigKey}))); + jsonrpcServer = shared_ptr(new WebThreeStubServer(*jsonrpcConnector.get(), web3, make_shared([&](){return web3.ethereum();}, getPassword, keyManager), vector())); jsonrpcServer->StartListening(); } else if (cmd == "jsonstop") @@ -1287,11 +1338,8 @@ int main(int argc, char** argv) #endif else if (cmd == "address") { - cout << "Current address:" << endl << sigKey.address() << endl; - } - else if (cmd == "secret") - { - cout << "Secret Key: " << sigKey.secret() << endl; + cout << "Current mining beneficiary:" << endl << beneficiary << endl; + cout << "Current signing account:" << endl << signingKey << endl; } else if (c && cmd == "block") { @@ -1306,7 +1354,15 @@ int main(int argc, char** argv) } else if (c && cmd == "balance") { - cout << "Current balance: " << formatBalance( c->balanceAt(sigKey.address())) << " = " <balanceAt(sigKey.address()) << " wei" << endl; + cout << "Current balance:" << endl; + u256 total = 0; + for (auto const& i: keyManager.accountDetails()) + { + auto b = c->balanceAt(i.first); + cout << ((i.first == signingKey) ? "SIGNING " : " ") << ((i.first == beneficiary) ? "COINBASE " : " ") << i.second.first << " (" << i.first << "): " << formatBalance(b) << " = " << b << " wei" << endl; + total += b; + } + cout << "Total: " << formatBalance(total) << " = " << total << " wei" << endl; } else if (c && cmd == "transact") { @@ -1422,7 +1478,7 @@ int main(int argc, char** argv) try { Address dest = h160(fromHex(hexAddr, WhenError::Throw)); - c->submitTransaction(sigKey.secret(), amount, dest, bytes(), minGas); + c->submitTransaction(keyManager.secret(signingKey, [&](){ return getPassword(signingKey); }), amount, dest, bytes(), minGas); } catch (BadHexCharacter& _e) { @@ -1491,7 +1547,7 @@ int main(int argc, char** argv) else if (gas < minGas) cwarn << "Minimum gas amount is" << minGas; else - c->submitTransaction(sigKey.secret(), endowment, init, gas, gasPrice); + c->submitTransaction(keyManager.secret(signingKey, [&](){ return getPassword(signingKey); }), endowment, init, gas, gasPrice); } else cwarn << "Require parameters: contract ENDOWMENT GASPRICE GAS CODEHEX"; @@ -1602,13 +1658,13 @@ int main(int argc, char** argv) } } } - else if (cmd == "setsecret") + else if (cmd == "setsigningkey") { if (iss.peek() != -1) { string hexSec; iss >> hexSec; - sigKey = KeyPair(h256(fromHex(hexSec))); + signingKey = Address(fromHex(hexSec)); } else cwarn << "Require parameter: setSecret HEXSECRETKEY"; @@ -1625,7 +1681,7 @@ int main(int argc, char** argv) { try { - coinbase = h160(fromHex(hexAddr, WhenError::Throw)); + beneficiary = h160(fromHex(hexAddr, WhenError::Throw)); } catch (BadHexCharacter& _e) { @@ -1648,7 +1704,7 @@ int main(int argc, char** argv) string path; iss >> path; RLPStream config(2); - config << sigKey.secret() << coinbase; + config << signingKey << beneficiary; writeFile(path, config.out()); } else @@ -1664,8 +1720,8 @@ int main(int argc, char** argv) if (b.size()) { RLP config(b); - sigKey = KeyPair(config[0].toHash()); - coinbase = config[1].toHash
(); + signingKey = config[0].toHash
(); + beneficiary = config[1].toHash
(); } else cwarn << path << "has no content!"; diff --git a/libdevcore/StructuredLogger.cpp b/libdevcore/StructuredLogger.cpp index f51ed310a..7d8a17722 100644 --- a/libdevcore/StructuredLogger.cpp +++ b/libdevcore/StructuredLogger.cpp @@ -34,6 +34,15 @@ using namespace std; namespace dev { +void StructuredLogger::initialize(bool _enabled, std::string const& _timeFormat, std::string const& _destinationURL) +{ + m_enabled = _enabled; + m_timeFormat = _timeFormat; + if (_destinationURL.size() > 7 && _destinationURL.substr(0, 7) == "file://") + m_out.open(_destinationURL.substr(7)); + // TODO: support tcp:// +} + void StructuredLogger::outputJson(Json::Value const& _value, std::string const& _name) const { Json::Value event; @@ -41,7 +50,7 @@ void StructuredLogger::outputJson(Json::Value const& _value, std::string const& Json::FastWriter fastWriter; Guard l(s_lock); event[_name] = _value; - cout << fastWriter.write(event) << endl; + (m_out.is_open() ? m_out : cout) << fastWriter.write(event) << endl; } void StructuredLogger::starting(string const& _clientImpl, const char* _ethVersion) @@ -51,6 +60,7 @@ void StructuredLogger::starting(string const& _clientImpl, const char* _ethVersi Json::Value event; event["client_impl"] = _clientImpl; event["eth_version"] = std::string(_ethVersion); + // TODO net_version event["ts"] = dev::toString(chrono::system_clock::now(), get().m_timeFormat.c_str()); get().outputJson(event, "starting"); @@ -64,6 +74,7 @@ void StructuredLogger::stopping(string const& _clientImpl, const char* _ethVersi Json::Value event; event["client_impl"] = _clientImpl; event["eth_version"] = std::string(_ethVersion); + // TODO net_version event["ts"] = dev::toString(chrono::system_clock::now(), get().m_timeFormat.c_str()); get().outputJson(event, "stopping"); diff --git a/libdevcore/StructuredLogger.h b/libdevcore/StructuredLogger.h index 2c30541e4..107598706 100644 --- a/libdevcore/StructuredLogger.h +++ b/libdevcore/StructuredLogger.h @@ -25,6 +25,7 @@ #pragma once +#include #include #include @@ -46,11 +47,7 @@ public: * http://en.cppreference.com/w/cpp/chrono/c/strftime * with which to display timestamps */ - void initialize(bool _enabled, std::string const& _timeFormat) - { - m_enabled = _enabled; - m_timeFormat = _timeFormat; - } + void initialize(bool _enabled, std::string const& _timeFormat, std::string const& _destinationURL); static StructuredLogger& get() { @@ -92,6 +89,11 @@ public: std::string const& _prevHash ); static void transactionReceived(std::string const& _hash, std::string const& _remoteId); + // TODO: static void pendingQueueChanged(std::vector const& _hashes); + // TODO: static void miningStarted(); + // TODO: static void stillMining(unsigned _hashrate); + // TODO: static void miningStopped(); + private: // Singleton class. Private default ctor and no copying StructuredLogger() = default; @@ -102,6 +104,8 @@ private: bool m_enabled = false; std::string m_timeFormat = "%Y-%m-%dT%H:%M:%S"; + + mutable std::ofstream m_out; }; } diff --git a/libethereum/BlockChain.cpp b/libethereum/BlockChain.cpp index 607fc586c..f13f83588 100644 --- a/libethereum/BlockChain.cpp +++ b/libethereum/BlockChain.cpp @@ -456,7 +456,7 @@ ImportRoute BlockChain::import(bytes const& _block, OverlayDB const& _db, Import { // Check transactions are valid and that they result in a state equivalent to our state_root. // Get total difficulty increase and update state, checking it. - State s(_db); //, bi.coinbaseAddress + State s(_db); auto tdIncrease = s.enactOn(&_block, bi, *this, _ir); BlockLogBlooms blb; @@ -467,6 +467,7 @@ ImportRoute BlockChain::import(bytes const& _block, OverlayDB const& _db, Import br.receipts.push_back(s.receipt(i)); } s.cleanup(true); + td = pd.totalDifficulty + tdIncrease; #if ETH_TIMED_IMPORTS @@ -603,7 +604,6 @@ ImportRoute BlockChain::import(bytes const& _block, OverlayDB const& _db, Import { newLastBlockHash = bi.hash(); newLastBlockNumber = (unsigned)bi.number; - extrasBatch.Put(ldb::Slice("best"), ldb::Slice((char const*)&(bi.hash()), 32)); } clog(BlockChainNote) << " Imported and best" << td << " (#" << bi.number << "). Has" << (details(bi.parentHash).children.size() - 1) << "siblings. Route:" << route; @@ -623,12 +623,33 @@ ImportRoute BlockChain::import(bytes const& _block, OverlayDB const& _db, Import m_blocksDB->Write(m_writeOptions, &blocksBatch); m_extrasDB->Write(m_writeOptions, &extrasBatch); - DEV_WRITE_GUARDED(x_lastBlockHash) + if (isKnown(bi.hash()) && !details(bi.hash())) { - m_lastBlockHash = newLastBlockHash; - m_lastBlockNumber = newLastBlockNumber; + clog(BlockChainDebug) << "Known block just inserted has no details."; + clog(BlockChainDebug) << "Block:" << bi; + clog(BlockChainDebug) << "DATABASE CORRUPTION: CRITICAL FAILURE"; + exit(-1); } + try { + State canary(_db, *this, bi.hash()); + } + catch (...) + { + clog(BlockChainDebug) << "Failed to initialise State object form imported block."; + clog(BlockChainDebug) << "Block:" << bi; + clog(BlockChainDebug) << "DATABASE CORRUPTION: CRITICAL FAILURE"; + exit(-1); + } + + if (m_lastBlockHash != newLastBlockHash) + DEV_WRITE_GUARDED(x_lastBlockHash) + { + m_lastBlockHash = newLastBlockHash; + m_lastBlockNumber = newLastBlockNumber; + m_extrasDB->Put(m_writeOptions, ldb::Slice("best"), ldb::Slice((char const*)&m_lastBlockHash, 32)); + } + #if ETH_PARANOIA || !ETH_TRUE checkConsistency(); #endif @@ -646,14 +667,6 @@ ImportRoute BlockChain::import(bytes const& _block, OverlayDB const& _db, Import if (!route.empty()) noteCanonChanged(); - if (isKnown(bi.hash()) && !details(bi.hash())) - { - clog(BlockChainDebug) << "Known block just inserted has no details."; - clog(BlockChainDebug) << "Block:" << bi; - clog(BlockChainDebug) << "DATABASE CORRUPTION: CRITICAL FAILURE"; - exit(-1); - } - h256s fresh; h256s dead; bool isOld = true; diff --git a/libethereum/KeyManager.h b/libethereum/KeyManager.h index 391121b1c..38e8d8853 100644 --- a/libethereum/KeyManager.h +++ b/libethereum/KeyManager.h @@ -66,6 +66,8 @@ public: bool load(std::string const& _pass); void save(std::string const& _pass) const { write(_pass, m_keysFile); } + void notePassword(std::string const& _pass) { m_cachedPasswords[hashPassword(_pass)] = _pass; } + AddressHash accounts() const; std::unordered_map> accountDetails() const; diff --git a/libethereum/State.cpp b/libethereum/State.cpp index 2e4fe5749..50e4b26ab 100644 --- a/libethereum/State.cpp +++ b/libethereum/State.cpp @@ -707,6 +707,7 @@ void State::cleanup(bool _fullCommit) { if (_fullCommit) { + paranoia("immediately before database commit", true); // Commit the new trie to disk. diff --git a/libethereum/State.h b/libethereum/State.h index 74d75685c..a11812c6f 100644 --- a/libethereum/State.h +++ b/libethereum/State.h @@ -49,7 +49,7 @@ class BlockChain; class State; struct StateChat: public LogChannel { static const char* name(); static const int verbosity = 4; }; -struct StateTrace: public LogChannel { static const char* name(); static const int verbosity = 7; }; +struct StateTrace: public LogChannel { static const char* name(); static const int verbosity = 5; }; struct StateDetail: public LogChannel { static const char* name(); static const int verbosity = 14; }; struct StateSafeExceptions: public LogChannel { static const char* name(); static const int verbosity = 21; }; From 488cfae8cbfb90a6868973d078233557dea10a64 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Mon, 11 May 2015 21:32:56 +0300 Subject: [PATCH 134/461] Version bump. --- libdevcore/Common.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libdevcore/Common.cpp b/libdevcore/Common.cpp index 5f15902e2..06950cbee 100644 --- a/libdevcore/Common.cpp +++ b/libdevcore/Common.cpp @@ -28,7 +28,7 @@ using namespace dev; namespace dev { -char const* Version = "0.9.17"; +char const* Version = "0.9.18"; const u256 UndefinedU256 = ~(u256)0; From 34bc96bbdca06b4f24f603802b2dfd1f0a04e199 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Mon, 11 May 2015 21:49:24 +0300 Subject: [PATCH 135/461] Quick fix for web3 keys dir. --- libdevcrypto/SecretStore.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libdevcrypto/SecretStore.cpp b/libdevcrypto/SecretStore.cpp index 858f2a09f..9be0b89e8 100644 --- a/libdevcrypto/SecretStore.cpp +++ b/libdevcrypto/SecretStore.cpp @@ -104,6 +104,7 @@ void SecretStore::save(std::string const& _keysPath) void SecretStore::load(std::string const& _keysPath) { fs::path p(_keysPath); + boost::filesystem::create_directories(p); js::mValue v; for (fs::directory_iterator it(p); it != fs::directory_iterator(); ++it) if (is_regular_file(it->path())) From 0f496a04bc46d29f9ba5504f89e2d4646ff3de6b Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Mon, 11 May 2015 21:56:42 +0300 Subject: [PATCH 136/461] Default srgument to structured logger to fix build. --- libdevcore/StructuredLogger.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libdevcore/StructuredLogger.h b/libdevcore/StructuredLogger.h index 107598706..913d7b9b2 100644 --- a/libdevcore/StructuredLogger.h +++ b/libdevcore/StructuredLogger.h @@ -47,7 +47,7 @@ public: * http://en.cppreference.com/w/cpp/chrono/c/strftime * with which to display timestamps */ - void initialize(bool _enabled, std::string const& _timeFormat, std::string const& _destinationURL); + void initialize(bool _enabled, std::string const& _timeFormat, std::string const& _destinationURL = ""); static StructuredLogger& get() { From 4ef410eee032cda9931988d40168ffa2cb1383e1 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Mon, 11 May 2015 22:37:16 +0300 Subject: [PATCH 137/461] Use Go bootnodes. --- alethzero/MainWin.cpp | 5 +++-- eth/main.cpp | 3 ++- libp2p/Host.cpp | 10 ++++++++++ libp2p/Host.h | 2 ++ 4 files changed, 17 insertions(+), 3 deletions(-) diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index 925a04cae..87c9c2dc9 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -173,7 +173,7 @@ Main::Main(QWidget *parent) : QMessageBox::warning(nullptr, "Try again", "You entered two different passwords - please enter the same password twice.", QMessageBox::Ok); } m_keyManager.create(password.toStdString()); - m_keyManager.import(Secret::random(), "{\"name\":\"Default identity\"}"); + m_keyManager.import(Secret::random(), "Default identity"); } #if ETH_DEBUG @@ -1994,7 +1994,8 @@ void Main::on_go_triggered() ui->net->setChecked(true); on_net_triggered(); } - web3()->addNode(p2p::NodeId(), Host::pocHost()); + for (auto const& i: Host::pocHosts()) + web3()->requirePeer(i.first, i.second); } std::string Main::prettyU256(dev::u256 const& _n) const diff --git a/eth/main.cpp b/eth/main.cpp index ba44b15a8..60d454287 100644 --- a/eth/main.cpp +++ b/eth/main.cpp @@ -1132,7 +1132,8 @@ int main(int argc, char** argv) cout << "Node ID: " << web3.enode() << endl; if (bootstrap) - web3.addNode(p2p::NodeId(), Host::pocHost()); + for (auto const& i: Host::pocHosts()) + web3.requirePeer(i.first, i.second); if (remoteHost.size()) web3.addNode(p2p::NodeId(), remoteHost + ":" + toString(remotePort)); diff --git a/libp2p/Host.cpp b/libp2p/Host.cpp index 4560c1564..9b5a6dca7 100644 --- a/libp2p/Host.cpp +++ b/libp2p/Host.cpp @@ -389,6 +389,16 @@ string Host::pocHost() return "poc-" + strs[1] + ".ethdev.com"; } +std::unordered_map const& Host::pocHosts() +{ + static const std::unordered_map c_ret = { +// { Public(""), "poc-9.ethdev.com:30303" }, + { Public("a979fb575495b8d6db44f750317d0f4622bf4c2aa3365d6af7c284339968eef29b69ad0dce72a4d8db5ebb4968de0e3bec910127f134779fbcb0cb6d3331163c"), "52.16.188.185:30303" }, + { Public("7f25d3eab333a6b98a8b5ed68d962bb22c876ffcd5561fca54e3c2ef27f754df6f7fd7c9b74cc919067abac154fb8e1f8385505954f161ae440abc355855e034"), "54.207.93.166:30303" } + }; + return c_ret; +} + void Host::addNode(NodeId const& _node, NodeIPEndpoint const& _endpoint) { // return if network is stopped while waiting on Host::run() or nodeTable to start diff --git a/libp2p/Host.h b/libp2p/Host.h index b9af0e8b0..4cfca7718 100644 --- a/libp2p/Host.h +++ b/libp2p/Host.h @@ -95,6 +95,8 @@ public: /// Default host for current version of client. static std::string pocHost(); + static std::unordered_map const& pocHosts(); + /// Register a peer-capability; all new peer connections will have this capability. template std::shared_ptr registerCapability(T* _t) { _t->m_host = this; std::shared_ptr ret(_t); m_capabilities[std::make_pair(T::staticName(), T::staticVersion())] = ret; return ret; } From da25ad8b9f6178248a593f843dad2593503f467a Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Mon, 11 May 2015 22:44:01 +0300 Subject: [PATCH 138/461] Fix iteration in evictions. --- libp2p/NodeTable.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libp2p/NodeTable.cpp b/libp2p/NodeTable.cpp index fe2940b30..35cfda64b 100644 --- a/libp2p/NodeTable.cpp +++ b/libp2p/NodeTable.cpp @@ -432,7 +432,7 @@ void NodeTable::onReceived(UDPSocketFace*, bi::udp::endpoint const& _from, bytes bool found = false; EvictionTimeout evictionEntry; DEV_GUARDED(x_evictions) - for (auto it = m_evictions.begin(); it != m_evictions.end();) + for (auto it = m_evictions.begin(); it != m_evictions.end(); ++it) if (it->first.first == nodeid && it->first.second > std::chrono::steady_clock::now()) { found = true; From c47fe49f80924e3fd54de006189ad7a515d37859 Mon Sep 17 00:00:00 2001 From: Vlad Gluhovsky Date: Mon, 11 May 2015 22:54:12 +0200 Subject: [PATCH 139/461] Fixed warning: unused parameter --- test/libp2p/capability.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/libp2p/capability.cpp b/test/libp2p/capability.cpp index e4d0d910c..2c158f4d8 100644 --- a/test/libp2p/capability.cpp +++ b/test/libp2p/capability.cpp @@ -68,10 +68,10 @@ protected: bool TestCapability::interpret(unsigned _id, RLP const& _r) { cnote << "Capability::interpret(): custom message received"; - BOOST_ASSERT(_id == UserPacket); ++m_cntReceivedMessages; m_testSum += _r[0].toInt(); - return true; + BOOST_ASSERT(_id == UserPacket); + return (_id == UserPacket); } class TestHostCapability: public HostCapability, public Worker From b3dd2eaceca518486d4c4a3c6347ad92e4d37cb3 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Mon, 11 May 2015 23:59:44 +0300 Subject: [PATCH 140/461] Disable neth from build until new API is refactored into it. --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1f2877c10..a675e8655 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -377,7 +377,8 @@ if (TOOLS) endif() if (NCURSES) - add_subdirectory(neth) + # Commented out until caktux refactors with the new wallet API. +# add_subdirectory(neth) endif () if (GUI) From cbe32996aca0331a8b5f875b5f8c81be3825be9d Mon Sep 17 00:00:00 2001 From: Marek Kotewicz Date: Mon, 11 May 2015 23:06:30 +0200 Subject: [PATCH 141/461] fix for building osx package --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1f2877c10..7eeab79d2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -396,7 +396,7 @@ if (GUI) endif() -if (APPLE) +if (APPLE AND GUI) add_custom_target(appdmg WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} From 5e22df8f4cfc5bc33da553faca7d1e57d124f7dc Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Tue, 12 May 2015 00:20:10 +0300 Subject: [PATCH 142/461] compatibility options HEADLESS should build solidity by default. --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a675e8655..879ca88bd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -155,7 +155,7 @@ set (ETH_HAVE_WEBENGINE 1) # Backwards compatibility if (HEADLESS) message("*** WARNING: -DHEADLESS=1 option is DEPRECATED! Use -DBUNDLE=minimal or -DGUI=0") - set(BUNDLE "minimal") + set(GUI OFF) endif () # TODO: Abstract into something sensible and move into a function. From 4b49df14ebedeb205cfeaf780b93f424f5c2b198 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Tue, 12 May 2015 01:10:10 +0300 Subject: [PATCH 143/461] Start at a random nonce, not just 0. --- libethash-cl/ethash_cl_miner.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libethash-cl/ethash_cl_miner.cpp b/libethash-cl/ethash_cl_miner.cpp index 42098e09d..ea9fdd3e9 100644 --- a/libethash-cl/ethash_cl_miner.cpp +++ b/libethash-cl/ethash_cl_miner.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -341,7 +342,9 @@ void ethash_cl_miner::search(uint8_t const* header, uint64_t target, search_hook unsigned buf = 0; - for (uint64_t start_nonce = 0; ; start_nonce += c_search_batch_size) + std::random_device engine; + uint64_t start_nonce = std::uniform_int_distribution()(engine); + for (; ; start_nonce += c_search_batch_size) { // supply output buffer to kernel m_search_kernel.setArg(0, m_search_buf[buf]); From 96803503d629dd8a7dc7010f84c5bd52ff7e2cec Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Tue, 12 May 2015 01:28:23 +0300 Subject: [PATCH 144/461] Build fix for neth. --- CMakeLists.txt | 3 +-- libethash-cl/ethash_cl_miner.cpp | 8 -------- neth/main.cpp | 9 +++++---- 3 files changed, 6 insertions(+), 14 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 222c191fa..289cecad8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -377,8 +377,7 @@ if (TOOLS) endif() if (NCURSES) - # Commented out until caktux refactors with the new wallet API. -# add_subdirectory(neth) + add_subdirectory(neth) endif () if (GUI) diff --git a/libethash-cl/ethash_cl_miner.cpp b/libethash-cl/ethash_cl_miner.cpp index ea9fdd3e9..cc35d6215 100644 --- a/libethash-cl/ethash_cl_miner.cpp +++ b/libethash-cl/ethash_cl_miner.cpp @@ -307,21 +307,15 @@ void ethash_cl_miner::search(uint8_t const* header, uint64_t target, search_hook // update header constant buffer m_queue.enqueueWriteBuffer(m_header, false, 0, 32, header); for (unsigned i = 0; i != c_num_buffers; ++i) - { m_queue.enqueueWriteBuffer(m_search_buf[i], false, 0, 4, &c_zero); - } #if CL_VERSION_1_2 && 0 cl::Event pre_return_event; if (!m_opencl_1_1) - { m_queue.enqueueBarrierWithWaitList(NULL, &pre_return_event); - } else #endif - { m_queue.finish(); - } /* __kernel void ethash_combined_search( @@ -389,9 +383,7 @@ void ethash_cl_miner::search(uint8_t const* header, uint64_t target, search_hook // not safe to return until this is ready #if CL_VERSION_1_2 && 0 if (!m_opencl_1_1) - { pre_return_event.wait(); - } #endif } diff --git a/neth/main.cpp b/neth/main.cpp index 066177b2f..7ce64cba5 100644 --- a/neth/main.cpp +++ b/neth/main.cpp @@ -36,8 +36,9 @@ #include #include #include -#if ETH_JSONRPC +#if ETH_JSONRPC || !ETH_TRUE #include +#include #include #endif #include "BuildInfo.h" @@ -573,13 +574,13 @@ int main(int argc, char** argv) if (c && mining) c->startMining(); -#if ETH_JSONRPC +#if ETH_JSONRPC || !ETH_TRUE shared_ptr jsonrpcServer; unique_ptr jsonrpcConnector; if (jsonrpc > -1) { jsonrpcConnector = unique_ptr(new jsonrpc::HttpServer(jsonrpc, "", "", SensibleHttpThreads)); - jsonrpcServer = shared_ptr(new WebThreeStubServer(*jsonrpcConnector.get(), web3, vector({us}))); + jsonrpcServer = shared_ptr(new WebThreeStubServer(*jsonrpcConnector.get(), web3, make_shared([&](){ return web3.ethereum(); }, vector({us})), vector({us}))); jsonrpcServer->setIdentities({us}); jsonrpcServer->StartListening(); } @@ -793,7 +794,7 @@ int main(int argc, char** argv) #else jsonrpcConnector = unique_ptr(new jsonrpc::HttpServer(jsonrpc, "", "", 4)); #endif - jsonrpcServer = shared_ptr(new WebThreeStubServer(*jsonrpcConnector.get(), web3, vector({us}))); + jsonrpcServer = shared_ptr(new WebThreeStubServer(*jsonrpcConnector.get(), web3, make_shared([&](){ return web3.ethereum(); }, vector({us})), vector({us}))); jsonrpcServer->setIdentities({us}); jsonrpcServer->StartListening(); } From fc34ceb83fadaf009c3cc9fb5c8b7d0cf18fea53 Mon Sep 17 00:00:00 2001 From: subtly Date: Tue, 12 May 2015 02:03:36 +0200 Subject: [PATCH 145/461] Guard m_node.endpoint access and updates. --- libp2p/Common.h | 1 + libp2p/NodeTable.cpp | 27 ++++++++++++++++----------- libp2p/NodeTable.h | 6 +++--- test/libp2p/net.cpp | 2 +- 4 files changed, 21 insertions(+), 15 deletions(-) diff --git a/libp2p/Common.h b/libp2p/Common.h index da7558ecb..e70d671b2 100644 --- a/libp2p/Common.h +++ b/libp2p/Common.h @@ -172,6 +172,7 @@ struct NodeIPEndpoint /// Setting true causes isAllowed to return true for all addresses. (Used by test fixtures) static bool test_allowLocal; + NodeIPEndpoint(): address(bi::address()), udpPort(0), tcpPort(0) {} NodeIPEndpoint(bi::address _addr, uint16_t _udp, uint16_t _tcp): address(_addr), udpPort(_udp), tcpPort(_tcp) {} NodeIPEndpoint(RLP const& _r) { interpretRLP(_r); } diff --git a/libp2p/NodeTable.cpp b/libp2p/NodeTable.cpp index e926356b7..bd64d4e5e 100644 --- a/libp2p/NodeTable.cpp +++ b/libp2p/NodeTable.cpp @@ -38,7 +38,7 @@ const char* NodeTableAllDetail::name() { return "=P="; } const char* NodeTableEgress::name() { return ">>P"; } const char* NodeTableIngress::name() { return "< NodeTable::addNode(Node const& _node, NodeRelation _relati { if (_relation == Known) { - shared_ptr ret(new NodeEntry(m_node, _node.id, _node.endpoint)); + shared_ptr ret(new NodeEntry(m_node.id, _node.id, _node.endpoint)); ret->pending = false; DEV_GUARDED(x_nodes) m_nodes[_node.id] = ret; @@ -93,11 +93,10 @@ shared_ptr NodeTable::addNode(Node const& _node, NodeRelation _relati // ping address to recover nodeid if nodeid is empty if (!_node.id) { - clog(NodeTableConnect) << "Sending public key discovery Ping to" << (bi::udp::endpoint)_node.endpoint << "(Advertising:" << (bi::udp::endpoint)m_node.endpoint << ")"; - { - Guard l(x_pubkDiscoverPings); + DEV_GUARDED(x_nodes) + clog(NodeTableConnect) << "Sending public key discovery Ping to" << (bi::udp::endpoint)_node.endpoint << "(Advertising:" << (bi::udp::endpoint)m_node.endpoint << ")"; + DEV_GUARDED(x_pubkDiscoverPings); m_pubkDiscoverPings[_node.endpoint.address] = std::chrono::steady_clock::now(); - } ping(_node.endpoint); return move(shared_ptr()); } @@ -106,7 +105,7 @@ shared_ptr NodeTable::addNode(Node const& _node, NodeRelation _relati if (m_nodes.count(_node.id)) return m_nodes[_node.id]; - shared_ptr ret(new NodeEntry(m_node, _node.id, _node.endpoint)); + shared_ptr ret(new NodeEntry(m_node.id, _node.id, _node.endpoint)); DEV_GUARDED(x_nodes) m_nodes[_node.id] = ret; clog(NodeTableConnect) << "addNode pending for" << _node.endpoint; @@ -290,7 +289,10 @@ vector> NodeTable::nearestNodeEntries(NodeId _target) void NodeTable::ping(NodeIPEndpoint _to) const { - PingNode p(m_node.endpoint, _to); + NodeIPEndpoint src; + DEV_GUARDED(x_nodes) + src = m_node.endpoint; + PingNode p(src, _to); p.sign(m_secret); m_socketPointer->send(p); } @@ -462,9 +464,12 @@ void NodeTable::onReceived(UDPSocketFace*, bi::udp::endpoint const& _from, bytes } // update our endpoint address and UDP port - if ((!m_node.endpoint || !m_node.endpoint.isAllowed()) && isPublicAddress(in.destination.address)) - m_node.endpoint.address = in.destination.address; - m_node.endpoint.udpPort = in.destination.udpPort; + DEV_GUARDED(x_nodes) + { + if ((!m_node.endpoint || !m_node.endpoint.isAllowed()) && isPublicAddress(in.destination.address)) + m_node.endpoint.address = in.destination.address; + m_node.endpoint.udpPort = in.destination.udpPort; + } clog(NodeTableConnect) << "PONG from " << nodeid << _from; break; diff --git a/libp2p/NodeTable.h b/libp2p/NodeTable.h index 92bf17f79..1df3c8800 100644 --- a/libp2p/NodeTable.h +++ b/libp2p/NodeTable.h @@ -40,7 +40,7 @@ namespace p2p */ struct NodeEntry: public Node { - NodeEntry(Node _src, Public _pubk, NodeIPEndpoint _gw); + NodeEntry(NodeId const& _src, Public const& _pubk, NodeIPEndpoint const& _gw); unsigned const distance; ///< Node's distance (xor of _src as integer). bool pending = true; ///< Node will be ignored until Pong is received }; @@ -201,7 +201,7 @@ private: void ping(NodeEntry* _n) const; /// Returns center node entry which describes this node and used with dist() to calculate xor metric for node table nodes. - NodeEntry center() const { return NodeEntry(m_node, m_node.publicKey(), m_node.endpoint); } + NodeEntry center() const { return NodeEntry(m_node.id, m_node.publicKey(), m_node.endpoint); } /// Used by asynchronous operations to return NodeEntry which is active and managed by node table. std::shared_ptr nodeEntry(NodeId _id); @@ -245,7 +245,7 @@ private: std::unique_ptr m_nodeEventHandler; ///< Event handler for node events. - Node m_node; ///< This node. + Node m_node; ///< This node. LOCK x_state if endpoint access or mutation is required. Do not modify id. Secret m_secret; ///< This nodes secret key. mutable Mutex x_nodes; ///< LOCK x_state first if both locks are required. Mutable for thread-safe copy in nodes() const. diff --git a/test/libp2p/net.cpp b/test/libp2p/net.cpp index a95e685c7..1cd43b13f 100644 --- a/test/libp2p/net.cpp +++ b/test/libp2p/net.cpp @@ -99,7 +99,7 @@ struct TestNodeTable: public NodeTable // manually add node for test { Guard ln(x_nodes); - shared_ptr node(new NodeEntry(m_node, n.first.pub(), NodeIPEndpoint(ourIp, n.second, n.second))); + shared_ptr node(new NodeEntry(m_node.id, n.first.pub(), NodeIPEndpoint(ourIp, n.second, n.second))); node->pending = false; m_nodes[node->id] = node; } From 03a82e401c8cfe3c16139e6f5830ac74b5cd7ae0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Tue, 12 May 2015 09:37:39 +0200 Subject: [PATCH 146/461] testeth: support for --singletest option with only test name param. --- test/TestHelper.cpp | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/test/TestHelper.cpp b/test/TestHelper.cpp index e0aad310f..1d7734e35 100644 --- a/test/TestHelper.cpp +++ b/test/TestHelper.cpp @@ -552,6 +552,9 @@ void checkCallCreates(eth::Transactions _resultCallCreates, eth::Transactions _e void userDefinedTest(std::function doTests) { if (!Options::get().singleTest) + return; + + if (Options::get().singleTestFile.empty() || Options::get().singleTestName.empty()) { cnote << "Missing user test specification\nUsage: testeth --singletest \n"; return; @@ -732,11 +735,23 @@ Options::Options() inputLimits = true; bigData = true; } - else if (arg == "--singletest" && i + 2 < argc) + else if (arg == "--singletest" && i + 1 < argc) { singleTest = true; - singleTestFile = argv[i + 1]; - singleTestName = argv[i + 2]; + auto name1 = std::string{argv[i + 1]}; + if (i + 1 < argc) // two params + { + auto name2 = std::string{argv[i + 2]}; + if (name2[0] == '-') // not param, another option + singleTestName = std::move(name1); + else + { + singleTestFile = std::move(name1); + singleTestName = std::move(name2); + } + } + else + singleTestName = std::move(name1); } } } From 129a5d4f050489e559d6c505655eaae8c0eb95e4 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 12 May 2015 09:42:10 +0200 Subject: [PATCH 147/461] add confirmation dialog --- mix/qml/FilesSection.qml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/mix/qml/FilesSection.qml b/mix/qml/FilesSection.qml index 05ba5f897..5e49143a7 100644 --- a/mix/qml/FilesSection.qml +++ b/mix/qml/FilesSection.qml @@ -3,6 +3,7 @@ import QtQuick.Window 2.0 import QtQuick.Layouts 1.0 import QtQuick.Controls 1.0 import QtQuick.Controls.Styles 1.3 +import QtQuick.Dialogs 1.2 import "." @@ -268,8 +269,7 @@ Rectangle MenuItem { text: qsTr("Delete") onTriggered: { - projectModel.removeDocument(documentId); - wrapperItem.removeDocument(documentId); + deleteConfirmation.open(); } } } @@ -279,11 +279,22 @@ Rectangle MenuItem { text: qsTr("Delete") onTriggered: { - projectModel.removeDocument(documentId); - wrapperItem.removeDocument(documentId); + deleteConfirmation.open(); } } } + + MessageDialog + { + id: deleteConfirmation + text: qsTr("Are you sure to delete this file ?") + standardButtons: StandardIcon.Ok | StandardIcon.Cancel + onAccepted: + { + projectModel.removeDocument(documentId); + wrapperItem.removeDocument(documentId); + } + } } } } From 1c91435c2c70011e23e2b7fcccdbce514bc2fb42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Tue, 12 May 2015 09:42:20 +0200 Subject: [PATCH 148/461] Style: remove comma. --- libevm/VMFactory.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libevm/VMFactory.h b/libevm/VMFactory.h index 777bb8cd1..d50b1aa3b 100644 --- a/libevm/VMFactory.h +++ b/libevm/VMFactory.h @@ -27,7 +27,7 @@ enum class VMKind { Interpreter, JIT, - Smart, + Smart }; class VMFactory From 294a73a4e9f85ae3220c644cd520d9933ebf3966 Mon Sep 17 00:00:00 2001 From: Marek Kotewicz Date: Tue, 12 May 2015 09:47:55 +0200 Subject: [PATCH 149/461] fixed RUNTIME_OUTPUT_DIRECTORY on osx --- cmake/EthExecutableHelper.cmake | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/cmake/EthExecutableHelper.cmake b/cmake/EthExecutableHelper.cmake index d971a5f92..3dd7fa798 100644 --- a/cmake/EthExecutableHelper.cmake +++ b/cmake/EthExecutableHelper.cmake @@ -88,20 +88,15 @@ macro(eth_install_executable EXECUTABLE) if (APPLE) # First have qt5 install plugins and frameworks add_custom_command(TARGET ${EXECUTABLE} POST_BUILD - COMMAND ${MACDEPLOYQT_APP} ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${EXECUTABLE}.app -executable=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${EXECUTABLE}.app/Contents/MacOS/${EXECUTABLE} ${eth_qml_dir} - WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} - COMMAND sh ${CMAKE_SOURCE_DIR}/macdeployfix.sh ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${EXECUTABLE}.app/Contents + COMMAND ${MACDEPLOYQT_APP} ${EXECUTABLE}.app -executable=${EXECUTABLE}.app/Contents/MacOS/${EXECUTABLE} ${eth_qml_dir} + WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR} + COMMAND sh ${CMAKE_SOURCE_DIR}/macdeployfix.sh ${EXECUTABLE}.app/Contents ) - get_target_property(TARGET_RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE} RUNTIME_OUTPUT_DIRECTORY) - # This tool and next will inspect linked libraries in order to determine which dependencies are required - if (${CMAKE_CFG_INTDIR} STREQUAL ".") - # TODO: This should only happen for GUI application - set(APP_BUNDLE_PATH "${TARGET_RUNTIME_OUTPUT_DIRECTORY}/${EXECUTABLE}.app") - else () - set(APP_BUNDLE_PATH "${TARGET_RUNTIME_OUTPUT_DIRECTORY}/\$ENV{CONFIGURATION}/${EXECUTABLE}.app") - endif () + # TODO: This should only happen for GUI application + set(APP_BUNDLE_PATH "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INDIR}/${EXECUTABLE}.app") + # This tool and next will inspect linked libraries in order to determine which dependencies are required install(CODE " include(BundleUtilities) set(BU_CHMOD_BUNDLE_ITEMS 1) From 9ea0bf5ab1d8c6146377b9fd3d3642c5d176f698 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 12 May 2015 10:46:04 +0200 Subject: [PATCH 150/461] std::pair instead of QString manipulation --- mix/ClientModel.cpp | 78 +++++++++++++++++---------------- mix/ClientModel.h | 16 ++++--- mix/qml/StateListModel.qml | 9 +++- mix/qml/TransactionDialog.qml | 11 +++-- mix/qml/js/TransactionHelper.js | 3 +- 5 files changed, 67 insertions(+), 50 deletions(-) diff --git a/mix/ClientModel.cpp b/mix/ClientModel.cpp index 5f6a6c26c..bbb9b109b 100644 --- a/mix/ClientModel.cpp +++ b/mix/ClientModel.cpp @@ -193,7 +193,7 @@ QVariantMap ClientModel::contractAddresses() const { QVariantMap res; for (auto const& c: m_contractAddresses) - res.insert(c.first, QString::fromStdString(toJS(c.second))); + res.insert(c.first.first, QString::fromStdString(toJS(c.second))); return res; } @@ -257,6 +257,7 @@ void ClientModel::setupState(QVariantMap _state) QString sender = transaction.value("sender").toString(); bool isStdContract = transaction.value("stdContract").toBool(); bool isContractCreation = transaction.value("isContractCreation").toBool(); + bool isFunctionCall = transaction.value("isFunctionCall").toBool(); if (isStdContract) { if (contractId.isEmpty()) //TODO: This is to support old project files, remove later @@ -272,7 +273,7 @@ void ClientModel::setupState(QVariantMap _state) { if (contractId.isEmpty() && m_codeModel->hasContract()) //TODO: This is to support old project files, remove later contractId = m_codeModel->contracts().keys()[0]; - TransactionSettings transactionSettings(contractId, functionId, value, gas, gasAuto, gasPrice, Secret(sender.toStdString()), isContractCreation); + TransactionSettings transactionSettings(contractId, functionId, value, gas, gasAuto, gasPrice, Secret(sender.toStdString()), isContractCreation, isFunctionCall); transactionSettings.parameterValues = transaction.value("parameters").toMap(); if (contractId == functionId || functionId == "Constructor") @@ -308,9 +309,9 @@ void ClientModel::executeSequence(vector const& _sequence, m_gasCosts.clear(); for (TransactionSettings const& transaction: _sequence) { - QString contractName = resolveContractName(transaction.contractId); - QString address = resolveToken(transaction.contractId, deployedContracts); - if (transaction.functionId == "(transfert)") + std::pair ctrInstance = resolvePair(transaction.contractId); + QString address = resolveToken(ctrInstance, deployedContracts); + if (transaction.isFunctionCall) { callAddress(Address(address.toStdString()), bytes(), transaction); onNewTransaction(); @@ -331,7 +332,7 @@ void ClientModel::executeSequence(vector const& _sequence, else { //encode data - CompiledContract const& compilerRes = m_codeModel->contract(contractName); + CompiledContract const& compilerRes = m_codeModel->contract(ctrInstance.first); QFunctionDefinition const* f = nullptr; bytes contractCode = compilerRes.bytes(); shared_ptr contractDef = compilerRes.sharedContract(); @@ -358,29 +359,28 @@ void ClientModel::executeSequence(vector const& _sequence, QSolidityType const* type = p->type(); QVariant value = transaction.parameterValues.value(p->name()); if (type->type().type == SolidityType::Type::Address) - value = QVariant(resolveToken(value.toString(), deployedContracts)); + { + std::pair ctrParamInstance = resolvePair(value.toString()); + value = QVariant(resolveToken(ctrParamInstance, deployedContracts)); + } encoder.encode(value, type->type()); } - if (transaction.functionId.isEmpty() || transaction.functionId == contractName) + if (transaction.functionId.isEmpty() || transaction.functionId == ctrInstance.first) { bytes param = encoder.encodedData(); contractCode.insert(contractCode.end(), param.begin(), param.end()); Address newAddress = deployContract(contractCode, transaction); deployedContracts.push_back(newAddress); - auto contractAddressIter = m_contractAddresses.find(transaction.contractId); - if (contractAddressIter == m_contractAddresses.end() || newAddress != contractAddressIter->second) - { - QString contractToken = retrieveToken(transaction.contractId, deployedContracts); - m_contractAddresses[contractToken] = newAddress; - m_contractNames[newAddress] = contractToken; - contractAddressesChanged(); - } + std::pair contractToken = retrieveToken(transaction.contractId, deployedContracts); + m_contractAddresses[contractToken] = newAddress; + m_contractNames[newAddress] = contractToken.first; + contractAddressesChanged(); gasCostsChanged(); } else { - auto contractAddressIter = m_contractAddresses.find(retrieveToken(transaction.contractId, deployedContracts)); + auto contractAddressIter = m_contractAddresses.find(ctrInstance); if (contractAddressIter == m_contractAddresses.end()) { emit runFailed("Contract '" + transaction.contractId + tr(" not deployed.") + "' " + tr(" Cannot call ") + transaction.functionId); @@ -412,31 +412,35 @@ void ClientModel::executeSequence(vector const& _sequence, }); } -QString ClientModel::resolveToken(QString const& _value, vector
const& _contracts) + +std::pair ClientModel::resolvePair(QString const& _contractId) { - QString ret = _value; - if (_value.startsWith("<") && _value.endsWith(">")) - { - QStringList nb = ret.remove("<").remove(">").split(" - "); - ret = QString::fromStdString("0x" + dev::toHex(_contracts.at(nb.back().toInt()).ref())); - } - return ret; + std::pair ret; + ret.first = _contractId; + ret.second = -1; + if (_contractId.startsWith("<") && _contractId.endsWith(">")) + { + QStringList values = ret.first.remove("<").remove(">").split(" - "); + ret.first = values[0]; + ret.second = values[1].toUInt(); + } + return ret; } -QString ClientModel::retrieveToken(QString const& _value, vector
const& _contracts) +QString ClientModel::resolveToken(std::pair const& _value, vector
const& _contracts) { - QString ret = _value; - if (!_value.startsWith("<") && !_value.endsWith(">")) - return "<" + _value + " - " + QString::number(_contracts.size() - 1) + ">"; - return ret; + if (_value.second != -1) + return QString::fromStdString("0x" + dev::toHex(_contracts.at(_value.second).ref())); + else + return _value.first; } -QString ClientModel::resolveContractName(QString const& _value) +std::pair ClientModel::retrieveToken(QString const& _value, vector
const& _contracts) { - QString ret = _value; - if (_value.startsWith("<") && _value.endsWith(">")) - ret = ret.remove("<").remove(">").split(" - ").first(); - return ret; + std::pair ret; + ret.first = _value; + ret.second = _contracts.size() - 1; + return ret; } void ClientModel::showDebugger() @@ -462,7 +466,7 @@ void ClientModel::showDebuggerForTransaction(ExecutionResult const& _t) //try to resolve contract for source level debugging auto nameIter = m_contractNames.find(code.address); CompiledContract const* compilerRes = nullptr; - if (nameIter != m_contractNames.end() && (compilerRes = m_codeModel->tryGetContract(resolveContractName(nameIter->second)))) //returned object is guaranteed to live till the end of event handler in main thread + if (nameIter != m_contractNames.end() && (compilerRes = m_codeModel->tryGetContract(nameIter->second))) //returned object is guaranteed to live till the end of event handler in main thread { eth::AssemblyItems assemblyItems = !_t.isConstructor() ? compilerRes->assemblyItems() : compilerRes->constructorAssemblyItems(); codes.back()->setDocument(compilerRes->documentId()); @@ -723,7 +727,7 @@ void ClientModel::onNewTransaction() auto contractAddressIter = m_contractNames.find(contractAddress); if (contractAddressIter != m_contractNames.end()) { - CompiledContract const& compilerRes = m_codeModel->contract(resolveContractName(contractAddressIter->second)); + CompiledContract const& compilerRes = m_codeModel->contract(contractAddressIter->second); const QContractDefinition* def = compilerRes.contract(); contract = def->name(); if (abi) diff --git a/mix/ClientModel.h b/mix/ClientModel.h index a9cf89018..9d4168995 100644 --- a/mix/ClientModel.h +++ b/mix/ClientModel.h @@ -53,10 +53,10 @@ struct SolidityType; struct TransactionSettings { TransactionSettings() {} - TransactionSettings(QString const& _contractId, QString const& _functionId, u256 _value, u256 _gas, bool _gasAuto, u256 _gasPrice, Secret _sender, int _isContractCreation): - contractId(_contractId), functionId(_functionId), value(_value), gas(_gas), gasAuto(_gasAuto), gasPrice(_gasPrice), sender(_sender), isContractCreation(_isContractCreation) {} + TransactionSettings(QString const& _contractId, QString const& _functionId, u256 _value, u256 _gas, bool _gasAuto, u256 _gasPrice, Secret _sender, bool _isContractCreation, bool _isFunctionCall): + contractId(_contractId), functionId(_functionId), value(_value), gas(_gas), gasAuto(_gasAuto), gasPrice(_gasPrice), sender(_sender), isContractCreation(_isContractCreation), isFunctionCall(_isFunctionCall) {} TransactionSettings(QString const& _stdContractName, QString const& _stdContractUrl): - contractId(_stdContractName), gasAuto(true), stdContractUrl(_stdContractUrl), isContractCreation(true) {} + contractId(_stdContractName), gasAuto(true), stdContractUrl(_stdContractUrl), isContractCreation(true), isFunctionCall(false) {} /// Contract name QString contractId; @@ -78,6 +78,8 @@ struct TransactionSettings Secret sender; /// Tr deploys a contract bool isContractCreation; + /// Tr call a ctr function + bool isFunctionCall; }; @@ -229,9 +231,9 @@ private: void onStateReset(); void showDebuggerForTransaction(ExecutionResult const& _t); QVariant formatValue(SolidityType const& _type, dev::u256 const& _value); - QString resolveToken(QString const& _value, std::vector
const& _contracts); - QString resolveContractName(QString const& _value); - QString retrieveToken(QString const& _value, std::vector
const& _contracts); + QString resolveToken(std::pair const& _value, std::vector
const& _contracts); + std::pair retrieveToken(QString const& _value, std::vector
const& _contracts); + std::pair resolvePair(QString const& _contractId); QVariant formatStorageValue(SolidityType const& _type, std::unordered_map const& _storage, unsigned _offset, dev::u256 const& _slot); std::atomic m_running; @@ -241,7 +243,7 @@ private: std::unique_ptr m_rpcConnector; std::unique_ptr m_web3Server; QList m_gasCosts; - std::map m_contractAddresses; + std::map, Address> m_contractAddresses; std::map m_contractNames; std::map m_stdContractAddresses; std::map m_stdContractNames; diff --git a/mix/qml/StateListModel.qml b/mix/qml/StateListModel.qml index b4eed525d..b4d9b6bc6 100644 --- a/mix/qml/StateListModel.qml +++ b/mix/qml/StateListModel.qml @@ -58,9 +58,13 @@ Item { parameters: {}, sender: t.sender, isContractCreation: t.isContractCreation, - label: t.label + label: t.label, + isFunctionCall: t.isFunctionCall }; + if (r.isFunctionCall === undefined) + r.isFunctionCall = true; + if (!r.label) r.label = r.contractId + " - " + r.functionId; @@ -122,7 +126,8 @@ Item { sender: t.sender, parameters: {}, isContractCreation: t.isContractCreation, - label: t.label + label: t.label, + isFunctionCall: t.isFunctionCall }; for (var key in t.parameters) r.parameters[key] = t.parameters[key]; diff --git a/mix/qml/TransactionDialog.qml b/mix/qml/TransactionDialog.qml index d26fbaf5a..7c9b28aa7 100644 --- a/mix/qml/TransactionDialog.qml +++ b/mix/qml/TransactionDialog.qml @@ -87,8 +87,6 @@ Dialog { else loadParameters(); - - visible = true; valueField.focus = true; } @@ -212,12 +210,19 @@ Dialog { } item.isContractCreation = trType.checked; + + if (item.functionId === "(transfert)") + item.isFunctionCall = false; + if (!item.isContractCreation) { item.contractId = recipients.currentText; item.label = item.contractId + " " + item.functionId; if (recipients.current().type === "address") - item.functionId = "(transfert)"; + { + item.functionId = ""; + item.isFunctionCall = false; + } } else { diff --git a/mix/qml/js/TransactionHelper.js b/mix/qml/js/TransactionHelper.js index 33072fdba..b9a011b66 100644 --- a/mix/qml/js/TransactionHelper.js +++ b/mix/qml/js/TransactionHelper.js @@ -11,7 +11,8 @@ function defaultTransaction() parameters: {}, stdContract: false, isContractCreation: true, - label: "" + label: "", + isFunctionCall: true }; } From d969e109bb92f1f4829f2d7a39c80137ef1c30e7 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Tue, 12 May 2015 12:21:26 +0300 Subject: [PATCH 151/461] Fix braces. --- libethcore/EthashAux.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libethcore/EthashAux.h b/libethcore/EthashAux.h index c90ee048e..8788acc83 100644 --- a/libethcore/EthashAux.h +++ b/libethcore/EthashAux.h @@ -24,7 +24,8 @@ namespace dev { -namespace eth{ +namespace eth +{ class EthashAux { From e8f7c26479d4f5d633012a82a53afd3cfa772f7b Mon Sep 17 00:00:00 2001 From: chriseth Date: Tue, 12 May 2015 11:25:34 +0200 Subject: [PATCH 152/461] Fixed template problem. --- libevmasm/KnownState.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libevmasm/KnownState.cpp b/libevmasm/KnownState.cpp index d6fbde2d9..5a70a74fb 100644 --- a/libevmasm/KnownState.cpp +++ b/libevmasm/KnownState.cpp @@ -162,7 +162,7 @@ KnownState::StoreOperation KnownState::feedItem(AssemblyItem const& _item, bool /// Helper function for KnownState::reduceToCommonKnowledge, removes everything from /// _this which is not in or not equal to the value in _other. -template void intersect( +template void intersect( _Mapping& _this, _Mapping const& _other, function<_KeyType(_KeyType)> const& _keyTrans = [](_KeyType _k) { return _k; } @@ -175,6 +175,11 @@ template void intersect it = _this.erase(it); } +template void intersect(_Mapping& _this, _Mapping const& _other) +{ + intersect<_Mapping, ExpressionClasses::Id>(_this, _other, [](ExpressionClasses::Id _k) { return _k; }); +} + void KnownState::reduceToCommonKnowledge(KnownState const& _other) { int stackDiff = m_stackHeight - _other.m_stackHeight; From 40de803f66f35ecd5a4636effd04b5d1662a3f3d Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 12 May 2015 11:39:31 +0200 Subject: [PATCH 153/461] bug fix --- mix/ClientModel.cpp | 2 +- mix/ClientModel.h | 2 +- mix/qml/TransactionDialog.qml | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/mix/ClientModel.cpp b/mix/ClientModel.cpp index dc9346d3e..fc8ce4c33 100644 --- a/mix/ClientModel.cpp +++ b/mix/ClientModel.cpp @@ -312,7 +312,7 @@ void ClientModel::executeSequence(vector const& _sequence, { std::pair ctrInstance = resolvePair(transaction.contractId); QString address = resolveToken(ctrInstance, deployedContracts); - if (transaction.isFunctionCall) + if (!transaction.isFunctionCall) { callAddress(Address(address.toStdString()), bytes(), transaction); onNewTransaction(); diff --git a/mix/ClientModel.h b/mix/ClientModel.h index 2ca3d2c69..e1648b78d 100644 --- a/mix/ClientModel.h +++ b/mix/ClientModel.h @@ -56,7 +56,7 @@ struct TransactionSettings TransactionSettings(QString const& _contractId, QString const& _functionId, u256 _value, u256 _gas, bool _gasAuto, u256 _gasPrice, Secret _sender, bool _isContractCreation, bool _isFunctionCall): contractId(_contractId), functionId(_functionId), value(_value), gas(_gas), gasAuto(_gasAuto), gasPrice(_gasPrice), sender(_sender), isContractCreation(_isContractCreation), isFunctionCall(_isFunctionCall) {} TransactionSettings(QString const& _stdContractName, QString const& _stdContractUrl): - contractId(_stdContractName), gasAuto(true), stdContractUrl(_stdContractUrl), isContractCreation(true), isFunctionCall(false) {} + contractId(_stdContractName), gasAuto(true), stdContractUrl(_stdContractUrl), isContractCreation(true), isFunctionCall(true) {} /// Contract name QString contractId; diff --git a/mix/qml/TransactionDialog.qml b/mix/qml/TransactionDialog.qml index 7c9b28aa7..d9c811704 100644 --- a/mix/qml/TransactionDialog.qml +++ b/mix/qml/TransactionDialog.qml @@ -210,9 +210,7 @@ Dialog { } item.isContractCreation = trType.checked; - - if (item.functionId === "(transfert)") - item.isFunctionCall = false; + item.isFunctionCall = item.functionId !== "(transfert)"; if (!item.isContractCreation) { From 2eed2ca5e0910a2d1412fb9e938b9c8778db025b Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Tue, 12 May 2015 12:55:40 +0300 Subject: [PATCH 154/461] Refactored much EthashAux., especially the DAG generation callback stuff. Made m_epochs active again. --- libethcore/EthashAux.cpp | 49 ++++++++++++++++++++++++++++++---------- libethcore/EthashAux.h | 11 +++++---- 2 files changed, 44 insertions(+), 16 deletions(-) diff --git a/libethcore/EthashAux.cpp b/libethcore/EthashAux.cpp index 210f70c78..7bcb976d6 100644 --- a/libethcore/EthashAux.cpp +++ b/libethcore/EthashAux.cpp @@ -41,6 +41,8 @@ using namespace chrono; using namespace dev; using namespace eth; +const char* DAGChannel::name() { return EthGreen "DAG"; } + EthashAux* dev::eth::EthashAux::s_this = nullptr; EthashAux::~EthashAux() @@ -76,9 +78,30 @@ h256 EthashAux::seedHash(unsigned _number) return get()->m_seedHashes[epoch]; } +uint64_t EthashAux::number(h256 const& _seedHash) +{ + Guard l(get()->x_epochs); + unsigned epoch = 0; + auto epochIter = get()->m_epochs.find(_seedHash); + if (epochIter == get()->m_epochs.end()) + { + // cdebug << "Searching for seedHash " << _seedHash; + for (h256 h; h != _seedHash && epoch < 2048; ++epoch, h = sha3(h), get()->m_epochs[h] = epoch) {} + if (epoch == 2048) + { + std::ostringstream error; + error << "apparent block number for " << _seedHash << " is too high; max is " << (ETHASH_EPOCH_LENGTH * 2048); + throw std::invalid_argument(error.str()); + } + } + else + epoch = epochIter->second; + return epoch * ETHASH_EPOCH_LENGTH; +} + void EthashAux::killCache(h256 const& _s) { - RecursiveGuard l(x_this); + RecursiveGuard l(x_lights); m_lights.erase(_s); } @@ -89,7 +112,7 @@ EthashAux::LightType EthashAux::light(BlockInfo const& _header) EthashAux::LightType EthashAux::light(uint64_t _blockNumber) { - RecursiveGuard l(get()->x_this); + RecursiveGuard l(get()->x_lights); h256 seedHash = EthashAux::seedHash(_blockNumber); LightType ret = get()->m_lights[seedHash]; return ret ? ret : (get()->m_lights[seedHash] = make_shared(_blockNumber)); @@ -126,30 +149,32 @@ bytesConstRef EthashAux::FullAllocation::data() const return bytesConstRef((byte const*)ethash_full_dag(full), size()); } -EthashAux::FullType EthashAux::full(BlockInfo const& _header) +EthashAux::FullType EthashAux::full(BlockInfo const& _header, function const& _f) { - return full((uint64_t) _header.number); + return full((uint64_t)_header.number, _f); } -struct DAGChannel: public LogChannel { static const char* name(); static const int verbosity = 0; }; -const char* DAGChannel::name() { return EthGreen "DAG"; } -static int ethash_callback(unsigned int _progress) +static std::function s_dagCallback; +static int dagCallbackShim(unsigned _p) { - clog(DAGChannel) << "Generating DAG file. Progress: " << toString(_progress) << "%"; - return 0; + clog(DAGChannel) << "Generating DAG file. Progress: " << toString(_p) << "%"; + return s_dagCallback ? s_dagCallback(_p) : 0; } -EthashAux::FullType EthashAux::full(uint64_t _blockNumber) +EthashAux::FullType EthashAux::full(uint64_t _blockNumber, function const& _f) { - RecursiveGuard l(get()->x_this); + auto l = light(_blockNumber); h256 seedHash = EthashAux::seedHash(_blockNumber); FullType ret; + + Guard lock(get()->x_fulls); if ((ret = get()->m_fulls[seedHash].lock())) { get()->m_lastUsedFull = ret; return ret; } - ret = get()->m_lastUsedFull = make_shared(light(_blockNumber)->light, ethash_callback); + s_dagCallback = _f; + ret = get()->m_lastUsedFull = make_shared(l->light, dagCallbackShim); get()->m_fulls[seedHash] = ret; return ret; } diff --git a/libethcore/EthashAux.h b/libethcore/EthashAux.h index bc9361db7..dbfe54d43 100644 --- a/libethcore/EthashAux.h +++ b/libethcore/EthashAux.h @@ -27,6 +27,7 @@ namespace dev namespace eth { +struct DAGChannel: public LogChannel { static const char* name(); static const int verbosity = 1; }; class EthashAux { @@ -59,27 +60,29 @@ public: using FullType = std::shared_ptr; static h256 seedHash(unsigned _number); + static uint64_t number(h256 const& _seedHash); static uint64_t cacheSize(BlockInfo const& _header); static LightType light(BlockInfo const& _header); static LightType light(uint64_t _blockNumber); - static FullType full(BlockInfo const& _header); - static FullType full(uint64_t _blockNumber); + static FullType full(BlockInfo const& _header, std::function const& _f = std::function()); + static FullType full(uint64_t _blockNumber, std::function const& _f = std::function()); static Ethash::Result eval(BlockInfo const& _header) { return eval(_header, _header.nonce); } static Ethash::Result eval(BlockInfo const& _header, Nonce const& _nonce); static Ethash::Result eval(uint64_t _blockNumber, h256 const& _headerHash, Nonce const& _nonce); - private: EthashAux() {} void killCache(h256 const& _s); static EthashAux* s_this; - RecursiveMutex x_this; + RecursiveMutex x_lights; std::unordered_map> m_lights; + + Mutex x_fulls; std::unordered_map> m_fulls; FullType m_lastUsedFull; From a202d2a633cf70d0dd8c5f9ae0ea0fed62893cee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Tue, 12 May 2015 12:13:42 +0200 Subject: [PATCH 155/461] Update SmartVM to new VM interface (without gas counter) --- libevm/SmartVM.cpp | 10 ++++------ libevm/SmartVM.h | 4 +--- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/libevm/SmartVM.cpp b/libevm/SmartVM.cpp index 4f759a745..7343bd7a2 100644 --- a/libevm/SmartVM.cpp +++ b/libevm/SmartVM.cpp @@ -41,7 +41,7 @@ namespace } } -bytesConstRef SmartVM::go(ExtVMFace& _ext, OnOpFunc const& _onOp, uint64_t _steps) +bytesConstRef SmartVM::go(u256& io_gas, ExtVMFace& _ext, OnOpFunc const& _onOp, uint64_t _steps) { auto codeHash = sha3(_ext.code); auto vmKind = VMKind::Interpreter; // default VM @@ -66,11 +66,9 @@ bytesConstRef SmartVM::go(ExtVMFace& _ext, OnOpFunc const& _onOp, uint64_t _step } // TODO: Selected VM must be kept only because it returns reference to its internal memory. - // VM implementations should be stateless, without gas counter and escaping memory reference. - m_selectedVM = VMFactory::create(vmKind, gas()); - auto out = m_selectedVM->go(_ext, _onOp, _steps); - m_gas = m_selectedVM->gas(); - return out; + // VM implementations should be stateless, without escaping memory reference. + m_selectedVM = VMFactory::create(vmKind); + return m_selectedVM->go(io_gas, _ext, _onOp, _steps); } } diff --git a/libevm/SmartVM.h b/libevm/SmartVM.h index 29f464ecd..cc198c0c2 100644 --- a/libevm/SmartVM.h +++ b/libevm/SmartVM.h @@ -31,9 +31,7 @@ namespace eth class SmartVM: public VMFace { public: - SmartVM(u256 _gas): VMFace(_gas) {} - - virtual bytesConstRef go(ExtVMFace& _ext, OnOpFunc const& _onOp = {}, uint64_t _steps = (uint64_t)-1) override final; + virtual bytesConstRef go(u256& io_gas, ExtVMFace& _ext, OnOpFunc const& _onOp = {}, uint64_t _steps = (uint64_t)-1) override final; private: std::unique_ptr m_selectedVM; From 3a81c1059846a93e1d46d843b319260c6b19b95e Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 12 May 2015 12:14:26 +0200 Subject: [PATCH 156/461] use - instead of "(transfer)" --- mix/qml/TransactionDialog.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mix/qml/TransactionDialog.qml b/mix/qml/TransactionDialog.qml index d9c811704..fe4bfc82e 100644 --- a/mix/qml/TransactionDialog.qml +++ b/mix/qml/TransactionDialog.qml @@ -107,6 +107,7 @@ Dialog { function loadFunctions(contractId) { functionsModel.clear(); + functionsModel.append({ text: " - " }); var contract = codeModel.contracts[contractId]; if (contract) { var functions = codeModel.contracts[contractId].contract.functions; @@ -114,7 +115,6 @@ Dialog { functionsModel.append({ text: functions[f].name }); } } - functionsModel.append({ text: "(transfert)" }); } function selectContract(contractName) @@ -210,7 +210,7 @@ Dialog { } item.isContractCreation = trType.checked; - item.isFunctionCall = item.functionId !== "(transfert)"; + item.isFunctionCall = item.functionId !== " - "; if (!item.isContractCreation) { From 6b74a4e96f03c0a6195a0954151a3a2c2a5bdda6 Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Tue, 12 May 2015 12:42:29 +0200 Subject: [PATCH 157/461] Recover lost code after ethash merge - Recover installing ethash if ethash-cl is not built --- libethash/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libethash/CMakeLists.txt b/libethash/CMakeLists.txt index a65621c3e..907eccd40 100644 --- a/libethash/CMakeLists.txt +++ b/libethash/CMakeLists.txt @@ -42,3 +42,7 @@ add_library(${LIBRARY} ${FILES}) if (CRYPTOPP_FOUND) TARGET_LINK_LIBRARIES(${LIBRARY} ${CRYPTOPP_LIBRARIES}) endif() + +if (NOT ETHASHCL) + install( TARGETS ${LIBRARY} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) +endif () \ No newline at end of file From 855d2f677c568b42aa38c0f230b57417b0d97885 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Tue, 12 May 2015 14:29:06 +0200 Subject: [PATCH 158/461] VM cleanups --- evmjit/libevmjit-cpp/JitVM.h | 3 +-- libevm/VM.h | 6 ++---- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/evmjit/libevmjit-cpp/JitVM.h b/evmjit/libevmjit-cpp/JitVM.h index 797fe7e1c..e6864f885 100644 --- a/evmjit/libevmjit-cpp/JitVM.h +++ b/evmjit/libevmjit-cpp/JitVM.h @@ -10,11 +10,10 @@ namespace eth class JitVM: public VMFace { +public: virtual bytesConstRef go(u256& io_gas, ExtVMFace& _ext, OnOpFunc const& _onOp = {}, uint64_t _steps = (uint64_t)-1) override final; private: - friend class VMFactory; - jit::RuntimeData m_data; jit::ExecutionEngine m_engine; std::unique_ptr m_fallbackVM; ///< VM used in case of input data rejected by JIT diff --git a/libevm/VM.h b/libevm/VM.h index 755d820fa..8a641b1b8 100644 --- a/libevm/VM.h +++ b/libevm/VM.h @@ -54,16 +54,14 @@ class VM: public VMFace public: virtual bytesConstRef go(u256& io_gas, ExtVMFace& _ext, OnOpFunc const& _onOp = {}, uint64_t _steps = (uint64_t)-1) override final; - void require(u256 _n, u256 _d) { if (m_stack.size() < _n) { if (m_onFail) m_onFail(); BOOST_THROW_EXCEPTION(StackUnderflow() << RequirementError((bigint)_n, (bigint)m_stack.size())); } if (m_stack.size() - _n + _d > c_stackLimit) { if (m_onFail) m_onFail(); BOOST_THROW_EXCEPTION(OutOfStack() << RequirementError((bigint)(_d - _n), (bigint)m_stack.size())); } } - void requireMem(unsigned _n) { if (m_temp.size() < _n) { m_temp.resize(_n); } } - u256 curPC() const { return m_curPC; } bytes const& memory() const { return m_temp; } u256s const& stack() const { return m_stack; } private: - friend class VMFactory; + void require(u256 _n, u256 _d) { if (m_stack.size() < _n) { if (m_onFail) m_onFail(); BOOST_THROW_EXCEPTION(StackUnderflow() << RequirementError((bigint)_n, (bigint)m_stack.size())); } if (m_stack.size() - _n + _d > c_stackLimit) { if (m_onFail) m_onFail(); BOOST_THROW_EXCEPTION(OutOfStack() << RequirementError((bigint)(_d - _n), (bigint)m_stack.size())); } } + void requireMem(unsigned _n) { if (m_temp.size() < _n) { m_temp.resize(_n); } } u256 m_curPC = 0; bytes m_temp; From da1fcbb19b4e07e9d40f1d29de0b190100f7e9d1 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Tue, 12 May 2015 16:46:42 +0300 Subject: [PATCH 159/461] DAG generation improvements. Generate next DAG in AZ! Cleanups to Ethash & Aux. DAG Progress in AZ. --- alethzero/Main.ui | 6 +++ alethzero/MainWin.cpp | 39 +++++++++----- alethzero/MainWin.h | 1 + alethzero/Transact.cpp | 5 +- eth/main.cpp | 107 ++++++++++++++++++++++----------------- libdevcore/Common.h | 8 +-- libdevcore/Worker.cpp | 10 ++-- libethcore/Ethash.cpp | 6 ++- libethcore/Ethash.h | 2 +- libethcore/EthashAux.cpp | 46 ++++++++++++----- libethcore/EthashAux.h | 14 ++++- libethereum/ClientBase.h | 4 +- libethereum/State.cpp | 4 +- 13 files changed, 161 insertions(+), 91 deletions(-) diff --git a/alethzero/Main.ui b/alethzero/Main.ui index 5b0ad7582..e0852142a 100644 --- a/alethzero/Main.ui +++ b/alethzero/Main.ui @@ -151,6 +151,7 @@ + @@ -1727,6 +1728,11 @@ font-size: 14pt In&ject Block + + + Prepare Next &DAG + + diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index 87c9c2dc9..7551eaa35 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -204,7 +204,7 @@ Main::Main(QWidget *parent) : QSettings s("ethereum", "alethzero"); m_networkConfig = s.value("peers").toByteArray(); bytesConstRef network((byte*)m_networkConfig.data(), m_networkConfig.size()); - m_webThree.reset(new WebThreeDirect(string("AlethZero/v") + dev::Version + "/" DEV_QUOTED(ETH_BUILD_TYPE) "/" DEV_QUOTED(ETH_BUILD_PLATFORM), getDataDir(), WithExisting::Trust, {"eth", "shh"}, p2p::NetworkPreferences(), network)); + m_webThree.reset(new WebThreeDirect(string("AlethZero/v") + dev::Version + "/" DEV_QUOTED(ETH_BUILD_TYPE) "/" DEV_QUOTED(ETH_BUILD_PLATFORM), getDataDir(), WithExisting::Trust, {"eth"/*, "shh"*/}, p2p::NetworkPreferences(), network)); m_httpConnector.reset(new jsonrpc::HttpServer(SensibleHttpPort, "", "", dev::SensibleHttpThreads)); m_server.reset(new OurWebThreeStubServer(*m_httpConnector, *web3(), this)); @@ -943,22 +943,30 @@ void Main::on_preview_triggered() refreshAll(); } +void Main::on_prepNextDAG_triggered() +{ + EthashAux::computeFull(ethereum()->blockChain().number() + ETHASH_EPOCH_LENGTH); +} + void Main::refreshMining() { + pair gp = EthashAux::fullGeneratingProgress(); + QString t; + if (gp.first != EthashAux::NotGenerating) + t = QString("DAG for #%1-#%2: %3% complete; ").arg(gp.first).arg(gp.first + ETHASH_EPOCH_LENGTH - 1).arg(gp.second); MiningProgress p = ethereum()->miningProgress(); - ui->mineStatus->setText(ethereum()->isMining() ? QString("%1s @ %2kH/s").arg(p.ms / 1000).arg(p.ms ? p.hashes / p.ms : 0) : "Not mining"); - if (!ui->miningView->isVisible()) - return; - list l = ethereum()->miningHistory(); - static unsigned lh = 0; - if (p.hashes < lh) - ui->miningView->resetStats(); - lh = p.hashes; - ui->miningView->appendStats(l, p); -/* if (p.ms) - for (MineInfo const& i: l) - cnote << i.hashes * 10 << "h/sec, need:" << i.requirement << " best:" << i.best << " best-so-far:" << p.best << " avg-speed:" << (p.hashes * 1000 / p.ms) << "h/sec"; -*/ + ui->mineStatus->setText(t + (ethereum()->isMining() ? p.hashes > 0 ? QString("%1s @ %2kH/s").arg(p.ms / 1000).arg(p.ms ? p.hashes / p.ms : 0) : "Awaiting DAG" : "Not mining")); + if (ethereum()->isMining() && p.hashes > 0) + { + if (!ui->miningView->isVisible()) + return; + list l = ethereum()->miningHistory(); + static unsigned lh = 0; + if (p.hashes < lh) + ui->miningView->resetStats(); + lh = p.hashes; + ui->miningView->appendStats(l, p); + } } void Main::setBeneficiary(Address const& _b) @@ -1878,6 +1886,7 @@ void Main::on_mine_triggered() { if (ui->mine->isChecked()) { +// EthashAux::computeFull(ethereum()->blockChain().number()); ethereum()->setAddress(m_beneficiary); ethereum()->startMining(); } @@ -2027,6 +2036,7 @@ std::string Main::prettyU256(dev::u256 const& _n) const void Main::on_post_clicked() { + return; shh::Message m; m.setTo(stringToPublic(ui->shhTo->currentText())); m.setPayload(parseData(ui->shhData->toPlainText().toStdString())); @@ -2051,6 +2061,7 @@ int Main::authenticate(QString _title, QString _text) void Main::refreshWhispers() { + return; ui->whispers->clear(); for (auto const& w: whisper()->all()) { diff --git a/alethzero/MainWin.h b/alethzero/MainWin.h index 51d4cc8f4..d9075d178 100644 --- a/alethzero/MainWin.h +++ b/alethzero/MainWin.h @@ -124,6 +124,7 @@ private slots: // Mining void on_mine_triggered(); + void on_prepNextDAG_triggered(); // View void on_refresh_triggered(); diff --git a/alethzero/Transact.cpp b/alethzero/Transact.cpp index bc37db8ef..f2a8ef0d5 100644 --- a/alethzero/Transact.cpp +++ b/alethzero/Transact.cpp @@ -299,8 +299,9 @@ void Transact::rejigData() return; // Determine how much balance we have to play with... - auto s = findSecret(value() + ethereum()->gasLimitRemaining() * gasPrice()); - auto b = ethereum()->balanceAt(KeyPair(s).address(), PendingBlock); + //findSecret(value() + ethereum()->gasLimitRemaining() * gasPrice()); + auto s = fromAccount(); + auto b = ethereum()->balanceAt(s, PendingBlock); m_allGood = true; QString htmlInfo; diff --git a/eth/main.cpp b/eth/main.cpp index d6582e4d3..abb78c20d 100644 --- a/eth/main.cpp +++ b/eth/main.cpp @@ -158,6 +158,11 @@ void help() << " --port Connect to remote port (default: 30303)." << endl << " --network-id Only connect to other hosts with this network id (default:0)." << endl << " --upnp Use UPnP for NAT (default: on)." << endl + << endl + << "Client structured logging:" << endl + << " --structured-logging Enable structured logging (default output to stdout)." << endl + << " --structured-logging-format Set the structured logging time format." << endl + << " --structured-logging-url Set the structured logging destination (currently only file:// supported)." << endl #if ETH_JSONRPC || !ETH_TRUE << endl << "Work farming mode:" << endl @@ -806,8 +811,11 @@ int main(int argc, char** argv) structuredLoggingFormat = string(argv[++i]); else if (arg == "--structured-logging") structuredLogging = true; - else if (arg == "--structured-logging-destination" && i + 1 < argc) + else if (arg == "--structured-logging-url" && i + 1 < argc) + { + structuredLogging = true; structuredLoggingURL = argv[++i]; + } else if ((arg == "-d" || arg == "--path" || arg == "--db-path") && i + 1 < argc) dbPath = argv[++i]; else if ((arg == "-D" || arg == "--create-dag") && i + 1 < argc) @@ -1033,6 +1041,28 @@ int main(int argc, char** argv) if (!clientName.empty()) clientName += "/"; + string logbuf; + bool silence = false; + std::string additional; + g_logPost = [&](std::string const& a, char const*){ + if (silence) + logbuf += a + "\n"; + else + cout << "\r \r" << a << endl << additional << flush; + }; + + auto getPassword = [&](string const& prompt){ + auto s = silence; + silence = true; + cout << endl; + string ret = dev::getPassword(prompt); + silence = s; + return ret; + }; + auto getAccountPassword = [&](Address const& a){ + return getPassword("Enter password for address " + keyManager.accountDetails()[a].first + " (" + a.abridged() + "; hint:" + keyManager.accountDetails()[a].second + "): "); + }; + StructuredLogger::get().initialize(structuredLogging, structuredLoggingFormat, structuredLoggingURL); VMFactory::setKind(jit ? VMKind::JIT : VMKind::Interpreter); auto netPrefs = publicIP.empty() ? NetworkPreferences(listenIP ,listenPort, upnp) : NetworkPreferences(publicIP, listenIP ,listenPort, upnp); @@ -1042,13 +1072,38 @@ int main(int argc, char** argv) clientImplString, dbPath, killChain, - nodeMode == NodeMode::Full ? set{"eth", "shh"} : set(), + nodeMode == NodeMode::Full ? set{"eth"/*, "shh"*/} : set(), netPrefs, &nodesState); if (mode == OperationMode::DAGInit) doInitDAG(web3.ethereum()->blockChain().number() + (initDAG == PendingBlock ? 30000 : 0)); + if (keyManager.exists()) + while (masterPassword.empty()) + { + masterPassword = getPassword("Please enter your MASTER password: "); + if (!keyManager.load(masterPassword)) + { + cout << "Password invalid. Try again." << endl; + masterPassword.clear(); + } + } + else + { + while (masterPassword.empty()) + { + masterPassword = getPassword("Please enter a MASTER password to protect your key store (make it strong!): "); + string confirm = getPassword("Please confirm the password by entering it again: "); + if (masterPassword != confirm) + { + cout << "Passwords were different. Try again." << endl; + masterPassword.clear(); + } + } + keyManager.create(masterPassword); + } + auto toNumber = [&](string const& s) -> unsigned { if (s == "latest") return web3.ethereum()->number(); @@ -1137,53 +1192,13 @@ int main(int argc, char** argv) if (remoteHost.size()) web3.addNode(p2p::NodeId(), remoteHost + ":" + toString(remotePort)); - if (keyManager.exists()) - while (masterPassword.empty()) - { - masterPassword = getPassword("Please enter your MASTER password: "); - if (!keyManager.load(masterPassword)) - { - cout << "Password invalid. Try again." << endl; - masterPassword.clear(); - } - } - else - { - while (masterPassword.empty()) - { - masterPassword = getPassword("Please enter a MASTER password to protect your key store (make it strong!): "); - string confirm = getPassword("Please confirm the password by entering it again: "); - if (masterPassword != confirm) - { - cout << "Passwords were different. Try again." << endl; - masterPassword.clear(); - } - } - keyManager.create(masterPassword); - } - - string logbuf; - bool silence = false; - std::string additional; - g_logPost = [&](std::string const& a, char const*) { if (silence) logbuf += a + "\n"; else cout << "\r \r" << a << endl << additional << flush; }; - - // TODO: give hints &c. - auto getPassword = [&](Address const& a){ - auto s = silence; - silence = true; - cout << endl; - string ret = dev::getPassword("Enter password for address " + keyManager.accountDetails()[a].first + " (" + a.abridged() + "; hint:" + keyManager.accountDetails()[a].second + "): "); - silence = s; - return ret; - }; - #if ETH_JSONRPC || !ETH_TRUE shared_ptr jsonrpcServer; unique_ptr jsonrpcConnector; if (jsonrpc > -1) { jsonrpcConnector = unique_ptr(new jsonrpc::HttpServer(jsonrpc, "", "", SensibleHttpThreads)); - jsonrpcServer = shared_ptr(new WebThreeStubServer(*jsonrpcConnector.get(), web3, make_shared([&](){return web3.ethereum();}, getPassword, keyManager), vector())); + jsonrpcServer = shared_ptr(new WebThreeStubServer(*jsonrpcConnector.get(), web3, make_shared([&](){return web3.ethereum();}, getAccountPassword, keyManager), vector())); jsonrpcServer->StartListening(); } #endif @@ -1327,7 +1342,7 @@ int main(int argc, char** argv) if (jsonrpc < 0) jsonrpc = SensibleHttpPort; jsonrpcConnector = unique_ptr(new jsonrpc::HttpServer(jsonrpc, "", "", SensibleHttpThreads)); - jsonrpcServer = shared_ptr(new WebThreeStubServer(*jsonrpcConnector.get(), web3, make_shared([&](){return web3.ethereum();}, getPassword, keyManager), vector())); + jsonrpcServer = shared_ptr(new WebThreeStubServer(*jsonrpcConnector.get(), web3, make_shared([&](){return web3.ethereum();}, getAccountPassword, keyManager), vector())); jsonrpcServer->StartListening(); } else if (cmd == "jsonstop") @@ -1479,7 +1494,7 @@ int main(int argc, char** argv) try { Address dest = h160(fromHex(hexAddr, WhenError::Throw)); - c->submitTransaction(keyManager.secret(signingKey, [&](){ return getPassword(signingKey); }), amount, dest, bytes(), minGas); + c->submitTransaction(keyManager.secret(signingKey, [&](){ return getAccountPassword(signingKey); }), amount, dest, bytes(), minGas); } catch (BadHexCharacter& _e) { @@ -1548,7 +1563,7 @@ int main(int argc, char** argv) else if (gas < minGas) cwarn << "Minimum gas amount is" << minGas; else - c->submitTransaction(keyManager.secret(signingKey, [&](){ return getPassword(signingKey); }), endowment, init, gas, gasPrice); + c->submitTransaction(keyManager.secret(signingKey, [&](){ return getAccountPassword(signingKey); }), endowment, init, gas, gasPrice); } else cwarn << "Require parameters: contract ENDOWMENT GASPRICE GAS CODEHEX"; diff --git a/libdevcore/Common.h b/libdevcore/Common.h index 41f1b1d49..95817e41c 100644 --- a/libdevcore/Common.h +++ b/libdevcore/Common.h @@ -199,12 +199,12 @@ private: #define DEV_TIMED_FUNCTION DEV_TIMED_SCOPE(__PRETTY_FUNCTION__) #endif -#define DEV_TIMED_IF(S, MS) for (::std::pair<::dev::TimerHelper, bool> __eth_t(::dev::TimerHelper(#S, MS), true); __eth_t.second; __eth_t.second = false) -#define DEV_TIMED_SCOPE_IF(S) ::dev::TimerHelper __eth_t(S, MS) +#define DEV_TIMED_ABOVE(S, MS) for (::std::pair<::dev::TimerHelper, bool> __eth_t(::dev::TimerHelper(#S, MS), true); __eth_t.second; __eth_t.second = false) +#define DEV_TIMED_SCOPE_ABOVE(S) ::dev::TimerHelper __eth_t(S, MS) #if WIN32 -#define DEV_TIMED_FUNCTION_IF(MS) DEV_TIMED_SCOPE_IF(__FUNCSIG__, MS) +#define DEV_TIMED_FUNCTION_ABOVE(MS) DEV_TIMED_SCOPE_ABOVE(__FUNCSIG__, MS) #else -#define DEV_TIMED_FUNCTION_IF(MS) DEV_TIMED_SCOPE_IF(__PRETTY_FUNCTION__, MS) +#define DEV_TIMED_FUNCTION_ABOVE(MS) DEV_TIMED_SCOPE_ABOVE(__PRETTY_FUNCTION__, MS) #endif enum class WithExisting: int diff --git a/libdevcore/Worker.cpp b/libdevcore/Worker.cpp index 7d790ccf6..ab19b2f74 100644 --- a/libdevcore/Worker.cpp +++ b/libdevcore/Worker.cpp @@ -65,15 +65,15 @@ void Worker::startWorking() m_state.exchange(ex); // cnote << "Waiting until not Stopped..."; - DEV_TIMED_IF(Worker stopping, 100) + DEV_TIMED_ABOVE(Worker stopping, 100) while (m_state == WorkerState::Stopped) this_thread::sleep_for(chrono::milliseconds(20)); } })); // cnote << "Spawning" << m_name; } - DEV_TIMED_IF(Start worker, 100) - while (m_state != WorkerState::Started) + DEV_TIMED_ABOVE(Start worker, 100) + while (m_state == WorkerState::Starting) this_thread::sleep_for(chrono::microseconds(20)); } @@ -85,7 +85,7 @@ void Worker::stopWorking() WorkerState ex = WorkerState::Started; m_state.compare_exchange_strong(ex, WorkerState::Stopping); - DEV_TIMED_IF(Stop worker, 100) + DEV_TIMED_ABOVE(Stop worker, 100) while (m_state != WorkerState::Stopped) this_thread::sleep_for(chrono::microseconds(20)); } @@ -99,7 +99,7 @@ void Worker::terminate() { m_state.exchange(WorkerState::Killing); - DEV_TIMED_IF(Terminate worker, 100) + DEV_TIMED_ABOVE(Terminate worker, 100) m_work->join(); m_work.reset(); diff --git a/libethcore/Ethash.cpp b/libethcore/Ethash.cpp index db1a17b0a..3724d8255 100644 --- a/libethcore/Ethash.cpp +++ b/libethcore/Ethash.cpp @@ -76,9 +76,9 @@ Ethash::WorkPackage Ethash::package(BlockInfo const& _bi) return ret; } -void Ethash::prep(BlockInfo const& _header) +void Ethash::prep(BlockInfo const& _header, std::function const& _f) { - EthashAux::full(_header); + EthashAux::full((unsigned)_header.number, _f); } bool Ethash::preVerify(BlockInfo const& _header) @@ -310,6 +310,8 @@ void Ethash::GPUMiner::workLoop() unsigned device = instances() > 1 ? index() : s_deviceId; + if (!EthashAux::computeFull(w.blockNumber)) + return; EthashAux::FullType dag = EthashAux::full(w.blockNumber); bytesConstRef dagData = dag->data(); m_miner->init(dagData.data(), dagData.size(), 32, s_platformId, device); diff --git a/libethcore/Ethash.h b/libethcore/Ethash.h index 1fcab55de..82db15e87 100644 --- a/libethcore/Ethash.h +++ b/libethcore/Ethash.h @@ -74,7 +74,7 @@ public: static std::string name(); static unsigned revision(); - static void prep(BlockInfo const& _header); + static void prep(BlockInfo const& _header, std::function const& _f = std::function()); static bool verify(BlockInfo const& _header); static bool preVerify(BlockInfo const& _header); static WorkPackage package(BlockInfo const& _header); diff --git a/libethcore/EthashAux.cpp b/libethcore/EthashAux.cpp index 7bcb976d6..f7a0ac41d 100644 --- a/libethcore/EthashAux.cpp +++ b/libethcore/EthashAux.cpp @@ -149,11 +149,6 @@ bytesConstRef EthashAux::FullAllocation::data() const return bytesConstRef((byte const*)ethash_full_dag(full), size()); } -EthashAux::FullType EthashAux::full(BlockInfo const& _header, function const& _f) -{ - return full((uint64_t)_header.number, _f); -} - static std::function s_dagCallback; static int dagCallbackShim(unsigned _p) { @@ -167,16 +162,43 @@ EthashAux::FullType EthashAux::full(uint64_t _blockNumber, functionx_fulls); - if ((ret = get()->m_fulls[seedHash].lock())) + DEV_GUARDED(get()->x_fulls) + if ((ret = get()->m_fulls[seedHash].lock())) + { + get()->m_lastUsedFull = ret; + return ret; + } + + s_dagCallback = _f; + ret = make_shared(l->light, dagCallbackShim); + + DEV_GUARDED(get()->x_fulls) + get()->m_fulls[seedHash] = get()->m_lastUsedFull = ret; + return ret; +} + +unsigned EthashAux::computeFull(uint64_t _blockNumber) +{ + Guard l(get()->x_fulls); + h256 seedHash = EthashAux::seedHash(_blockNumber); + if (FullType ret = get()->m_fulls[seedHash].lock()) { get()->m_lastUsedFull = ret; - return ret; + return 100; } - s_dagCallback = _f; - ret = get()->m_lastUsedFull = make_shared(l->light, dagCallbackShim); - get()->m_fulls[seedHash] = ret; - return ret; + + if (!get()->m_fullGenerator || !get()->m_fullGenerator->joinable()) + { + get()->m_fullProgress = 0; + get()->m_generatingFullNumber = _blockNumber / ETHASH_EPOCH_LENGTH * ETHASH_EPOCH_LENGTH; + get()->m_fullGenerator = unique_ptr(new thread([=](){ + get()->full(_blockNumber, [](unsigned p){ get()->m_fullProgress = p; return 0; }); + get()->m_fullProgress = 0; + get()->m_generatingFullNumber = NotGenerating; + })); + } + + return (get()->m_generatingFullNumber == _blockNumber) ? get()->m_fullProgress : 0; } Ethash::Result EthashAux::FullAllocation::compute(h256 const& _headerHash, Nonce const& _nonce) const diff --git a/libethcore/EthashAux.h b/libethcore/EthashAux.h index dbfe54d43..f57f7a4d3 100644 --- a/libethcore/EthashAux.h +++ b/libethcore/EthashAux.h @@ -19,7 +19,9 @@ * @date 2014 */ +#include #include +#include #include "Ethash.h" namespace dev @@ -65,7 +67,13 @@ public: static LightType light(BlockInfo const& _header); static LightType light(uint64_t _blockNumber); - static FullType full(BlockInfo const& _header, std::function const& _f = std::function()); + + static const uint64_t NotGenerating = (uint64_t)-1; + /// Kicks off generation of DAG for @a _blocknumber and @returns false or @returns true if ready. + static unsigned computeFull(uint64_t _blockNumber); + /// Information on the generation progress. + static std::pair fullGeneratingProgress() { return std::make_pair(get()->m_generatingFullNumber, get()->m_fullProgress); } + /// Kicks off generation of DAG for @a _blocknumber and blocks until ready; @returns result. static FullType full(uint64_t _blockNumber, std::function const& _f = std::function()); static Ethash::Result eval(BlockInfo const& _header) { return eval(_header, _header.nonce); } @@ -83,8 +91,12 @@ private: std::unordered_map> m_lights; Mutex x_fulls; + std::condition_variable m_fullsChanged; std::unordered_map> m_fulls; FullType m_lastUsedFull; + std::unique_ptr m_fullGenerator; + uint64_t m_generatingFullNumber = NotGenerating; + unsigned m_fullProgress; Mutex x_epochs; std::unordered_map m_epochs; diff --git a/libethereum/ClientBase.h b/libethereum/ClientBase.h index 235a6f540..2b271b1df 100644 --- a/libethereum/ClientBase.h +++ b/libethereum/ClientBase.h @@ -84,11 +84,11 @@ public: using Interface::submitTransaction; /// Makes the given call. Nothing is recorded into the state. - virtual ExecutionResult call(Address const& _secret, u256 _value, Address _dest, bytes const& _data = bytes(), u256 _gas = 10000, u256 _gasPrice = 10 * szabo, BlockNumber _blockNumber = PendingBlock, FudgeFactor _ff = FudgeFactor::Strict) override; + virtual ExecutionResult call(Address const& _secret, u256 _value, Address _dest, bytes const& _data, u256 _gas, u256 _gasPrice, BlockNumber _blockNumber, FudgeFactor _ff = FudgeFactor::Strict) override; using Interface::call; /// Makes the given create. Nothing is recorded into the state. - virtual ExecutionResult create(Address const& _secret, u256 _value, bytes const& _data = bytes(), u256 _gas = 10000, u256 _gasPrice = 10 * szabo, BlockNumber _blockNumber = PendingBlock, FudgeFactor _ff = FudgeFactor::Strict) override; + virtual ExecutionResult create(Address const& _secret, u256 _value, bytes const& _data, u256 _gas, u256 _gasPrice, BlockNumber _blockNumber, FudgeFactor _ff = FudgeFactor::Strict) override; using Interface::create; using Interface::balanceAt; diff --git a/libethereum/State.cpp b/libethereum/State.cpp index 50e4b26ab..584de461b 100644 --- a/libethereum/State.cpp +++ b/libethereum/State.cpp @@ -515,10 +515,10 @@ pair State::sync(BlockChain const& _bc, TransactionQu cnote << i.first << "Dropping old transaction (nonce too low)"; _tq.drop(i.first); } - else if (got > req + 5) + else if (got > req + 25) { // too new - cnote << i.first << "Dropping new transaction (> 5 nonces ahead)"; + cnote << i.first << "Dropping new transaction (> 25 nonces ahead)"; _tq.drop(i.first); } else From 0315689bb37f63c714abc6194a29f8312e6f9e3b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Tue, 12 May 2015 16:14:18 +0200 Subject: [PATCH 160/461] Ping buildbot --- test/libevm/vm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/libevm/vm.cpp b/test/libevm/vm.cpp index 2d67d7670..f9aac2eb2 100644 --- a/test/libevm/vm.cpp +++ b/test/libevm/vm.cpp @@ -432,7 +432,7 @@ void doVMTests(json_spirit::mValue& v, bool _fillin) } } -} } // Namespace Close +} } // namespace close BOOST_AUTO_TEST_SUITE(VMTests) From 212a01136bd28d0f53cab2e07c018ae888977377 Mon Sep 17 00:00:00 2001 From: chriseth Date: Tue, 12 May 2015 16:16:44 +0200 Subject: [PATCH 161/461] Unify blocks with shared code. --- libevmasm/Assembly.cpp | 10 +++ libevmasm/AssemblyItem.h | 2 + libevmasm/BlockDeduplicator.cpp | 93 ++++++++++++++++++++++++++ libevmasm/BlockDeduplicator.h | 69 +++++++++++++++++++ test/libsolidity/SolidityOptimizer.cpp | 38 ++++++++++- 5 files changed, 211 insertions(+), 1 deletion(-) create mode 100644 libevmasm/BlockDeduplicator.cpp create mode 100644 libevmasm/BlockDeduplicator.h diff --git a/libevmasm/Assembly.cpp b/libevmasm/Assembly.cpp index abcd44516..1011392b9 100644 --- a/libevmasm/Assembly.cpp +++ b/libevmasm/Assembly.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include using namespace std; using namespace dev; @@ -348,8 +349,17 @@ Assembly& Assembly::optimise(bool _enable) copy(orig, iter, back_inserter(optimisedItems)); } } + if (optimisedItems.size() < m_items.size()) + { m_items = move(optimisedItems); + count++; + } + + // This only modifies PushTags, we have to run again to actually remove code. + BlockDeduplicator dedup(m_items); + if (dedup.deduplicate()) + count++; } } diff --git a/libevmasm/AssemblyItem.h b/libevmasm/AssemblyItem.h index 6f2a65de9..b3012a7ea 100644 --- a/libevmasm/AssemblyItem.h +++ b/libevmasm/AssemblyItem.h @@ -68,6 +68,8 @@ public: /// @returns true iff the type and data of the items are equal. bool operator==(AssemblyItem const& _other) const { return m_type == _other.m_type && m_data == _other.m_data; } bool operator!=(AssemblyItem const& _other) const { return !operator==(_other); } + /// Less-than operator compatible with operator==. + bool operator<(AssemblyItem const& _other) const { return std::tie(m_type, m_data) < std::tie(_other.m_type, _other.m_data); } /// @returns an upper bound for the number of bytes required by this item, assuming that /// the value of a jump tag takes @a _addressLength bytes. diff --git a/libevmasm/BlockDeduplicator.cpp b/libevmasm/BlockDeduplicator.cpp new file mode 100644 index 000000000..ca4f7e21a --- /dev/null +++ b/libevmasm/BlockDeduplicator.cpp @@ -0,0 +1,93 @@ +/* + This file is part of cpp-ethereum. + + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** + * @file BlockDeduplicator.cpp + * @author Christian + * @date 2015 + * Unifies basic blocks that share content. + */ + +#include +#include +#include +#include + +#include + +using namespace std; +using namespace dev; +using namespace dev::eth; + + +bool BlockDeduplicator::deduplicate() +{ + // Compares indices based on the suffix that starts there, ignoring tags and stopping at + // opcodes that stop the control flow. + function comparator = [&](size_t _i, size_t _j) + { + if (_i == _j) + return false; + + BlockIterator first(m_items.begin() + _i, m_items.end()); + BlockIterator second(m_items.begin() + _j, m_items.end()); + BlockIterator end(m_items.end(), m_items.end()); + + if (first != end && (*first).type() == Tag) + ++first; + if (second != end && (*second).type() == Tag) + ++second; + + return std::lexicographical_compare(first, end, second, end); + }; + + set> blocksSeen(comparator); + map tagReplacement; + for (size_t i = 0; i < m_items.size(); ++i) + { + if (m_items.at(i).type() != Tag) + continue; + auto it = blocksSeen.find(i); + if (it == blocksSeen.end()) + blocksSeen.insert(i); + else + tagReplacement[m_items.at(i).data()] = m_items.at(*it).data(); + } + + bool ret = false; + for (AssemblyItem& item: m_items) + if (item.type() == PushTag && tagReplacement.count(item.data())) + { + ret = true; + item.setData(tagReplacement.at(item.data())); + } + return ret; +} + +BlockDeduplicator::BlockIterator& BlockDeduplicator::BlockIterator::operator++() +{ + if (it == end) + return *this; + if (SemanticInformation::altersControlFlow(*it) && *it != AssemblyItem(eth::Instruction::JUMPI)) + it = end; + else + { + ++it; + while (it != end && it->type() == Tag) + ++it; + } + return *this; +} diff --git a/libevmasm/BlockDeduplicator.h b/libevmasm/BlockDeduplicator.h new file mode 100644 index 000000000..8a82a1ed7 --- /dev/null +++ b/libevmasm/BlockDeduplicator.h @@ -0,0 +1,69 @@ +/* + This file is part of cpp-ethereum. + + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** + * @file BlockDeduplicator.h + * @author Christian + * @date 2015 + * Unifies basic blocks that share content. + */ + +#pragma once + +#include +#include +#include + +namespace dev +{ +namespace eth +{ + +class AssemblyItem; +using AssemblyItems = std::vector; + +/** + * Optimizer class to be used to unify blocks that share content. + * Modifies the passed vector in place. + */ +class BlockDeduplicator +{ +public: + BlockDeduplicator(AssemblyItems& _items): m_items(_items) {} + /// @returns true if something was changed + bool deduplicate(); + +private: + /// Iterator that skips tags skips to the end if (all branches of) the control + /// flow does not continue to the next instruction. + struct BlockIterator: std::iterator + { + public: + BlockIterator(AssemblyItems::const_iterator _it, AssemblyItems::const_iterator _end): + it(_it), end(_end) { } + BlockIterator& operator++(); + bool operator==(BlockIterator const& _other) const { return it == _other.it; } + bool operator!=(BlockIterator const& _other) const { return it != _other.it; } + AssemblyItem const& operator*() const { return *it; } + AssemblyItems::const_iterator it; + AssemblyItems::const_iterator end; + }; + + AssemblyItems& m_items; +}; + +} +} diff --git a/test/libsolidity/SolidityOptimizer.cpp b/test/libsolidity/SolidityOptimizer.cpp index e50469dd6..efc9316b0 100644 --- a/test/libsolidity/SolidityOptimizer.cpp +++ b/test/libsolidity/SolidityOptimizer.cpp @@ -29,6 +29,7 @@ #include #include #include +#include using namespace std; using namespace dev::eth; @@ -125,7 +126,7 @@ public: BOOST_CHECK_EQUAL_COLLECTIONS(_expectation.begin(), _expectation.end(), output.begin(), output.end()); } - void checkCFG(AssemblyItems const& _input, AssemblyItems const& _expectation) + AssemblyItems getCFG(AssemblyItems const& _input) { AssemblyItems output = _input; // Running it four times should be enough for these tests. @@ -138,6 +139,12 @@ public: back_inserter(optItems)); output = move(optItems); } + return output; + } + + void checkCFG(AssemblyItems const& _input, AssemblyItems const& _expectation) + { + AssemblyItems output = getCFG(_input); BOOST_CHECK_EQUAL_COLLECTIONS(_expectation.begin(), _expectation.end(), output.begin(), output.end()); } @@ -925,6 +932,35 @@ BOOST_AUTO_TEST_CASE(control_flow_graph_do_not_remove_returned_to) checkCFG(input, {u256(2)}); } +BOOST_AUTO_TEST_CASE(block_deduplicator) +{ + AssemblyItems input{ + AssemblyItem(PushTag, 2), + AssemblyItem(PushTag, 1), + AssemblyItem(PushTag, 3), + u256(6), + eth::Instruction::SWAP3, + eth::Instruction::JUMP, + AssemblyItem(Tag, 1), + u256(6), + eth::Instruction::SWAP3, + eth::Instruction::JUMP, + AssemblyItem(Tag, 2), + u256(6), + eth::Instruction::SWAP3, + eth::Instruction::JUMP, + AssemblyItem(Tag, 3) + }; + BlockDeduplicator dedup(input); + dedup.deduplicate(); + + set pushTags; + for (AssemblyItem const& item: input) + if (item.type() == PushTag) + pushTags.insert(item.data()); + BOOST_CHECK_EQUAL(pushTags.size(), 2); +} + BOOST_AUTO_TEST_SUITE_END() } From bf51bfef0e59c3be4e1ddcadc6b0c44a15b5d272 Mon Sep 17 00:00:00 2001 From: chriseth Date: Tue, 12 May 2015 17:00:23 +0200 Subject: [PATCH 162/461] Removed unnecessary include. --- libevmasm/BlockDeduplicator.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/libevmasm/BlockDeduplicator.cpp b/libevmasm/BlockDeduplicator.cpp index ca4f7e21a..eadbe1b40 100644 --- a/libevmasm/BlockDeduplicator.cpp +++ b/libevmasm/BlockDeduplicator.cpp @@ -26,8 +26,6 @@ #include #include -#include - using namespace std; using namespace dev; using namespace dev::eth; From 18e223e9456195dbc56528927d211805de57202a Mon Sep 17 00:00:00 2001 From: chriseth Date: Tue, 12 May 2015 17:50:41 +0200 Subject: [PATCH 163/461] Reverse if and else body. --- libsolidity/Compiler.cpp | 12 ++++-- test/libsolidity/SolidityCompiler.cpp | 59 +++++++++++++-------------- 2 files changed, 37 insertions(+), 34 deletions(-) diff --git a/libsolidity/Compiler.cpp b/libsolidity/Compiler.cpp index bcd4f9d68..66c503172 100644 --- a/libsolidity/Compiler.cpp +++ b/libsolidity/Compiler.cpp @@ -377,12 +377,16 @@ bool Compiler::visit(IfStatement const& _ifStatement) StackHeightChecker checker(m_context); CompilerContext::LocationSetter locationSetter(m_context, _ifStatement); compileExpression(_ifStatement.getCondition()); - eth::AssemblyItem trueTag = m_context.appendConditionalJump(); + m_context << eth::Instruction::ISZERO; + eth::AssemblyItem falseTag = m_context.appendConditionalJump(); + eth::AssemblyItem endTag = falseTag; + _ifStatement.getTrueStatement().accept(*this); if (_ifStatement.getFalseStatement()) + { + endTag = m_context.appendJumpToNew(); + m_context << falseTag; _ifStatement.getFalseStatement()->accept(*this); - eth::AssemblyItem endTag = m_context.appendJumpToNew(); - m_context << trueTag; - _ifStatement.getTrueStatement().accept(*this); + } m_context << endTag; checker.check(); diff --git a/test/libsolidity/SolidityCompiler.cpp b/test/libsolidity/SolidityCompiler.cpp index aa83c4650..dda7847ed 100644 --- a/test/libsolidity/SolidityCompiler.cpp +++ b/test/libsolidity/SolidityCompiler.cpp @@ -116,36 +116,35 @@ BOOST_AUTO_TEST_CASE(ifStatement) bytes code = compileContract(sourceCode); unsigned shift = 60; unsigned boilerplateSize = 73; - bytes expectation({byte(Instruction::JUMPDEST), - byte(Instruction::PUSH1), 0x0, - byte(Instruction::DUP1), - byte(Instruction::PUSH1), byte(0x1b + shift), // "true" target - byte(Instruction::JUMPI), - // new check "else if" condition - byte(Instruction::DUP1), - byte(Instruction::ISZERO), - byte(Instruction::PUSH1), byte(0x13 + shift), - byte(Instruction::JUMPI), - // "else" body - byte(Instruction::PUSH1), 0x4f, - byte(Instruction::POP), - byte(Instruction::PUSH1), byte(0x17 + shift), // exit path of second part - byte(Instruction::JUMP), - // "else if" body - byte(Instruction::JUMPDEST), - byte(Instruction::PUSH1), 0x4e, - byte(Instruction::POP), - byte(Instruction::JUMPDEST), - byte(Instruction::PUSH1), byte(0x1f + shift), - byte(Instruction::JUMP), - // "if" body - byte(Instruction::JUMPDEST), - byte(Instruction::PUSH1), 0x4d, - byte(Instruction::POP), - byte(Instruction::JUMPDEST), - byte(Instruction::JUMPDEST), - byte(Instruction::POP), - byte(Instruction::JUMP)}); + bytes expectation({ + byte(Instruction::JUMPDEST), + byte(Instruction::PUSH1), 0x0, + byte(Instruction::DUP1), + byte(Instruction::ISZERO), + byte(Instruction::PUSH1), byte(0x0f + shift), // "false" target + byte(Instruction::JUMPI), + // "if" body + byte(Instruction::PUSH1), 0x4d, + byte(Instruction::POP), + byte(Instruction::PUSH1), byte(0x21 + shift), + byte(Instruction::JUMP), + // new check "else if" condition + byte(Instruction::JUMPDEST), + byte(Instruction::DUP1), + byte(Instruction::ISZERO), + byte(Instruction::ISZERO), + byte(Instruction::PUSH1), byte(0x1c + shift), + byte(Instruction::JUMPI), + // "else if" body + byte(Instruction::PUSH1), 0x4e, + byte(Instruction::POP), + byte(Instruction::PUSH1), byte(0x20 + shift), + byte(Instruction::JUMP), + // "else" body + byte(Instruction::JUMPDEST), + byte(Instruction::PUSH1), 0x4f, + byte(Instruction::POP), + }); checkCodePresentAt(code, expectation, boilerplateSize); } From 2d2efc070a6239a76e80e2d452f1f4fad4b20985 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 12 May 2015 17:52:03 +0200 Subject: [PATCH 164/461] Gas estimation --- mix/CodeModel.cpp | 49 +++++++++++++++++++++++++++++++++++ mix/CodeModel.h | 25 ++++++++++++++++++ mix/qml/CodeEditorView.qml | 4 +++ mix/qml/WebCodeEditor.qml | 8 ++++++ mix/qml/html/cm/solarized.css | 4 +++ mix/qml/html/codeeditor.js | 23 +++++++++++++++- 6 files changed, 112 insertions(+), 1 deletion(-) diff --git a/mix/CodeModel.cpp b/mix/CodeModel.cpp index 636a665e6..ecdb46be3 100644 --- a/mix/CodeModel.cpp +++ b/mix/CodeModel.cpp @@ -33,6 +33,8 @@ #include #include #include +#include +#include #include #include #include "QContractDefinition.h" @@ -41,6 +43,7 @@ #include "CodeHighlighter.h" #include "FileIo.h" #include "CodeModel.h" +#include "QBigInt.h" using namespace dev::mix; @@ -50,6 +53,7 @@ const std::set c_predefinedContracts = namespace { +using namespace dev::eth; using namespace dev::solidity; class CollectLocalsVisitor: public ASTConstVisitor @@ -185,6 +189,7 @@ CodeModel::CodeModel(): qRegisterMetaType("QContractDefinition*"); qRegisterMetaType("QFunctionDefinition*"); qRegisterMetaType("QVariableDeclaration*"); + //qRegisterMetaType("GasMap"); qmlRegisterType("org.ethereum.qml", 1, 0, "QFunctionDefinition"); qmlRegisterType("org.ethereum.qml", 1, 0, "QVariableDeclaration"); } @@ -292,6 +297,7 @@ void CodeModel::runCompilationJob(int _jobId) } } cs.compile(false); + gasEstimation(cs); collectContracts(cs, sourceNames); } catch (dev::Exception const& _exception) @@ -314,6 +320,49 @@ void CodeModel::runCompilationJob(int _jobId) emit stateChanged(); } +void CodeModel::gasEstimation(solidity::CompilerStack const& _cs) +{ + m_gasCostsMaps.clear(); + for (std::string n: _cs.getContractNames()) + { + + ContractDefinition const& contractDefinition = _cs.getContractDefinition(n); + QString sourceName = QString::fromStdString(*contractDefinition.getLocation().sourceName); + + if (!m_gasCostsMaps.contains(sourceName)) + m_gasCostsMaps.insert(sourceName, QVariantList()); + + if (!contractDefinition.isFullyImplemented()) + continue; + dev::solidity::SourceUnit const& sourceUnit = _cs.getAST(*contractDefinition.getLocation().sourceName); + AssemblyItems const* items = _cs.getRuntimeAssemblyItems(n); + + StructuralGasEstimator estimator; + std::map gasCosts = estimator.breakToStatementLevel(estimator.performEstimation(*items, std::vector({&sourceUnit})), {&sourceUnit}); + + for (auto gasIte = gasCosts.begin(); gasIte != gasCosts.end(); ++gasIte) + { + SourceLocation location = gasIte->first->getLocation(); + GasMeter::GasConsumption cost = gasIte->second; + GasMap* gas = new GasMap(location.start, location.end, (new QBigInt(cost.value))->value()); + m_gasCostsMaps.find(sourceName).value().push_back(QVariant::fromValue(gas)); + } + } +} + +QVariantList CodeModel::gasCostByDocumentId(QString const& _documentId) const +{ + if (m_gasCostsMaps.contains(_documentId)) + { + auto sourceMapIter = m_gasCostsMaps.find(_documentId); + int gg = sourceMapIter.value().size(); + Q_UNUSED(gg); + return sourceMapIter.value(); + } + else + return QVariantList(); +} + void CodeModel::collectContracts(dev::solidity::CompilerStack const& _cs, std::vector const& _sourceNames) { Guard pl(x_pendingContracts); diff --git a/mix/CodeModel.h b/mix/CodeModel.h index 3f713a17b..a1a2c29ec 100644 --- a/mix/CodeModel.h +++ b/mix/CodeModel.h @@ -32,6 +32,7 @@ #include #include #include "SolidityType.h" +#include "QBigInt.h" class QTextDocument; @@ -126,7 +127,24 @@ struct SourceMap LocationMap functions; }; +class GasMap: public QObject +{ + Q_OBJECT + + Q_PROPERTY(int start MEMBER m_start CONSTANT) + Q_PROPERTY(int end MEMBER m_end CONSTANT) + Q_PROPERTY(QString gas MEMBER m_gas CONSTANT) + +public: + GasMap(int _start, int _end, QString _gas): m_start(_start), m_end(_end), m_gas(_gas) {} + + int m_start; + int m_end; + QString m_gas; +}; + using SourceMaps = QMap; //by source id +using GasCostsMaps = QMap*/>; //gas cost by contract name /// Code compilation model. Compiles contracts in background an provides compiled contract data class CodeModel: public QObject @@ -166,6 +184,10 @@ public: bool isContractOrFunctionLocation(dev::SourceLocation const& _location); /// Get funciton name by location QString resolveFunctionName(dev::SourceLocation const& _location); + /// Gas estimation for compiled sources + void gasEstimation(solidity::CompilerStack const& _cs); + /// Gas cost by doc id + Q_INVOKABLE QVariantList gasCostByDocumentId(QString const& _documentId) const; signals: /// Emited on compilation state change @@ -201,6 +223,7 @@ private: mutable dev::Mutex x_contractMap; ContractMap m_contractMap; SourceMaps m_sourceMaps; + GasCostsMaps m_gasCostsMaps; std::unique_ptr m_codeHighlighterSettings; QThread m_backgroundThread; BackgroundWorker m_backgroundWorker; @@ -214,3 +237,5 @@ private: } } + +//Q_DECLARE_METATYPE(dev::mix::GasMap) diff --git a/mix/qml/CodeEditorView.qml b/mix/qml/CodeEditorView.qml index e4d62ed81..08bb072f5 100644 --- a/mix/qml/CodeEditorView.qml +++ b/mix/qml/CodeEditorView.qml @@ -177,6 +177,10 @@ Item { } onCompilationComplete: { sourceInError = ""; + var gasCosts = codeModel.gasCostByDocumentId(currentDocumentId); + var editor = getEditor(currentDocumentId); + if (editor) + editor.displayGasCosts(gasCosts); } } diff --git a/mix/qml/WebCodeEditor.qml b/mix/qml/WebCodeEditor.qml index 38f2327b1..a2602304a 100644 --- a/mix/qml/WebCodeEditor.qml +++ b/mix/qml/WebCodeEditor.qml @@ -83,6 +83,14 @@ Item { editorBrowser.runJavaScript("setFontSize(" + size + ")", function(result) {}); } + function displayGasCosts(gasCosts) { + + //console.log(gasCosts); + //console.log(JSON.stringify(gasCosts)); + if (initialized && editorBrowser) + editorBrowser.runJavaScript("displayGasCosts('" + JSON.stringify(gasCosts) + "')", function(result) {}); + } + Clipboard { id: clipboard diff --git a/mix/qml/html/cm/solarized.css b/mix/qml/html/cm/solarized.css index b8cede806..046042450 100644 --- a/mix/qml/html/cm/solarized.css +++ b/mix/qml/html/cm/solarized.css @@ -189,3 +189,7 @@ view-port } span.CodeMirror-selectedtext { color: #586e75 !important; } + +.gasCost { + background: #b58900 !important; +} diff --git a/mix/qml/html/codeeditor.js b/mix/qml/html/codeeditor.js index d25fbd091..cc5e9a28c 100644 --- a/mix/qml/html/codeeditor.js +++ b/mix/qml/html/codeeditor.js @@ -3,7 +3,7 @@ var editor = CodeMirror(document.body, { //styleActiveLine: true, matchBrackets: true, autofocus: true, - gutters: ["CodeMirror-linenumbers", "breakpoints"], + gutters: ["CodeMirror-linenumbers", "breakpoints", "gasCost"], autoCloseBrackets: true, styleSelectedText: true }); @@ -203,5 +203,26 @@ setFontSize = function(size) editor.refresh(); } +makeGasCostMarker = function(value) { + var marker = document.createElement("div"); + marker.style.color = "#822"; + marker.innerHTML = value; + return marker; +}; + +displayGasCosts = function(gasCosts) +{ + gasCosts = JSON.parse(gasCosts); + for (var i in gasCosts) + { + var line = editor.posFromIndex(gasCosts[i].start); + console.log("___________") + console.log(line.line); + console.log(gasCosts[i].start); + //editor.setGutterMarker(line.line, "gasCost", makeGasCostMarker(gasCosts[i].gas)); + editor.markText(editor.posFromIndex(gasCosts[i].start), editor.posFromIndex(gasCosts[i].end), { className: "gasCost" }); + } +} + editor.setOption("extraKeys", extraKeys); From 368532c107f383c909dde8e951693c9f42f00b0d Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Wed, 13 May 2015 00:26:43 +0300 Subject: [PATCH 165/461] Extra diagnostics, assertions and fail-safes for tracking BadRoot bug. --- libdevcrypto/MemoryDB.cpp | 34 +++++++++++++++++------ libdevcrypto/MemoryDB.h | 11 ++++++-- libdevcrypto/OverlayDB.cpp | 57 +++++++++++++++++++++++++------------- libdevcrypto/OverlayDB.h | 8 +++--- libdevcrypto/TrieDB.cpp | 2 +- libdevcrypto/TrieDB.h | 36 ++++++++++++++---------- libethereum/BlockChain.cpp | 9 +++++- libethereum/Client.cpp | 2 +- libethereum/State.cpp | 12 +++++++- test/libdevcrypto/trie.cpp | 10 +++++++ 10 files changed, 128 insertions(+), 53 deletions(-) diff --git a/libdevcrypto/MemoryDB.cpp b/libdevcrypto/MemoryDB.cpp index 4b08db083..2cf56475b 100644 --- a/libdevcrypto/MemoryDB.cpp +++ b/libdevcrypto/MemoryDB.cpp @@ -32,6 +32,7 @@ const char* DBWarn::name() { return "TDB"; } std::unordered_map MemoryDB::get() const { + ReadGuard l(x_this); std::unordered_map ret; for (auto const& i: m_main) if (!m_enforceRefs || i.second.second > 0) @@ -39,21 +40,34 @@ std::unordered_map MemoryDB::get() const return ret; } +MemoryDB& MemoryDB::operator=(MemoryDB const& _c) +{ + if (this == &_c) + return *this; + ReadGuard l(_c.x_this); + WriteGuard l2(x_this); + m_main = _c.m_main; + m_aux = _c.m_aux; + return *this; +} + std::string MemoryDB::lookup(h256 const& _h) const { + ReadGuard l(x_this); auto it = m_main.find(_h); if (it != m_main.end()) { if (!m_enforceRefs || it->second.second > 0) return it->second.first; -// else if (m_enforceRefs && m_refCount.count(it->first) && !m_refCount.at(it->first)) -// cnote << "Lookup required for value with no refs. Let's hope it's in the DB." << _h; + else + cwarn << "Lookup required for value with refcount == 0. This is probably a critical trie issue" << _h; } return std::string(); } bool MemoryDB::exists(h256 const& _h) const { + ReadGuard l(x_this); auto it = m_main.find(_h); if (it != m_main.end() && (!m_enforceRefs || it->second.second > 0)) return true; @@ -62,6 +76,7 @@ bool MemoryDB::exists(h256 const& _h) const void MemoryDB::insert(h256 const& _h, bytesConstRef _v) { + WriteGuard l(x_this); auto it = m_main.find(_h); if (it != m_main.end()) { @@ -77,34 +92,34 @@ void MemoryDB::insert(h256 const& _h, bytesConstRef _v) bool MemoryDB::kill(h256 const& _h) { + ReadGuard l(x_this); if (m_main.count(_h)) { if (m_main[_h].second > 0) + { m_main[_h].second--; + return true; + } #if ETH_PARANOIA else { // If we get to this point, then there was probably a node in the level DB which we need to remove and which we have previously // used as part of the memory-based MemoryDB. Nothing to be worried about *as long as the node exists in the DB*. dbdebug << "NOKILL-WAS" << _h; - return false; } dbdebug << "KILL" << _h << "=>" << m_main[_h].second; - return true; } else { dbdebug << "NOKILL" << _h; - return false; - } -#else - } - return true; #endif + } + return false; } void MemoryDB::purge() { + WriteGuard l(x_this); for (auto it = m_main.begin(); it != m_main.end(); ) if (it->second.second) ++it; @@ -114,6 +129,7 @@ void MemoryDB::purge() h256Hash MemoryDB::keys() const { + ReadGuard l(x_this); h256Hash ret; for (auto const& i: m_main) if (i.second.second) diff --git a/libdevcrypto/MemoryDB.h b/libdevcrypto/MemoryDB.h index 3169d8fbc..169682815 100644 --- a/libdevcrypto/MemoryDB.h +++ b/libdevcrypto/MemoryDB.h @@ -23,6 +23,7 @@ #include #include +#include #include #include #include @@ -43,6 +44,9 @@ class MemoryDB public: MemoryDB() {} + MemoryDB(MemoryDB const& _c) { operator=(_c); } + + MemoryDB& operator=(MemoryDB const& _c); void clear() { m_main.clear(); } // WARNING !!!! didn't originally clear m_refCount!!! std::unordered_map get() const; @@ -53,13 +57,14 @@ public: bool kill(h256 const& _h); void purge(); - bytes lookupAux(h256 const& _h) const { try { return m_aux.at(_h).first; } catch (...) { return bytes(); } } - void removeAux(h256 const& _h) { m_aux[_h].second = false; } - void insertAux(h256 const& _h, bytesConstRef _v) { m_aux[_h] = make_pair(_v.toBytes(), true); } + bytes lookupAux(h256 const& _h) const { ReadGuard l(x_this); auto it = m_aux.find(_h); if (it != m_aux.end() && (!m_enforceRefs || it->second.second)) return it->second.first; return bytes(); } + void removeAux(h256 const& _h) { WriteGuard l(x_this); m_aux[_h].second = false; } + void insertAux(h256 const& _h, bytesConstRef _v) { WriteGuard l(x_this); m_aux[_h] = make_pair(_v.toBytes(), true); } h256Hash keys() const; protected: + mutable SharedMutex x_this; std::unordered_map> m_main; std::unordered_map> m_aux; diff --git a/libdevcrypto/OverlayDB.cpp b/libdevcrypto/OverlayDB.cpp index 87c8a0927..957c7f0e3 100644 --- a/libdevcrypto/OverlayDB.cpp +++ b/libdevcrypto/OverlayDB.cpp @@ -19,6 +19,7 @@ * @date 2014 */ +#include #include #include #include @@ -29,6 +30,8 @@ using namespace dev; namespace dev { +h256 const EmptyTrie = sha3(rlp("")); + OverlayDB::~OverlayDB() { if (m_db.use_count() == 1 && m_db.get()) @@ -41,30 +44,41 @@ void OverlayDB::commit() { ldb::WriteBatch batch; // cnote << "Committing nodes to disk DB:"; - for (auto const& i: m_main) + DEV_READ_GUARDED(x_this) { -// cnote << i.first << "#" << m_main[i.first].second; - if (i.second.second) - batch.Put(ldb::Slice((char const*)i.first.data(), i.first.size), ldb::Slice(i.second.first.data(), i.second.first.size())); - } - for (auto const& i: m_aux) - if (i.second.second) + for (auto const& i: m_main) { - bytes b = i.first.asBytes(); - b.push_back(255); // for aux - batch.Put(bytesConstRef(&b), bytesConstRef(&i.second.first)); + if (i.second.second) + batch.Put(ldb::Slice((char const*)i.first.data(), i.first.size), ldb::Slice(i.second.first.data(), i.second.first.size())); +// cnote << i.first << "#" << m_main[i.first].second; } - m_db->Write(m_writeOptions, &batch); + for (auto const& i: m_aux) + if (i.second.second) + { + bytes b = i.first.asBytes(); + b.push_back(255); // for aux + batch.Put(bytesConstRef(&b), bytesConstRef(&i.second.first)); + } + } + + while (true) + { + ldb::Status o = m_db->Write(m_writeOptions, &batch); + if (o.ok()) + break; + cwarn << "Error writing to database. Sleeping a while then retrying. If it keeps saying this, free up some space!"; + this_thread::sleep_for(chrono::milliseconds(500)); + } m_aux.clear(); m_main.clear(); } } -bytes OverlayDB::lookupAux(h256 _h) const +bytes OverlayDB::lookupAux(h256 const& _h) const { bytes ret = MemoryDB::lookupAux(_h); if (!ret.empty()) - return ret; + return move(ret); std::string v; bytes b = _h.asBytes(); b.push_back(255); // for aux @@ -76,18 +90,19 @@ bytes OverlayDB::lookupAux(h256 _h) const void OverlayDB::rollback() { + WriteGuard l(x_this); m_main.clear(); } -std::string OverlayDB::lookup(h256 _h) const +std::string OverlayDB::lookup(h256 const& _h) const { std::string ret = MemoryDB::lookup(_h); if (ret.empty() && m_db) m_db->Get(m_readOptions, ldb::Slice((char const*)_h.data(), 32), &ret); - return ret; + return move(ret); } -bool OverlayDB::exists(h256 _h) const +bool OverlayDB::exists(h256 const& _h) const { if (MemoryDB::exists(_h)) return true; @@ -97,16 +112,20 @@ bool OverlayDB::exists(h256 _h) const return !ret.empty(); } -void OverlayDB::kill(h256 _h) +void OverlayDB::kill(h256 const& _h) { -#if ETH_PARANOIA +#if ETH_PARANOIA || 1 if (!MemoryDB::kill(_h)) { std::string ret; if (m_db) m_db->Get(m_readOptions, ldb::Slice((char const*)_h.data(), 32), &ret); - if (ret.empty()) + // No point node ref decreasing for EmptyTrie since we never bother incrementing it in the first place for + // empty storage tries. + if (ret.empty() && _h != EmptyTrie) cnote << "Decreasing DB node ref count below zero with no DB node. Probably have a corrupt Trie." << _h; + + // TODO: for 1.1: ref-counted triedb. } #else MemoryDB::kill(_h); diff --git a/libdevcrypto/OverlayDB.h b/libdevcrypto/OverlayDB.h index 7f7736ac1..2e5428bdf 100644 --- a/libdevcrypto/OverlayDB.h +++ b/libdevcrypto/OverlayDB.h @@ -46,11 +46,11 @@ public: void commit(); void rollback(); - std::string lookup(h256 _h) const; - bool exists(h256 _h) const; - void kill(h256 _h); + std::string lookup(h256 const& _h) const; + bool exists(h256 const& _h) const; + void kill(h256 const& _h); - bytes lookupAux(h256 _h) const; + bytes lookupAux(h256 const& _h) const; private: using MemoryDB::clear; diff --git a/libdevcrypto/TrieDB.cpp b/libdevcrypto/TrieDB.cpp index 6f84a3e29..719bd74ad 100644 --- a/libdevcrypto/TrieDB.cpp +++ b/libdevcrypto/TrieDB.cpp @@ -25,6 +25,6 @@ using namespace std; using namespace dev; h256 const dev::c_shaNull = sha3(rlp("")); -h256 const dev::EmptyTrie = c_shaNull; +h256 const dev::EmptyTrie = sha3(rlp("")); const char* TrieDBChannel::name() { return "-T-"; } diff --git a/libdevcrypto/TrieDB.h b/libdevcrypto/TrieDB.h index ff2bcc589..29b412bab 100644 --- a/libdevcrypto/TrieDB.h +++ b/libdevcrypto/TrieDB.h @@ -79,7 +79,7 @@ public: void open(DB* _db) { m_db = _db; } void open(DB* _db, h256 const& _root, Verification _v = Verification::Normal) { m_db = _db; setRoot(_root, _v); } - void init() { setRoot(insertNode(&RLPNull)); assert(node(m_root).size()); } + void init() { setRoot(forceInsertNode(&RLPNull)); assert(node(m_root).size()); } void setRoot(h256 const& _root, Verification _v = Verification::Normal) { @@ -88,11 +88,13 @@ public: { if (m_root == c_shaNull && !m_db->exists(m_root)) init(); - - /*std::cout << "Setting root to " << _root << " (patched to " << m_root << ")" << std::endl;*/ + } + /*std::cout << "Setting root to " << _root << " (patched to " << m_root << ")" << std::endl;*/ +#if ETH_DEBUG + if (_v == Verification::Normal) +#endif if (!node(m_root).size()) BOOST_THROW_EXCEPTION(RootNotFound()); - } } /// True if the trie is uninitialised (i.e. that the DB doesn't contain the root node). @@ -282,11 +284,17 @@ private: std::string deref(RLP const& _n) const; std::string node(h256 _h) const { return m_db->lookup(_h); } - void insertNode(h256 _h, bytesConstRef _v) { m_db->insert(_h, _v); } - void killNode(h256 _h) { m_db->kill(_h); } - h256 insertNode(bytesConstRef _v) { auto h = sha3(_v); insertNode(h, _v); return h; } - void killNode(RLP const& _d) { if (_d.data().size() >= 32) killNode(sha3(_d.data())); } + // These are low-level node insertion functions that just go straight through into the DB. + h256 forceInsertNode(bytesConstRef _v) { auto h = sha3(_v); forceInsertNode(h, _v); return h; } + void forceInsertNode(h256 _h, bytesConstRef _v) { m_db->insert(_h, _v); } + void forceKillNode(h256 _h) { m_db->kill(_h); } + + // This are semantically-aware node insertion functions that only kills when the node's + // data is < 32 bytes. It can safely be used when pruning the trie but won't work correctly + // for the special case of the root (which is always looked up via a hash). In that case, + // use forceKillNode(). + void killNode(RLP const& _d) { if (_d.data().size() >= 32) forceKillNode(sha3(_d.data())); } h256 m_root; DB* m_db = nullptr; @@ -743,8 +751,8 @@ template void GenericTrieDB::insert(bytesConstRef _key, bytesCons // However, we know it's the root node and thus always hashed. // So, if it's less than 32 (and thus should have been deleted but wasn't) then we delete it here. if (rv.size() < 32) - killNode(m_root); - m_root = insertNode(&b); + forceKillNode(m_root); + m_root = forceInsertNode(&b); } template std::string GenericTrieDB::at(bytesConstRef _key) const @@ -890,8 +898,8 @@ template void GenericTrieDB::remove(bytesConstRef _key) if (b.size()) { if (rv.size() < 32) - killNode(m_root); - m_root = insertNode(&b); + forceKillNode(m_root); + m_root = forceInsertNode(&b); } } @@ -1081,7 +1089,7 @@ template RLPStream& GenericTrieDB::streamNode(RLPStream& _s, byte if (_b.size() < 32) _s.appendRaw(_b); else - _s.append(insertNode(&_b)); + _s.append(forceInsertNode(&_b)); return _s; } @@ -1122,7 +1130,7 @@ template bytes GenericTrieDB::graft(RLP const& _orig) // remove second item from the trie after derefrencing it into s & n. auto lh = _orig[1].toHash(); s = node(lh); - killNode(lh); + forceKillNode(lh); n = RLP(s); } assert(n.itemCount() == 2); diff --git a/libethereum/BlockChain.cpp b/libethereum/BlockChain.cpp index f13f83588..32a11ee53 100644 --- a/libethereum/BlockChain.cpp +++ b/libethereum/BlockChain.cpp @@ -466,7 +466,14 @@ ImportRoute BlockChain::import(bytes const& _block, OverlayDB const& _db, Import blb.blooms.push_back(s.receipt(i).bloom()); br.receipts.push_back(s.receipt(i)); } - s.cleanup(true); + try { + s.cleanup(true); + } + catch (BadRoot) + { + cwarn << "BadRoot error. Retrying import later."; + BOOST_THROW_EXCEPTION(FutureTime()); + } td = pd.totalDifficulty + tdIncrease; diff --git a/libethereum/Client.cpp b/libethereum/Client.cpp index a43c98aa2..6d934f3ad 100644 --- a/libethereum/Client.cpp +++ b/libethereum/Client.cpp @@ -164,7 +164,7 @@ const char* ClientDetail::name() { return EthTeal "⧫" EthCoal " ●"; } #endif Client::Client(p2p::Host* _extNet, std::string const& _dbPath, WithExisting _forceAction, u256 _networkId): - Worker("eth"), + Worker("eth", 0), m_vc(_dbPath), m_bc(_dbPath, max(m_vc.action(), _forceAction), [](unsigned d, unsigned t){ cerr << "REVISING BLOCKCHAIN: Processed " << d << " of " << t << "...\r"; }), m_gp(new TrivialGasPricer), diff --git a/libethereum/State.cpp b/libethereum/State.cpp index 584de461b..167d6236e 100644 --- a/libethereum/State.cpp +++ b/libethereum/State.cpp @@ -707,11 +707,21 @@ void State::cleanup(bool _fullCommit) { if (_fullCommit) { - paranoia("immediately before database commit", true); // Commit the new trie to disk. clog(StateTrace) << "Committing to disk: stateRoot" << m_currentBlock.stateRoot << "=" << rootHash() << "=" << toHex(asBytes(m_db.lookup(rootHash()))); + + try { + EnforceRefs er(m_db, true); + rootHash(); + } + catch (BadRoot const&) + { + clog(StateChat) << "Trie corrupt! :-("; + throw; + } + m_db.commit(); clog(StateTrace) << "Committed: stateRoot" << m_currentBlock.stateRoot << "=" << rootHash() << "=" << toHex(asBytes(m_db.lookup(rootHash()))); diff --git a/test/libdevcrypto/trie.cpp b/test/libdevcrypto/trie.cpp index 3b3fa1dd2..d41739a01 100644 --- a/test/libdevcrypto/trie.cpp +++ b/test/libdevcrypto/trie.cpp @@ -102,10 +102,13 @@ BOOST_AUTO_TEST_CASE(hex_encoded_securetrie_test) { next_permutation(ss.begin(), ss.end()); MemoryDB m; + EnforceRefs r(m, true); GenericTrieDB t(&m); MemoryDB hm; + EnforceRefs hr(hm, true); HashedGenericTrieDB ht(&hm); MemoryDB fm; + EnforceRefs fr(fm, true); FatGenericTrieDB ft(&fm); t.init(); ht.init(); @@ -164,10 +167,13 @@ BOOST_AUTO_TEST_CASE(trie_test_anyorder) { next_permutation(ss.begin(), ss.end()); MemoryDB m; + EnforceRefs r(m, true); GenericTrieDB t(&m); MemoryDB hm; + EnforceRefs hr(hm, true); HashedGenericTrieDB ht(&hm); MemoryDB fm; + EnforceRefs fr(fm, true); FatGenericTrieDB ft(&fm); t.init(); ht.init(); @@ -244,10 +250,13 @@ BOOST_AUTO_TEST_CASE(trie_tests_ordered) } MemoryDB m; + EnforceRefs r(m, true); GenericTrieDB t(&m); MemoryDB hm; + EnforceRefs hr(hm, true); HashedGenericTrieDB ht(&hm); MemoryDB fm; + EnforceRefs fr(fm, true); FatGenericTrieDB ft(&fm); t.init(); ht.init(); @@ -360,6 +369,7 @@ BOOST_AUTO_TEST_CASE(moreTrieTests) #endif { MemoryDB m; + EnforceRefs r(m, true); GenericTrieDB d(&m); d.init(); // initialise as empty tree. MemTrie t; From 6978731367a1fe1caec11abaaaeea92349125c8a Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Wed, 13 May 2015 00:36:13 +0300 Subject: [PATCH 166/461] Bump. --- libdevcore/Common.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libdevcore/Common.cpp b/libdevcore/Common.cpp index 06950cbee..6723ab76d 100644 --- a/libdevcore/Common.cpp +++ b/libdevcore/Common.cpp @@ -28,7 +28,7 @@ using namespace dev; namespace dev { -char const* Version = "0.9.18"; +char const* Version = "0.9.19"; const u256 UndefinedU256 = ~(u256)0; From 44cd78d647c0d6162ceda1bd2724983047d46b9c Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Wed, 13 May 2015 10:14:34 +0200 Subject: [PATCH 167/461] Improve getpass() usage As can be seen from: http://unixhelp.ed.ac.uk/CGI/man-cgi?getpass+3 getpass() is a deprecated function and it's advised not to use it. What's more all signals are disabled so (SIGINT, SIGQUIT, SIGSTOP, SIGTSTOP) will do nothing and as such if the user wants to quit the program while typing the password in the password loop he is out of luck. With this commit we get a manual version of getpass(), inspired by this SO answer: http://stackoverflow.com/a/1196696/110395 --- libdevcore/CommonIO.cpp | 28 +++++++++++++++++++++++++++- libdevcore/Exceptions.h | 1 + 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/libdevcore/CommonIO.cpp b/libdevcore/CommonIO.cpp index 80ad7ecf9..10c53ddb9 100644 --- a/libdevcore/CommonIO.cpp +++ b/libdevcore/CommonIO.cpp @@ -24,6 +24,9 @@ #include #include #include "Exceptions.h" +#ifndef _WIN32 +#include +#endif using namespace std; using namespace dev; @@ -126,6 +129,29 @@ std::string dev::getPassword(std::string const& _prompt) std::getline(cin, ret); return ret; #else - return getpass(_prompt.c_str()); + struct termios oflags; + struct termios nflags; + char password[128]; + + // disable echo in the terminal + tcgetattr(fileno(stdin), &oflags); + nflags = oflags; + nflags.c_lflag &= ~ECHO; + nflags.c_lflag |= ECHONL; + + if (tcsetattr(fileno(stdin), TCSANOW, &nflags) != 0) + BOOST_THROW_EXCEPTION(ExternalFunctionFailure("tcsetattr")); + + printf("%s", _prompt.c_str()); + if (!fgets(password, sizeof(password), stdin)) + BOOST_THROW_EXCEPTION(ExternalFunctionFailure("fgets")); + password[strlen(password) - 1] = 0; + + // restore terminal + if (tcsetattr(fileno(stdin), TCSANOW, &oflags) != 0) { + BOOST_THROW_EXCEPTION(ExternalFunctionFailure("tcsetattr")); + } + + return password; #endif } diff --git a/libdevcore/Exceptions.h b/libdevcore/Exceptions.h index 36c624a71..025568efa 100644 --- a/libdevcore/Exceptions.h +++ b/libdevcore/Exceptions.h @@ -54,6 +54,7 @@ struct FileError: virtual Exception {}; struct Overflow: virtual Exception {}; struct InterfaceNotSupported: virtual Exception { public: InterfaceNotSupported(std::string _f): Exception("Interface " + _f + " not supported.") {} }; struct FailedInvariant: virtual Exception {}; +struct ExternalFunctionFailure: virtual Exception { public: ExternalFunctionFailure(std::string _f): Exception("Function " + _f + "() failed.") {} }; // error information to be added to exceptions using errinfo_invalidSymbol = boost::error_info; From 6439506e376c3876ef15ff779b7772b362a4011d Mon Sep 17 00:00:00 2001 From: subtly Date: Wed, 13 May 2015 10:32:22 +0200 Subject: [PATCH 168/461] Fix for when macos doesn't set HOME environment variable. --- libdevcrypto/FileSystem.cpp | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/libdevcrypto/FileSystem.cpp b/libdevcrypto/FileSystem.cpp index ed054553d..e3b8c6e3f 100644 --- a/libdevcrypto/FileSystem.cpp +++ b/libdevcrypto/FileSystem.cpp @@ -25,8 +25,13 @@ #include #include -#ifdef _WIN32 +#if defined(_WIN32) #include +#elif defined(__APPLE__) +#include +#include +#include +#include #endif #include using namespace std; @@ -51,6 +56,15 @@ std::string dev::getDataDir(std::string _prefix) #else boost::filesystem::path dataDirPath; char const* homeDir = getenv("HOME"); +#if defined(__APPLE__) + if (!homeDir || strlen(homeDir) == 0) + { + struct passwd* pwd = getpwuid(getuid()); + if (pwd) + homeDir = pwd->pw_dir; + } +#endif + if (!homeDir || strlen(homeDir) == 0) dataDirPath = boost::filesystem::path("/"); else From 1aabac3cfcf8cfdfbfa86c60f8e707feb41c5a06 Mon Sep 17 00:00:00 2001 From: subtly Date: Wed, 13 May 2015 10:37:43 +0200 Subject: [PATCH 169/461] Increase frequency of node discovery by factor of 8 (random lookup every 7 seconds). --- libp2p/NodeTable.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libp2p/NodeTable.h b/libp2p/NodeTable.h index 2e10dd891..de139b683 100644 --- a/libp2p/NodeTable.h +++ b/libp2p/NodeTable.h @@ -186,7 +186,7 @@ private: /* todo: replace boost::posix_time; change constants to upper camelcase */ boost::posix_time::milliseconds const c_evictionCheckInterval = boost::posix_time::milliseconds(75); ///< Interval at which eviction timeouts are checked. std::chrono::milliseconds const c_reqTimeout = std::chrono::milliseconds(300); ///< How long to wait for requests (evict, find iterations). - std::chrono::milliseconds const c_bucketRefresh = std::chrono::milliseconds(57600); ///< Refresh interval prevents bucket from becoming stale. [Kademlia] + std::chrono::milliseconds const c_bucketRefresh = std::chrono::milliseconds(7200); ///< Refresh interval prevents bucket from becoming stale. [Kademlia] struct NodeBucket { From 13898c57e7a708ceb27294162b3b12127ae39558 Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Wed, 13 May 2015 10:38:23 +0200 Subject: [PATCH 170/461] style --- .../stPreCompiledContractsFiller.json | 1224 ++++++++--------- 1 file changed, 612 insertions(+), 612 deletions(-) diff --git a/test/libethereum/StateTestsFiller/stPreCompiledContractsFiller.json b/test/libethereum/StateTestsFiller/stPreCompiledContractsFiller.json index 41f5bc345..87e6df3cf 100644 --- a/test/libethereum/StateTestsFiller/stPreCompiledContractsFiller.json +++ b/test/libethereum/StateTestsFiller/stPreCompiledContractsFiller.json @@ -1,14 +1,14 @@ { "CallEcrecover0": { - "env" : { - "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", - "currentNumber" : "0", - "currentGasLimit" : "10000000", - "currentDifficulty" : "256", - "currentTimestamp" : 1, - "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" - }, - "expect" : { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "10000000", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "expect" : { "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { "storage" : { "0x" : "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", @@ -16,14 +16,14 @@ "0x02" : "0x01" } } - }, - "pre" : { - "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { - "balance" : "20000000", - "nonce" : "0", - "code": "{ (MSTORE 0 0x18c547e4f7b0f325ad1e56f57e26c745b09a3e503d86e00e5255ff7f715d3d1c) (MSTORE 32 28) (MSTORE 64 0x73b1693892219d736caba55bdb67216e485557ea6b6af75f37096c9aa6a5a75f) (MSTORE 96 0xeeb940b1d03b21e36b0e47e79769f095fe2ab855bd91e3a38756b7d75a9c4549) [[ 2 ]] (CALL 300000 1 0 0 128 128 32) [[ 0 ]] (MOD (MLOAD 128) (EXP 2 160)) [[ 1 ]] (EQ (ORIGIN) (SLOAD 0)) }", - "storage": {} - }, + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "20000000", + "nonce" : "0", + "code": "{ (MSTORE 0 0x18c547e4f7b0f325ad1e56f57e26c745b09a3e503d86e00e5255ff7f715d3d1c) (MSTORE 32 28) (MSTORE 64 0x73b1693892219d736caba55bdb67216e485557ea6b6af75f37096c9aa6a5a75f) (MSTORE 96 0xeeb940b1d03b21e36b0e47e79769f095fe2ab855bd91e3a38756b7d75a9c4549) [[ 2 ]] (CALL 300000 1 0 0 128 128 32) [[ 0 ]] (MOD (MLOAD 128) (EXP 2 160)) [[ 1 ]] (EQ (ORIGIN) (SLOAD 0)) }", + "storage": {} + }, "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { "balance" : "1000000000000000000", "nonce" : "0", @@ -40,18 +40,18 @@ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", "data" : "" } - }, + }, "CallEcrecover0_overlappingInputOutput": { - "env" : { - "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", - "currentNumber" : "0", - "currentGasLimit" : "10000000", - "currentDifficulty" : "256", - "currentTimestamp" : 1, - "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" - }, - "expect" : { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "10000000", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "expect" : { "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { "storage" : { "0x" : "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", @@ -59,14 +59,14 @@ "0x02" : "0x01" } } - }, - "pre" : { - "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { - "balance" : "20000000", - "nonce" : "0", - "code": "{ (MSTORE 0 0x18c547e4f7b0f325ad1e56f57e26c745b09a3e503d86e00e5255ff7f715d3d1c) (MSTORE 32 28) (MSTORE 64 0x73b1693892219d736caba55bdb67216e485557ea6b6af75f37096c9aa6a5a75f) (MSTORE 96 0xeeb940b1d03b21e36b0e47e79769f095fe2ab855bd91e3a38756b7d75a9c4549) [[ 2 ]] (CALL 300000 1 0 0 128 64 32) [[ 0 ]] (MOD (MLOAD 64) (EXP 2 160)) [[ 1 ]] (EQ (ORIGIN) (SLOAD 0)) }", - "storage": {} - }, + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "20000000", + "nonce" : "0", + "code": "{ (MSTORE 0 0x18c547e4f7b0f325ad1e56f57e26c745b09a3e503d86e00e5255ff7f715d3d1c) (MSTORE 32 28) (MSTORE 64 0x73b1693892219d736caba55bdb67216e485557ea6b6af75f37096c9aa6a5a75f) (MSTORE 96 0xeeb940b1d03b21e36b0e47e79769f095fe2ab855bd91e3a38756b7d75a9c4549) [[ 2 ]] (CALL 300000 1 0 0 128 64 32) [[ 0 ]] (MOD (MLOAD 64) (EXP 2 160)) [[ 1 ]] (EQ (ORIGIN) (SLOAD 0)) }", + "storage": {} + }, "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { "balance" : "1000000000000000000", "nonce" : "0", @@ -83,33 +83,33 @@ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", "data" : "" } - }, + }, "CallEcrecover0_completeReturnValue": { - "env" : { - "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", - "currentNumber" : "0", - "currentGasLimit" : "10000000", - "currentDifficulty" : "256", - "currentTimestamp" : 1, - "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" - }, - "expect" : { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "10000000", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "expect" : { "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { "storage" : { "0x" : "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", "0x02" : "0x01" } } - }, - "pre" : { - "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { - "balance" : "20000000", - "nonce" : "0", - "code": "{ (MSTORE 0 0x18c547e4f7b0f325ad1e56f57e26c745b09a3e503d86e00e5255ff7f715d3d1c) (MSTORE 32 28) (MSTORE 64 0x73b1693892219d736caba55bdb67216e485557ea6b6af75f37096c9aa6a5a75f) (MSTORE 96 0xeeb940b1d03b21e36b0e47e79769f095fe2ab855bd91e3a38756b7d75a9c4549) [[ 2 ]] (CALL 3000 1 0 0 128 128 32) [[ 0 ]] (MLOAD 128) }", - "storage": {} - }, + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "20000000", + "nonce" : "0", + "code": "{ (MSTORE 0 0x18c547e4f7b0f325ad1e56f57e26c745b09a3e503d86e00e5255ff7f715d3d1c) (MSTORE 32 28) (MSTORE 64 0x73b1693892219d736caba55bdb67216e485557ea6b6af75f37096c9aa6a5a75f) (MSTORE 96 0xeeb940b1d03b21e36b0e47e79769f095fe2ab855bd91e3a38756b7d75a9c4549) [[ 2 ]] (CALL 3000 1 0 0 128 128 32) [[ 0 ]] (MLOAD 128) }", + "storage": {} + }, "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { "balance" : "1000000000000000000", "nonce" : "0", @@ -126,18 +126,18 @@ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", "data" : "" } - }, + }, "CallEcrecover0_gas3000": { - "env" : { - "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", - "currentNumber" : "0", - "currentGasLimit" : "10000000", - "currentDifficulty" : "256", - "currentTimestamp" : 1, - "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" - }, - "expect" : { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "10000000", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "expect" : { "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { "storage" : { "0x" : "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", @@ -145,14 +145,14 @@ "0x02" : "0x01" } } - }, - "pre" : { - "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { - "balance" : "20000000", - "nonce" : "0", - "code": "{ (MSTORE 0 0x18c547e4f7b0f325ad1e56f57e26c745b09a3e503d86e00e5255ff7f715d3d1c) (MSTORE 32 28) (MSTORE 64 0x73b1693892219d736caba55bdb67216e485557ea6b6af75f37096c9aa6a5a75f) (MSTORE 96 0xeeb940b1d03b21e36b0e47e79769f095fe2ab855bd91e3a38756b7d75a9c4549) [[ 2 ]] (CALL 3000 1 0 0 128 128 32) [[ 0 ]] (MOD (MLOAD 128) (EXP 2 160)) [[ 1 ]] (EQ (ORIGIN) (SLOAD 0)) }", - "storage": {} - }, + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "20000000", + "nonce" : "0", + "code": "{ (MSTORE 0 0x18c547e4f7b0f325ad1e56f57e26c745b09a3e503d86e00e5255ff7f715d3d1c) (MSTORE 32 28) (MSTORE 64 0x73b1693892219d736caba55bdb67216e485557ea6b6af75f37096c9aa6a5a75f) (MSTORE 96 0xeeb940b1d03b21e36b0e47e79769f095fe2ab855bd91e3a38756b7d75a9c4549) [[ 2 ]] (CALL 3000 1 0 0 128 128 32) [[ 0 ]] (MOD (MLOAD 128) (EXP 2 160)) [[ 1 ]] (EQ (ORIGIN) (SLOAD 0)) }", + "storage": {} + }, "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { "balance" : "1000000000000000000", "nonce" : "0", @@ -169,30 +169,30 @@ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", "data" : "" } - }, + }, "CallEcrecover0_BonusGas": { - "env" : { - "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", - "currentNumber" : "0", - "currentGasLimit" : "10000000", - "currentDifficulty" : "256", - "currentTimestamp" : 1, - "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" - }, - "expect" : { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "10000000", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "expect" : { "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { "storage" : { } } - }, - "pre" : { - "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { - "balance" : "20000000", - "nonce" : "0", - "code": "{ (MSTORE 0 0x18c547e4f7b0f325ad1e56f57e26c745b09a3e503d86e00e5255ff7f715d3d1c) (MSTORE 32 28) (MSTORE 64 0x73b1693892219d736caba55bdb67216e485557ea6b6af75f37096c9aa6a5a75f) (MSTORE 96 0xeeb940b1d03b21e36b0e47e79769f095fe2ab855bd91e3a38756b7d75a9c4549) [[ 2 ]] (CALL 0 1 1 0 128 128 32) [[ 0 ]] (MOD (MLOAD 128) (EXP 2 160)) [[ 1 ]] (EQ (ORIGIN) (SLOAD 0)) }", - "storage": {} - }, + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "20000000", + "nonce" : "0", + "code": "{ (MSTORE 0 0x18c547e4f7b0f325ad1e56f57e26c745b09a3e503d86e00e5255ff7f715d3d1c) (MSTORE 32 28) (MSTORE 64 0x73b1693892219d736caba55bdb67216e485557ea6b6af75f37096c9aa6a5a75f) (MSTORE 96 0xeeb940b1d03b21e36b0e47e79769f095fe2ab855bd91e3a38756b7d75a9c4549) [[ 2 ]] (CALL 0 1 1 0 128 128 32) [[ 0 ]] (MOD (MLOAD 128) (EXP 2 160)) [[ 1 ]] (EQ (ORIGIN) (SLOAD 0)) }", + "storage": {} + }, "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { "balance" : "1000000000000000000", "nonce" : "0", @@ -209,30 +209,30 @@ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", "data" : "" } - }, + }, "CallEcrecover0_Gas2999": { - "env" : { - "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", - "currentNumber" : "0", - "currentGasLimit" : "10000000", - "currentDifficulty" : "256", - "currentTimestamp" : 1, - "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" - }, - "expect" : { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "10000000", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "expect" : { "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { "storage" : { } } - }, - "pre" : { - "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { - "balance" : "20000000", - "nonce" : "0", - "code": "{ (MSTORE 0 0x18c547e4f7b0f325ad1e56f57e26c745b09a3e503d86e00e5255ff7f715d3d1c) (MSTORE 32 28) (MSTORE 64 0x73b1693892219d736caba55bdb67216e485557ea6b6af75f37096c9aa6a5a75f) (MSTORE 96 0xeeb940b1d03b21e36b0e47e79769f095fe2ab855bd91e3a38756b7d75a9c4549) [[ 2 ]] (CALL 2999 1 0 0 128 128 32) [[ 0 ]] (MOD (MLOAD 128) (EXP 2 160)) [[ 1 ]] (EQ (ORIGIN) (SLOAD 0)) }", - "storage": {} - }, + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "20000000", + "nonce" : "0", + "code": "{ (MSTORE 0 0x18c547e4f7b0f325ad1e56f57e26c745b09a3e503d86e00e5255ff7f715d3d1c) (MSTORE 32 28) (MSTORE 64 0x73b1693892219d736caba55bdb67216e485557ea6b6af75f37096c9aa6a5a75f) (MSTORE 96 0xeeb940b1d03b21e36b0e47e79769f095fe2ab855bd91e3a38756b7d75a9c4549) [[ 2 ]] (CALL 2999 1 0 0 128 128 32) [[ 0 ]] (MOD (MLOAD 128) (EXP 2 160)) [[ 1 ]] (EQ (ORIGIN) (SLOAD 0)) }", + "storage": {} + }, "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { "balance" : "1000000000000000000", "nonce" : "0", @@ -249,31 +249,31 @@ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", "data" : "" } - }, + }, "CallEcrecover0_0input": { - "env" : { - "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", - "currentNumber" : "0", - "currentGasLimit" : "10000000", - "currentDifficulty" : "256", - "currentTimestamp" : 1, - "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" - }, - "expect" : { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "10000000", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "expect" : { "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { "storage" : { "0x02" : "0x01" } } - }, - "pre" : { - "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { - "balance" : "20000000", - "nonce" : "0", - "code": "{ [[ 2 ]] (CALL 300000 1 0 0 128 128 32) [[ 0 ]] (MOD (MLOAD 128) (EXP 2 160)) }", - "storage": {} - }, + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "20000000", + "nonce" : "0", + "code": "{ [[ 2 ]] (CALL 300000 1 0 0 128 128 32) [[ 0 ]] (MOD (MLOAD 128) (EXP 2 160)) }", + "storage": {} + }, "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { "balance" : "1000000000000000000", "nonce" : "0", @@ -290,31 +290,31 @@ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", "data" : "" } - }, + }, "CallEcrecover1": { - "env" : { - "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", - "currentNumber" : "0", - "currentGasLimit" : "10000000", - "currentDifficulty" : "256", - "currentTimestamp" : 1, - "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" - }, - "expect" : { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "10000000", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "expect" : { "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { "storage" : { "0x02" : "0x01" } } - }, - "pre" : { - "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { - "balance" : "20000000", - "nonce" : "0", - "code": "{ (MSTORE 0 0x18c547e4f7b0f325ad1e56f57e26c745b09a3e503d86e00e5255ff7f715d3d1c) (MSTORE 32 1) (MSTORE 64 0x73b1693892219d736caba55bdb67216e485557ea6b6af75f37096c9aa6a5a75f) (MSTORE 96 0xeeb940b1d03b21e36b0e47e79769f095fe2ab855bd91e3a38756b7d75a9c4549) [[ 2 ]] (CALL 100000 1 0 0 128 128 32) [[ 0 ]] (MOD (MLOAD 128) (EXP 2 160)) [[ 1 ]] (EQ (ORIGIN) (SLOAD 0)) }", - "storage": {} - }, + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "20000000", + "nonce" : "0", + "code": "{ (MSTORE 0 0x18c547e4f7b0f325ad1e56f57e26c745b09a3e503d86e00e5255ff7f715d3d1c) (MSTORE 32 1) (MSTORE 64 0x73b1693892219d736caba55bdb67216e485557ea6b6af75f37096c9aa6a5a75f) (MSTORE 96 0xeeb940b1d03b21e36b0e47e79769f095fe2ab855bd91e3a38756b7d75a9c4549) [[ 2 ]] (CALL 100000 1 0 0 128 128 32) [[ 0 ]] (MOD (MLOAD 128) (EXP 2 160)) [[ 1 ]] (EQ (ORIGIN) (SLOAD 0)) }", + "storage": {} + }, "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { "balance" : "1000000000000000000", "nonce" : "0", @@ -331,31 +331,31 @@ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", "data" : "" } - }, + }, "CallEcrecover2": { - "env" : { - "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", - "currentNumber" : "0", - "currentGasLimit" : "10000000", - "currentDifficulty" : "256", - "currentTimestamp" : 1, - "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" - }, - "expect" : { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "10000000", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "expect" : { "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { "storage" : { "0x02" : "0x01" } } - }, - "pre" : { - "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { - "balance" : "20000000", - "nonce" : "0", - "code": "{ (MSTORE 0 0x18c547e4f7b0f325ad1e56f57e26c745b09a3e503d86e00e5255ff7f715d3d1c) (MSTORE 32 28) (MSTORE 33 0x73b1693892219d736caba55bdb67216e485557ea6b6af75f37096c9aa6a5a75f) (MSTORE 65 0xeeb940b1d03b21e36b0e47e79769f095fe2ab855bd91e3a38756b7d75a9c4549) [[ 2 ]] (CALL 100000 1 0 0 97 97 32) [[ 0 ]] (MOD (MLOAD 97) (EXP 2 160)) [[ 1 ]] (EQ (ORIGIN) (SLOAD 0)) }", - "storage": {} - }, + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "20000000", + "nonce" : "0", + "code": "{ (MSTORE 0 0x18c547e4f7b0f325ad1e56f57e26c745b09a3e503d86e00e5255ff7f715d3d1c) (MSTORE 32 28) (MSTORE 33 0x73b1693892219d736caba55bdb67216e485557ea6b6af75f37096c9aa6a5a75f) (MSTORE 65 0xeeb940b1d03b21e36b0e47e79769f095fe2ab855bd91e3a38756b7d75a9c4549) [[ 2 ]] (CALL 100000 1 0 0 97 97 32) [[ 0 ]] (MOD (MLOAD 97) (EXP 2 160)) [[ 1 ]] (EQ (ORIGIN) (SLOAD 0)) }", + "storage": {} + }, "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { "balance" : "1000000000000000000", "nonce" : "0", @@ -372,32 +372,32 @@ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", "data" : "" } - }, + }, "CallEcrecover3": { - "env" : { - "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", - "currentNumber" : "0", - "currentGasLimit" : "10000000", - "currentDifficulty" : "256", - "currentTimestamp" : 1, - "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" - }, - "expect" : { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "10000000", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "expect" : { "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { "storage" : { "0x" : "0xe4319f4b631c6d0fcfc84045dbcb676865fe5e13", "0x02" : "0x01" } } - }, - "pre" : { - "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { - "balance" : "20000000", - "nonce" : "0", - "code": "{ (MSTORE 0 0x2f380a2dea7e778d81affc2443403b8fe4644db442ae4862ff5bb3732829cdb9) (MSTORE 32 27) (MSTORE 64 0x6b65ccb0558806e9b097f27a396d08f964e37b8b7af6ceeb516ff86739fbea0a) (MSTORE 96 0x37cbc8d883e129a4b1ef9d5f1df53c4f21a3ef147cf2a50a4ede0eb06ce092d4) [[ 2 ]] (CALL 100000 1 0 0 128 128 32) [[ 0 ]] (MOD (MLOAD 128) (EXP 2 160)) [[ 1 ]] (EQ (ORIGIN) (SLOAD 0)) }", - "storage": {} - }, + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "20000000", + "nonce" : "0", + "code": "{ (MSTORE 0 0x2f380a2dea7e778d81affc2443403b8fe4644db442ae4862ff5bb3732829cdb9) (MSTORE 32 27) (MSTORE 64 0x6b65ccb0558806e9b097f27a396d08f964e37b8b7af6ceeb516ff86739fbea0a) (MSTORE 96 0x37cbc8d883e129a4b1ef9d5f1df53c4f21a3ef147cf2a50a4ede0eb06ce092d4) [[ 2 ]] (CALL 100000 1 0 0 128 128 32) [[ 0 ]] (MOD (MLOAD 128) (EXP 2 160)) [[ 1 ]] (EQ (ORIGIN) (SLOAD 0)) }", + "storage": {} + }, "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { "balance" : "1000000000000000000", "nonce" : "0", @@ -414,31 +414,31 @@ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", "data" : "" } - }, + }, "CallSha256_0": { - "env" : { - "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", - "currentNumber" : "0", - "currentGasLimit" : "10000000", - "currentDifficulty" : "256", - "currentTimestamp" : 1, - "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" - }, - "expect" : { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "10000000", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "expect" : { "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { "storage" : { "0x" : "0xec4916dd28fc4c10d78e287ca5d9cc51ee1ae73cbfde08c6b37324cbfaac8bc5" } } - }, - "pre" : { - "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { - "balance" : "20000000", - "nonce" : "0", - "code" : "0x600160005260206000602060006000600260fff1600051600055", - "storage": {} - }, + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "20000000", + "nonce" : "0", + "code" : "0x600160005260206000602060006000600260fff1600051600055", + "storage": {} + }, "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { "balance" : "1000000000000000000", "nonce" : "0", @@ -455,32 +455,32 @@ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", "data" : "" } - }, + }, "CallSha256_1": { - "env" : { - "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", - "currentNumber" : "0", - "currentGasLimit" : "10000000", - "currentDifficulty" : "256", - "currentTimestamp" : 1, - "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" - }, - "expect" : { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "10000000", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "expect" : { "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { "storage" : { "0x" : "0xe3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "0x02" : "0x01" } } - }, - "pre" : { - "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { - "balance" : "20000000", - "nonce" : "0", - "code" : "{ [[ 2 ]] (CALL 500 2 0 0 0 0 32) [[ 0 ]] (MLOAD 0)}", - "storage": {} - }, + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "20000000", + "nonce" : "0", + "code" : "{ [[ 2 ]] (CALL 500 2 0 0 0 0 32) [[ 0 ]] (MLOAD 0)}", + "storage": {} + }, "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { "balance" : "1000000000000000000", "nonce" : "0", @@ -497,18 +497,18 @@ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", "data" : "" } - }, + }, "CallSha256_1_nonzeroValue": { - "env" : { - "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", - "currentNumber" : "0", - "currentGasLimit" : "100000000", - "currentDifficulty" : "256", - "currentTimestamp" : 1, - "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" - }, - "expect" : { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "100000000", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "expect" : { "0000000000000000000000000000000000000002" : { "balance" : "19" }, @@ -518,14 +518,14 @@ "0x02" : "0x01" } } - }, - "pre" : { - "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { - "balance" : "200000000", - "nonce" : "0", - "code" : "{ [[ 2 ]] (CALL 200000 2 0x13 0 0 0 32) [[ 0 ]] (MLOAD 0)}", - "storage": {} - }, + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "200000000", + "nonce" : "0", + "code" : "{ [[ 2 ]] (CALL 200000 2 0x13 0 0 0 32) [[ 0 ]] (MLOAD 0)}", + "storage": {} + }, "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { "balance" : "1000000000000000000", "nonce" : "0", @@ -542,32 +542,32 @@ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", "data" : "" } - }, + }, "CallSha256_2": { - "env" : { - "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", - "currentNumber" : "0", - "currentGasLimit" : "10000000", - "currentDifficulty" : "256", - "currentTimestamp" : 1, - "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" - }, - "expect" : { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "10000000", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "expect" : { "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { "storage" : { "0x" : "0xcb39b3bde22925b2f931111130c774761d8895e0e08437c9b396c1e97d10f34d", "0x02" : "0x01" } } - }, - "pre" : { - "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { - "balance" : "20000000", - "nonce" : "0", - "code" : "{ (MSTORE 5 0xf34578907f) [[ 2 ]] (CALL 500 2 0 0 37 0 32) [[ 0 ]] (MLOAD 0)}", - "storage": {} - }, + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "20000000", + "nonce" : "0", + "code" : "{ (MSTORE 5 0xf34578907f) [[ 2 ]] (CALL 500 2 0 0 37 0 32) [[ 0 ]] (MLOAD 0)}", + "storage": {} + }, "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { "balance" : "1000000000000000000", "nonce" : "0", @@ -584,32 +584,32 @@ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", "data" : "" } - }, + }, "CallSha256_3": { - "env" : { - "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", - "currentNumber" : "0", - "currentGasLimit" : "10000000", - "currentDifficulty" : "256", - "currentTimestamp" : 1, - "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" - }, - "expect" : { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "10000000", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "expect" : { "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { "storage" : { "0x" : "0x7392925565d67be8e9620aacbcfaecd8cb6ec58d709d25da9eccf1d08a41ce35", "0x02" : "0x01" } } - }, - "pre" : { - "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { - "balance" : "20000000", - "nonce" : "0", - "code" : "{ (MSTORE 0 0xf34578907f) [[ 2 ]] (CALL 500 2 0 0 37 0 32) [[ 0 ]] (MLOAD 0)}", - "storage": {} - }, + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "20000000", + "nonce" : "0", + "code" : "{ (MSTORE 0 0xf34578907f) [[ 2 ]] (CALL 500 2 0 0 37 0 32) [[ 0 ]] (MLOAD 0)}", + "storage": {} + }, "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { "balance" : "1000000000000000000", "nonce" : "0", @@ -626,32 +626,32 @@ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", "data" : "" } - }, + }, "CallSha256_4": { - "env" : { - "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", - "currentNumber" : "0", - "currentGasLimit" : "10000000", - "currentDifficulty" : "256", - "currentTimestamp" : 1, - "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" - }, - "expect" : { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "10000000", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "expect" : { "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { "storage" : { "0x" : "0xaf9613760f72635fbdb44a5a0a63c39f12af30f950a6ee5c971be188e89c4051", "0x02" : "0x01" } } - }, - "pre" : { - "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { - "balance" : "20000000", - "nonce" : "0", - "code" : "{ (MSTORE 0 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) [[ 2 ]] (CALL 100 2 0 0 32 0 32) [[ 0 ]] (MLOAD 0)}", - "storage": {} - }, + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "20000000", + "nonce" : "0", + "code" : "{ (MSTORE 0 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) [[ 2 ]] (CALL 100 2 0 0 32 0 32) [[ 0 ]] (MLOAD 0)}", + "storage": {} + }, "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { "balance" : "1000000000000000000", "nonce" : "0", @@ -668,32 +668,32 @@ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", "data" : "" } - }, + }, "CallSha256_4_gas99": { - "env" : { - "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", - "currentNumber" : "0", - "currentGasLimit" : "10000000", - "currentDifficulty" : "256", - "currentTimestamp" : 1, - "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" - }, - "expect" : { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "10000000", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "expect" : { "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { "storage" : { "0x" : "0xaf9613760f72635fbdb44a5a0a63c39f12af30f950a6ee5c971be188e89c4051", "0x02" : "0x01" } } - }, - "pre" : { - "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { - "balance" : "20000000", - "nonce" : "0", - "code" : "{ (MSTORE 0 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) [[ 2 ]] (CALL 99 2 0 0 32 0 32) [[ 0 ]] (MLOAD 0)}", - "storage": {} - }, + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "20000000", + "nonce" : "0", + "code" : "{ (MSTORE 0 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) [[ 2 ]] (CALL 99 2 0 0 32 0 32) [[ 0 ]] (MLOAD 0)}", + "storage": {} + }, "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { "balance" : "1000000000000000000", "nonce" : "0", @@ -710,31 +710,31 @@ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", "data" : "" } - }, + }, "CallSha256_5": { - "env" : { - "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", - "currentNumber" : "0", - "currentGasLimit" : "10000000", - "currentDifficulty" : "256", - "currentTimestamp" : 1, - "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" - }, - "expect" : { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "10000000", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "expect" : { "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { "storage" : { "0x" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" } } - }, - "pre" : { - "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { - "balance" : "20000000", - "nonce" : "0", - "code" : "{ (MSTORE 0 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) [[ 2 ]] (CALL 600 2 0 0 1000000 0 32) [[ 0 ]] (MLOAD 0)}", - "storage": {} - }, + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "20000000", + "nonce" : "0", + "code" : "{ (MSTORE 0 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) [[ 2 ]] (CALL 600 2 0 0 1000000 0 32) [[ 0 ]] (MLOAD 0)}", + "storage": {} + }, "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { "balance" : "1000000000000000000", "nonce" : "0", @@ -751,31 +751,31 @@ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", "data" : "" } - }, + }, "CallRipemd160_0": { - "env" : { - "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", - "currentNumber" : "0", - "currentGasLimit" : "10000000", - "currentDifficulty" : "256", - "currentTimestamp" : 1, - "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" - }, - "expect" : { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "10000000", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "expect" : { "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { "storage" : { "0x" : "0x01" } } - }, - "pre" : { - "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { - "balance" : "20000000", - "nonce" : "0", - "code" : "0x600160005260206000602060006000600360fff1600051600055", - "storage": {} - }, + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "20000000", + "nonce" : "0", + "code" : "0x600160005260206000602060006000600360fff1600051600055", + "storage": {} + }, "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { "balance" : "1000000000000000000", "nonce" : "0", @@ -792,32 +792,32 @@ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", "data" : "" } - }, + }, "CallRipemd160_1": { - "env" : { - "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", - "currentNumber" : "0", - "currentGasLimit" : "10000000", - "currentDifficulty" : "256", - "currentTimestamp" : 1, - "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" - }, - "expect" : { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "10000000", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "expect" : { "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { "storage" : { "0x" : "0x9c1185a5c5e9fc54612808977ee8f548b2258d31", "0x02" : "0x01" } } - }, - "pre" : { - "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { - "balance" : "20000000", - "nonce" : "0", - "code" : "{ [[ 2 ]] (CALL 600 3 0 0 0 0 32) [[ 0 ]] (MLOAD 0)}", - "storage": {} - }, + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "20000000", + "nonce" : "0", + "code" : "{ [[ 2 ]] (CALL 600 3 0 0 0 0 32) [[ 0 ]] (MLOAD 0)}", + "storage": {} + }, "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { "balance" : "1000000000000000000", "nonce" : "0", @@ -834,30 +834,30 @@ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", "data" : "" } - }, + }, "CallRipemd160_2": { - "env" : { - "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", - "currentNumber" : "0", - "currentGasLimit" : "10000000", - "currentDifficulty" : "256", - "currentTimestamp" : 1, - "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" - }, - "expect" : { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "10000000", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "expect" : { "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { "storage" : { } } - }, - "pre" : { - "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { - "balance" : "20000000", - "nonce" : "0", - "code" : "{ (MSTORE 5 0xf34578907f) [[ 2 ]] (CALL 600 3 0 0 37 0 32) [[ 0 ]] (MLOAD 0)}", - "storage": {} - }, + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "20000000", + "nonce" : "0", + "code" : "{ (MSTORE 5 0xf34578907f) [[ 2 ]] (CALL 600 3 0 0 37 0 32) [[ 0 ]] (MLOAD 0)}", + "storage": {} + }, "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { "balance" : "1000000000000000000", "nonce" : "0", @@ -874,31 +874,31 @@ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", "data" : "" } - }, + }, "CallRipemd160_3": { - "env" : { - "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", - "currentNumber" : "0", - "currentGasLimit" : "10000000", - "currentDifficulty" : "256", - "currentTimestamp" : 1, - "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" - }, - "expect" : { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "10000000", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "expect" : { "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { "storage" : { "0x" : "0xf34578907f" } } - }, - "pre" : { - "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { - "balance" : "20000000", - "nonce" : "0", - "code" : "{ (MSTORE 0 0xf34578907f) [[ 2 ]] (CALL 600 3 0 0 37 0 32) [[ 0 ]] (MLOAD 0)}", - "storage": {} - }, + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "20000000", + "nonce" : "0", + "code" : "{ (MSTORE 0 0xf34578907f) [[ 2 ]] (CALL 600 3 0 0 37 0 32) [[ 0 ]] (MLOAD 0)}", + "storage": {} + }, "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { "balance" : "1000000000000000000", "nonce" : "0", @@ -915,31 +915,31 @@ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", "data" : "" } - }, + }, "CallRipemd160_4": { - "env" : { - "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", - "currentNumber" : "0", - "currentGasLimit" : "10000000", - "currentDifficulty" : "256", - "currentTimestamp" : 1, - "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" - }, - "expect" : { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "10000000", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "expect" : { "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { "storage" : { "0x" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" } } - }, - "pre" : { - "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { - "balance" : "20000000", - "nonce" : "0", - "code" : "{ (MSTORE 0 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) [[ 2 ]] (CALL 120 3 0 0 32 0 32) [[ 0 ]] (MLOAD 0)}", - "storage": {} - }, + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "20000000", + "nonce" : "0", + "code" : "{ (MSTORE 0 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) [[ 2 ]] (CALL 120 3 0 0 32 0 32) [[ 0 ]] (MLOAD 0)}", + "storage": {} + }, "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { "balance" : "1000000000000000000", "nonce" : "0", @@ -956,31 +956,31 @@ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", "data" : "" } - }, + }, "CallRipemd160_4_gas99": { - "env" : { - "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", - "currentNumber" : "0", - "currentGasLimit" : "10000000", - "currentDifficulty" : "256", - "currentTimestamp" : 1, - "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" - }, - "expect" : { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "10000000", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "expect" : { "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { "storage" : { "0x" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" } } - }, - "pre" : { - "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { - "balance" : "20000000", - "nonce" : "0", - "code" : "{ (MSTORE 0 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) [[ 2 ]] (CALL 119 3 0 0 32 0 32) [[ 0 ]] (MLOAD 0)}", - "storage": {} - }, + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "20000000", + "nonce" : "0", + "code" : "{ (MSTORE 0 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) [[ 2 ]] (CALL 119 3 0 0 32 0 32) [[ 0 ]] (MLOAD 0)}", + "storage": {} + }, "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { "balance" : "1000000000000000000", "nonce" : "0", @@ -997,31 +997,31 @@ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", "data" : "" } - }, + }, "CallRipemd160_5": { - "env" : { - "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", - "currentNumber" : "0", - "currentGasLimit" : "10000000", - "currentDifficulty" : "256", - "currentTimestamp" : 1, - "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" - }, - "expect" : { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "10000000", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "expect" : { "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { "storage" : { "0x" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" } } - }, - "pre" : { - "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { - "balance" : "20000000", - "nonce" : "0", - "code" : "{ (MSTORE 0 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) [[ 2 ]] (CALL 600 3 0 0 1000000 0 32) [[ 0 ]] (MLOAD 0)}", - "storage": {} - }, + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "20000000", + "nonce" : "0", + "code" : "{ (MSTORE 0 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) [[ 2 ]] (CALL 600 3 0 0 1000000 0 32) [[ 0 ]] (MLOAD 0)}", + "storage": {} + }, "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { "balance" : "1000000000000000000", "nonce" : "0", @@ -1038,31 +1038,31 @@ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", "data" : "" } - }, + }, "CallIdentitiy_0": { - "env" : { - "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", - "currentNumber" : "0", - "currentGasLimit" : "10000000", - "currentDifficulty" : "256", - "currentTimestamp" : 1, - "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" - }, - "expect" : { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "10000000", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "expect" : { "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { "storage" : { "0x" : "0000000000000000000000000000000000000000000000000000000000000001" } } - }, - "pre" : { - "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { - "balance" : "20000000", - "nonce" : "0", - "code" : "0x600160005260206000602060006000600460fff1600051600055", - "storage": {} - }, + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "20000000", + "nonce" : "0", + "code" : "0x600160005260206000602060006000600460fff1600051600055", + "storage": {} + }, "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { "balance" : "1000000000000000000", "nonce" : "0", @@ -1079,32 +1079,32 @@ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", "data" : "" } - }, + }, "CallIdentitiy_1": { - "env" : { - "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", - "currentNumber" : "0", - "currentGasLimit" : "10000000", - "currentDifficulty" : "256", - "currentTimestamp" : 1, - "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" - }, - "expect" : { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "10000000", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "expect" : { "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { "storage" : { "0x" : "0x00", "0x02" : "0x01" } } - }, - "pre" : { - "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { - "balance" : "20000000", - "nonce" : "0", - "code" : "{ [[ 2 ]] (CALL 500 4 0 0 0 0 32) [[ 0 ]] (MLOAD 0)}", - "storage": {} - }, + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "20000000", + "nonce" : "0", + "code" : "{ [[ 2 ]] (CALL 500 4 0 0 0 0 32) [[ 0 ]] (MLOAD 0)}", + "storage": {} + }, "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { "balance" : "1000000000000000000", "nonce" : "0", @@ -1121,18 +1121,18 @@ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", "data" : "" } - }, + }, "CallIdentity_1_nonzeroValue": { - "env" : { - "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", - "currentNumber" : "0", - "currentGasLimit" : "100000000", - "currentDifficulty" : "256", - "currentTimestamp" : 1, - "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" - }, - "expect" : { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "100000000", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "expect" : { "0000000000000000000000000000000000000004" : { "balance" : "19" }, @@ -1142,14 +1142,14 @@ "0x02" : "0x01" } } - }, - "pre" : { - "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { - "balance" : "200000000", - "nonce" : "0", - "code" : "{ [[ 2 ]] (CALL 200000 4 0x13 0 0 0 32) [[ 0 ]] (MLOAD 0)}", - "storage": {} - }, + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "200000000", + "nonce" : "0", + "code" : "{ [[ 2 ]] (CALL 200000 4 0x13 0 0 0 32) [[ 0 ]] (MLOAD 0)}", + "storage": {} + }, "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { "balance" : "1000000000000000000", "nonce" : "0", @@ -1166,32 +1166,32 @@ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", "data" : "" } - }, + }, "CallIdentity_2": { - "env" : { - "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", - "currentNumber" : "0", - "currentGasLimit" : "10000000", - "currentDifficulty" : "256", - "currentTimestamp" : 1, - "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" - }, - "expect" : { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "10000000", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "expect" : { "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { "storage" : { "0x" : "0x000000000000000000000000000000000000000000000000000000f34578907f", "0x02" : "0x01" } } - }, - "pre" : { - "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { - "balance" : "20000000", - "nonce" : "0", - "code" : "{ (MSTORE 0 0xf34578907f) [[ 2 ]] (CALL 500 4 0 0 37 0 32) [[ 0 ]] (MLOAD 0)}", - "storage": {} - }, + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "20000000", + "nonce" : "0", + "code" : "{ (MSTORE 0 0xf34578907f) [[ 2 ]] (CALL 500 4 0 0 37 0 32) [[ 0 ]] (MLOAD 0)}", + "storage": {} + }, "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { "balance" : "1000000000000000000", "nonce" : "0", @@ -1208,32 +1208,32 @@ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", "data" : "" } - }, + }, "CallIdentity_3": { - "env" : { - "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", - "currentNumber" : "0", - "currentGasLimit" : "10000000", - "currentDifficulty" : "256", - "currentTimestamp" : 1, - "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" - }, - "expect" : { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "10000000", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "expect" : { "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { "storage" : { "0x" : "0x000000000000000000000000000000000000000000000000000000f34578907f", "0x02" : "0x01" } } - }, - "pre" : { - "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { - "balance" : "20000000", - "nonce" : "0", - "code" : "{ (MSTORE 0 0xf34578907f) [[ 2 ]] (CALL 500 4 0 0 37 0 32) [[ 0 ]] (MLOAD 0)}", - "storage": {} - }, + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "20000000", + "nonce" : "0", + "code" : "{ (MSTORE 0 0xf34578907f) [[ 2 ]] (CALL 500 4 0 0 37 0 32) [[ 0 ]] (MLOAD 0)}", + "storage": {} + }, "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { "balance" : "1000000000000000000", "nonce" : "0", @@ -1250,32 +1250,32 @@ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", "data" : "" } - }, + }, "CallIdentity_4": { - "env" : { - "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", - "currentNumber" : "0", - "currentGasLimit" : "10000000", - "currentDifficulty" : "256", - "currentTimestamp" : 1, - "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" - }, - "expect" : { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "10000000", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "expect" : { "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { "storage" : { "0x" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0x02" : "0x01" } } - }, - "pre" : { - "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { - "balance" : "20000000", - "nonce" : "0", - "code" : "{ (MSTORE 0 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) [[ 2 ]] (CALL 100 4 0 0 32 0 32) [[ 0 ]] (MLOAD 0)}", - "storage": {} - }, + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "20000000", + "nonce" : "0", + "code" : "{ (MSTORE 0 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) [[ 2 ]] (CALL 100 4 0 0 32 0 32) [[ 0 ]] (MLOAD 0)}", + "storage": {} + }, "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { "balance" : "1000000000000000000", "nonce" : "0", @@ -1292,32 +1292,32 @@ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", "data" : "" } - }, + }, "CallIdentity_4_gas18": { - "env" : { - "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", - "currentNumber" : "0", - "currentGasLimit" : "10000000", - "currentDifficulty" : "256", - "currentTimestamp" : 1, - "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" - }, - "expect" : { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "10000000", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "expect" : { "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { "storage" : { "0x" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0x02" : "0x01" } } - }, - "pre" : { - "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { - "balance" : "20000000", - "nonce" : "0", - "code" : "{ (MSTORE 0 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) [[ 2 ]] (CALL 18 4 0 0 32 0 32) [[ 0 ]] (MLOAD 0)}", - "storage": {} - }, + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "20000000", + "nonce" : "0", + "code" : "{ (MSTORE 0 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) [[ 2 ]] (CALL 18 4 0 0 32 0 32) [[ 0 ]] (MLOAD 0)}", + "storage": {} + }, "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { "balance" : "1000000000000000000", "nonce" : "0", @@ -1334,32 +1334,32 @@ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", "data" : "" } - }, + }, "CallIdentity_4_gas17": { - "env" : { - "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", - "currentNumber" : "0", - "currentGasLimit" : "10000000", - "currentDifficulty" : "256", - "currentTimestamp" : 1, - "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" - }, - "expect" : { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "10000000", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "expect" : { "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { "storage" : { "0x" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff", "0x02" : "0x00" } } - }, - "pre" : { - "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { - "balance" : "20000000", - "nonce" : "0", - "code" : "{ (MSTORE 0 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) [[ 2 ]] (CALL 17 4 0 0 32 0 32) [[ 0 ]] (MLOAD 0)}", - "storage": {} - }, + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "20000000", + "nonce" : "0", + "code" : "{ (MSTORE 0 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) [[ 2 ]] (CALL 17 4 0 0 32 0 32) [[ 0 ]] (MLOAD 0)}", + "storage": {} + }, "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { "balance" : "1000000000000000000", "nonce" : "0", @@ -1376,31 +1376,31 @@ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", "data" : "" } - }, + }, "CallIdentity_5": { - "env" : { - "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", - "currentNumber" : "0", - "currentGasLimit" : "10000000", - "currentDifficulty" : "256", - "currentTimestamp" : 1, - "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" - }, - "expect" : { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "10000000", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "expect" : { "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { "storage" : { "0x" : "0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" } } - }, - "pre" : { - "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { - "balance" : "20000000", - "nonce" : "0", - "code" : "{ (MSTORE 0 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) [[ 2 ]] (CALL 600 4 0 0 1000000 0 32) [[ 0 ]] (MLOAD 0)}", - "storage": {} - }, + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "20000000", + "nonce" : "0", + "code" : "{ (MSTORE 0 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff) [[ 2 ]] (CALL 600 4 0 0 1000000 0 32) [[ 0 ]] (MLOAD 0)}", + "storage": {} + }, "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { "balance" : "1000000000000000000", "nonce" : "0", @@ -1417,6 +1417,6 @@ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", "data" : "" } - } + } } From d638df83ae76519c506839ea827482074be11fb0 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Wed, 13 May 2015 11:45:18 +0300 Subject: [PATCH 171/461] Revert "CMake: set default RUNTIME_OUTPUT_DIRECTORY property to "bin"" --- CMakeLists.txt | 1 - cmake/EthExecutableHelper.cmake | 44 ++++++++++++++++++--------------- cmake/scripts/copydlls.cmake | 3 ++- libevmasm/CMakeLists.txt | 7 +++++- test/CMakeLists.txt | 9 ++----- 5 files changed, 34 insertions(+), 30 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ac37454d8..289cecad8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -295,7 +295,6 @@ message("-- EVMJIT Build LLVM-based JIT EVM (experimental!) ${EVMJIT}" message("------------------------------------------------------------------------") message("") -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin") set(CMAKE_THREAD_LIBS_INIT pthread) include(EthCompilerSettings) diff --git a/cmake/EthExecutableHelper.cmake b/cmake/EthExecutableHelper.cmake index 3dd7fa798..1d1cb887b 100644 --- a/cmake/EthExecutableHelper.cmake +++ b/cmake/EthExecutableHelper.cmake @@ -45,26 +45,25 @@ endmacro() macro(eth_copy_dlls EXECUTABLE DLLS) # dlls must be unsubstitud list variable (without ${}) in format - # optimized;path_to_dll.dll;debug;path_to_dlld.dll + # optimized;path_to_dll.dll;debug;path_to_dlld.dll list(GET ${DLLS} 1 DLL_RELEASE) list(GET ${DLLS} 3 DLL_DEBUG) - get_target_property(TARGET_RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE} RUNTIME_OUTPUT_DIRECTORY) add_custom_command(TARGET ${EXECUTABLE} - POST_BUILD - COMMAND ${CMAKE_COMMAND} ARGS - -DDLL_RELEASE="${DLL_RELEASE}" - -DDLL_DEBUG="${DLL_DEBUG}" + POST_BUILD + COMMAND ${CMAKE_COMMAND} ARGS + -DDLL_RELEASE="${DLL_RELEASE}" + -DDLL_DEBUG="${DLL_DEBUG}" -DCONF="$" - -DDESTINATION="${TARGET_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}" + -DDESTINATION="${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}" -P "${ETH_SCRIPTS_DIR}/copydlls.cmake" ) endmacro() -# +# # this function requires the following variables to be specified: # ETH_DEPENDENCY_INSTALL_DIR # -# params: +# params: # QMLDIR # @@ -75,7 +74,7 @@ macro(eth_install_executable EXECUTABLE) set (one_value_args QMLDIR) set (multi_value_args DLLS) cmake_parse_arguments (ETH_INSTALL_EXECUTABLE "${options}" "${one_value_args}" "${multi_value_args}" "${extra_macro_args}") - + if (ETH_INSTALL_EXECUTABLE_QMLDIR) if (APPLE) set(eth_qml_dir "-qmldir=${ETH_INSTALL_EXECUTABLE_QMLDIR}") @@ -88,15 +87,19 @@ macro(eth_install_executable EXECUTABLE) if (APPLE) # First have qt5 install plugins and frameworks add_custom_command(TARGET ${EXECUTABLE} POST_BUILD - COMMAND ${MACDEPLOYQT_APP} ${EXECUTABLE}.app -executable=${EXECUTABLE}.app/Contents/MacOS/${EXECUTABLE} ${eth_qml_dir} - WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR} - COMMAND sh ${CMAKE_SOURCE_DIR}/macdeployfix.sh ${EXECUTABLE}.app/Contents + COMMAND ${MACDEPLOYQT_APP} ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${EXECUTABLE}.app -executable=${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${EXECUTABLE}.app/Contents/MacOS/${EXECUTABLE} ${eth_qml_dir} + WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} + COMMAND sh ${CMAKE_SOURCE_DIR}/macdeployfix.sh ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${EXECUTABLE}.app/Contents ) - - # TODO: This should only happen for GUI application - set(APP_BUNDLE_PATH "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INDIR}/${EXECUTABLE}.app") - + # This tool and next will inspect linked libraries in order to determine which dependencies are required + if (${CMAKE_CFG_INTDIR} STREQUAL ".") + # TODO: This should only happen for GUI application + set(APP_BUNDLE_PATH "${CMAKE_CURRENT_BINARY_DIR}/${EXECUTABLE}.app") + else () + set(APP_BUNDLE_PATH "${CMAKE_CURRENT_BINARY_DIR}/\$ENV{CONFIGURATION}/${EXECUTABLE}.app") + endif () + install(CODE " include(BundleUtilities) set(BU_CHMOD_BUNDLE_ITEMS 1) @@ -108,15 +111,14 @@ macro(eth_install_executable EXECUTABLE) get_target_property(TARGET_LIBS ${EXECUTABLE} INTERFACE_LINK_LIBRARIES) string(REGEX MATCH "Qt5::Core" HAVE_QT ${TARGET_LIBS}) if ("${HAVE_QT}" STREQUAL "Qt5::Core") - get_target_property(TARGET_RUNTIME_OUTPUT_DIRECTORY ${EXECUTABLE} RUNTIME_OUTPUT_DIRECTORY) add_custom_command(TARGET ${EXECUTABLE} POST_BUILD - COMMAND cmd /C "set PATH=${Qt5Core_DIR}/../../../bin;%PATH% && ${WINDEPLOYQT_APP} ${TARGET_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR}/${EXECUTABLE}.exe ${eth_qml_dir}" + COMMAND cmd /C "set PATH=${Qt5Core_DIR}/../../../bin;%PATH% && ${WINDEPLOYQT_APP} ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR}/${EXECUTABLE}.exe ${eth_qml_dir}" WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} ) #workaround for https://bugreports.qt.io/browse/QTBUG-42083 add_custom_command(TARGET ${EXECUTABLE} POST_BUILD COMMAND cmd /C "(echo [Paths] & echo.Prefix=.)" > "qt.conf" - WORKING_DIRECTORY ${TARGET_RUNTIME_OUTPUT_DIRECTORY}/${CMAKE_CFG_INTDIR} VERBATIM + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_CFG_INTDIR} VERBATIM ) endif() @@ -142,3 +144,5 @@ macro(eth_install_executable EXECUTABLE) endif () endmacro() + + diff --git a/cmake/scripts/copydlls.cmake b/cmake/scripts/copydlls.cmake index 57eb0ffd4..6d86b8e4e 100644 --- a/cmake/scripts/copydlls.cmake +++ b/cmake/scripts/copydlls.cmake @@ -14,4 +14,5 @@ else () # Debug set(DLL ${DLL_DEBUG}) endif() -execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different "${DLL}" "${DESTINATION}") +execute_process(COMMAND ${CMAKE_COMMAND} -E copy "${DLL}" "${DESTINATION}") + diff --git a/libevmasm/CMakeLists.txt b/libevmasm/CMakeLists.txt index eb8fea95c..f8150806f 100644 --- a/libevmasm/CMakeLists.txt +++ b/libevmasm/CMakeLists.txt @@ -19,10 +19,15 @@ set(EXECUTABLE evmasm) file(GLOB HEADERS "*.h") -add_library(${EXECUTABLE} ${SRC_LIST} ${HEADERS}) +if (ETH_STATIC) + add_library(${EXECUTABLE} STATIC ${SRC_LIST} ${HEADERS}) +else() + add_library(${EXECUTABLE} SHARED ${SRC_LIST} ${HEADERS}) +endif() target_link_libraries(${EXECUTABLE} evmcore) target_link_libraries(${EXECUTABLE} devcrypto) install( TARGETS ${EXECUTABLE} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) install( FILES ${HEADERS} DESTINATION include/${EXECUTABLE} ) + diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index bedbe42f3..39a235c58 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -95,12 +95,6 @@ if (JSONRPC) target_link_libraries(testeth ${JSON_RPC_CPP_CLIENT_LIBRARIES}) endif() -if (UNIX) # Create symlink to old testeth location to make bildbot happy - add_custom_command(TARGET testeth POST_BUILD - COMMAND ${CMAKE_COMMAND} -E create_symlink ${CMAKE_BINARY_DIR}/bin/testeth ${CMAKE_BINARY_DIR}/test/testeth - ) -endif() - enable_testing() set(CTEST_OUTPUT_ON_FAILURE TRUE) @@ -116,6 +110,7 @@ eth_add_test(ClientBase ) eth_add_test(JsonRpc - ARGS --eth_testfile=BlockTests/bcJS_API_Test + ARGS --eth_testfile=BlockTests/bcJS_API_Test ARGS --eth_testfile=BlockTests/bcValidBlockTest ) + From 44c3e7b914224b92a47b2e6f9904b053891fe828 Mon Sep 17 00:00:00 2001 From: Marek Kotewicz Date: Wed, 13 May 2015 10:59:26 +0200 Subject: [PATCH 172/461] libjsonconsole fix --- eth/main.cpp | 2 +- libjsconsole/JSConsole.cpp | 5 ++--- libjsconsole/JSConsole.h | 4 +++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/eth/main.cpp b/eth/main.cpp index abb78c20d..387ae3be7 100644 --- a/eth/main.cpp +++ b/eth/main.cpp @@ -1765,7 +1765,7 @@ int main(int argc, char** argv) if (useConsole) { #if ETH_JSCONSOLE - JSConsole console(web3, vector({sigKey})); + JSConsole console(web3, make_shared([&](){return web3.ethereum();}, getAccountPassword, keyManager)); while (!g_exit) { console.repl(); diff --git a/libjsconsole/JSConsole.cpp b/libjsconsole/JSConsole.cpp index 791df2de4..d1f7c0264 100644 --- a/libjsconsole/JSConsole.cpp +++ b/libjsconsole/JSConsole.cpp @@ -25,7 +25,6 @@ #include #include "JSConsole.h" #include "JSV8Connector.h" -#include "libjsconsole/JSConsoleResources.hpp" // TODO! make readline optional! #include @@ -35,12 +34,12 @@ using namespace std; using namespace dev; using namespace dev::eth; -JSConsole::JSConsole(WebThreeDirect& _web3, std::vector const& _accounts): +JSConsole::JSConsole(WebThreeDirect& _web3, shared_ptr const& _accounts): m_engine(), m_printer(m_engine) { m_jsonrpcConnector.reset(new JSV8Connector(m_engine)); - m_jsonrpcServer.reset(new WebThreeStubServer(*m_jsonrpcConnector.get(), _web3, _accounts)); + m_jsonrpcServer.reset(new WebThreeStubServer(*m_jsonrpcConnector.get(), _web3, _accounts, vector())); } JSConsole::~JSConsole() {} diff --git a/libjsconsole/JSConsole.h b/libjsconsole/JSConsole.h index 3b65691f6..b7aded4f3 100644 --- a/libjsconsole/JSConsole.h +++ b/libjsconsole/JSConsole.h @@ -33,10 +33,12 @@ namespace dev namespace eth { +class AccountHolder; + class JSConsole { public: - JSConsole(WebThreeDirect& _web3, std::vector const& _accounts); + JSConsole(WebThreeDirect& _web3, std::shared_ptr const& _accounts); ~JSConsole(); void repl() const; From be5aa3dbf0c3997c8d90cf92ff5a9fba69fc7c59 Mon Sep 17 00:00:00 2001 From: subtly Date: Wed, 13 May 2015 11:03:05 +0200 Subject: [PATCH 173/461] cleanup --- libp2p/Common.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libp2p/Common.h b/libp2p/Common.h index e70d671b2..3029bf18a 100644 --- a/libp2p/Common.h +++ b/libp2p/Common.h @@ -172,13 +172,13 @@ struct NodeIPEndpoint /// Setting true causes isAllowed to return true for all addresses. (Used by test fixtures) static bool test_allowLocal; - NodeIPEndpoint(): address(bi::address()), udpPort(0), tcpPort(0) {} + NodeIPEndpoint() = default; NodeIPEndpoint(bi::address _addr, uint16_t _udp, uint16_t _tcp): address(_addr), udpPort(_udp), tcpPort(_tcp) {} NodeIPEndpoint(RLP const& _r) { interpretRLP(_r); } - bi::address address; - uint16_t udpPort; - uint16_t tcpPort; + bi::address address = bi::address(); + uint16_t udpPort = 0; + uint16_t tcpPort = 0; operator bi::udp::endpoint() const { return std::move(bi::udp::endpoint(address, udpPort)); } operator bi::tcp::endpoint() const { return std::move(bi::tcp::endpoint(address, tcpPort)); } From f724508902350194053960ec052c2a11df6cc307 Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Wed, 13 May 2015 10:57:40 +0200 Subject: [PATCH 174/461] Bump password size to 256 chars --- libdevcore/CommonIO.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libdevcore/CommonIO.cpp b/libdevcore/CommonIO.cpp index 10c53ddb9..d37f74db2 100644 --- a/libdevcore/CommonIO.cpp +++ b/libdevcore/CommonIO.cpp @@ -131,7 +131,7 @@ std::string dev::getPassword(std::string const& _prompt) #else struct termios oflags; struct termios nflags; - char password[128]; + char password[256]; // disable echo in the terminal tcgetattr(fileno(stdin), &oflags); @@ -148,9 +148,9 @@ std::string dev::getPassword(std::string const& _prompt) password[strlen(password) - 1] = 0; // restore terminal - if (tcsetattr(fileno(stdin), TCSANOW, &oflags) != 0) { + if (tcsetattr(fileno(stdin), TCSANOW, &oflags) != 0) BOOST_THROW_EXCEPTION(ExternalFunctionFailure("tcsetattr")); - } + return password; #endif From 100066a66475ca60ead252644ab04391c7180a66 Mon Sep 17 00:00:00 2001 From: debris Date: Wed, 13 May 2015 13:54:17 +0200 Subject: [PATCH 175/461] fix for building OpenCL on some linux distributions --- cmake/FindOpenCL.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/FindOpenCL.cmake b/cmake/FindOpenCL.cmake index 4d3ed842c..a786e2e86 100644 --- a/cmake/FindOpenCL.cmake +++ b/cmake/FindOpenCL.cmake @@ -118,7 +118,7 @@ if(WIN32) endif() else() find_library(OpenCL_LIBRARY - NAMES OpenCL) + NAMES OpenCL libOpenCL.so.1) endif() set(OpenCL_LIBRARIES ${OpenCL_LIBRARY}) From 5cac25e2efa8844a38a1a24b52751be71799b4d4 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Wed, 13 May 2015 15:45:12 +0300 Subject: [PATCH 176/461] Fix mining. --- ethminer/main.cpp | 27 +++++++++++++++++++++------ libethcore/Ethash.cpp | 9 ++++----- libethcore/Ethash.h | 1 - 3 files changed, 25 insertions(+), 12 deletions(-) diff --git a/ethminer/main.cpp b/ethminer/main.cpp index 124d3f779..80895c975 100644 --- a/ethminer/main.cpp +++ b/ethminer/main.cpp @@ -223,6 +223,7 @@ void doFarm(MinerType _m, string const& _remote, unsigned _recheckPeriod) (void)_recheckPeriod; #if ETH_JSONRPC || !ETH_TRUE jsonrpc::HttpClient client(_remote); + Farm rpc(client); GenericFarm f; if (_m == MinerType::CPU) @@ -254,17 +255,31 @@ void doFarm(MinerType _m, string const& _remote, unsigned _recheckPeriod) current.headerHash = hh; current.seedHash = h256(v[1].asString()); current.boundary = h256(fromHex(v[2].asString()), h256::AlignRight); - cnote << "Got work package:" << current.headerHash << " < " << current.boundary; + cnote << "Got work package:"; + cnote << " Header-hash:" << current.headerHash.hex(); + cnote << " Seedhash:" << current.seedHash.hex(); + cnote << " Target: " << h256(current.boundary).hex(); f.setWork(current); } this_thread::sleep_for(chrono::milliseconds(_recheckPeriod)); } - cnote << "Solution found; submitting [" << solution.nonce << "," << current.headerHash << "," << solution.mixHash << "] to" << _remote << "..."; - bool ok = rpc.eth_submitWork("0x" + toString(solution.nonce), "0x" + toString(current.headerHash), "0x" + toString(solution.mixHash)); - if (ok) - clog(HappyChannel) << "Submitted and accepted."; + cnote << "Solution found; Submitting to" << _remote << "..."; + cnote << " Nonce:" << solution.nonce.hex(); + cnote << " Mixhash:" << solution.mixHash.hex(); + cnote << " Header-hash:" << current.headerHash.hex(); + cnote << " Seedhash:" << current.seedHash.hex(); + cnote << " Target: " << h256(current.boundary).hex(); + cnote << " Ethash: " << h256(EthashAux::eval(EthashAux::number(current.seedHash), current.headerHash, solution.nonce).value).hex(); + if (EthashAux::eval(EthashAux::number(current.seedHash), current.headerHash, solution.nonce).value < current.boundary) + { + bool ok = rpc.eth_submitWork("0x" + toString(solution.nonce), "0x" + toString(current.headerHash), "0x" + toString(solution.mixHash)); + if (ok) + clog(HappyChannel) << "Submitted and accepted."; + else + clog(SadChannel) << "Not accepted."; + } else - clog(SadChannel) << "Not accepted."; + cwarn << "FAILURE: GPU gave incorrect result!"; current.reset(); } catch (jsonrpc::JsonRpcException&) diff --git a/libethcore/Ethash.cpp b/libethcore/Ethash.cpp index 3724d8255..1a8355fdf 100644 --- a/libethcore/Ethash.cpp +++ b/libethcore/Ethash.cpp @@ -72,7 +72,6 @@ Ethash::WorkPackage Ethash::package(BlockInfo const& _bi) ret.boundary = _bi.boundary(); ret.headerHash = _bi.headerHash(WithoutNonce); ret.seedHash = _bi.seedHash(); - ret.blockNumber = (uint64_t) _bi.number; return ret; } @@ -135,7 +134,7 @@ void Ethash::CPUMiner::workLoop() WorkPackage w = work(); - auto dag = EthashAux::full(w.blockNumber); + auto dag = EthashAux::full(EthashAux::number(w.seedHash)); h256 boundary = w.boundary; unsigned hashCount = 1; for (; !shouldStop(); tryNonce++, hashCount++) @@ -284,7 +283,7 @@ Ethash::GPUMiner::~GPUMiner() bool Ethash::GPUMiner::report(uint64_t _nonce) { Nonce n = (Nonce)(u64)_nonce; - Result r = EthashAux::eval(work().blockNumber, work().headerHash, n); + Result r = EthashAux::eval(EthashAux::number(work().seedHash), work().headerHash, n); if (r.value < work().boundary) return submitProof(Solution{n, r.mixHash}); return false; @@ -310,9 +309,9 @@ void Ethash::GPUMiner::workLoop() unsigned device = instances() > 1 ? index() : s_deviceId; - if (!EthashAux::computeFull(w.blockNumber)) + if (!EthashAux::computeFull(EthashAux::number(w.seedHash))) return; - EthashAux::FullType dag = EthashAux::full(w.blockNumber); + EthashAux::FullType dag = EthashAux::full(EthashAux::number(w.seedHash)); bytesConstRef dagData = dag->data(); m_miner->init(dagData.data(), dagData.size(), 32, s_platformId, device); } diff --git a/libethcore/Ethash.h b/libethcore/Ethash.h index 82db15e87..997c32cd0 100644 --- a/libethcore/Ethash.h +++ b/libethcore/Ethash.h @@ -67,7 +67,6 @@ public: h256 boundary; h256 headerHash; ///< When h256() means "pause until notified a new work package is available". h256 seedHash; /// LTODO: IS this needed now that we use the block number instead? - uint64_t blockNumber; }; static const WorkPackage NullWorkPackage; From c7424bfce71b79f7eef458397c3f988f1ac0afea Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Wed, 13 May 2015 15:51:32 +0300 Subject: [PATCH 177/461] Version bump. --- libdevcore/Common.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libdevcore/Common.cpp b/libdevcore/Common.cpp index 6723ab76d..28b537be5 100644 --- a/libdevcore/Common.cpp +++ b/libdevcore/Common.cpp @@ -28,7 +28,7 @@ using namespace dev; namespace dev { -char const* Version = "0.9.19"; +char const* Version = "0.9.20"; const u256 UndefinedU256 = ~(u256)0; From 83650be2139734148ab1fc9882ff9e5074ac17ba Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Wed, 13 May 2015 16:34:37 +0300 Subject: [PATCH 178/461] Fix GPU mining in ethminer. --- libethcore/Ethash.cpp | 8 +++++++- libethcore/EthashAux.cpp | 4 ++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/libethcore/Ethash.cpp b/libethcore/Ethash.cpp index 1a8355fdf..80550886c 100644 --- a/libethcore/Ethash.cpp +++ b/libethcore/Ethash.cpp @@ -300,6 +300,7 @@ void Ethash::GPUMiner::workLoop() // take local copy of work since it may end up being overwritten by kickOff/pause. try { WorkPackage w = work(); + cnote << "workLoop" << !!m_miner << m_minerSeed << w.seedHash; if (!m_miner || m_minerSeed != w.seedHash) { m_minerSeed = w.seedHash; @@ -309,7 +310,12 @@ void Ethash::GPUMiner::workLoop() unsigned device = instances() > 1 ? index() : s_deviceId; - if (!EthashAux::computeFull(EthashAux::number(w.seedHash))) + while (EthashAux::computeFull(EthashAux::number(w.seedHash)) != 100 && !shouldStop()) + { + cnote << "Awaiting DAG" << EthashAux::computeFull(EthashAux::number(w.seedHash)); + this_thread::sleep_for(chrono::milliseconds(500)); + } + if (shouldStop()) return; EthashAux::FullType dag = EthashAux::full(EthashAux::number(w.seedHash)); bytesConstRef dagData = dag->data(); diff --git a/libethcore/EthashAux.cpp b/libethcore/EthashAux.cpp index f7a0ac41d..9287bcbfc 100644 --- a/libethcore/EthashAux.cpp +++ b/libethcore/EthashAux.cpp @@ -170,7 +170,9 @@ EthashAux::FullType EthashAux::full(uint64_t _blockNumber, function(l->light, dagCallbackShim); + cnote << "Done loading."; DEV_GUARDED(get()->x_fulls) get()->m_fulls[seedHash] = get()->m_lastUsedFull = ret; @@ -192,7 +194,9 @@ unsigned EthashAux::computeFull(uint64_t _blockNumber) get()->m_fullProgress = 0; get()->m_generatingFullNumber = _blockNumber / ETHASH_EPOCH_LENGTH * ETHASH_EPOCH_LENGTH; get()->m_fullGenerator = unique_ptr(new thread([=](){ + cnote << "Loading full DAG of" << _blockNumber; get()->full(_blockNumber, [](unsigned p){ get()->m_fullProgress = p; return 0; }); + cnote << "Full DAG loaded"; get()->m_fullProgress = 0; get()->m_generatingFullNumber = NotGenerating; })); From de8c7e1c5d3379ff122cd51adcffb71231d373c0 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Wed, 13 May 2015 16:35:16 +0300 Subject: [PATCH 179/461] newaccount in eth. fix importing old accounts and guarantee wallet has at least one key in it. --- eth/main.cpp | 48 ++++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 40 insertions(+), 8 deletions(-) diff --git a/eth/main.cpp b/eth/main.cpp index abb78c20d..1eed535cd 100644 --- a/eth/main.cpp +++ b/eth/main.cpp @@ -93,6 +93,7 @@ void interactiveHelp() << " mineforce Forces mining, even when there are no transactions." << endl << " block Gives the current block height." << endl << " accounts Gives information on all owned accounts (balances, mining beneficiary and default signer)." << endl + << " newaccount Creates a new account with the given name." << endl << " transact Execute a given transaction." << endl << " send Execute a given transaction with current secret." << endl << " contract Create a new contract with current secret." << endl @@ -1002,12 +1003,6 @@ int main(int argc, char** argv) KeyManager keyManager; for (auto const& s: passwordsToNote) keyManager.notePassword(s); - for (auto const& s: toImport) - { - keyManager.import(s, "Imported key"); - if (!signingKey) - signingKey = toAddress(s); - } { RLPStream config(2); @@ -1104,6 +1099,16 @@ int main(int argc, char** argv) keyManager.create(masterPassword); } + for (auto const& s: toImport) + { + keyManager.import(s, "Imported key (UNSAFE)"); + if (!signingKey) + signingKey = toAddress(s); + } + + if (keyManager.accounts().empty()) + keyManager.import(Secret::random(), "Default key"); + auto toNumber = [&](string const& s) -> unsigned { if (s == "latest") return web3.ethereum()->number(); @@ -1368,9 +1373,36 @@ int main(int argc, char** argv) << std::chrono::duration_cast(it.lastPing).count() << "ms" << endl; } - else if (c && cmd == "balance") + else if (cmd == "newaccount") + { + string name; + std::getline(iss, name); + auto s = Secret::random(); + string password; + while (password.empty()) + { + password = getPassword("Please enter a password to protect this key (press enter for protection only be the MASTER password/keystore): "); + string confirm = getPassword("Please confirm the password by entering it again: "); + if (password != confirm) + { + cout << "Passwords were different. Try again." << endl; + password.clear(); + } + } + if (!password.empty()) + { + cout << "Enter a hint for this password: " << flush; + string hint; + std::getline(cin, hint); + keyManager.import(s, name, password, hint); + } + else + keyManager.import(s, name); + cout << "New account created: " << toAddress(s); + } + else if (c && cmd == "accounts") { - cout << "Current balance:" << endl; + cout << "Accounts:" << endl; u256 total = 0; for (auto const& i: keyManager.accountDetails()) { From fb7c6a10c0814b24ca59d9a7446ab2a8e4957fbb Mon Sep 17 00:00:00 2001 From: subtly Date: Wed, 13 May 2015 16:43:42 +0200 Subject: [PATCH 180/461] Bump ideal peer count based on network simulations. See also https://github.com/ethereum/devp2p/wiki/Peer-Selection-Strategy --- eth/main.cpp | 2 +- libp2p/Host.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/eth/main.cpp b/eth/main.cpp index abb78c20d..1c553885c 100644 --- a/eth/main.cpp +++ b/eth/main.cpp @@ -547,7 +547,7 @@ int main(int argc, char** argv) string publicIP; string remoteHost; unsigned short remotePort = 30303; - unsigned peers = 5; + unsigned peers = 11; bool bootstrap = false; unsigned networkId = 0; diff --git a/libp2p/Host.h b/libp2p/Host.h index 4cfca7718..78dc50727 100644 --- a/libp2p/Host.h +++ b/libp2p/Host.h @@ -243,7 +243,7 @@ private: std::list> m_connecting; ///< Pending connections. Mutex x_connecting; ///< Mutex for m_connecting. - unsigned m_idealPeerCount = 5; ///< Ideal number of peers to be connected to. + unsigned m_idealPeerCount = 11; ///< Ideal number of peers to be connected to. std::map> m_capabilities; ///< Each of the capabilities we support. From 09bc520f7b7cc8a09f9d45e1481e2d716a895d74 Mon Sep 17 00:00:00 2001 From: chriseth Date: Tue, 12 May 2015 21:27:04 +0200 Subject: [PATCH 181/461] Known state: store tags on stack as unions. --- libevmasm/CommonSubexpressionEliminator.cpp | 9 +- libevmasm/ControlFlowGraph.cpp | 51 ++++++------ libevmasm/ControlFlowGraph.h | 4 - libevmasm/ExpressionClasses.cpp | 10 +++ libevmasm/ExpressionClasses.h | 6 +- libevmasm/KnownState.cpp | 92 +++++++++++++++------ libevmasm/KnownState.h | 19 +++-- test/libsolidity/SolidityOptimizer.cpp | 43 ++++++++++ 8 files changed, 168 insertions(+), 66 deletions(-) diff --git a/libevmasm/CommonSubexpressionEliminator.cpp b/libevmasm/CommonSubexpressionEliminator.cpp index e369c9dbc..7564fcd99 100644 --- a/libevmasm/CommonSubexpressionEliminator.cpp +++ b/libevmasm/CommonSubexpressionEliminator.cpp @@ -153,7 +153,9 @@ AssemblyItems CSECodeGenerator::generateCode( assertThrow(!m_classPositions[targetItem.second].empty(), OptimizerException, ""); if (m_classPositions[targetItem.second].count(targetItem.first)) continue; - SourceLocation const& location = m_expressionClasses.representative(targetItem.second).item->getLocation(); + SourceLocation location; + if (m_expressionClasses.representative(targetItem.second).item) + location = m_expressionClasses.representative(targetItem.second).item->getLocation(); int position = classElementPosition(targetItem.second); if (position < targetItem.first) // it is already at its target, we need another copy @@ -197,7 +199,9 @@ void CSECodeGenerator::addDependencies(Id _c) addDependencies(argument); m_neededBy.insert(make_pair(argument, _c)); } - if (expr.item->type() == Operation && ( + if ( + expr.item && + expr.item->type() == Operation && ( expr.item->instruction() == Instruction::SLOAD || expr.item->instruction() == Instruction::MLOAD || expr.item->instruction() == Instruction::SHA3 @@ -288,6 +292,7 @@ void CSECodeGenerator::generateClassElement(Id _c, bool _allowSequenced) OptimizerException, "Sequence constrained operation requested out of sequence." ); + assertThrow(expr.item, OptimizerException, "Non-generated expression without item."); vector const& arguments = expr.arguments; for (Id arg: boost::adaptors::reverse(arguments)) generateClassElement(arg); diff --git a/libevmasm/ControlFlowGraph.cpp b/libevmasm/ControlFlowGraph.cpp index cc68b2af8..3566bdb17 100644 --- a/libevmasm/ControlFlowGraph.cpp +++ b/libevmasm/ControlFlowGraph.cpp @@ -24,6 +24,7 @@ #include #include #include +#include #include #include #include @@ -217,7 +218,6 @@ void ControlFlowGraph::gatherKnowledge() // @todo actually we know that memory is filled with zeros at the beginning, // we could make use of that. KnownStatePointer emptyState = make_shared(); - ExpressionClasses& expr = emptyState->expressionClasses(); bool unknownJumpEncountered = false; vector> workQueue({make_pair(BlockId::initial(), emptyState->copy())}); @@ -238,8 +238,6 @@ void ControlFlowGraph::gatherKnowledge() } block.startState = state->copy(); - //@todo we might know the return address for the first pass, but not anymore for the second, - // -> store knowledge about tags as a union. // Feed all items except for the final jump yet because it will erase the target tag. unsigned pc = block.begin; @@ -254,22 +252,29 @@ void ControlFlowGraph::gatherKnowledge() assertThrow(block.begin <= pc && pc == block.end - 1, OptimizerException, ""); //@todo in the case of JUMPI, add knowledge about the condition to the state // (for both values of the condition) - BlockId nextBlock = expressionClassToBlockId( - state->stackElement(state->stackHeight(), SourceLocation()), - expr + set tags = state->tagsInExpression( + state->stackElement(state->stackHeight(), SourceLocation()) ); state->feedItem(m_items.at(pc++)); - if (nextBlock) - workQueue.push_back(make_pair(nextBlock, state->copy())); - else if (!unknownJumpEncountered) + + if (tags.empty() || std::any_of(tags.begin(), tags.end(), [&](u256 const& _tag) + { + return !m_blocks.count(BlockId(_tag)); + })) { - // We do not know where this jump goes, so we have to reset the states of all - // JUMPDESTs. - unknownJumpEncountered = true; - for (auto const& it: m_blocks) - if (it.second.begin < it.second.end && m_items[it.second.begin].type() == Tag) - workQueue.push_back(make_pair(it.first, emptyState->copy())); + if (!unknownJumpEncountered) + { + // We do not know the target of this jump, so we have to reset the states of all + // JUMPDESTs. + unknownJumpEncountered = true; + for (auto const& it: m_blocks) + if (it.second.begin < it.second.end && m_items[it.second.begin].type() == Tag) + workQueue.push_back(make_pair(it.first, emptyState->copy())); + } } + else + for (auto tag: tags) + workQueue.push_back(make_pair(BlockId(tag), state->copy())); } else if (block.begin <= pc && pc < block.end) state->feedItem(m_items.at(pc++)); @@ -329,7 +334,11 @@ BasicBlocks ControlFlowGraph::rebuildCode() if (previousHandedOver && !pushes[blockId] && m_items[block.begin].type() == Tag) ++block.begin; if (block.begin < block.end) + { blocks.push_back(block); + blocks.back().startState->clearTagUnions(); + blocks.back().endState->clearTagUnions(); + } previousHandedOver = (block.endType == BasicBlock::EndType::HANDOVER); } } @@ -337,18 +346,6 @@ BasicBlocks ControlFlowGraph::rebuildCode() return blocks; } -BlockId ControlFlowGraph::expressionClassToBlockId( - ExpressionClasses::Id _id, - ExpressionClasses& _exprClasses -) -{ - ExpressionClasses::Expression expr = _exprClasses.representative(_id); - if (expr.item && expr.item->type() == PushTag) - return BlockId(expr.item->data()); - else - return BlockId::invalid(); -} - BlockId ControlFlowGraph::generateNewId() { BlockId id = BlockId(++m_lastUsedId); diff --git a/libevmasm/ControlFlowGraph.h b/libevmasm/ControlFlowGraph.h index 3366dc45f..4480ba491 100644 --- a/libevmasm/ControlFlowGraph.h +++ b/libevmasm/ControlFlowGraph.h @@ -108,10 +108,6 @@ private: void setPrevLinks(); BasicBlocks rebuildCode(); - /// @returns the corresponding BlockId if _id is a pushed jump tag, - /// and an invalid BlockId otherwise. - BlockId expressionClassToBlockId(ExpressionClasses::Id _id, ExpressionClasses& _exprClasses); - BlockId generateNewId(); unsigned m_lastUsedId = 0; diff --git a/libevmasm/ExpressionClasses.cpp b/libevmasm/ExpressionClasses.cpp index cfbeba7fa..81adc0dbb 100644 --- a/libevmasm/ExpressionClasses.cpp +++ b/libevmasm/ExpressionClasses.cpp @@ -82,6 +82,16 @@ ExpressionClasses::Id ExpressionClasses::find( return exp.id; } +ExpressionClasses::Id ExpressionClasses::newClass(SourceLocation const& _location) +{ + Expression exp; + exp.id = m_representatives.size(); + exp.item = storeItem(AssemblyItem(UndefinedItem, (u256(1) << 255) + exp.id, _location)); + m_representatives.push_back(exp); + m_expressions.insert(exp); + return exp.id; +} + bool ExpressionClasses::knownToBeDifferent(ExpressionClasses::Id _a, ExpressionClasses::Id _b) { // Try to simplify "_a - _b" and return true iff the value is a non-zero constant. diff --git a/libevmasm/ExpressionClasses.h b/libevmasm/ExpressionClasses.h index c83520300..dd94092e8 100644 --- a/libevmasm/ExpressionClasses.h +++ b/libevmasm/ExpressionClasses.h @@ -52,7 +52,8 @@ public: Id id; AssemblyItem const* item = nullptr; Ids arguments; - unsigned sequenceNumber; ///< Storage modification sequence, only used for SLOAD/SSTORE instructions. + /// Storage modification sequence, only used for storage and memory operations. + unsigned sequenceNumber = 0; /// Behaves as if this was a tuple of (item->type(), item->data(), arguments, sequenceNumber). bool operator<(Expression const& _other) const; }; @@ -73,6 +74,9 @@ public: /// @returns the number of classes. Id size() const { return m_representatives.size(); } + /// @returns the id of a new class which is different to all other classes. + Id newClass(SourceLocation const& _location); + /// @returns true if the values of the given classes are known to be different (on every input). /// @note that this function might still return false for some different inputs. bool knownToBeDifferent(Id _a, Id _b); diff --git a/libevmasm/KnownState.cpp b/libevmasm/KnownState.cpp index 5a70a74fb..b84e656aa 100644 --- a/libevmasm/KnownState.cpp +++ b/libevmasm/KnownState.cpp @@ -162,29 +162,41 @@ KnownState::StoreOperation KnownState::feedItem(AssemblyItem const& _item, bool /// Helper function for KnownState::reduceToCommonKnowledge, removes everything from /// _this which is not in or not equal to the value in _other. -template void intersect( - _Mapping& _this, - _Mapping const& _other, - function<_KeyType(_KeyType)> const& _keyTrans = [](_KeyType _k) { return _k; } -) +template void intersect(_Mapping& _this, _Mapping const& _other) { for (auto it = _this.begin(); it != _this.end();) - if (_other.count(_keyTrans(it->first)) && _other.at(_keyTrans(it->first)) == it->second) + if (_other.count(it->first) && _other.at(it->first) == it->second) ++it; else it = _this.erase(it); } -template void intersect(_Mapping& _this, _Mapping const& _other) -{ - intersect<_Mapping, ExpressionClasses::Id>(_this, _other, [](ExpressionClasses::Id _k) { return _k; }); -} - void KnownState::reduceToCommonKnowledge(KnownState const& _other) { int stackDiff = m_stackHeight - _other.m_stackHeight; - function stackKeyTransform = [=](int _key) -> int { return _key - stackDiff; }; - intersect(m_stackElements, _other.m_stackElements, stackKeyTransform); + for (auto it = m_stackElements.begin(); it != m_stackElements.end();) + if (_other.m_stackElements.count(it->first - stackDiff)) + { + Id other = _other.m_stackElements.at(it->first - stackDiff); + if (it->second == other) + ++it; + else + { + set theseTags = tagsInExpression(it->second); + set otherTags = tagsInExpression(other); + if (!theseTags.empty() && !otherTags.empty()) + { + theseTags.insert(otherTags.begin(), otherTags.end()); + it->second = tagUnion(theseTags); + ++it; + } + else + it = m_stackElements.erase(it); + } + } + else + it = m_stackElements.erase(it); + // Use the smaller stack height. Essential to terminate in case of loops. if (m_stackHeight > _other.m_stackHeight) { @@ -201,10 +213,15 @@ void KnownState::reduceToCommonKnowledge(KnownState const& _other) bool KnownState::operator==(const KnownState& _other) const { - return m_storageContent == _other.m_storageContent && - m_memoryContent == _other.m_memoryContent && - m_stackHeight == _other.m_stackHeight && - m_stackElements == _other.m_stackElements; + if (m_storageContent != _other.m_storageContent || m_memoryContent != _other.m_memoryContent) + return false; + int stackDiff = m_stackHeight - _other.m_stackHeight; + auto thisIt = m_stackElements.cbegin(); + auto otherIt = _other.m_stackElements.cbegin(); + for (; thisIt != m_stackElements.cend() && otherIt != _other.m_stackElements.cend(); ++thisIt, ++otherIt) + if (thisIt->first - stackDiff != otherIt->first || thisIt->second != otherIt->second) + return false; + return (thisIt == m_stackElements.cend() && otherIt == _other.m_stackElements.cend()); } ExpressionClasses::Id KnownState::stackElement(int _stackHeight, SourceLocation const& _location) @@ -212,18 +229,17 @@ ExpressionClasses::Id KnownState::stackElement(int _stackHeight, SourceLocation if (m_stackElements.count(_stackHeight)) return m_stackElements.at(_stackHeight); // Stack element not found (not assigned yet), create new unknown equivalence class. - //@todo check that we do not infer incorrect equivalences when the stack is cleared partially - //in between. - return m_stackElements[_stackHeight] = initialStackElement(_stackHeight, _location); + return m_stackElements[_stackHeight] = + m_expressionClasses->find(AssemblyItem(UndefinedItem, _stackHeight, _location)); } -ExpressionClasses::Id KnownState::initialStackElement( - int _stackHeight, - SourceLocation const& _location -) +void KnownState::clearTagUnions() { - // This is a special assembly item that refers to elements pre-existing on the initial stack. - return m_expressionClasses->find(AssemblyItem(UndefinedItem, u256(_stackHeight), _location)); + for (auto it = m_stackElements.begin(); it != m_stackElements.end();) + if (m_tagUnions.left.count(it->second)) + it = m_stackElements.erase(it); + else + ++it; } void KnownState::setStackElement(int _stackHeight, Id _class) @@ -352,3 +368,27 @@ KnownState::Id KnownState::applySha3( return m_knownSha3Hashes[arguments] = v; } +set KnownState::tagsInExpression(KnownState::Id _expressionId) +{ + if (m_tagUnions.left.count(_expressionId)) + return m_tagUnions.left.at(_expressionId); + // Might be a tag, then return the set of itself. + ExpressionClasses::Expression expr = m_expressionClasses->representative(_expressionId); + if (expr.item && expr.item->type() == PushTag) + return set({expr.item->data()}); + else + return set(); +} + +KnownState::Id KnownState::tagUnion(set _tags) +{ + if (m_tagUnions.right.count(_tags)) + return m_tagUnions.right.at(_tags); + else + { + Id id = m_expressionClasses->newClass(SourceLocation()); + m_tagUnions.right.insert(make_pair(_tags, id)); + return id; + } +} + diff --git a/libevmasm/KnownState.h b/libevmasm/KnownState.h index f7a3dd675..3505df74f 100644 --- a/libevmasm/KnownState.h +++ b/libevmasm/KnownState.h @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -107,15 +108,16 @@ public: /// @returns true if the knowledge about the state of both objects is (known to be) equal. bool operator==(KnownState const& _other) const; - ///@todo the sequence numbers in two copies of this class should never be the same. - /// might be doable using two-dimensional sequence numbers, where the first value is incremented - /// for each copy - /// Retrieves the current equivalence class fo the given stack element (or generates a new /// one if it does not exist yet). Id stackElement(int _stackHeight, SourceLocation const& _location); - /// @returns the equivalence class id of the special initial stack element at the given height. - Id initialStackElement(int _stackHeight, SourceLocation const& _location); + + /// @returns its set of tags if the given expression class is a known tag union; returns a set + /// containing the tag if it is a PushTag expression and the empty set otherwise. + std::set tagsInExpression(Id _expressionId); + /// During analysis, different tags on the stack are partially treated as the same class. + /// This removes such classes not to confuse later analyzers. + void clearTagUnions(); int stackHeight() const { return m_stackHeight; } std::map const& stackElements() const { return m_stackElements; } @@ -142,6 +144,9 @@ private: /// Finds or creates a new expression that applies the sha3 hash function to the contents in memory. Id applySha3(Id _start, Id _length, SourceLocation const& _location); + /// @returns a new or already used Id representing the given set of tags. + Id tagUnion(std::set _tags); + /// Current stack height, can be negative. int m_stackHeight = 0; /// Current stack layout, mapping stack height -> equivalence class @@ -157,6 +162,8 @@ private: std::map, Id> m_knownSha3Hashes; /// Structure containing the classes of equivalent expressions. std::shared_ptr m_expressionClasses; + /// Container for unions of tags stored on the stack. + boost::bimap> m_tagUnions; }; } diff --git a/test/libsolidity/SolidityOptimizer.cpp b/test/libsolidity/SolidityOptimizer.cpp index efc9316b0..ce43887e1 100644 --- a/test/libsolidity/SolidityOptimizer.cpp +++ b/test/libsolidity/SolidityOptimizer.cpp @@ -315,6 +315,49 @@ BOOST_AUTO_TEST_CASE(retain_information_in_branches) BOOST_CHECK_EQUAL(1, numSHA3s); } +BOOST_AUTO_TEST_CASE(store_tags_as_unions) +{ + // This calls the same function from two sources and both calls have a certain sha3 on + // the stack at the same position. + // Without storing tags as unions, the return from the shared function would not know where to + // jump and thus all jumpdests are forced to clear their state and we do not know about the + // sha3 anymore. + // Note that, for now, this only works if the functions have the same number of return + // parameters since otherwise, the return jump addresses are at different stack positions + // which triggers the "unknown jump target" situation. + char const* sourceCode = R"( + contract test { + bytes32 data; + function f(uint x, bytes32 y) external returns (uint r_a, bytes32 r_d) { + r_d = sha3(y); + shared(y); + r_d = sha3(y); + r_a = 5; + } + function g(uint x, bytes32 y) external returns (uint r_a, bytes32 r_d) { + r_d = sha3(y); + shared(y); + r_d = bytes32(uint(sha3(y)) + 2); + r_a = 7; + } + function shared(bytes32 y) internal { + data = sha3(y); + } + } + )"; + compileBothVersions(sourceCode); + compareVersions("f()", 7, "abc"); + + m_optimize = true; + bytes optimizedBytecode = compileAndRun(sourceCode, 0, "test"); + size_t numSHA3s = 0; + eth::eachInstruction(optimizedBytecode, [&](Instruction _instr, u256 const&) { + if (_instr == eth::Instruction::SHA3) + numSHA3s++; + }); + BOOST_CHECK_EQUAL(2, numSHA3s); +} + BOOST_AUTO_TEST_CASE(cse_intermediate_swap) { eth::KnownState state; From c094c3652efacdd20ea55440da2aeae4f7f8faee Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Wed, 13 May 2015 18:47:50 +0300 Subject: [PATCH 182/461] Fix defualt endpoint in ethminer. --- ethminer/main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ethminer/main.cpp b/ethminer/main.cpp index 80895c975..a322431b4 100644 --- a/ethminer/main.cpp +++ b/ethminer/main.cpp @@ -74,7 +74,7 @@ void help() << "Options:" << endl << endl #if ETH_JSONRPC || !ETH_TRUE << "Work farming mode:" << endl - << " -F,--farm Put into mining farm mode with the work server at URL (default: http://127.0.0.1:8080)" << endl + << " -F,--farm Put into mining farm mode with the work server at URL (default: http://127.0.0.1:8545)" << endl << " --farm-recheck Leave n ms between checks for changed work (default: 500)." << endl #endif << "Benchmarking mode:" << endl @@ -316,7 +316,7 @@ int main(int argc, char** argv) unsigned benchmarkTrials = 5; /// Farm params - string farmURL = "http://127.0.0.1:8080"; + string farmURL = "http://127.0.0.1:8545"; unsigned farmRecheckPeriod = 500; for (int i = 1; i < argc; ++i) From a508bb85ae93c03b8971d064602567f39c07cad7 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Wed, 13 May 2015 18:48:14 +0300 Subject: [PATCH 183/461] Fix default farm endpoint in eth. --- eth/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eth/main.cpp b/eth/main.cpp index 22556bac0..56c9c3534 100644 --- a/eth/main.cpp +++ b/eth/main.cpp @@ -579,7 +579,7 @@ int main(int argc, char** argv) bool useConsole = false; /// Farm params - string farmURL = "http://127.0.0.1:8080"; + string farmURL = "http://127.0.0.1:8545"; unsigned farmRecheckPeriod = 500; /// Wallet password stuff From 5cc63de2f969acbedbfbf52a3681657c57d92570 Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Wed, 13 May 2015 18:02:20 +0200 Subject: [PATCH 184/461] Use seedhash everywhere in EthashAux We now use seedhash everywhere and generate a block number only where it's needed. Namely ethash_light_new() --- alethzero/MainWin.cpp | 6 ++++- eth/main.cpp | 4 ++-- ethminer/main.cpp | 8 +++---- libethcore/Ethash.cpp | 12 +++++----- libethcore/EthashAux.cpp | 48 +++++++++++++++++++--------------------- libethcore/EthashAux.h | 12 +++++----- 6 files changed, 46 insertions(+), 44 deletions(-) diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index 7551eaa35..619fc0637 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -945,7 +945,11 @@ void Main::on_preview_triggered() void Main::on_prepNextDAG_triggered() { - EthashAux::computeFull(ethereum()->blockChain().number() + ETHASH_EPOCH_LENGTH); + EthashAux::computeFull( + EthashAux::seedHash( + ethereum()->blockChain().number() + ETHASH_EPOCH_LENGTH + ) + ); } void Main::refreshMining() diff --git a/eth/main.cpp b/eth/main.cpp index 1eed535cd..e352cd53a 100644 --- a/eth/main.cpp +++ b/eth/main.cpp @@ -857,7 +857,7 @@ int main(int argc, char** argv) auto boundary = bi.boundary(); m = boost::to_lower_copy(string(argv[++i])); bi.nonce = h64(m); - auto r = EthashAux::eval((uint64_t)bi.number, powHash, bi.nonce); + auto r = EthashAux::eval(bi.seedHash(), powHash, bi.nonce); bool valid = r.value < boundary; cout << (valid ? "VALID :-)" : "INVALID :-(") << endl; cout << r.value << (valid ? " < " : " >= ") << boundary << endl; @@ -866,7 +866,7 @@ int main(int argc, char** argv) cout << " with seed as " << seedHash << endl; if (valid) cout << "(mixHash = " << r.mixHash << ")" << endl; - cout << "SHA3( light(seed) ) = " << sha3(EthashAux::light((uint64_t)bi.number)->data()) << endl; + cout << "SHA3( light(seed) ) = " << sha3(EthashAux::light(bi)->data()) << endl; exit(0); } catch (...) diff --git a/ethminer/main.cpp b/ethminer/main.cpp index 80895c975..33c2e7c80 100644 --- a/ethminer/main.cpp +++ b/ethminer/main.cpp @@ -269,8 +269,8 @@ void doFarm(MinerType _m, string const& _remote, unsigned _recheckPeriod) cnote << " Header-hash:" << current.headerHash.hex(); cnote << " Seedhash:" << current.seedHash.hex(); cnote << " Target: " << h256(current.boundary).hex(); - cnote << " Ethash: " << h256(EthashAux::eval(EthashAux::number(current.seedHash), current.headerHash, solution.nonce).value).hex(); - if (EthashAux::eval(EthashAux::number(current.seedHash), current.headerHash, solution.nonce).value < current.boundary) + cnote << " Ethash: " << h256(EthashAux::eval(current.seedHash, current.headerHash, solution.nonce).value).hex(); + if (EthashAux::eval(current.seedHash, current.headerHash, solution.nonce).value < current.boundary) { bool ok = rpc.eth_submitWork("0x" + toString(solution.nonce), "0x" + toString(current.headerHash), "0x" + toString(solution.mixHash)); if (ok) @@ -432,7 +432,7 @@ int main(int argc, char** argv) auto boundary = bi.boundary(); m = boost::to_lower_copy(string(argv[++i])); bi.nonce = h64(m); - auto r = EthashAux::eval((uint64_t)bi.number, powHash, bi.nonce); + auto r = EthashAux::eval(bi.seedHash(), powHash, bi.nonce); bool valid = r.value < boundary; cout << (valid ? "VALID :-)" : "INVALID :-(") << endl; cout << r.value << (valid ? " < " : " >= ") << boundary << endl; @@ -441,7 +441,7 @@ int main(int argc, char** argv) cout << " with seed as " << seedHash << endl; if (valid) cout << "(mixHash = " << r.mixHash << ")" << endl; - cout << "SHA3( light(seed) ) = " << sha3(EthashAux::light((uint64_t)bi.number)->data()) << endl; + cout << "SHA3( light(seed) ) = " << sha3(EthashAux::light(bi)->data()) << endl; exit(0); } catch (...) diff --git a/libethcore/Ethash.cpp b/libethcore/Ethash.cpp index 80550886c..92f9d2e18 100644 --- a/libethcore/Ethash.cpp +++ b/libethcore/Ethash.cpp @@ -77,7 +77,7 @@ Ethash::WorkPackage Ethash::package(BlockInfo const& _bi) void Ethash::prep(BlockInfo const& _header, std::function const& _f) { - EthashAux::full((unsigned)_header.number, _f); + EthashAux::full(_header.seedHash(), _f); } bool Ethash::preVerify(BlockInfo const& _header) @@ -134,7 +134,7 @@ void Ethash::CPUMiner::workLoop() WorkPackage w = work(); - auto dag = EthashAux::full(EthashAux::number(w.seedHash)); + auto dag = EthashAux::full(w.seedHash); h256 boundary = w.boundary; unsigned hashCount = 1; for (; !shouldStop(); tryNonce++, hashCount++) @@ -283,7 +283,7 @@ Ethash::GPUMiner::~GPUMiner() bool Ethash::GPUMiner::report(uint64_t _nonce) { Nonce n = (Nonce)(u64)_nonce; - Result r = EthashAux::eval(EthashAux::number(work().seedHash), work().headerHash, n); + Result r = EthashAux::eval(work().seedHash, work().headerHash, n); if (r.value < work().boundary) return submitProof(Solution{n, r.mixHash}); return false; @@ -310,14 +310,14 @@ void Ethash::GPUMiner::workLoop() unsigned device = instances() > 1 ? index() : s_deviceId; - while (EthashAux::computeFull(EthashAux::number(w.seedHash)) != 100 && !shouldStop()) + while (EthashAux::computeFull(w.seedHash) != 100 && !shouldStop()) { - cnote << "Awaiting DAG" << EthashAux::computeFull(EthashAux::number(w.seedHash)); + cnote << "Awaiting DAG" << EthashAux::computeFull(w.seedHash); this_thread::sleep_for(chrono::milliseconds(500)); } if (shouldStop()) return; - EthashAux::FullType dag = EthashAux::full(EthashAux::number(w.seedHash)); + EthashAux::FullType dag = EthashAux::full(w.seedHash); bytesConstRef dagData = dag->data(); m_miner->init(dagData.data(), dagData.size(), 32, s_platformId, device); } diff --git a/libethcore/EthashAux.cpp b/libethcore/EthashAux.cpp index 9287bcbfc..4f29a6516 100644 --- a/libethcore/EthashAux.cpp +++ b/libethcore/EthashAux.cpp @@ -107,21 +107,21 @@ void EthashAux::killCache(h256 const& _s) EthashAux::LightType EthashAux::light(BlockInfo const& _header) { - return light((uint64_t)_header.number); + return light(_header.seedHash()); } -EthashAux::LightType EthashAux::light(uint64_t _blockNumber) +EthashAux::LightType EthashAux::light(h256 const& _seedHash) { RecursiveGuard l(get()->x_lights); - h256 seedHash = EthashAux::seedHash(_blockNumber); - LightType ret = get()->m_lights[seedHash]; - return ret ? ret : (get()->m_lights[seedHash] = make_shared(_blockNumber)); + LightType ret = get()->m_lights[_seedHash]; + return ret ? ret : (get()->m_lights[_seedHash] = make_shared(_seedHash)); } -EthashAux::LightAllocation::LightAllocation(uint64_t _blockNumber) +EthashAux::LightAllocation::LightAllocation(h256 const& _seedHash) { - light = ethash_light_new(_blockNumber); - size = ethash_get_cachesize(_blockNumber); + uint64_t blockNumber = EthashAux::number(_seedHash); + light = ethash_light_new(blockNumber); + size = ethash_get_cachesize(blockNumber); } EthashAux::LightAllocation::~LightAllocation() @@ -156,14 +156,13 @@ static int dagCallbackShim(unsigned _p) return s_dagCallback ? s_dagCallback(_p) : 0; } -EthashAux::FullType EthashAux::full(uint64_t _blockNumber, function const& _f) +EthashAux::FullType EthashAux::full(h256 const& _seedHash, function const& _f) { - auto l = light(_blockNumber); - h256 seedHash = EthashAux::seedHash(_blockNumber); FullType ret; + auto l = light(_seedHash); DEV_GUARDED(get()->x_fulls) - if ((ret = get()->m_fulls[seedHash].lock())) + if ((ret = get()->m_fulls[_seedHash].lock())) { get()->m_lastUsedFull = ret; return ret; @@ -175,15 +174,15 @@ EthashAux::FullType EthashAux::full(uint64_t _blockNumber, functionx_fulls) - get()->m_fulls[seedHash] = get()->m_lastUsedFull = ret; + get()->m_fulls[_seedHash] = get()->m_lastUsedFull = ret; return ret; } -unsigned EthashAux::computeFull(uint64_t _blockNumber) +unsigned EthashAux::computeFull(h256 const& _seedHash) { Guard l(get()->x_fulls); - h256 seedHash = EthashAux::seedHash(_blockNumber); - if (FullType ret = get()->m_fulls[seedHash].lock()) + uint64_t blockNumber = EthashAux::number(_seedHash); + if (FullType ret = get()->m_fulls[_seedHash].lock()) { get()->m_lastUsedFull = ret; return 100; @@ -192,17 +191,17 @@ unsigned EthashAux::computeFull(uint64_t _blockNumber) if (!get()->m_fullGenerator || !get()->m_fullGenerator->joinable()) { get()->m_fullProgress = 0; - get()->m_generatingFullNumber = _blockNumber / ETHASH_EPOCH_LENGTH * ETHASH_EPOCH_LENGTH; + get()->m_generatingFullNumber = blockNumber / ETHASH_EPOCH_LENGTH * ETHASH_EPOCH_LENGTH; get()->m_fullGenerator = unique_ptr(new thread([=](){ - cnote << "Loading full DAG of" << _blockNumber; - get()->full(_blockNumber, [](unsigned p){ get()->m_fullProgress = p; return 0; }); + cnote << "Loading full DAG of seedhash: " << _seedHash; + get()->full(_seedHash, [](unsigned p){ get()->m_fullProgress = p; return 0; }); cnote << "Full DAG loaded"; get()->m_fullProgress = 0; get()->m_generatingFullNumber = NotGenerating; })); } - return (get()->m_generatingFullNumber == _blockNumber) ? get()->m_fullProgress : 0; + return (get()->m_generatingFullNumber == blockNumber) ? get()->m_fullProgress : 0; } Ethash::Result EthashAux::FullAllocation::compute(h256 const& _headerHash, Nonce const& _nonce) const @@ -223,13 +222,12 @@ Ethash::Result EthashAux::LightAllocation::compute(h256 const& _headerHash, Nonc Ethash::Result EthashAux::eval(BlockInfo const& _header, Nonce const& _nonce) { - return eval((uint64_t)_header.number, _header.headerHash(WithoutNonce), _nonce); + return eval(_header.seedHash(), _header.headerHash(WithoutNonce), _nonce); } -Ethash::Result EthashAux::eval(uint64_t _blockNumber, h256 const& _headerHash, Nonce const& _nonce) +Ethash::Result EthashAux::eval(h256 const& _seedHash, h256 const& _headerHash, Nonce const& _nonce) { - h256 seedHash = EthashAux::seedHash(_blockNumber); - if (FullType dag = get()->m_fulls[seedHash].lock()) + if (FullType dag = get()->m_fulls[_seedHash].lock()) return dag->compute(_headerHash, _nonce); - return EthashAux::get()->light(_blockNumber)->compute(_headerHash, _nonce); + return EthashAux::get()->light(_seedHash)->compute(_headerHash, _nonce); } diff --git a/libethcore/EthashAux.h b/libethcore/EthashAux.h index f57f7a4d3..2a4060e78 100644 --- a/libethcore/EthashAux.h +++ b/libethcore/EthashAux.h @@ -40,7 +40,7 @@ public: struct LightAllocation { - LightAllocation(uint64_t _blockNumber); + LightAllocation(h256 const& _seedHash); ~LightAllocation(); bytesConstRef data() const; Ethash::Result compute(h256 const& _headerHash, Nonce const& _nonce) const; @@ -66,19 +66,19 @@ public: static uint64_t cacheSize(BlockInfo const& _header); static LightType light(BlockInfo const& _header); - static LightType light(uint64_t _blockNumber); + static LightType light(h256 const& _seedHash); static const uint64_t NotGenerating = (uint64_t)-1; - /// Kicks off generation of DAG for @a _blocknumber and @returns false or @returns true if ready. - static unsigned computeFull(uint64_t _blockNumber); + /// Kicks off generation of DAG for @a _seedHash and @returns false or @returns true if ready. + static unsigned computeFull(h256 const& _seedHash); /// Information on the generation progress. static std::pair fullGeneratingProgress() { return std::make_pair(get()->m_generatingFullNumber, get()->m_fullProgress); } /// Kicks off generation of DAG for @a _blocknumber and blocks until ready; @returns result. - static FullType full(uint64_t _blockNumber, std::function const& _f = std::function()); + static FullType full(h256 const& _seedHash, std::function const& _f = std::function()); static Ethash::Result eval(BlockInfo const& _header) { return eval(_header, _header.nonce); } static Ethash::Result eval(BlockInfo const& _header, Nonce const& _nonce); - static Ethash::Result eval(uint64_t _blockNumber, h256 const& _headerHash, Nonce const& _nonce); + static Ethash::Result eval(h256 const& _seedHash, h256 const& _headerHash, Nonce const& _nonce); private: EthashAux() {} From 8aaaae3d33ee003338153803641d369a670610fe Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Wed, 13 May 2015 18:18:47 +0200 Subject: [PATCH 185/461] Remove unneeded comment --- libethcore/Ethash.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libethcore/Ethash.h b/libethcore/Ethash.h index 997c32cd0..0fd2e4cd0 100644 --- a/libethcore/Ethash.h +++ b/libethcore/Ethash.h @@ -66,7 +66,7 @@ public: h256 boundary; h256 headerHash; ///< When h256() means "pause until notified a new work package is available". - h256 seedHash; /// LTODO: IS this needed now that we use the block number instead? + h256 seedHash; }; static const WorkPackage NullWorkPackage; @@ -78,7 +78,7 @@ public: static bool preVerify(BlockInfo const& _header); static WorkPackage package(BlockInfo const& _header); static void assignResult(Solution const& _r, BlockInfo& _header) { _header.nonce = _r.nonce; _header.mixHash = _r.mixHash; } - + class CPUMiner: public Miner, Worker { @@ -119,7 +119,7 @@ public: static void setDefaultPlatform(unsigned _id) { s_platformId = _id; } static void setDefaultDevice(unsigned _id) { s_deviceId = _id; } static void setNumInstances(unsigned _instances) { s_numInstances = std::min(_instances, getNumDevices()); } - + protected: void kickOff() override; void pause() override; From dfdc1a44e9dc820f9931e9d17c0070386cfee0d7 Mon Sep 17 00:00:00 2001 From: chriseth Date: Wed, 13 May 2015 19:13:03 +0200 Subject: [PATCH 186/461] Fixed indentation. --- libevmasm/CommonSubexpressionEliminator.cpp | 4 +--- libevmasm/KnownState.cpp | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/libevmasm/CommonSubexpressionEliminator.cpp b/libevmasm/CommonSubexpressionEliminator.cpp index 7564fcd99..9f6f9dd63 100644 --- a/libevmasm/CommonSubexpressionEliminator.cpp +++ b/libevmasm/CommonSubexpressionEliminator.cpp @@ -199,9 +199,7 @@ void CSECodeGenerator::addDependencies(Id _c) addDependencies(argument); m_neededBy.insert(make_pair(argument, _c)); } - if ( - expr.item && - expr.item->type() == Operation && ( + if (expr.item && expr.item->type() == Operation && ( expr.item->instruction() == Instruction::SLOAD || expr.item->instruction() == Instruction::MLOAD || expr.item->instruction() == Instruction::SHA3 diff --git a/libevmasm/KnownState.cpp b/libevmasm/KnownState.cpp index b84e656aa..0aac9cedb 100644 --- a/libevmasm/KnownState.cpp +++ b/libevmasm/KnownState.cpp @@ -230,7 +230,7 @@ ExpressionClasses::Id KnownState::stackElement(int _stackHeight, SourceLocation return m_stackElements.at(_stackHeight); // Stack element not found (not assigned yet), create new unknown equivalence class. return m_stackElements[_stackHeight] = - m_expressionClasses->find(AssemblyItem(UndefinedItem, _stackHeight, _location)); + m_expressionClasses->find(AssemblyItem(UndefinedItem, _stackHeight, _location)); } void KnownState::clearTagUnions() From b821f0e7dc66bcc1ed35ecbc46c84fe83562b192 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Wed, 13 May 2015 20:17:43 +0300 Subject: [PATCH 187/461] Fix build. --- libethash/CMakeLists.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libethash/CMakeLists.txt b/libethash/CMakeLists.txt index 907eccd40..d6ae41569 100644 --- a/libethash/CMakeLists.txt +++ b/libethash/CMakeLists.txt @@ -43,6 +43,4 @@ if (CRYPTOPP_FOUND) TARGET_LINK_LIBRARIES(${LIBRARY} ${CRYPTOPP_LIBRARIES}) endif() -if (NOT ETHASHCL) - install( TARGETS ${LIBRARY} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) -endif () \ No newline at end of file +install( TARGETS ${LIBRARY} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) From 6b0007d98ec41b5de7237df0677ae8a06510608e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Wed, 13 May 2015 19:35:19 +0200 Subject: [PATCH 188/461] Add support for --singletest filter in VM tests. Add & correct arithmetic VM tests. --- .../VMTestsFiller/vmArithmeticTestFiller.json | 189 +++++++++++++++++- test/libevm/vm.cpp | 7 +- 2 files changed, 188 insertions(+), 8 deletions(-) diff --git a/test/libevm/VMTestsFiller/vmArithmeticTestFiller.json b/test/libevm/VMTestsFiller/vmArithmeticTestFiller.json index c06a429e0..76771982e 100644 --- a/test/libevm/VMTestsFiller/vmArithmeticTestFiller.json +++ b/test/libevm/VMTestsFiller/vmArithmeticTestFiller.json @@ -728,6 +728,41 @@ "gas" : "100000" } }, + + "divByZero_2": { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "1000000", + "currentDifficulty" : "256", + "currentTimestamp" : "1", + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "expect" : { + "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "storage" : { + "0x" : "0x00" + } + } + }, + "pre" : { + "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "1000000000000000000", + "nonce" : "0", + "code" : "{ [[ 0 ]] (+ (/ 13 0) 7)}", + "storage": {} + } + }, + "exec" : { + "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681", + "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681", + "value" : "1000000000000000000", + "data" : "", + "gasPrice" : "100000000000000", + "gas" : "100000" + } + }, "div1": { "env" : { @@ -974,6 +1009,34 @@ } }, + "sdivByZero2": { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "1000000", + "currentDifficulty" : "256", + "currentTimestamp" : "1", + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "pre" : { + "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "1000000000000000000", + "nonce" : "0", + "code" : "{ [[ 0 ]] (+ (SDIV (- 0 115792089237316195423570985008687907853269984665640564039457584007900129639935) 0) 1) }", + "storage": {} + } + }, + "exec" : { + "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681", + "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681", + "value" : "1000000000000000000", + "data" : "", + "gasPrice" : "100000000000000", + "gas" : "100000" + } + }, + "sdiv0": { "env" : { "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", @@ -1639,6 +1702,34 @@ } }, + "modByZero": { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "1000000", + "currentDifficulty" : "256", + "currentTimestamp" : "1", + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "pre" : { + "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "1000000000000000000", + "nonce" : "0", + "code" : "{ [[ 0 ]] (- (% 3 0) 1) }", + "storage": {} + } + }, + "exec" : { + "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681", + "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681", + "value" : "1000000000000000000", + "data" : "", + "gasPrice" : "100000000000000", + "gas" : "100000" + } + }, + "smod0": { "env" : { "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", @@ -1873,7 +1964,7 @@ "value" : "1000000000000000000", "data" : "", "gasPrice" : "100000000000000", - "gas" : "10000" + "gas" : "100000" } }, @@ -1912,6 +2003,34 @@ } }, + "smod8_byZero": { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "1000000", + "currentDifficulty" : "256", + "currentTimestamp" : "1", + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "pre" : { + "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "1000000000000000000", + "nonce" : "0", + "code" : "{ [[ 0 ]] (- (SMOD (- 0 200) 0) 13)}", + "storage": {} + } + }, + "exec" : { + "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681", + "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681", + "value" : "1000000000000000000", + "data" : "", + "gasPrice" : "100000000000000", + "gas" : "100000" + } + }, + "addmod0": { "env" : { "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", @@ -2006,7 +2125,7 @@ "value" : "1000000000000000000", "data" : "", "gasPrice" : "100000000000000", - "gas" : "10000" + "gas" : "1000000" } }, @@ -2104,7 +2223,7 @@ "value" : "1000000000000000000", "data" : "", "gasPrice" : "100000000000000", - "gas" : "10000" + "gas" : "1000000" } }, @@ -2132,7 +2251,7 @@ "value" : "1000000000000000000", "data" : "", "gasPrice" : "100000000000000", - "gas" : "10000" + "gas" : "1000000" } }, @@ -2416,6 +2535,34 @@ } }, + "addmodDivByZero3": { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "1000000", + "currentDifficulty" : "256", + "currentTimestamp" : "1", + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "pre" : { + "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "1000000000000000000", + "nonce" : "0", + "code" : "{ [[ 0 ]] (- (ADDMOD 0 0 0) 1) } ", + "storage": {} + } + }, + "exec" : { + "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681", + "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681", + "value" : "1000000000000000000", + "data" : "", + "gasPrice" : "100000000000000", + "gas" : "100000" + } + }, + "mulmod0": { "env" : { @@ -2546,7 +2693,7 @@ "value" : "1000000000000000000", "data" : "", "gasPrice" : "100000000000000", - "gas" : "10000" + "gas" : "1000000" } }, @@ -2574,7 +2721,7 @@ "value" : "1000000000000000000", "data" : "", "gasPrice" : "100000000000000", - "gas" : "10000" + "gas" : "1000000" } }, @@ -2602,7 +2749,7 @@ "value" : "1000000000000000000", "data" : "", "gasPrice" : "100000000000000", - "gas" : "10000" + "gas" : "1000000" } }, @@ -2921,6 +3068,34 @@ } }, + "mulmoddivByZero3": { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "1000000", + "currentDifficulty" : "256", + "currentTimestamp" : "1", + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "pre" : { + "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "1000000000000000000", + "nonce" : "0", + "code" : "{ [[ 0 ]] (- 1 (MULMOD 0 0 0)) } ", + "storage": {} + } + }, + "exec" : { + "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681", + "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681", + "value" : "1000000000000000000", + "data" : "", + "gasPrice" : "100000000000000", + "gas" : "100000" + } + }, + "expXY": { "env" : { "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", diff --git a/test/libevm/vm.cpp b/test/libevm/vm.cpp index 090258244..10670bfe3 100644 --- a/test/libevm/vm.cpp +++ b/test/libevm/vm.cpp @@ -300,9 +300,14 @@ void doVMTests(json_spirit::mValue& v, bool _fillin) { for (auto& i: v.get_obj()) { - std::cout << " " << i.first << "\n"; mObject& o = i.second.get_obj(); + if (test::Options::get().singleTest && test::Options::get().singleTestName != i.first) + { + o.clear(); + continue; + } + std::cout << " " << i.first << "\n"; BOOST_REQUIRE(o.count("env") > 0); BOOST_REQUIRE(o.count("pre") > 0); BOOST_REQUIRE(o.count("exec") > 0); From 89dbcca30b752ecf2b8b56b5f396a6a86c29fc0a Mon Sep 17 00:00:00 2001 From: Marek Kotewicz Date: Thu, 14 May 2015 14:05:30 +0200 Subject: [PATCH 189/461] Squashed 'libjsqrc/ethereumjs/' changes from e908439..16861fc 16861fc version 0.4.2 e4f7dde fixed failing lint 69e7d9d fixed #133 55553d7 add async error test d02a375 Merge branch 'develop' of github.com:ethereum/web3.js into develop ff48da1 fixed callback error issue 471bce1 #133 in progress dc69085 version 0.4.1 2ae0afa critical bugfix 09f2a92 updated examples a0a36e5 Merge branch 'develop' of https://github.com/ethereum/ethereum.js into develop 2b179a8 updated node install test 8f63640 Merge pull request #203 from frozeman/develop 22ef4a1 added estimateGas method cd2e462 version 0.4.0 ae7762a Merge pull request #198 from ethereum/minerMethods d1e1206 removed byte formatter methods 6fd17d9 merged develop 373fd1b Merge pull request #201 from debris/batch 274fc29 Merge pull request #200 from debris/contract_overhaul b2ff2ff Merge branch 'contract_overhaul' into batch 99a3bda removed redundant lines 7cafac9 Merge branch 'develop' into contract_overhaul fa8db32 Merge pull request #202 from debris/async_properties 5f9272c asyncGet -> getAsync cd0df61 gulp 80c0792 async getting properties, remove property setters 744bb9e batch for requests with calls/transacts 8636077 initial support for batch requests a0b9cfb contract async call && transact 1272780 sendTransaction && call async 6afb1f9 Merge branch 'async-contract-calls' of https://github.com/niran/web3.js into contract_overhaul 611f640 asynchronous contract creation, breaking changes e3796bf merged develop edf808a add getWork and submitWork functions and toXBytes utils 9812b01 Merge branch 'blockFilterProposal' of https://github.com/ethereum/ethereum.js into develop 6f466f6 add miner functions 3af8e27 add newblockfilter Proposal e86552f Use async contract calls when a callback is passed git-subtree-dir: libjsqrc/ethereumjs git-subtree-split: 16861fc1944cca721672bb8faa81909d69be2b99 --- bower.json | 2 +- dist/web3-light.js | 591 +++++++++++++++++---------- dist/web3-light.js.map | 30 +- dist/web3-light.min.js | 4 +- dist/web3.js | 593 ++++++++++++++++++---------- dist/web3.js.map | 30 +- dist/web3.min.js | 4 +- example/contract.html | 44 ++- example/event_inc.html | 64 ++- example/node-app.js | 4 +- index.js | 1 - lib/solidity/abi.js | 44 --- lib/solidity/utils.js | 45 --- lib/utils/utils.js | 1 + lib/version.json | 2 +- lib/web3.js | 4 + lib/web3/batch.js | 61 +++ lib/web3/contract.js | 166 +++++--- lib/web3/eth.js | 23 ++ lib/web3/function.js | 89 ++++- lib/web3/method.js | 17 +- lib/web3/property.js | 40 +- lib/web3/requestmanager.js | 27 ++ lib/web3/watches.js | 15 +- package.js | 2 +- package.json | 2 +- test/abi.formatConstructorParams.js | 106 ----- test/async.js | 69 ++++ test/batch.js | 86 ++++ test/contract.js | 100 ++++- test/method.request.js | 23 ++ test/node/app.js | 2 +- test/node/package.json | 2 +- test/polling.js | 21 +- test/web3.eth.blockNumber.js | 20 + test/web3.eth.call.js | 41 ++ test/web3.eth.contract.js | 21 +- test/web3.eth.estimateGas.js | 25 ++ test/web3.eth.filter.js | 10 +- test/web3.eth.getWork.js | 16 + test/web3.eth.submitWork.js | 17 + 41 files changed, 1675 insertions(+), 789 deletions(-) delete mode 100644 lib/solidity/abi.js delete mode 100644 lib/solidity/utils.js create mode 100644 lib/web3/batch.js delete mode 100644 test/abi.formatConstructorParams.js create mode 100644 test/async.js create mode 100644 test/batch.js create mode 100644 test/method.request.js create mode 100644 test/web3.eth.call.js create mode 100644 test/web3.eth.estimateGas.js create mode 100644 test/web3.eth.getWork.js create mode 100644 test/web3.eth.submitWork.js diff --git a/bower.json b/bower.json index db9a4702d..ed620555f 100644 --- a/bower.json +++ b/bower.json @@ -1,7 +1,7 @@ { "name": "web3", "namespace": "ethereum", - "version": "0.3.6", + "version": "0.4.2", "description": "Ethereum Compatible JavaScript API", "main": [ "./dist/web3.js", diff --git a/dist/web3-light.js b/dist/web3-light.js index c128634de..be6d95eec 100644 --- a/dist/web3-light.js +++ b/dist/web3-light.js @@ -15,52 +15,6 @@ require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof requ You should have received a copy of the GNU Lesser General Public License along with ethereum.js. If not, see . */ -/** - * @file abi.js - * @author Marek Kotewicz - * @author Gav Wood - * @date 2014 - */ - -var coder = require('./coder'); -var utils = require('./utils'); - -var formatConstructorParams = function (abi, params) { - var constructor = utils.getConstructor(abi, params.length); - if (!constructor) { - if (params.length > 0) { - console.warn("didn't found matching constructor, using default one"); - } - return ''; - } - - return coder.encodeParams(constructor.inputs.map(function (input) { - return input.type; - }), params); -}; - -module.exports = { - formatConstructorParams: formatConstructorParams -}; - - -},{"./coder":2,"./utils":5}],2:[function(require,module,exports){ -/* - This file is part of ethereum.js. - - ethereum.js is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - ethereum.js is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with ethereum.js. If not, see . -*/ /** * @file coder.js * @author Marek Kotewicz @@ -328,7 +282,7 @@ var coder = new SolidityCoder([ module.exports = coder; -},{"../utils/utils":8,"./formatters":3,"./param":4,"bignumber.js":"bignumber.js"}],3:[function(require,module,exports){ +},{"../utils/utils":6,"./formatters":2,"./param":3,"bignumber.js":"bignumber.js"}],2:[function(require,module,exports){ /* This file is part of ethereum.js. @@ -548,7 +502,7 @@ module.exports = { }; -},{"../utils/config":7,"../utils/utils":8,"./param":4,"bignumber.js":"bignumber.js"}],4:[function(require,module,exports){ +},{"../utils/config":5,"../utils/utils":6,"./param":3,"bignumber.js":"bignumber.js"}],3:[function(require,module,exports){ /* This file is part of ethereum.js. @@ -760,54 +714,7 @@ SolidityParam.decodeArray = function (bytes, index) { module.exports = SolidityParam; -},{"../utils/utils":8}],5:[function(require,module,exports){ -/* - This file is part of ethereum.js. - - ethereum.js is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - ethereum.js is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with ethereum.js. If not, see . -*/ -/** - * @file utils.js - * @author Marek Kotewicz - * @date 2015 - */ - -/** - * Returns the contstructor with matching number of arguments - * - * @method getConstructor - * @param {Array} abi - * @param {Number} numberOfArgs - * @returns {Object} constructor function abi - */ -var getConstructor = function (abi, numberOfArgs) { - return abi.filter(function (f) { - return f.type === 'constructor' && f.inputs.length === numberOfArgs; - })[0]; -}; - -//var getSupremeType = function (type) { - //return type.substr(0, type.indexOf('[')) + ']'; -//}; - - -module.exports = { - getConstructor: getConstructor -}; - - -},{}],6:[function(require,module,exports){ +},{"../utils/utils":6}],4:[function(require,module,exports){ 'use strict'; // go env doesn't have and need XMLHttpRequest @@ -818,7 +725,7 @@ if (typeof XMLHttpRequest === 'undefined') { } -},{}],7:[function(require,module,exports){ +},{}],5:[function(require,module,exports){ /* This file is part of ethereum.js. @@ -890,7 +797,7 @@ module.exports = { }; -},{"bignumber.js":"bignumber.js"}],8:[function(require,module,exports){ +},{"bignumber.js":"bignumber.js"}],6:[function(require,module,exports){ /* This file is part of ethereum.js. @@ -1256,6 +1163,7 @@ var toAddress = function (address) { return '0x' + padLeft(toHex(address).substr(2), 40); }; + /** * Returns true if object is BigNumber, otherwise false * @@ -1366,12 +1274,12 @@ module.exports = { }; -},{"bignumber.js":"bignumber.js"}],9:[function(require,module,exports){ +},{"bignumber.js":"bignumber.js"}],7:[function(require,module,exports){ module.exports={ - "version": "0.3.6" + "version": "0.4.2" } -},{}],10:[function(require,module,exports){ +},{}],8:[function(require,module,exports){ /* This file is part of ethereum.js. @@ -1411,6 +1319,7 @@ var RequestManager = require('./web3/requestmanager'); var c = require('./utils/config'); var Method = require('./web3/method'); var Property = require('./web3/property'); +var Batch = require('./web3/batch'); var web3Methods = [ new Method({ @@ -1503,6 +1412,9 @@ web3.toBigNumber = utils.toBigNumber; web3.toWei = utils.toWei; web3.fromWei = utils.fromWei; web3.isAddress = utils.isAddress; +web3.createBatch = function () { + return new Batch(); +}; // ADD defaultblock Object.defineProperty(web3.eth, 'defaultBlock', { @@ -1538,7 +1450,70 @@ setupMethods(web3.shh, shh.methods); module.exports = web3; -},{"./utils/config":7,"./utils/utils":8,"./version.json":9,"./web3/db":12,"./web3/eth":14,"./web3/filter":16,"./web3/formatters":17,"./web3/method":21,"./web3/net":22,"./web3/property":23,"./web3/requestmanager":25,"./web3/shh":26,"./web3/watches":27}],11:[function(require,module,exports){ +},{"./utils/config":5,"./utils/utils":6,"./version.json":7,"./web3/batch":9,"./web3/db":11,"./web3/eth":13,"./web3/filter":15,"./web3/formatters":16,"./web3/method":20,"./web3/net":21,"./web3/property":22,"./web3/requestmanager":24,"./web3/shh":25,"./web3/watches":26}],9:[function(require,module,exports){ +/* + This file is part of ethereum.js. + + ethereum.js is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ethereum.js is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with ethereum.js. If not, see . +*/ +/** + * @file batch.js + * @author Marek Kotewicz + * @date 2015 + */ + +var RequestManager = require('./requestmanager'); + +var Batch = function () { + this.requests = []; +}; + +/** + * Should be called to add create new request to batch request + * + * @method add + * @param {Object} jsonrpc requet object + */ +Batch.prototype.add = function (request) { + this.requests.push(request); +}; + +/** + * Should be called to execute batch request + * + * @method execute + */ +Batch.prototype.execute = function () { + var requests = this.requests; + RequestManager.getInstance().sendBatch(requests, function (err, results) { + results = results || []; + requests.map(function (request, index) { + return results[index] || {}; + }).map(function (result, index) { + return requests[index].format ? requests[index].format(result.result) : result.result; + }).forEach(function (result, index) { + if (requests[index].callback) { + requests[index].callback(err, result); + } + }); + }); +}; + +module.exports = Batch; + + +},{"./requestmanager":24}],10:[function(require,module,exports){ /* This file is part of ethereum.js. @@ -1562,13 +1537,39 @@ module.exports = web3; */ var web3 = require('../web3'); -var solAbi = require('../solidity/abi'); var utils = require('../utils/utils'); +var coder = require('../solidity/coder'); var SolidityEvent = require('./event'); var SolidityFunction = require('./function'); -var addFunctionsToContract = function (contract, desc) { - desc.filter(function (json) { +/** + * Should be called to encode constructor params + * + * @method encodeConstructorParams + * @param {Array} abi + * @param {Array} constructor params + */ +var encodeConstructorParams = function (abi, params) { + return abi.filter(function (json) { + return json.type === 'constructor' && json.inputs.length === params.length; + }).map(function (json) { + return json.inputs.map(function (input) { + return input.type; + }); + }).map(function (types) { + return coder.encodeParams(types, params); + })[0] || ''; +}; + +/** + * Should be called to add functions to contract object + * + * @method addFunctionsToContract + * @param {Contract} contract + * @param {Array} abi + */ +var addFunctionsToContract = function (contract, abi) { + abi.filter(function (json) { return json.type === 'function'; }).map(function (json) { return new SolidityFunction(json, contract.address); @@ -1577,8 +1578,15 @@ var addFunctionsToContract = function (contract, desc) { }); }; -var addEventsToContract = function (contract, desc) { - desc.filter(function (json) { +/** + * Should be called to add events to contract object + * + * @method addEventsToContract + * @param {Contract} contract + * @param {Array} abi + */ +var addEventsToContract = function (contract, abi) { + abi.filter(function (json) { return json.type === 'event'; }).map(function (json) { return new SolidityEvent(json, contract.address); @@ -1588,65 +1596,106 @@ var addEventsToContract = function (contract, desc) { }; /** - * This method should be called when we want to call / transact some solidity method from javascript - * it returns an object which has same methods available as solidity contract description - * usage example: - * - * var abi = [{ - * name: 'myMethod', - * inputs: [{ name: 'a', type: 'string' }], - * outputs: [{name: 'd', type: 'string' }] - * }]; // contract abi - * - * var MyContract = web3.eth.contract(abi); // creation of contract prototype - * - * var contractInstance = new MyContract('0x0123123121'); + * Should be called to create new ContractFactory * - * contractInstance.myMethod('this is test string param for call'); // myMethod call (implicit, default) - * contractInstance.call().myMethod('this is test string param for call'); // myMethod call (explicit) - * contractInstance.sendTransaction().myMethod('this is test string param for transact'); // myMethod sendTransaction - * - * @param abi - abi json description of the contract, which is being created - * @returns contract object + * @method contract + * @param {Array} abi + * @returns {ContractFactory} new contract factory */ var contract = function (abi) { + return new ContractFactory(abi); +}; - // return prototype - return Contract.bind(null, abi); +/** + * Should be called to create new ContractFactory instance + * + * @method ContractFactory + * @param {Array} abi + */ +var ContractFactory = function (abi) { + this.abi = abi; }; -var Contract = function (abi, options) { +/** + * Should be called to create new contract on a blockchain + * + * @method new + * @param {Any} contract constructor param1 (optional) + * @param {Any} contract constructor param2 (optional) + * @param {Object} contract transaction object (required) + * @param {Function} callback + * @returns {Contract} returns contract if no callback was passed, + * otherwise calls callback function (err, contract) + */ +ContractFactory.prototype.new = function () { + // parse arguments + var options = {}; // required! + var callback; - this.address = ''; - if (utils.isAddress(options)) { - this.address = options; - } else { // is an object! - // TODO, parse the rest of the args - options = options || {}; - var args = Array.prototype.slice.call(arguments, 2); - var bytes = solAbi.formatConstructorParams(abi, args); - options.data += bytes; - this.address = web3.eth.sendTransaction(options); + var args = Array.prototype.slice.call(arguments); + if (utils.isFunction(args[args.length - 1])) { + callback = args.pop(); } - addFunctionsToContract(this, abi); - addEventsToContract(this, abi); + var last = args[args.length - 1]; + if (utils.isObject(last) && !utils.isArray(last)) { + options = args.pop(); + } + + // throw an error if there are no options + + var bytes = encodeConstructorParams(this.abi, args); + options.data += bytes; + + if (!callback) { + var address = web3.eth.sendTransaction(options); + return this.at(address); + } + + var self = this; + web3.eth.sendTransaction(options, function (err, address) { + if (err) { + callback(err); + } + self.at(address, callback); + }); }; -Contract.prototype.call = function () { - console.error('contract.call is deprecated'); - return this; +/** + * Should be called to get access to existing contract on a blockchain + * + * @method at + * @param {Address} contract address (required) + * @param {Function} callback {optional) + * @returns {Contract} returns contract if no callback was passed, + * otherwise calls callback function (err, contract) + */ +ContractFactory.prototype.at = function (address, callback) { + // TODO: address is required + + if (callback) { + callback(null, new Contract(this.abi, address)); + } + return new Contract(this.abi, address); }; -Contract.prototype.sendTransaction = function () { - console.error('contract.sendTransact is deprecated'); - return this; +/** + * Should be called to create new contract instance + * + * @method Contract + * @param {Array} abi + * @param {Address} contract address + */ +var Contract = function (abi, address) { + this.address = address; + addFunctionsToContract(this, abi); + addEventsToContract(this, abi); }; module.exports = contract; -},{"../solidity/abi":1,"../utils/utils":8,"../web3":10,"./event":15,"./function":18}],12:[function(require,module,exports){ +},{"../solidity/coder":1,"../utils/utils":6,"../web3":8,"./event":14,"./function":17}],11:[function(require,module,exports){ /* This file is part of ethereum.js. @@ -1704,7 +1753,7 @@ module.exports = { methods: methods }; -},{"./method":21}],13:[function(require,module,exports){ +},{"./method":20}],12:[function(require,module,exports){ /* This file is part of ethereum.js. @@ -1744,7 +1793,7 @@ module.exports = { }; -},{}],14:[function(require,module,exports){ +},{}],13:[function(require,module,exports){ /* This file is part of ethereum.js. @@ -1921,6 +1970,14 @@ var call = new Method({ inputFormatter: [formatters.inputTransactionFormatter, formatters.inputDefaultBlockNumberFormatter] }); +var estimateGas = new Method({ + name: 'estimateGas', + call: 'eth_estimateGas', + params: 1, + inputFormatter: [formatters.inputTransactionFormatter], + outputFormatter: utils.toDecimal +}); + var compileSolidity = new Method({ name: 'compile.solidity', call: 'eth_compileSolidity', @@ -1939,6 +1996,18 @@ var compileSerpent = new Method({ params: 1 }); +var submitWork = new Method({ + name: 'submitWork', + call: 'eth_submitWork', + params: 3 +}); + +var getWork = new Method({ + name: 'getWork', + call: 'eth_getWork', + params: 0 +}); + var methods = [ getBalance, getStorageAt, @@ -1952,10 +2021,13 @@ var methods = [ getTransactionFromBlock, getTransactionCount, call, + estimateGas, sendTransaction, compileSolidity, compileLLL, compileSerpent, + submitWork, + getWork ]; /// @returns an array of objects describing web3.eth api properties @@ -1998,7 +2070,7 @@ module.exports = { }; -},{"../utils/utils":8,"./formatters":17,"./method":21,"./property":23}],15:[function(require,module,exports){ +},{"../utils/utils":6,"./formatters":16,"./method":20,"./property":22}],14:[function(require,module,exports){ /* This file is part of ethereum.js. @@ -2194,7 +2266,7 @@ SolidityEvent.prototype.attachToContract = function (contract) { module.exports = SolidityEvent; -},{"../solidity/coder":2,"../utils/utils":8,"../web3":10,"./formatters":17}],16:[function(require,module,exports){ +},{"../solidity/coder":1,"../utils/utils":6,"../web3":8,"./formatters":16}],15:[function(require,module,exports){ /* This file is part of ethereum.js. @@ -2351,7 +2423,7 @@ Filter.prototype.get = function (callback) { module.exports = Filter; -},{"../utils/utils":8,"./formatters":17,"./requestmanager":25}],17:[function(require,module,exports){ +},{"../utils/utils":6,"./formatters":16,"./requestmanager":24}],16:[function(require,module,exports){ /* This file is part of ethereum.js. @@ -2571,7 +2643,7 @@ module.exports = { }; -},{"../utils/config":7,"../utils/utils":8}],18:[function(require,module,exports){ +},{"../utils/config":5,"../utils/utils":6}],17:[function(require,module,exports){ /* This file is part of ethereum.js. @@ -2588,7 +2660,7 @@ module.exports = { You should have received a copy of the GNU Lesser General Public License along with ethereum.js. If not, see . */ -/** +/** * @file function.js * @author Marek Kotewicz * @date 2015 @@ -2613,18 +2685,23 @@ var SolidityFunction = function (json, address) { this._address = address; }; +SolidityFunction.prototype.extractCallback = function (args) { + if (utils.isFunction(args[args.length - 1])) { + return args.pop(); // modify the args array! + } +}; + /** * Should be used to create payload from arguments * * @method toPayload - * @param {...} solidity function params + * @param {Array} solidity function params * @param {Object} optional payload options */ -SolidityFunction.prototype.toPayload = function () { - var args = Array.prototype.slice.call(arguments); +SolidityFunction.prototype.toPayload = function (args) { var options = {}; if (args.length > this._inputTypes.length && utils.isObject(args[args.length -1])) { - options = args.pop(); + options = args[args.length - 1]; } options.to = this._address; options.data = '0x' + this.signature() + coder.encodeParams(this._inputTypes, args); @@ -2641,19 +2718,41 @@ SolidityFunction.prototype.signature = function () { return web3.sha3(web3.fromAscii(this._name)).slice(2, 10); }; + +SolidityFunction.prototype.unpackOutput = function (output) { + if (output === null) { + return; + } + + output = output.length >= 2 ? output.slice(2) : output; + var result = coder.decodeParams(this._outputTypes, output); + return result.length === 1 ? result[0] : result; +}; + /** - * Should be used to call function - * + * Calls a contract function. + * * @method call - * @param {Object} options + * @param {...Object} Contract function arguments + * @param {function} If the last argument is a function, the contract function + * call will be asynchronous, and the callback will be passed the + * error and result. * @return {String} output bytes */ SolidityFunction.prototype.call = function () { - var payload = this.toPayload.apply(this, Array.prototype.slice.call(arguments)); - var output = web3.eth.call(payload); - output = output.length >= 2 ? output.slice(2) : output; - var result = coder.decodeParams(this._outputTypes, output); - return result.length === 1 ? result[0] : result; + var args = Array.prototype.slice.call(arguments); + var callback = this.extractCallback(args); + var payload = this.toPayload(args); + + if (!callback) { + var output = web3.eth.call(payload); + return this.unpackOutput(output); + } + + var self = this; + web3.eth.call(payload, function (error, output) { + callback(error, self.unpackOutput(output)); + }); }; /** @@ -2663,8 +2762,16 @@ SolidityFunction.prototype.call = function () { * @param {Object} options */ SolidityFunction.prototype.sendTransaction = function () { - var payload = this.toPayload.apply(this, Array.prototype.slice.call(arguments)); - web3.eth.sendTransaction(payload); + var args = Array.prototype.slice.call(arguments); + var callback = this.extractCallback(args); + var payload = this.toPayload(args); + + if (!callback) { + web3.eth.sendTransaction(payload); + return; + } + + web3.eth.sendTransaction(payload, callback); }; /** @@ -2679,7 +2786,7 @@ SolidityFunction.prototype.displayName = function () { /** * Should be used to get function type name - * + * * @method typeName * @return {String} type name of the function */ @@ -2687,6 +2794,25 @@ SolidityFunction.prototype.typeName = function () { return utils.extractTypeName(this._name); }; +/** + * Should be called to get rpc requests from solidity function + * + * @method request + * @returns {Object} + */ +SolidityFunction.prototype.request = function () { + var args = Array.prototype.slice.call(arguments); + var callback = this.extractCallback(args); + var payload = this.toPayload(args); + var format = this.unpackOutput.bind(this); + + return { + callback: callback, + payload: payload, + format: format + }; +}; + /** * Should be called to execute function * @@ -2694,7 +2820,7 @@ SolidityFunction.prototype.typeName = function () { */ SolidityFunction.prototype.execute = function () { var transaction = !this._constant; - + // send transaction if (transaction) { return this.sendTransaction.apply(this, Array.prototype.slice.call(arguments)); @@ -2712,6 +2838,7 @@ SolidityFunction.prototype.execute = function () { */ SolidityFunction.prototype.attachToContract = function (contract) { var execute = this.execute.bind(this); + execute.request = this.request.bind(this); execute.call = this.call.bind(this); execute.sendTransaction = this.sendTransaction.bind(this); var displayName = this.displayName(); @@ -2724,7 +2851,7 @@ SolidityFunction.prototype.attachToContract = function (contract) { module.exports = SolidityFunction; -},{"../solidity/coder":2,"../utils/utils":8,"../web3":10}],19:[function(require,module,exports){ +},{"../solidity/coder":1,"../utils/utils":6,"../web3":8}],18:[function(require,module,exports){ /* This file is part of ethereum.js. @@ -2816,7 +2943,7 @@ HttpProvider.prototype.sendAsync = function (payload, callback) { module.exports = HttpProvider; -},{"./errors":13,"xmlhttprequest":6}],20:[function(require,module,exports){ +},{"./errors":12,"xmlhttprequest":4}],19:[function(require,module,exports){ /* This file is part of ethereum.js. @@ -2909,7 +3036,7 @@ Jsonrpc.prototype.toBatchPayload = function (messages) { module.exports = Jsonrpc; -},{}],21:[function(require,module,exports){ +},{}],20:[function(require,module,exports){ /* This file is part of ethereum.js. @@ -2966,7 +3093,6 @@ Method.prototype.extractCallback = function (args) { if (utils.isFunction(args[args.length - 1])) { return args.pop(); // modify the args array! } - return null; }; /** @@ -3019,6 +3145,7 @@ Method.prototype.formatOutput = function (result) { */ Method.prototype.attachToObject = function (obj) { var func = this.send.bind(this); + func.request = this.request.bind(this); func.call = this.call; // that's ugly. filter.js uses it var name = this.name.split('.'); if (name.length > 1) { @@ -3049,6 +3176,19 @@ Method.prototype.toPayload = function (args) { }; }; +/** + * Should be called to create pure JSONRPC request which can be used in batch request + * + * @method request + * @param {...} params + * @return {Object} jsonrpc request + */ +Method.prototype.request = function () { + var payload = this.toPayload(Array.prototype.slice.call(arguments)); + payload.format = this.formatOutput.bind(this); + return payload; +}; + /** * Should send request to the API * @@ -3061,7 +3201,7 @@ Method.prototype.send = function () { if (payload.callback) { var self = this; return RequestManager.getInstance().sendAsync(payload, function (err, result) { - payload.callback(null, self.formatOutput(result)); + payload.callback(err, self.formatOutput(result)); }); } return this.formatOutput(RequestManager.getInstance().send(payload)); @@ -3070,7 +3210,7 @@ Method.prototype.send = function () { module.exports = Method; -},{"../utils/utils":8,"./errors":13,"./requestmanager":25}],22:[function(require,module,exports){ +},{"../utils/utils":6,"./errors":12,"./requestmanager":24}],21:[function(require,module,exports){ /* This file is part of ethereum.js. @@ -3120,7 +3260,7 @@ module.exports = { }; -},{"../utils/utils":8,"./property":23}],23:[function(require,module,exports){ +},{"../utils/utils":6,"./property":22}],22:[function(require,module,exports){ /* This file is part of ethereum.js. @@ -3186,16 +3326,23 @@ Property.prototype.formatOutput = function (result) { Property.prototype.attachToObject = function (obj) { var proto = { get: this.get.bind(this), - set: this.set.bind(this) }; - var name = this.name.split('.'); - if (name.length > 1) { - obj[name[0]] = obj[name[0]] || {}; - Object.defineProperty(obj[name[0]], name[1], proto); - } else { - Object.defineProperty(obj, name[0], proto); + var names = this.name.split('.'); + var name = names[0]; + if (names.length > 1) { + obj[names[0]] = obj[names[0]] || {}; + obj = obj[names[0]]; + name = names[1]; } + + Object.defineProperty(obj, name, proto); + + var toAsyncName = function (prefix, name) { + return prefix + name.charAt(0).toUpperCase() + name.slice(1); + }; + + obj[toAsyncName('get', name)] = this.getAsync.bind(this); }; /** @@ -3211,22 +3358,27 @@ Property.prototype.get = function () { }; /** - * Should be used to set value of the property + * Should be used to asynchrounously get value of property * - * @method set - * @param {Object} new value of the property + * @method getAsync + * @param {Function} */ -Property.prototype.set = function (value) { - return RequestManager.getInstance().send({ - method: this.setter, - params: [this.formatInput(value)] +Property.prototype.getAsync = function (callback) { + var self = this; + RequestManager.getInstance().sendAsync({ + method: this.getter + }, function (err, result) { + if (err) { + return callback(err); + } + callback(err, self.formatOutput(result)); }); }; module.exports = Property; -},{"./requestmanager":25}],24:[function(require,module,exports){ +},{"./requestmanager":24}],23:[function(require,module,exports){ /* This file is part of ethereum.js. @@ -3261,7 +3413,7 @@ QtSyncProvider.prototype.send = function (payload) { module.exports = QtSyncProvider; -},{}],25:[function(require,module,exports){ +},{}],24:[function(require,module,exports){ /* This file is part of ethereum.js. @@ -3369,6 +3521,33 @@ RequestManager.prototype.sendAsync = function (data, callback) { }); }; +/** + * Should be called to asynchronously send batch request + * + * @method sendBatch + * @param {Array} batch data + * @param {Function} callback + */ +RequestManager.prototype.sendBatch = function (data, callback) { + if (!this.provider) { + return callback(errors.InvalidProvider()); + } + + var payload = Jsonrpc.getInstance().toBatchPayload(data); + + this.provider.sendAsync(payload, function (err, results) { + if (err) { + return callback(err); + } + + if (!utils.isArray(results)) { + return callback(errors.InvalidResponse(results)); + } + + callback(err, results); + }); +}; + /** * Should be used to set provider of request manager * @@ -3482,7 +3661,7 @@ RequestManager.prototype.poll = function () { module.exports = RequestManager; -},{"../utils/config":7,"../utils/utils":8,"./errors":13,"./jsonrpc":20}],26:[function(require,module,exports){ +},{"../utils/config":5,"../utils/utils":6,"./errors":12,"./jsonrpc":19}],25:[function(require,module,exports){ /* This file is part of ethereum.js. @@ -3552,7 +3731,7 @@ module.exports = { }; -},{"./formatters":17,"./method":21}],27:[function(require,module,exports){ +},{"./formatters":16,"./method":20}],26:[function(require,module,exports){ /* This file is part of ethereum.js. @@ -3580,7 +3759,20 @@ var Method = require('./method'); /// @returns an array of objects describing web3.eth.filter api methods var eth = function () { var newFilterCall = function (args) { - return typeof args[0] === 'string' ? 'eth_newBlockFilter' : 'eth_newFilter'; + var type = args[0]; + + switch(type) { + case 'latest': + args.pop(); + this.params = 0; + return 'eth_newBlockFilter'; + case 'pending': + args.pop(); + this.params = 0; + return 'eth_newPendingTransactionFilter'; + default: + return 'eth_newFilter'; + } }; var newFilter = new Method({ @@ -3655,7 +3847,7 @@ module.exports = { }; -},{"./method":21}],28:[function(require,module,exports){ +},{"./method":20}],27:[function(require,module,exports){ },{}],"bignumber.js":[function(require,module,exports){ 'use strict'; @@ -3668,7 +3860,6 @@ var web3 = require('./lib/web3'); web3.providers.HttpProvider = require('./lib/web3/httpprovider'); web3.providers.QtSyncProvider = require('./lib/web3/qtsync'); web3.eth.contract = require('./lib/web3/contract'); -web3.abi = require('./lib/solidity/abi'); // dont override global variable if (typeof window !== 'undefined' && typeof window.web3 === 'undefined') { @@ -3678,7 +3869,7 @@ if (typeof window !== 'undefined' && typeof window.web3 === 'undefined') { module.exports = web3; -},{"./lib/solidity/abi":1,"./lib/web3":10,"./lib/web3/contract":11,"./lib/web3/httpprovider":19,"./lib/web3/qtsync":24}]},{},["web3"]) +},{"./lib/web3":8,"./lib/web3/contract":10,"./lib/web3/httpprovider":18,"./lib/web3/qtsync":23}]},{},["web3"]) //# sourceMappingURL=web3-light.js.map \ No newline at end of file diff --git a/dist/web3-light.js.map b/dist/web3-light.js.map index 31e9b5a44..53b78067d 100644 --- a/dist/web3-light.js.map +++ b/dist/web3-light.js.map @@ -2,16 +2,15 @@ "version": 3, "sources": [ "node_modules/browserify/node_modules/browser-pack/_prelude.js", - "lib/solidity/abi.js", "lib/solidity/coder.js", "lib/solidity/formatters.js", "lib/solidity/param.js", - "lib/solidity/utils.js", "lib/utils/browser-xhr.js", "lib/utils/config.js", "lib/utils/utils.js", "lib/version.json", "lib/web3.js", + "lib/web3/batch.js", "lib/web3/contract.js", "lib/web3/db.js", "lib/web3/errors.js", @@ -34,40 +33,39 @@ "index.js" ], "names": [], - "mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1RA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1dA;AACA;AACA;AACA;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5PA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrGA;;ACAA;AACA;AACA;AACA;AACA;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA", + "mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1RA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3dA;AACA;AACA;AACA;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5KA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClHA;;ACAA;AACA;AACA;AACA;AACA;;ACJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA", "file": "generated.js", "sourceRoot": "", "sourcesContent": [ "(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o.\n*/\n/** \n * @file abi.js\n * @author Marek Kotewicz \n * @author Gav Wood \n * @date 2014\n */\n\nvar coder = require('./coder');\nvar utils = require('./utils');\n\nvar formatConstructorParams = function (abi, params) {\n var constructor = utils.getConstructor(abi, params.length);\n if (!constructor) {\n if (params.length > 0) {\n console.warn(\"didn't found matching constructor, using default one\");\n }\n return '';\n }\n\n return coder.encodeParams(constructor.inputs.map(function (input) {\n return input.type;\n }), params);\n};\n\nmodule.exports = {\n formatConstructorParams: formatConstructorParams\n};\n\n", "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file coder.js\n * @author Marek Kotewicz \n * @date 2015\n */\n\nvar BigNumber = require('bignumber.js');\nvar utils = require('../utils/utils');\nvar f = require('./formatters');\nvar SolidityParam = require('./param');\n\n/**\n * Should be used to check if a type is an array type\n *\n * @method isArrayType\n * @param {String} type\n * @return {Bool} true is the type is an array, otherwise false\n */\nvar isArrayType = function (type) {\n return type.slice(-2) === '[]';\n};\n\n/**\n * SolidityType prototype is used to encode/decode solidity params of certain type\n */\nvar SolidityType = function (config) {\n this._name = config.name;\n this._match = config.match;\n this._mode = config.mode;\n this._inputFormatter = config.inputFormatter;\n this._outputFormatter = config.outputFormatter;\n};\n\n/**\n * Should be used to determine if this SolidityType do match given type\n *\n * @method isType\n * @param {String} name\n * @return {Bool} true if type match this SolidityType, otherwise false\n */\nSolidityType.prototype.isType = function (name) {\n if (this._match === 'strict') {\n return this._name === name || (name.indexOf(this._name) === 0 && name.slice(this._name.length) === '[]');\n } else if (this._match === 'prefix') {\n // TODO better type detection!\n return name.indexOf(this._name) === 0;\n }\n};\n\n/**\n * Should be used to transform plain param to SolidityParam object\n *\n * @method formatInput\n * @param {Object} param - plain object, or an array of objects\n * @param {Bool} arrayType - true if a param should be encoded as an array\n * @return {SolidityParam} encoded param wrapped in SolidityParam object \n */\nSolidityType.prototype.formatInput = function (param, arrayType) {\n if (utils.isArray(param) && arrayType) { // TODO: should fail if this two are not the same\n var self = this;\n return param.map(function (p) {\n return self._inputFormatter(p);\n }).reduce(function (acc, current) {\n return acc.combine(current);\n }, f.formatInputInt(param.length)).withOffset(32);\n } \n return this._inputFormatter(param);\n};\n\n/**\n * Should be used to transoform SolidityParam to plain param\n *\n * @method formatOutput\n * @param {SolidityParam} byteArray\n * @param {Bool} arrayType - true if a param should be decoded as an array\n * @return {Object} plain decoded param\n */\nSolidityType.prototype.formatOutput = function (param, arrayType) {\n if (arrayType) {\n // let's assume, that we solidity will never return long arrays :P \n var result = [];\n var length = new BigNumber(param.dynamicPart().slice(0, 64), 16);\n for (var i = 0; i < length * 64; i += 64) {\n result.push(this._outputFormatter(new SolidityParam(param.dynamicPart().substr(i + 64, 64))));\n }\n return result;\n }\n return this._outputFormatter(param);\n};\n\n/**\n * Should be used to slice single param from bytes\n *\n * @method sliceParam\n * @param {String} bytes\n * @param {Number} index of param to slice\n * @param {String} type\n * @returns {SolidityParam} param\n */\nSolidityType.prototype.sliceParam = function (bytes, index, type) {\n if (this._mode === 'bytes') {\n return SolidityParam.decodeBytes(bytes, index);\n } else if (isArrayType(type)) {\n return SolidityParam.decodeArray(bytes, index);\n }\n return SolidityParam.decodeParam(bytes, index);\n};\n\n/**\n * SolidityCoder prototype should be used to encode/decode solidity params of any type\n */\nvar SolidityCoder = function (types) {\n this._types = types;\n};\n\n/**\n * This method should be used to transform type to SolidityType\n *\n * @method _requireType\n * @param {String} type\n * @returns {SolidityType} \n * @throws {Error} throws if no matching type is found\n */\nSolidityCoder.prototype._requireType = function (type) {\n var solidityType = this._types.filter(function (t) {\n return t.isType(type);\n })[0];\n\n if (!solidityType) {\n throw Error('invalid solidity type!: ' + type);\n }\n\n return solidityType;\n};\n\n/**\n * Should be used to transform plain param of given type to SolidityParam\n *\n * @method _formatInput\n * @param {String} type of param\n * @param {Object} plain param\n * @return {SolidityParam}\n */\nSolidityCoder.prototype._formatInput = function (type, param) {\n return this._requireType(type).formatInput(param, isArrayType(type));\n};\n\n/**\n * Should be used to encode plain param\n *\n * @method encodeParam\n * @param {String} type\n * @param {Object} plain param\n * @return {String} encoded plain param\n */\nSolidityCoder.prototype.encodeParam = function (type, param) {\n return this._formatInput(type, param).encode();\n};\n\n/**\n * Should be used to encode list of params\n *\n * @method encodeParams\n * @param {Array} types\n * @param {Array} params\n * @return {String} encoded list of params\n */\nSolidityCoder.prototype.encodeParams = function (types, params) {\n var self = this;\n var solidityParams = types.map(function (type, index) {\n return self._formatInput(type, params[index]);\n });\n\n return SolidityParam.encodeList(solidityParams);\n};\n\n/**\n * Should be used to decode bytes to plain param\n *\n * @method decodeParam\n * @param {String} type\n * @param {String} bytes\n * @return {Object} plain param\n */\nSolidityCoder.prototype.decodeParam = function (type, bytes) {\n return this.decodeParams([type], bytes)[0];\n};\n\n/**\n * Should be used to decode list of params\n *\n * @method decodeParam\n * @param {Array} types\n * @param {String} bytes\n * @return {Array} array of plain params\n */\nSolidityCoder.prototype.decodeParams = function (types, bytes) {\n var self = this;\n return types.map(function (type, index) {\n var solidityType = self._requireType(type);\n var p = solidityType.sliceParam(bytes, index, type);\n return solidityType.formatOutput(p, isArrayType(type));\n });\n};\n\nvar coder = new SolidityCoder([\n new SolidityType({\n name: 'address',\n match: 'strict',\n mode: 'value',\n inputFormatter: f.formatInputInt,\n outputFormatter: f.formatOutputAddress\n }),\n new SolidityType({\n name: 'bool',\n match: 'strict',\n mode: 'value',\n inputFormatter: f.formatInputBool,\n outputFormatter: f.formatOutputBool\n }),\n new SolidityType({\n name: 'int',\n match: 'prefix',\n mode: 'value',\n inputFormatter: f.formatInputInt,\n outputFormatter: f.formatOutputInt,\n }),\n new SolidityType({\n name: 'uint',\n match: 'prefix',\n mode: 'value',\n inputFormatter: f.formatInputInt,\n outputFormatter: f.formatOutputUInt\n }),\n new SolidityType({\n name: 'bytes',\n match: 'strict',\n mode: 'bytes',\n inputFormatter: f.formatInputDynamicBytes,\n outputFormatter: f.formatOutputDynamicBytes\n }),\n new SolidityType({\n name: 'bytes',\n match: 'prefix',\n mode: 'value',\n inputFormatter: f.formatInputBytes,\n outputFormatter: f.formatOutputBytes\n }),\n new SolidityType({\n name: 'real',\n match: 'prefix',\n mode: 'value',\n inputFormatter: f.formatInputReal,\n outputFormatter: f.formatOutputReal\n }),\n new SolidityType({\n name: 'ureal',\n match: 'prefix',\n mode: 'value',\n inputFormatter: f.formatInputReal,\n outputFormatter: f.formatOutputUReal\n })\n]);\n\nmodule.exports = coder;\n\n", "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file formatters.js\n * @author Marek Kotewicz \n * @date 2015\n */\n\nvar BigNumber = require('bignumber.js');\nvar utils = require('../utils/utils');\nvar c = require('../utils/config');\nvar SolidityParam = require('./param');\n\n\n/**\n * Formats input value to byte representation of int\n * If value is negative, return it's two's complement\n * If the value is floating point, round it down\n *\n * @method formatInputInt\n * @param {String|Number|BigNumber} value that needs to be formatted\n * @returns {SolidityParam}\n */\nvar formatInputInt = function (value) {\n var padding = c.ETH_PADDING * 2;\n BigNumber.config(c.ETH_BIGNUMBER_ROUNDING_MODE);\n var result = utils.padLeft(utils.toTwosComplement(value).round().toString(16), padding);\n return new SolidityParam(result);\n};\n\n/**\n * Formats input value to byte representation of string\n *\n * @method formatInputBytes\n * @param {String}\n * @returns {SolidityParam}\n */\nvar formatInputBytes = function (value) {\n var result = utils.fromAscii(value, c.ETH_PADDING).substr(2);\n return new SolidityParam(result);\n};\n\n/**\n * Formats input value to byte representation of string\n *\n * @method formatInputDynamicBytes\n * @param {String}\n * @returns {SolidityParam}\n */\nvar formatInputDynamicBytes = function (value) {\n var result = utils.fromAscii(value, c.ETH_PADDING).substr(2);\n return new SolidityParam(formatInputInt(value.length).value + result, 32);\n};\n\n/**\n * Formats input value to byte representation of bool\n *\n * @method formatInputBool\n * @param {Boolean}\n * @returns {SolidityParam}\n */\nvar formatInputBool = function (value) {\n var result = '000000000000000000000000000000000000000000000000000000000000000' + (value ? '1' : '0');\n return new SolidityParam(result);\n};\n\n/**\n * Formats input value to byte representation of real\n * Values are multiplied by 2^m and encoded as integers\n *\n * @method formatInputReal\n * @param {String|Number|BigNumber}\n * @returns {SolidityParam}\n */\nvar formatInputReal = function (value) {\n return formatInputInt(new BigNumber(value).times(new BigNumber(2).pow(128)));\n};\n\n/**\n * Check if input value is negative\n *\n * @method signedIsNegative\n * @param {String} value is hex format\n * @returns {Boolean} true if it is negative, otherwise false\n */\nvar signedIsNegative = function (value) {\n return (new BigNumber(value.substr(0, 1), 16).toString(2).substr(0, 1)) === '1';\n};\n\n/**\n * Formats right-aligned output bytes to int\n *\n * @method formatOutputInt\n * @param {SolidityParam} param\n * @returns {BigNumber} right-aligned output bytes formatted to big number\n */\nvar formatOutputInt = function (param) {\n var value = param.staticPart() || \"0\";\n\n // check if it's negative number\n // it it is, return two's complement\n if (signedIsNegative(value)) {\n return new BigNumber(value, 16).minus(new BigNumber('ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff', 16)).minus(1);\n }\n return new BigNumber(value, 16);\n};\n\n/**\n * Formats right-aligned output bytes to uint\n *\n * @method formatOutputUInt\n * @param {SolidityParam}\n * @returns {BigNumeber} right-aligned output bytes formatted to uint\n */\nvar formatOutputUInt = function (param) {\n var value = param.staticPart() || \"0\";\n return new BigNumber(value, 16);\n};\n\n/**\n * Formats right-aligned output bytes to real\n *\n * @method formatOutputReal\n * @param {SolidityParam}\n * @returns {BigNumber} input bytes formatted to real\n */\nvar formatOutputReal = function (param) {\n return formatOutputInt(param).dividedBy(new BigNumber(2).pow(128)); \n};\n\n/**\n * Formats right-aligned output bytes to ureal\n *\n * @method formatOutputUReal\n * @param {SolidityParam}\n * @returns {BigNumber} input bytes formatted to ureal\n */\nvar formatOutputUReal = function (param) {\n return formatOutputUInt(param).dividedBy(new BigNumber(2).pow(128)); \n};\n\n/**\n * Should be used to format output bool\n *\n * @method formatOutputBool\n * @param {SolidityParam}\n * @returns {Boolean} right-aligned input bytes formatted to bool\n */\nvar formatOutputBool = function (param) {\n return param.staticPart() === '0000000000000000000000000000000000000000000000000000000000000001' ? true : false;\n};\n\n/**\n * Should be used to format output string\n *\n * @method formatOutputBytes\n * @param {SolidityParam} left-aligned hex representation of string\n * @returns {String} ascii string\n */\nvar formatOutputBytes = function (param) {\n // length might also be important!\n return utils.toAscii(param.staticPart());\n};\n\n/**\n * Should be used to format output string\n *\n * @method formatOutputDynamicBytes\n * @param {SolidityParam} left-aligned hex representation of string\n * @returns {String} ascii string\n */\nvar formatOutputDynamicBytes = function (param) {\n // length might also be important!\n return utils.toAscii(param.dynamicPart().slice(64));\n};\n\n/**\n * Should be used to format output address\n *\n * @method formatOutputAddress\n * @param {SolidityParam} right-aligned input bytes\n * @returns {String} address\n */\nvar formatOutputAddress = function (param) {\n var value = param.staticPart();\n return \"0x\" + value.slice(value.length - 40, value.length);\n};\n\nmodule.exports = {\n formatInputInt: formatInputInt,\n formatInputBytes: formatInputBytes,\n formatInputDynamicBytes: formatInputDynamicBytes,\n formatInputBool: formatInputBool,\n formatInputReal: formatInputReal,\n formatOutputInt: formatOutputInt,\n formatOutputUInt: formatOutputUInt,\n formatOutputReal: formatOutputReal,\n formatOutputUReal: formatOutputUReal,\n formatOutputBool: formatOutputBool,\n formatOutputBytes: formatOutputBytes,\n formatOutputDynamicBytes: formatOutputDynamicBytes,\n formatOutputAddress: formatOutputAddress\n};\n\n", "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file param.js\n * @author Marek Kotewicz \n * @date 2015\n */\n\nvar utils = require('../utils/utils');\n\n/**\n * SolidityParam object prototype.\n * Should be used when encoding, decoding solidity bytes\n */\nvar SolidityParam = function (value, offset) {\n this.value = value || '';\n this.offset = offset; // offset in bytes\n};\n\n/**\n * This method should be used to get length of params's dynamic part\n * \n * @method dynamicPartLength\n * @returns {Number} length of dynamic part (in bytes)\n */\nSolidityParam.prototype.dynamicPartLength = function () {\n return this.dynamicPart().length / 2;\n};\n\n/**\n * This method should be used to create copy of solidity param with different offset\n *\n * @method withOffset\n * @param {Number} offset length in bytes\n * @returns {SolidityParam} new solidity param with applied offset\n */\nSolidityParam.prototype.withOffset = function (offset) {\n return new SolidityParam(this.value, offset);\n};\n\n/**\n * This method should be used to combine solidity params together\n * eg. when appending an array\n *\n * @method combine\n * @param {SolidityParam} param with which we should combine\n * @param {SolidityParam} result of combination\n */\nSolidityParam.prototype.combine = function (param) {\n return new SolidityParam(this.value + param.value); \n};\n\n/**\n * This method should be called to check if param has dynamic size.\n * If it has, it returns true, otherwise false\n *\n * @method isDynamic\n * @returns {Boolean}\n */\nSolidityParam.prototype.isDynamic = function () {\n return this.value.length > 64;\n};\n\n/**\n * This method should be called to transform offset to bytes\n *\n * @method offsetAsBytes\n * @returns {String} bytes representation of offset\n */\nSolidityParam.prototype.offsetAsBytes = function () {\n return !this.isDynamic() ? '' : utils.padLeft(utils.toTwosComplement(this.offset).toString(16), 64);\n};\n\n/**\n * This method should be called to get static part of param\n *\n * @method staticPart\n * @returns {String} offset if it is a dynamic param, otherwise value\n */\nSolidityParam.prototype.staticPart = function () {\n if (!this.isDynamic()) {\n return this.value; \n } \n return this.offsetAsBytes();\n};\n\n/**\n * This method should be called to get dynamic part of param\n *\n * @method dynamicPart\n * @returns {String} returns a value if it is a dynamic param, otherwise empty string\n */\nSolidityParam.prototype.dynamicPart = function () {\n return this.isDynamic() ? this.value : '';\n};\n\n/**\n * This method should be called to encode param\n *\n * @method encode\n * @returns {String}\n */\nSolidityParam.prototype.encode = function () {\n return this.staticPart() + this.dynamicPart();\n};\n\n/**\n * This method should be called to encode array of params\n *\n * @method encodeList\n * @param {Array[SolidityParam]} params\n * @returns {String}\n */\nSolidityParam.encodeList = function (params) {\n \n // updating offsets\n var totalOffset = params.length * 32;\n var offsetParams = params.map(function (param) {\n if (!param.isDynamic()) {\n return param;\n }\n var offset = totalOffset;\n totalOffset += param.dynamicPartLength();\n return param.withOffset(offset);\n });\n\n // encode everything!\n return offsetParams.reduce(function (result, param) {\n return result + param.dynamicPart();\n }, offsetParams.reduce(function (result, param) {\n return result + param.staticPart();\n }, ''));\n};\n\n/**\n * This method should be used to decode plain (static) solidity param at given index\n *\n * @method decodeParam\n * @param {String} bytes\n * @param {Number} index\n * @returns {SolidityParam}\n */\nSolidityParam.decodeParam = function (bytes, index) {\n index = index || 0;\n return new SolidityParam(bytes.substr(index * 64, 64)); \n};\n\n/**\n * This method should be called to get offset value from bytes at given index\n *\n * @method getOffset\n * @param {String} bytes\n * @param {Number} index\n * @returns {Number} offset as number\n */\nvar getOffset = function (bytes, index) {\n // we can do this cause offset is rather small\n return parseInt('0x' + bytes.substr(index * 64, 64));\n};\n\n/**\n * This method should be called to decode solidity bytes param at given index\n *\n * @method decodeBytes\n * @param {String} bytes\n * @param {Number} index\n * @returns {SolidityParam}\n */\nSolidityParam.decodeBytes = function (bytes, index) {\n index = index || 0;\n //TODO add support for strings longer than 32 bytes\n //var length = parseInt('0x' + bytes.substr(offset * 64, 64));\n\n var offset = getOffset(bytes, index);\n\n // 2 * , cause we also parse length\n return new SolidityParam(bytes.substr(offset * 2, 2 * 64));\n};\n\n/**\n * This method should be used to decode solidity array at given index\n *\n * @method decodeArray\n * @param {String} bytes\n * @param {Number} index\n * @returns {SolidityParam}\n */\nSolidityParam.decodeArray = function (bytes, index) {\n index = index || 0;\n var offset = getOffset(bytes, index);\n var length = parseInt('0x' + bytes.substr(offset * 2, 64));\n return new SolidityParam(bytes.substr(offset * 2, (length + 1) * 64));\n};\n\nmodule.exports = SolidityParam;\n\n", - "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/**\n * @file utils.js\n * @author Marek Kotewicz \n * @date 2015\n */\n\n/**\n * Returns the contstructor with matching number of arguments\n *\n * @method getConstructor\n * @param {Array} abi\n * @param {Number} numberOfArgs\n * @returns {Object} constructor function abi\n */\nvar getConstructor = function (abi, numberOfArgs) {\n return abi.filter(function (f) {\n return f.type === 'constructor' && f.inputs.length === numberOfArgs;\n })[0];\n};\n\n//var getSupremeType = function (type) {\n //return type.substr(0, type.indexOf('[')) + ']';\n//};\n\n\nmodule.exports = {\n getConstructor: getConstructor\n};\n\n", "'use strict';\n\n// go env doesn't have and need XMLHttpRequest\nif (typeof XMLHttpRequest === 'undefined') {\n exports.XMLHttpRequest = {};\n} else {\n exports.XMLHttpRequest = XMLHttpRequest; // jshint ignore:line\n}\n\n", "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** @file config.js\n * @authors:\n * Marek Kotewicz \n * @date 2015\n */\n\n/**\n * Utils\n * \n * @module utils\n */\n\n/**\n * Utility functions\n * \n * @class [utils] config\n * @constructor\n */\n\n/// required to define ETH_BIGNUMBER_ROUNDING_MODE\nvar BigNumber = require('bignumber.js');\n\nvar ETH_UNITS = [ \n 'wei', \n 'Kwei', \n 'Mwei', \n 'Gwei', \n 'szabo', \n 'finney', \n 'ether', \n 'grand', \n 'Mether', \n 'Gether', \n 'Tether', \n 'Pether', \n 'Eether', \n 'Zether', \n 'Yether', \n 'Nether', \n 'Dether', \n 'Vether', \n 'Uether' \n];\n\nmodule.exports = {\n ETH_PADDING: 32,\n ETH_SIGNATURE_LENGTH: 4,\n ETH_UNITS: ETH_UNITS,\n ETH_BIGNUMBER_ROUNDING_MODE: { ROUNDING_MODE: BigNumber.ROUND_DOWN },\n ETH_POLLING_TIMEOUT: 1000,\n defaultBlock: 'latest',\n defaultAccount: undefined\n};\n\n", - "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file utils.js\n * @author Marek Kotewicz \n * @date 2015\n */\n\n/**\n * Utils\n * \n * @module utils\n */\n\n/**\n * Utility functions\n * \n * @class [utils] utils\n * @constructor\n */\n\nvar BigNumber = require('bignumber.js');\n\nvar unitMap = {\n 'wei': '1',\n 'kwei': '1000',\n 'ada': '1000',\n 'mwei': '1000000',\n 'babbage': '1000000',\n 'gwei': '1000000000',\n 'shannon': '1000000000',\n 'szabo': '1000000000000',\n 'finney': '1000000000000000',\n 'ether': '1000000000000000000',\n 'kether': '1000000000000000000000',\n 'grand': '1000000000000000000000',\n 'einstein': '1000000000000000000000',\n 'mether': '1000000000000000000000000',\n 'gether': '1000000000000000000000000000',\n 'tether': '1000000000000000000000000000000'\n};\n\n/**\n * Should be called to pad string to expected length\n *\n * @method padLeft\n * @param {String} string to be padded\n * @param {Number} characters that result string should have\n * @param {String} sign, by default 0\n * @returns {String} right aligned string\n */\nvar padLeft = function (string, chars, sign) {\n return new Array(chars - string.length + 1).join(sign ? sign : \"0\") + string;\n};\n\n/** \n * Should be called to get sting from it's hex representation\n *\n * @method toAscii\n * @param {String} string in hex\n * @returns {String} ascii string representation of hex value\n */\nvar toAscii = function(hex) {\n// Find termination\n var str = \"\";\n var i = 0, l = hex.length;\n if (hex.substring(0, 2) === '0x') {\n i = 2;\n }\n for (; i < l; i+=2) {\n var code = parseInt(hex.substr(i, 2), 16);\n if (code === 0) {\n break;\n }\n\n str += String.fromCharCode(code);\n }\n\n return str;\n};\n \n/**\n * Shold be called to get hex representation (prefixed by 0x) of ascii string \n *\n * @method toHexNative\n * @param {String} string\n * @returns {String} hex representation of input string\n */\nvar toHexNative = function(str) {\n var hex = \"\";\n for(var i = 0; i < str.length; i++) {\n var n = str.charCodeAt(i).toString(16);\n hex += n.length < 2 ? '0' + n : n;\n }\n\n return hex;\n};\n\n/**\n * Shold be called to get hex representation (prefixed by 0x) of ascii string \n *\n * @method fromAscii\n * @param {String} string\n * @param {Number} optional padding\n * @returns {String} hex representation of input string\n */\nvar fromAscii = function(str, pad) {\n pad = pad === undefined ? 0 : pad;\n var hex = toHexNative(str);\n while (hex.length < pad*2)\n hex += \"00\";\n return \"0x\" + hex;\n};\n\n/**\n * Should be used to create full function/event name from json abi\n *\n * @method transformToFullName\n * @param {Object} json-abi\n * @return {String} full fnction/event name\n */\nvar transformToFullName = function (json) {\n if (json.name.indexOf('(') !== -1) {\n return json.name;\n }\n\n var typeName = json.inputs.map(function(i){return i.type; }).join();\n return json.name + '(' + typeName + ')';\n};\n\n/**\n * Should be called to get display name of contract function\n * \n * @method extractDisplayName\n * @param {String} name of function/event\n * @returns {String} display name for function/event eg. multiply(uint256) -> multiply\n */\nvar extractDisplayName = function (name) {\n var length = name.indexOf('('); \n return length !== -1 ? name.substr(0, length) : name;\n};\n\n/// @returns overloaded part of function/event name\nvar extractTypeName = function (name) {\n /// TODO: make it invulnerable\n var length = name.indexOf('(');\n return length !== -1 ? name.substr(length + 1, name.length - 1 - (length + 1)).replace(' ', '') : \"\";\n};\n\n/**\n * Converts value to it's decimal representation in string\n *\n * @method toDecimal\n * @param {String|Number|BigNumber}\n * @return {String}\n */\nvar toDecimal = function (value) {\n return toBigNumber(value).toNumber();\n};\n\n/**\n * Converts value to it's hex representation\n *\n * @method fromDecimal\n * @param {String|Number|BigNumber}\n * @return {String}\n */\nvar fromDecimal = function (value) {\n var number = toBigNumber(value);\n var result = number.toString(16);\n\n return number.lessThan(0) ? '-0x' + result.substr(1) : '0x' + result;\n};\n\n/**\n * Auto converts any given value into it's hex representation.\n *\n * And even stringifys objects before.\n *\n * @method toHex\n * @param {String|Number|BigNumber|Object}\n * @return {String}\n */\nvar toHex = function (val) {\n /*jshint maxcomplexity:7 */\n\n if (isBoolean(val))\n return fromDecimal(+val);\n\n if (isBigNumber(val))\n return fromDecimal(val);\n\n if (isObject(val))\n return fromAscii(JSON.stringify(val));\n\n // if its a negative number, pass it through fromDecimal\n if (isString(val)) {\n if (val.indexOf('-0x') === 0)\n return fromDecimal(val);\n else if (!isFinite(val))\n return fromAscii(val);\n }\n\n return fromDecimal(val);\n};\n\n/**\n * Returns value of unit in Wei\n *\n * @method getValueOfUnit\n * @param {String} unit the unit to convert to, default ether\n * @returns {BigNumber} value of the unit (in Wei)\n * @throws error if the unit is not correct:w\n */\nvar getValueOfUnit = function (unit) {\n unit = unit ? unit.toLowerCase() : 'ether';\n var unitValue = unitMap[unit];\n if (unitValue === undefined) {\n throw new Error('This unit doesn\\'t exists, please use the one of the following units' + JSON.stringify(unitMap, null, 2));\n }\n return new BigNumber(unitValue, 10);\n};\n\n/**\n * Takes a number of wei and converts it to any other ether unit.\n *\n * Possible units are:\n * - kwei/ada\n * - mwei/babbage\n * - gwei/shannon\n * - szabo\n * - finney\n * - ether\n * - kether/grand/einstein\n * - mether\n * - gether\n * - tether\n *\n * @method fromWei\n * @param {Number|String} number can be a number, number string or a HEX of a decimal\n * @param {String} unit the unit to convert to, default ether\n * @return {String|Object} When given a BigNumber object it returns one as well, otherwise a number\n*/\nvar fromWei = function(number, unit) {\n var returnValue = toBigNumber(number).dividedBy(getValueOfUnit(unit));\n\n return isBigNumber(number) ? returnValue : returnValue.toString(10); \n};\n\n/**\n * Takes a number of a unit and converts it to wei.\n *\n * Possible units are:\n * - kwei/ada\n * - mwei/babbage\n * - gwei/shannon\n * - szabo\n * - finney\n * - ether\n * - kether/grand/einstein\n * - mether\n * - gether\n * - tether\n *\n * @method toWei\n * @param {Number|String|BigNumber} number can be a number, number string or a HEX of a decimal\n * @param {String} unit the unit to convert from, default ether\n * @return {String|Object} When given a BigNumber object it returns one as well, otherwise a number\n*/\nvar toWei = function(number, unit) {\n var returnValue = toBigNumber(number).times(getValueOfUnit(unit));\n\n return isBigNumber(number) ? returnValue : returnValue.toString(10); \n};\n\n/**\n * Takes an input and transforms it into an bignumber\n *\n * @method toBigNumber\n * @param {Number|String|BigNumber} a number, string, HEX string or BigNumber\n * @return {BigNumber} BigNumber\n*/\nvar toBigNumber = function(number) {\n /*jshint maxcomplexity:5 */\n number = number || 0;\n if (isBigNumber(number))\n return number;\n\n if (isString(number) && (number.indexOf('0x') === 0 || number.indexOf('-0x') === 0)) {\n return new BigNumber(number.replace('0x',''), 16);\n }\n \n return new BigNumber(number.toString(10), 10);\n};\n\n/**\n * Takes and input transforms it into bignumber and if it is negative value, into two's complement\n *\n * @method toTwosComplement\n * @param {Number|String|BigNumber}\n * @return {BigNumber}\n */\nvar toTwosComplement = function (number) {\n var bigNumber = toBigNumber(number);\n if (bigNumber.lessThan(0)) {\n return new BigNumber(\"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\", 16).plus(bigNumber).plus(1);\n }\n return bigNumber;\n};\n\n/**\n * Checks if the given string is strictly an address\n *\n * @method isStrictAddress\n * @param {String} address the given HEX adress\n * @return {Boolean}\n*/\nvar isStrictAddress = function (address) {\n return /^0x[0-9a-f]{40}$/.test(address);\n};\n\n/**\n * Checks if the given string is an address\n *\n * @method isAddress\n * @param {String} address the given HEX adress\n * @return {Boolean}\n*/\nvar isAddress = function (address) {\n return /^(0x)?[0-9a-f]{40}$/.test(address);\n};\n\n/**\n * Transforms given string to valid 20 bytes-length addres with 0x prefix\n *\n * @method toAddress\n * @param {String} address\n * @return {String} formatted address\n */\nvar toAddress = function (address) {\n if (isStrictAddress(address)) {\n return address;\n }\n \n if (/^[0-9a-f]{40}$/.test(address)) {\n return '0x' + address;\n }\n\n return '0x' + padLeft(toHex(address).substr(2), 40);\n};\n\n/**\n * Returns true if object is BigNumber, otherwise false\n *\n * @method isBigNumber\n * @param {Object}\n * @return {Boolean} \n */\nvar isBigNumber = function (object) {\n return object instanceof BigNumber ||\n (object && object.constructor && object.constructor.name === 'BigNumber');\n};\n\n/**\n * Returns true if object is string, otherwise false\n * \n * @method isString\n * @param {Object}\n * @return {Boolean}\n */\nvar isString = function (object) {\n return typeof object === 'string' ||\n (object && object.constructor && object.constructor.name === 'String');\n};\n\n/**\n * Returns true if object is function, otherwise false\n *\n * @method isFunction\n * @param {Object}\n * @return {Boolean}\n */\nvar isFunction = function (object) {\n return typeof object === 'function';\n};\n\n/**\n * Returns true if object is Objet, otherwise false\n *\n * @method isObject\n * @param {Object}\n * @return {Boolean}\n */\nvar isObject = function (object) {\n return typeof object === 'object';\n};\n\n/**\n * Returns true if object is boolean, otherwise false\n *\n * @method isBoolean\n * @param {Object}\n * @return {Boolean}\n */\nvar isBoolean = function (object) {\n return typeof object === 'boolean';\n};\n\n/**\n * Returns true if object is array, otherwise false\n *\n * @method isArray\n * @param {Object}\n * @return {Boolean}\n */\nvar isArray = function (object) {\n return object instanceof Array; \n};\n\n/**\n * Returns true if given string is valid json object\n * \n * @method isJson\n * @param {String}\n * @return {Boolean}\n */\nvar isJson = function (str) {\n try {\n return !!JSON.parse(str);\n } catch (e) {\n return false;\n }\n};\n\nmodule.exports = {\n padLeft: padLeft,\n toHex: toHex,\n toDecimal: toDecimal,\n fromDecimal: fromDecimal,\n toAscii: toAscii,\n fromAscii: fromAscii,\n transformToFullName: transformToFullName,\n extractDisplayName: extractDisplayName,\n extractTypeName: extractTypeName,\n toWei: toWei,\n fromWei: fromWei,\n toBigNumber: toBigNumber,\n toTwosComplement: toTwosComplement,\n toAddress: toAddress,\n isBigNumber: isBigNumber,\n isStrictAddress: isStrictAddress,\n isAddress: isAddress,\n isFunction: isFunction,\n isString: isString,\n isObject: isObject,\n isBoolean: isBoolean,\n isArray: isArray,\n isJson: isJson\n};\n\n", - "module.exports={\n \"version\": \"0.3.6\"\n}\n", - "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** @file web3.js\n * @authors:\n * Jeffrey Wilcke \n * Marek Kotewicz \n * Marian Oancea \n * Fabian Vogelsteller \n * Gav Wood \n * @date 2014\n */\n\nvar version = require('./version.json');\nvar net = require('./web3/net');\nvar eth = require('./web3/eth');\nvar db = require('./web3/db');\nvar shh = require('./web3/shh');\nvar watches = require('./web3/watches');\nvar Filter = require('./web3/filter');\nvar utils = require('./utils/utils');\nvar formatters = require('./web3/formatters');\nvar RequestManager = require('./web3/requestmanager');\nvar c = require('./utils/config');\nvar Method = require('./web3/method');\nvar Property = require('./web3/property');\n\nvar web3Methods = [\n new Method({\n name: 'sha3',\n call: 'web3_sha3',\n params: 1\n })\n];\n\nvar web3Properties = [\n new Property({\n name: 'version.client',\n getter: 'web3_clientVersion'\n }),\n new Property({\n name: 'version.network',\n getter: 'net_version',\n inputFormatter: utils.toDecimal\n }),\n new Property({\n name: 'version.ethereum',\n getter: 'eth_protocolVersion',\n inputFormatter: utils.toDecimal\n }),\n new Property({\n name: 'version.whisper',\n getter: 'shh_version',\n inputFormatter: utils.toDecimal\n })\n];\n\n/// creates methods in a given object based on method description on input\n/// setups api calls for these methods\nvar setupMethods = function (obj, methods) {\n methods.forEach(function (method) {\n method.attachToObject(obj);\n });\n};\n\n/// creates properties in a given object based on properties description on input\n/// setups api calls for these properties\nvar setupProperties = function (obj, properties) {\n properties.forEach(function (property) {\n property.attachToObject(obj);\n });\n};\n\n/// setups web3 object, and it's in-browser executed methods\nvar web3 = {};\nweb3.providers = {};\nweb3.version = {};\nweb3.version.api = version.version;\nweb3.eth = {};\n\n/*jshint maxparams:4 */\nweb3.eth.filter = function (fil, eventParams, options, formatter) {\n\n // if its event, treat it differently\n // TODO: simplify and remove\n if (fil._isEvent) {\n return fil(eventParams, options);\n }\n\n // what outputLogFormatter? that's wrong\n //return new Filter(fil, watches.eth(), formatters.outputLogFormatter);\n return new Filter(fil, watches.eth(), formatter || formatters.outputLogFormatter);\n};\n/*jshint maxparams:3 */\n\nweb3.shh = {};\nweb3.shh.filter = function (fil) {\n return new Filter(fil, watches.shh(), formatters.outputPostFormatter);\n};\nweb3.net = {};\nweb3.db = {};\nweb3.setProvider = function (provider) {\n RequestManager.getInstance().setProvider(provider);\n};\nweb3.reset = function () {\n RequestManager.getInstance().reset();\n c.defaultBlock = 'latest';\n c.defaultAccount = undefined;\n};\nweb3.toHex = utils.toHex;\nweb3.toAscii = utils.toAscii;\nweb3.fromAscii = utils.fromAscii;\nweb3.toDecimal = utils.toDecimal;\nweb3.fromDecimal = utils.fromDecimal;\nweb3.toBigNumber = utils.toBigNumber;\nweb3.toWei = utils.toWei;\nweb3.fromWei = utils.fromWei;\nweb3.isAddress = utils.isAddress;\n\n// ADD defaultblock\nObject.defineProperty(web3.eth, 'defaultBlock', {\n get: function () {\n return c.defaultBlock;\n },\n set: function (val) {\n c.defaultBlock = val;\n return val;\n }\n});\n\nObject.defineProperty(web3.eth, 'defaultAccount', {\n get: function () {\n return c.defaultAccount;\n },\n set: function (val) {\n c.defaultAccount = val;\n return val;\n }\n});\n\n/// setups all api methods\nsetupMethods(web3, web3Methods);\nsetupProperties(web3, web3Properties);\nsetupMethods(web3.net, net.methods);\nsetupProperties(web3.net, net.properties);\nsetupMethods(web3.eth, eth.methods);\nsetupProperties(web3.eth, eth.properties);\nsetupMethods(web3.db, db.methods);\nsetupMethods(web3.shh, shh.methods);\n\nmodule.exports = web3;\n\n", - "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file contract.js\n * @author Marek Kotewicz \n * @date 2014\n */\n\nvar web3 = require('../web3'); \nvar solAbi = require('../solidity/abi');\nvar utils = require('../utils/utils');\nvar SolidityEvent = require('./event');\nvar SolidityFunction = require('./function');\n\nvar addFunctionsToContract = function (contract, desc) {\n desc.filter(function (json) {\n return json.type === 'function';\n }).map(function (json) {\n return new SolidityFunction(json, contract.address);\n }).forEach(function (f) {\n f.attachToContract(contract);\n });\n};\n\nvar addEventsToContract = function (contract, desc) {\n desc.filter(function (json) {\n return json.type === 'event';\n }).map(function (json) {\n return new SolidityEvent(json, contract.address);\n }).forEach(function (e) {\n e.attachToContract(contract);\n });\n};\n\n/**\n * This method should be called when we want to call / transact some solidity method from javascript\n * it returns an object which has same methods available as solidity contract description\n * usage example: \n *\n * var abi = [{\n * name: 'myMethod',\n * inputs: [{ name: 'a', type: 'string' }],\n * outputs: [{name: 'd', type: 'string' }]\n * }]; // contract abi\n *\n * var MyContract = web3.eth.contract(abi); // creation of contract prototype\n *\n * var contractInstance = new MyContract('0x0123123121');\n *\n * contractInstance.myMethod('this is test string param for call'); // myMethod call (implicit, default)\n * contractInstance.call().myMethod('this is test string param for call'); // myMethod call (explicit)\n * contractInstance.sendTransaction().myMethod('this is test string param for transact'); // myMethod sendTransaction\n *\n * @param abi - abi json description of the contract, which is being created\n * @returns contract object\n */\nvar contract = function (abi) {\n\n // return prototype\n return Contract.bind(null, abi);\n};\n\nvar Contract = function (abi, options) {\n\n this.address = '';\n if (utils.isAddress(options)) {\n this.address = options;\n } else { // is an object!\n // TODO, parse the rest of the args\n options = options || {};\n var args = Array.prototype.slice.call(arguments, 2);\n var bytes = solAbi.formatConstructorParams(abi, args);\n options.data += bytes;\n this.address = web3.eth.sendTransaction(options);\n }\n\n addFunctionsToContract(this, abi);\n addEventsToContract(this, abi);\n};\n\nContract.prototype.call = function () {\n console.error('contract.call is deprecated');\n return this;\n};\n\nContract.prototype.sendTransaction = function () {\n console.error('contract.sendTransact is deprecated');\n return this;\n};\n\nmodule.exports = contract;\n\n", + "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file utils.js\n * @author Marek Kotewicz \n * @date 2015\n */\n\n/**\n * Utils\n * \n * @module utils\n */\n\n/**\n * Utility functions\n * \n * @class [utils] utils\n * @constructor\n */\n\nvar BigNumber = require('bignumber.js');\n\nvar unitMap = {\n 'wei': '1',\n 'kwei': '1000',\n 'ada': '1000',\n 'mwei': '1000000',\n 'babbage': '1000000',\n 'gwei': '1000000000',\n 'shannon': '1000000000',\n 'szabo': '1000000000000',\n 'finney': '1000000000000000',\n 'ether': '1000000000000000000',\n 'kether': '1000000000000000000000',\n 'grand': '1000000000000000000000',\n 'einstein': '1000000000000000000000',\n 'mether': '1000000000000000000000000',\n 'gether': '1000000000000000000000000000',\n 'tether': '1000000000000000000000000000000'\n};\n\n/**\n * Should be called to pad string to expected length\n *\n * @method padLeft\n * @param {String} string to be padded\n * @param {Number} characters that result string should have\n * @param {String} sign, by default 0\n * @returns {String} right aligned string\n */\nvar padLeft = function (string, chars, sign) {\n return new Array(chars - string.length + 1).join(sign ? sign : \"0\") + string;\n};\n\n/** \n * Should be called to get sting from it's hex representation\n *\n * @method toAscii\n * @param {String} string in hex\n * @returns {String} ascii string representation of hex value\n */\nvar toAscii = function(hex) {\n// Find termination\n var str = \"\";\n var i = 0, l = hex.length;\n if (hex.substring(0, 2) === '0x') {\n i = 2;\n }\n for (; i < l; i+=2) {\n var code = parseInt(hex.substr(i, 2), 16);\n if (code === 0) {\n break;\n }\n\n str += String.fromCharCode(code);\n }\n\n return str;\n};\n \n/**\n * Shold be called to get hex representation (prefixed by 0x) of ascii string \n *\n * @method toHexNative\n * @param {String} string\n * @returns {String} hex representation of input string\n */\nvar toHexNative = function(str) {\n var hex = \"\";\n for(var i = 0; i < str.length; i++) {\n var n = str.charCodeAt(i).toString(16);\n hex += n.length < 2 ? '0' + n : n;\n }\n\n return hex;\n};\n\n/**\n * Shold be called to get hex representation (prefixed by 0x) of ascii string \n *\n * @method fromAscii\n * @param {String} string\n * @param {Number} optional padding\n * @returns {String} hex representation of input string\n */\nvar fromAscii = function(str, pad) {\n pad = pad === undefined ? 0 : pad;\n var hex = toHexNative(str);\n while (hex.length < pad*2)\n hex += \"00\";\n return \"0x\" + hex;\n};\n\n/**\n * Should be used to create full function/event name from json abi\n *\n * @method transformToFullName\n * @param {Object} json-abi\n * @return {String} full fnction/event name\n */\nvar transformToFullName = function (json) {\n if (json.name.indexOf('(') !== -1) {\n return json.name;\n }\n\n var typeName = json.inputs.map(function(i){return i.type; }).join();\n return json.name + '(' + typeName + ')';\n};\n\n/**\n * Should be called to get display name of contract function\n * \n * @method extractDisplayName\n * @param {String} name of function/event\n * @returns {String} display name for function/event eg. multiply(uint256) -> multiply\n */\nvar extractDisplayName = function (name) {\n var length = name.indexOf('('); \n return length !== -1 ? name.substr(0, length) : name;\n};\n\n/// @returns overloaded part of function/event name\nvar extractTypeName = function (name) {\n /// TODO: make it invulnerable\n var length = name.indexOf('(');\n return length !== -1 ? name.substr(length + 1, name.length - 1 - (length + 1)).replace(' ', '') : \"\";\n};\n\n/**\n * Converts value to it's decimal representation in string\n *\n * @method toDecimal\n * @param {String|Number|BigNumber}\n * @return {String}\n */\nvar toDecimal = function (value) {\n return toBigNumber(value).toNumber();\n};\n\n/**\n * Converts value to it's hex representation\n *\n * @method fromDecimal\n * @param {String|Number|BigNumber}\n * @return {String}\n */\nvar fromDecimal = function (value) {\n var number = toBigNumber(value);\n var result = number.toString(16);\n\n return number.lessThan(0) ? '-0x' + result.substr(1) : '0x' + result;\n};\n\n/**\n * Auto converts any given value into it's hex representation.\n *\n * And even stringifys objects before.\n *\n * @method toHex\n * @param {String|Number|BigNumber|Object}\n * @return {String}\n */\nvar toHex = function (val) {\n /*jshint maxcomplexity:7 */\n\n if (isBoolean(val))\n return fromDecimal(+val);\n\n if (isBigNumber(val))\n return fromDecimal(val);\n\n if (isObject(val))\n return fromAscii(JSON.stringify(val));\n\n // if its a negative number, pass it through fromDecimal\n if (isString(val)) {\n if (val.indexOf('-0x') === 0)\n return fromDecimal(val);\n else if (!isFinite(val))\n return fromAscii(val);\n }\n\n return fromDecimal(val);\n};\n\n/**\n * Returns value of unit in Wei\n *\n * @method getValueOfUnit\n * @param {String} unit the unit to convert to, default ether\n * @returns {BigNumber} value of the unit (in Wei)\n * @throws error if the unit is not correct:w\n */\nvar getValueOfUnit = function (unit) {\n unit = unit ? unit.toLowerCase() : 'ether';\n var unitValue = unitMap[unit];\n if (unitValue === undefined) {\n throw new Error('This unit doesn\\'t exists, please use the one of the following units' + JSON.stringify(unitMap, null, 2));\n }\n return new BigNumber(unitValue, 10);\n};\n\n/**\n * Takes a number of wei and converts it to any other ether unit.\n *\n * Possible units are:\n * - kwei/ada\n * - mwei/babbage\n * - gwei/shannon\n * - szabo\n * - finney\n * - ether\n * - kether/grand/einstein\n * - mether\n * - gether\n * - tether\n *\n * @method fromWei\n * @param {Number|String} number can be a number, number string or a HEX of a decimal\n * @param {String} unit the unit to convert to, default ether\n * @return {String|Object} When given a BigNumber object it returns one as well, otherwise a number\n*/\nvar fromWei = function(number, unit) {\n var returnValue = toBigNumber(number).dividedBy(getValueOfUnit(unit));\n\n return isBigNumber(number) ? returnValue : returnValue.toString(10); \n};\n\n/**\n * Takes a number of a unit and converts it to wei.\n *\n * Possible units are:\n * - kwei/ada\n * - mwei/babbage\n * - gwei/shannon\n * - szabo\n * - finney\n * - ether\n * - kether/grand/einstein\n * - mether\n * - gether\n * - tether\n *\n * @method toWei\n * @param {Number|String|BigNumber} number can be a number, number string or a HEX of a decimal\n * @param {String} unit the unit to convert from, default ether\n * @return {String|Object} When given a BigNumber object it returns one as well, otherwise a number\n*/\nvar toWei = function(number, unit) {\n var returnValue = toBigNumber(number).times(getValueOfUnit(unit));\n\n return isBigNumber(number) ? returnValue : returnValue.toString(10); \n};\n\n/**\n * Takes an input and transforms it into an bignumber\n *\n * @method toBigNumber\n * @param {Number|String|BigNumber} a number, string, HEX string or BigNumber\n * @return {BigNumber} BigNumber\n*/\nvar toBigNumber = function(number) {\n /*jshint maxcomplexity:5 */\n number = number || 0;\n if (isBigNumber(number))\n return number;\n\n if (isString(number) && (number.indexOf('0x') === 0 || number.indexOf('-0x') === 0)) {\n return new BigNumber(number.replace('0x',''), 16);\n }\n \n return new BigNumber(number.toString(10), 10);\n};\n\n/**\n * Takes and input transforms it into bignumber and if it is negative value, into two's complement\n *\n * @method toTwosComplement\n * @param {Number|String|BigNumber}\n * @return {BigNumber}\n */\nvar toTwosComplement = function (number) {\n var bigNumber = toBigNumber(number);\n if (bigNumber.lessThan(0)) {\n return new BigNumber(\"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\", 16).plus(bigNumber).plus(1);\n }\n return bigNumber;\n};\n\n/**\n * Checks if the given string is strictly an address\n *\n * @method isStrictAddress\n * @param {String} address the given HEX adress\n * @return {Boolean}\n*/\nvar isStrictAddress = function (address) {\n return /^0x[0-9a-f]{40}$/.test(address);\n};\n\n/**\n * Checks if the given string is an address\n *\n * @method isAddress\n * @param {String} address the given HEX adress\n * @return {Boolean}\n*/\nvar isAddress = function (address) {\n return /^(0x)?[0-9a-f]{40}$/.test(address);\n};\n\n/**\n * Transforms given string to valid 20 bytes-length addres with 0x prefix\n *\n * @method toAddress\n * @param {String} address\n * @return {String} formatted address\n */\nvar toAddress = function (address) {\n if (isStrictAddress(address)) {\n return address;\n }\n \n if (/^[0-9a-f]{40}$/.test(address)) {\n return '0x' + address;\n }\n\n return '0x' + padLeft(toHex(address).substr(2), 40);\n};\n\n\n/**\n * Returns true if object is BigNumber, otherwise false\n *\n * @method isBigNumber\n * @param {Object}\n * @return {Boolean} \n */\nvar isBigNumber = function (object) {\n return object instanceof BigNumber ||\n (object && object.constructor && object.constructor.name === 'BigNumber');\n};\n\n/**\n * Returns true if object is string, otherwise false\n * \n * @method isString\n * @param {Object}\n * @return {Boolean}\n */\nvar isString = function (object) {\n return typeof object === 'string' ||\n (object && object.constructor && object.constructor.name === 'String');\n};\n\n/**\n * Returns true if object is function, otherwise false\n *\n * @method isFunction\n * @param {Object}\n * @return {Boolean}\n */\nvar isFunction = function (object) {\n return typeof object === 'function';\n};\n\n/**\n * Returns true if object is Objet, otherwise false\n *\n * @method isObject\n * @param {Object}\n * @return {Boolean}\n */\nvar isObject = function (object) {\n return typeof object === 'object';\n};\n\n/**\n * Returns true if object is boolean, otherwise false\n *\n * @method isBoolean\n * @param {Object}\n * @return {Boolean}\n */\nvar isBoolean = function (object) {\n return typeof object === 'boolean';\n};\n\n/**\n * Returns true if object is array, otherwise false\n *\n * @method isArray\n * @param {Object}\n * @return {Boolean}\n */\nvar isArray = function (object) {\n return object instanceof Array; \n};\n\n/**\n * Returns true if given string is valid json object\n * \n * @method isJson\n * @param {String}\n * @return {Boolean}\n */\nvar isJson = function (str) {\n try {\n return !!JSON.parse(str);\n } catch (e) {\n return false;\n }\n};\n\nmodule.exports = {\n padLeft: padLeft,\n toHex: toHex,\n toDecimal: toDecimal,\n fromDecimal: fromDecimal,\n toAscii: toAscii,\n fromAscii: fromAscii,\n transformToFullName: transformToFullName,\n extractDisplayName: extractDisplayName,\n extractTypeName: extractTypeName,\n toWei: toWei,\n fromWei: fromWei,\n toBigNumber: toBigNumber,\n toTwosComplement: toTwosComplement,\n toAddress: toAddress,\n isBigNumber: isBigNumber,\n isStrictAddress: isStrictAddress,\n isAddress: isAddress,\n isFunction: isFunction,\n isString: isString,\n isObject: isObject,\n isBoolean: isBoolean,\n isArray: isArray,\n isJson: isJson\n};\n\n", + "module.exports={\n \"version\": \"0.4.2\"\n}\n", + "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** @file web3.js\n * @authors:\n * Jeffrey Wilcke \n * Marek Kotewicz \n * Marian Oancea \n * Fabian Vogelsteller \n * Gav Wood \n * @date 2014\n */\n\nvar version = require('./version.json');\nvar net = require('./web3/net');\nvar eth = require('./web3/eth');\nvar db = require('./web3/db');\nvar shh = require('./web3/shh');\nvar watches = require('./web3/watches');\nvar Filter = require('./web3/filter');\nvar utils = require('./utils/utils');\nvar formatters = require('./web3/formatters');\nvar RequestManager = require('./web3/requestmanager');\nvar c = require('./utils/config');\nvar Method = require('./web3/method');\nvar Property = require('./web3/property');\nvar Batch = require('./web3/batch');\n\nvar web3Methods = [\n new Method({\n name: 'sha3',\n call: 'web3_sha3',\n params: 1\n })\n];\n\nvar web3Properties = [\n new Property({\n name: 'version.client',\n getter: 'web3_clientVersion'\n }),\n new Property({\n name: 'version.network',\n getter: 'net_version',\n inputFormatter: utils.toDecimal\n }),\n new Property({\n name: 'version.ethereum',\n getter: 'eth_protocolVersion',\n inputFormatter: utils.toDecimal\n }),\n new Property({\n name: 'version.whisper',\n getter: 'shh_version',\n inputFormatter: utils.toDecimal\n })\n];\n\n/// creates methods in a given object based on method description on input\n/// setups api calls for these methods\nvar setupMethods = function (obj, methods) {\n methods.forEach(function (method) {\n method.attachToObject(obj);\n });\n};\n\n/// creates properties in a given object based on properties description on input\n/// setups api calls for these properties\nvar setupProperties = function (obj, properties) {\n properties.forEach(function (property) {\n property.attachToObject(obj);\n });\n};\n\n/// setups web3 object, and it's in-browser executed methods\nvar web3 = {};\nweb3.providers = {};\nweb3.version = {};\nweb3.version.api = version.version;\nweb3.eth = {};\n\n/*jshint maxparams:4 */\nweb3.eth.filter = function (fil, eventParams, options, formatter) {\n\n // if its event, treat it differently\n // TODO: simplify and remove\n if (fil._isEvent) {\n return fil(eventParams, options);\n }\n\n // what outputLogFormatter? that's wrong\n //return new Filter(fil, watches.eth(), formatters.outputLogFormatter);\n return new Filter(fil, watches.eth(), formatter || formatters.outputLogFormatter);\n};\n/*jshint maxparams:3 */\n\nweb3.shh = {};\nweb3.shh.filter = function (fil) {\n return new Filter(fil, watches.shh(), formatters.outputPostFormatter);\n};\nweb3.net = {};\nweb3.db = {};\nweb3.setProvider = function (provider) {\n RequestManager.getInstance().setProvider(provider);\n};\nweb3.reset = function () {\n RequestManager.getInstance().reset();\n c.defaultBlock = 'latest';\n c.defaultAccount = undefined;\n};\nweb3.toHex = utils.toHex;\nweb3.toAscii = utils.toAscii;\nweb3.fromAscii = utils.fromAscii;\nweb3.toDecimal = utils.toDecimal;\nweb3.fromDecimal = utils.fromDecimal;\nweb3.toBigNumber = utils.toBigNumber;\nweb3.toWei = utils.toWei;\nweb3.fromWei = utils.fromWei;\nweb3.isAddress = utils.isAddress;\nweb3.createBatch = function () {\n return new Batch();\n};\n\n// ADD defaultblock\nObject.defineProperty(web3.eth, 'defaultBlock', {\n get: function () {\n return c.defaultBlock;\n },\n set: function (val) {\n c.defaultBlock = val;\n return val;\n }\n});\n\nObject.defineProperty(web3.eth, 'defaultAccount', {\n get: function () {\n return c.defaultAccount;\n },\n set: function (val) {\n c.defaultAccount = val;\n return val;\n }\n});\n\n/// setups all api methods\nsetupMethods(web3, web3Methods);\nsetupProperties(web3, web3Properties);\nsetupMethods(web3.net, net.methods);\nsetupProperties(web3.net, net.properties);\nsetupMethods(web3.eth, eth.methods);\nsetupProperties(web3.eth, eth.properties);\nsetupMethods(web3.db, db.methods);\nsetupMethods(web3.shh, shh.methods);\n\nmodule.exports = web3;\n\n", + "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file batch.js\n * @author Marek Kotewicz \n * @date 2015\n */\n\nvar RequestManager = require('./requestmanager');\n\nvar Batch = function () {\n this.requests = [];\n};\n\n/**\n * Should be called to add create new request to batch request\n *\n * @method add\n * @param {Object} jsonrpc requet object\n */\nBatch.prototype.add = function (request) {\n this.requests.push(request);\n};\n\n/**\n * Should be called to execute batch request\n *\n * @method execute\n */\nBatch.prototype.execute = function () {\n var requests = this.requests;\n RequestManager.getInstance().sendBatch(requests, function (err, results) {\n results = results || [];\n requests.map(function (request, index) {\n return results[index] || {};\n }).map(function (result, index) {\n return requests[index].format ? requests[index].format(result.result) : result.result;\n }).forEach(function (result, index) {\n if (requests[index].callback) {\n requests[index].callback(err, result);\n }\n });\n }); \n};\n\nmodule.exports = Batch;\n\n", + "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file contract.js\n * @author Marek Kotewicz \n * @date 2014\n */\n\nvar web3 = require('../web3'); \nvar utils = require('../utils/utils');\nvar coder = require('../solidity/coder');\nvar SolidityEvent = require('./event');\nvar SolidityFunction = require('./function');\n\n/**\n * Should be called to encode constructor params\n *\n * @method encodeConstructorParams\n * @param {Array} abi\n * @param {Array} constructor params\n */\nvar encodeConstructorParams = function (abi, params) {\n return abi.filter(function (json) {\n return json.type === 'constructor' && json.inputs.length === params.length;\n }).map(function (json) {\n return json.inputs.map(function (input) {\n return input.type;\n });\n }).map(function (types) {\n return coder.encodeParams(types, params);\n })[0] || '';\n};\n\n/**\n * Should be called to add functions to contract object\n *\n * @method addFunctionsToContract\n * @param {Contract} contract\n * @param {Array} abi\n */\nvar addFunctionsToContract = function (contract, abi) {\n abi.filter(function (json) {\n return json.type === 'function';\n }).map(function (json) {\n return new SolidityFunction(json, contract.address);\n }).forEach(function (f) {\n f.attachToContract(contract);\n });\n};\n\n/**\n * Should be called to add events to contract object\n *\n * @method addEventsToContract\n * @param {Contract} contract\n * @param {Array} abi\n */\nvar addEventsToContract = function (contract, abi) {\n abi.filter(function (json) {\n return json.type === 'event';\n }).map(function (json) {\n return new SolidityEvent(json, contract.address);\n }).forEach(function (e) {\n e.attachToContract(contract);\n });\n};\n\n/**\n * Should be called to create new ContractFactory\n *\n * @method contract\n * @param {Array} abi\n * @returns {ContractFactory} new contract factory\n */\nvar contract = function (abi) {\n return new ContractFactory(abi);\n};\n\n/**\n * Should be called to create new ContractFactory instance\n *\n * @method ContractFactory\n * @param {Array} abi\n */\nvar ContractFactory = function (abi) {\n this.abi = abi;\n};\n\n/**\n * Should be called to create new contract on a blockchain\n * \n * @method new\n * @param {Any} contract constructor param1 (optional)\n * @param {Any} contract constructor param2 (optional)\n * @param {Object} contract transaction object (required)\n * @param {Function} callback\n * @returns {Contract} returns contract if no callback was passed,\n * otherwise calls callback function (err, contract)\n */\nContractFactory.prototype.new = function () {\n // parse arguments\n var options = {}; // required!\n var callback;\n\n var args = Array.prototype.slice.call(arguments);\n if (utils.isFunction(args[args.length - 1])) {\n callback = args.pop();\n }\n\n var last = args[args.length - 1];\n if (utils.isObject(last) && !utils.isArray(last)) {\n options = args.pop();\n }\n\n // throw an error if there are no options\n\n var bytes = encodeConstructorParams(this.abi, args);\n options.data += bytes;\n\n if (!callback) {\n var address = web3.eth.sendTransaction(options);\n return this.at(address);\n }\n \n var self = this;\n web3.eth.sendTransaction(options, function (err, address) {\n if (err) {\n callback(err);\n }\n self.at(address, callback); \n }); \n};\n\n/**\n * Should be called to get access to existing contract on a blockchain\n *\n * @method at\n * @param {Address} contract address (required)\n * @param {Function} callback {optional)\n * @returns {Contract} returns contract if no callback was passed,\n * otherwise calls callback function (err, contract)\n */\nContractFactory.prototype.at = function (address, callback) {\n // TODO: address is required\n \n if (callback) {\n callback(null, new Contract(this.abi, address));\n } \n return new Contract(this.abi, address);\n};\n\n/**\n * Should be called to create new contract instance\n *\n * @method Contract\n * @param {Array} abi\n * @param {Address} contract address\n */\nvar Contract = function (abi, address) {\n this.address = address;\n addFunctionsToContract(this, abi);\n addEventsToContract(this, abi);\n};\n\nmodule.exports = contract;\n\n", "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** @file db.js\n * @authors:\n * Marek Kotewicz \n * @date 2015\n */\n\nvar Method = require('./method');\n\nvar putString = new Method({\n name: 'putString',\n call: 'db_putString',\n params: 3\n});\n\n\nvar getString = new Method({\n name: 'getString',\n call: 'db_getString',\n params: 2\n});\n\nvar putHex = new Method({\n name: 'putHex',\n call: 'db_putHex',\n params: 3\n});\n\nvar getHex = new Method({\n name: 'getHex',\n call: 'db_getHex',\n params: 2\n});\n\nvar methods = [\n putString, getString, putHex, getHex\n];\n\nmodule.exports = {\n methods: methods\n};\n", "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file errors.js\n * @author Marek Kotewicz \n * @date 2015\n */\n\nmodule.exports = {\n InvalidNumberOfParams: function () {\n return new Error('Invalid number of input parameters');\n },\n InvalidConnection: function (host){\n return new Error('CONNECTION ERROR: Couldn\\'t connect to node '+ host +', is it running?');\n },\n InvalidProvider: function () {\n return new Error('Providor not set or invalid');\n },\n InvalidResponse: function (result){\n var message = !!result && !!result.error && !!result.error.message ? result.error.message : 'Invalid JSON RPC response';\n return new Error(message);\n }\n};\n\n", - "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/**\n * @file eth.js\n * @author Marek Kotewicz \n * @author Fabian Vogelsteller \n * @date 2015\n */\n\n/**\n * Web3\n *\n * @module web3\n */\n\n/**\n * Eth methods and properties\n *\n * An example method object can look as follows:\n *\n * {\n * name: 'getBlock',\n * call: blockCall,\n * params: 2,\n * outputFormatter: formatters.outputBlockFormatter,\n * inputFormatter: [ // can be a formatter funciton or an array of functions. Where each item in the array will be used for one parameter\n * utils.toHex, // formats paramter 1\n * function(param){ return !!param; } // formats paramter 2\n * ]\n * },\n *\n * @class [web3] eth\n * @constructor\n */\n\n\"use strict\";\n\nvar formatters = require('./formatters');\nvar utils = require('../utils/utils');\nvar Method = require('./method');\nvar Property = require('./property');\n\nvar blockCall = function (args) {\n return (utils.isString(args[0]) && args[0].indexOf('0x') === 0) ? \"eth_getBlockByHash\" : \"eth_getBlockByNumber\";\n};\n\nvar transactionFromBlockCall = function (args) {\n return (utils.isString(args[0]) && args[0].indexOf('0x') === 0) ? 'eth_getTransactionByBlockHashAndIndex' : 'eth_getTransactionByBlockNumberAndIndex';\n};\n\nvar uncleCall = function (args) {\n return (utils.isString(args[0]) && args[0].indexOf('0x') === 0) ? 'eth_getUncleByBlockHashAndIndex' : 'eth_getUncleByBlockNumberAndIndex';\n};\n\nvar getBlockTransactionCountCall = function (args) {\n return (utils.isString(args[0]) && args[0].indexOf('0x') === 0) ? 'eth_getBlockTransactionCountByHash' : 'eth_getBlockTransactionCountByNumber';\n};\n\nvar uncleCountCall = function (args) {\n return (utils.isString(args[0]) && args[0].indexOf('0x') === 0) ? 'eth_getUncleCountByBlockHash' : 'eth_getUncleCountByBlockNumber';\n};\n\n/// @returns an array of objects describing web3.eth api methods\n\nvar getBalance = new Method({\n name: 'getBalance',\n call: 'eth_getBalance',\n params: 2,\n inputFormatter: [utils.toAddress, formatters.inputDefaultBlockNumberFormatter],\n outputFormatter: formatters.outputBigNumberFormatter\n});\n\nvar getStorageAt = new Method({\n name: 'getStorageAt',\n call: 'eth_getStorageAt',\n params: 3,\n inputFormatter: [null, utils.toHex, formatters.inputDefaultBlockNumberFormatter]\n});\n\nvar getCode = new Method({\n name: 'getCode',\n call: 'eth_getCode',\n params: 2,\n inputFormatter: [utils.toAddress, formatters.inputDefaultBlockNumberFormatter]\n});\n\nvar getBlock = new Method({\n name: 'getBlock',\n call: blockCall,\n params: 2,\n inputFormatter: [formatters.inputBlockNumberFormatter, function (val) { return !!val; }],\n outputFormatter: formatters.outputBlockFormatter\n});\n\nvar getUncle = new Method({\n name: 'getUncle',\n call: uncleCall,\n params: 2,\n inputFormatter: [formatters.inputBlockNumberFormatter, utils.toHex],\n outputFormatter: formatters.outputBlockFormatter,\n\n});\n\nvar getCompilers = new Method({\n name: 'getCompilers',\n call: 'eth_getCompilers',\n params: 0\n});\n\nvar getBlockTransactionCount = new Method({\n name: 'getBlockTransactionCount',\n call: getBlockTransactionCountCall,\n params: 1,\n inputFormatter: [formatters.inputBlockNumberFormatter],\n outputFormatter: utils.toDecimal\n});\n\nvar getBlockUncleCount = new Method({\n name: 'getBlockUncleCount',\n call: uncleCountCall,\n params: 1,\n inputFormatter: [formatters.inputBlockNumberFormatter],\n outputFormatter: utils.toDecimal\n});\n\nvar getTransaction = new Method({\n name: 'getTransaction',\n call: 'eth_getTransactionByHash',\n params: 1,\n outputFormatter: formatters.outputTransactionFormatter\n});\n\nvar getTransactionFromBlock = new Method({\n name: 'getTransactionFromBlock',\n call: transactionFromBlockCall,\n params: 2,\n inputFormatter: [formatters.inputBlockNumberFormatter, utils.toHex],\n outputFormatter: formatters.outputTransactionFormatter\n});\n\nvar getTransactionCount = new Method({\n name: 'getTransactionCount',\n call: 'eth_getTransactionCount',\n params: 2,\n inputFormatter: [null, formatters.inputDefaultBlockNumberFormatter],\n outputFormatter: utils.toDecimal\n});\n\nvar sendTransaction = new Method({\n name: 'sendTransaction',\n call: 'eth_sendTransaction',\n params: 1,\n inputFormatter: [formatters.inputTransactionFormatter]\n});\n\nvar call = new Method({\n name: 'call',\n call: 'eth_call',\n params: 2,\n inputFormatter: [formatters.inputTransactionFormatter, formatters.inputDefaultBlockNumberFormatter]\n});\n\nvar compileSolidity = new Method({\n name: 'compile.solidity',\n call: 'eth_compileSolidity',\n params: 1\n});\n\nvar compileLLL = new Method({\n name: 'compile.lll',\n call: 'eth_compileLLL',\n params: 1\n});\n\nvar compileSerpent = new Method({\n name: 'compile.serpent',\n call: 'eth_compileSerpent',\n params: 1\n});\n\nvar methods = [\n getBalance,\n getStorageAt,\n getCode,\n getBlock,\n getUncle,\n getCompilers,\n getBlockTransactionCount,\n getBlockUncleCount,\n getTransaction,\n getTransactionFromBlock,\n getTransactionCount,\n call,\n sendTransaction,\n compileSolidity,\n compileLLL,\n compileSerpent,\n];\n\n/// @returns an array of objects describing web3.eth api properties\n\n\n\nvar properties = [\n new Property({\n name: 'coinbase',\n getter: 'eth_coinbase'\n }),\n new Property({\n name: 'mining',\n getter: 'eth_mining'\n }),\n new Property({\n name: 'hashrate',\n getter: 'eth_hashrate',\n outputFormatter: utils.toDecimal\n }),\n new Property({\n name: 'gasPrice',\n getter: 'eth_gasPrice',\n outputFormatter: formatters.outputBigNumberFormatter\n }),\n new Property({\n name: 'accounts',\n getter: 'eth_accounts'\n }),\n new Property({\n name: 'blockNumber',\n getter: 'eth_blockNumber',\n outputFormatter: utils.toDecimal\n })\n];\n\nmodule.exports = {\n methods: methods,\n properties: properties\n};\n\n", + "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/**\n * @file eth.js\n * @author Marek Kotewicz \n * @author Fabian Vogelsteller \n * @date 2015\n */\n\n/**\n * Web3\n *\n * @module web3\n */\n\n/**\n * Eth methods and properties\n *\n * An example method object can look as follows:\n *\n * {\n * name: 'getBlock',\n * call: blockCall,\n * params: 2,\n * outputFormatter: formatters.outputBlockFormatter,\n * inputFormatter: [ // can be a formatter funciton or an array of functions. Where each item in the array will be used for one parameter\n * utils.toHex, // formats paramter 1\n * function(param){ return !!param; } // formats paramter 2\n * ]\n * },\n *\n * @class [web3] eth\n * @constructor\n */\n\n\"use strict\";\n\nvar formatters = require('./formatters');\nvar utils = require('../utils/utils');\nvar Method = require('./method');\nvar Property = require('./property');\n\nvar blockCall = function (args) {\n return (utils.isString(args[0]) && args[0].indexOf('0x') === 0) ? \"eth_getBlockByHash\" : \"eth_getBlockByNumber\";\n};\n\nvar transactionFromBlockCall = function (args) {\n return (utils.isString(args[0]) && args[0].indexOf('0x') === 0) ? 'eth_getTransactionByBlockHashAndIndex' : 'eth_getTransactionByBlockNumberAndIndex';\n};\n\nvar uncleCall = function (args) {\n return (utils.isString(args[0]) && args[0].indexOf('0x') === 0) ? 'eth_getUncleByBlockHashAndIndex' : 'eth_getUncleByBlockNumberAndIndex';\n};\n\nvar getBlockTransactionCountCall = function (args) {\n return (utils.isString(args[0]) && args[0].indexOf('0x') === 0) ? 'eth_getBlockTransactionCountByHash' : 'eth_getBlockTransactionCountByNumber';\n};\n\nvar uncleCountCall = function (args) {\n return (utils.isString(args[0]) && args[0].indexOf('0x') === 0) ? 'eth_getUncleCountByBlockHash' : 'eth_getUncleCountByBlockNumber';\n};\n\n/// @returns an array of objects describing web3.eth api methods\n\nvar getBalance = new Method({\n name: 'getBalance',\n call: 'eth_getBalance',\n params: 2,\n inputFormatter: [utils.toAddress, formatters.inputDefaultBlockNumberFormatter],\n outputFormatter: formatters.outputBigNumberFormatter\n});\n\nvar getStorageAt = new Method({\n name: 'getStorageAt',\n call: 'eth_getStorageAt',\n params: 3,\n inputFormatter: [null, utils.toHex, formatters.inputDefaultBlockNumberFormatter]\n});\n\nvar getCode = new Method({\n name: 'getCode',\n call: 'eth_getCode',\n params: 2,\n inputFormatter: [utils.toAddress, formatters.inputDefaultBlockNumberFormatter]\n});\n\nvar getBlock = new Method({\n name: 'getBlock',\n call: blockCall,\n params: 2,\n inputFormatter: [formatters.inputBlockNumberFormatter, function (val) { return !!val; }],\n outputFormatter: formatters.outputBlockFormatter\n});\n\nvar getUncle = new Method({\n name: 'getUncle',\n call: uncleCall,\n params: 2,\n inputFormatter: [formatters.inputBlockNumberFormatter, utils.toHex],\n outputFormatter: formatters.outputBlockFormatter,\n\n});\n\nvar getCompilers = new Method({\n name: 'getCompilers',\n call: 'eth_getCompilers',\n params: 0\n});\n\nvar getBlockTransactionCount = new Method({\n name: 'getBlockTransactionCount',\n call: getBlockTransactionCountCall,\n params: 1,\n inputFormatter: [formatters.inputBlockNumberFormatter],\n outputFormatter: utils.toDecimal\n});\n\nvar getBlockUncleCount = new Method({\n name: 'getBlockUncleCount',\n call: uncleCountCall,\n params: 1,\n inputFormatter: [formatters.inputBlockNumberFormatter],\n outputFormatter: utils.toDecimal\n});\n\nvar getTransaction = new Method({\n name: 'getTransaction',\n call: 'eth_getTransactionByHash',\n params: 1,\n outputFormatter: formatters.outputTransactionFormatter\n});\n\nvar getTransactionFromBlock = new Method({\n name: 'getTransactionFromBlock',\n call: transactionFromBlockCall,\n params: 2,\n inputFormatter: [formatters.inputBlockNumberFormatter, utils.toHex],\n outputFormatter: formatters.outputTransactionFormatter\n});\n\nvar getTransactionCount = new Method({\n name: 'getTransactionCount',\n call: 'eth_getTransactionCount',\n params: 2,\n inputFormatter: [null, formatters.inputDefaultBlockNumberFormatter],\n outputFormatter: utils.toDecimal\n});\n\nvar sendTransaction = new Method({\n name: 'sendTransaction',\n call: 'eth_sendTransaction',\n params: 1,\n inputFormatter: [formatters.inputTransactionFormatter]\n});\n\nvar call = new Method({\n name: 'call',\n call: 'eth_call',\n params: 2,\n inputFormatter: [formatters.inputTransactionFormatter, formatters.inputDefaultBlockNumberFormatter]\n});\n\nvar estimateGas = new Method({\n name: 'estimateGas',\n call: 'eth_estimateGas',\n params: 1,\n inputFormatter: [formatters.inputTransactionFormatter],\n outputFormatter: utils.toDecimal\n});\n\nvar compileSolidity = new Method({\n name: 'compile.solidity',\n call: 'eth_compileSolidity',\n params: 1\n});\n\nvar compileLLL = new Method({\n name: 'compile.lll',\n call: 'eth_compileLLL',\n params: 1\n});\n\nvar compileSerpent = new Method({\n name: 'compile.serpent',\n call: 'eth_compileSerpent',\n params: 1\n});\n\nvar submitWork = new Method({\n name: 'submitWork',\n call: 'eth_submitWork',\n params: 3\n});\n\nvar getWork = new Method({\n name: 'getWork',\n call: 'eth_getWork',\n params: 0\n});\n\nvar methods = [\n getBalance,\n getStorageAt,\n getCode,\n getBlock,\n getUncle,\n getCompilers,\n getBlockTransactionCount,\n getBlockUncleCount,\n getTransaction,\n getTransactionFromBlock,\n getTransactionCount,\n call,\n estimateGas,\n sendTransaction,\n compileSolidity,\n compileLLL,\n compileSerpent,\n submitWork,\n getWork\n];\n\n/// @returns an array of objects describing web3.eth api properties\n\n\n\nvar properties = [\n new Property({\n name: 'coinbase',\n getter: 'eth_coinbase'\n }),\n new Property({\n name: 'mining',\n getter: 'eth_mining'\n }),\n new Property({\n name: 'hashrate',\n getter: 'eth_hashrate',\n outputFormatter: utils.toDecimal\n }),\n new Property({\n name: 'gasPrice',\n getter: 'eth_gasPrice',\n outputFormatter: formatters.outputBigNumberFormatter\n }),\n new Property({\n name: 'accounts',\n getter: 'eth_accounts'\n }),\n new Property({\n name: 'blockNumber',\n getter: 'eth_blockNumber',\n outputFormatter: utils.toDecimal\n })\n];\n\nmodule.exports = {\n methods: methods,\n properties: properties\n};\n\n", "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file event.js\n * @author Marek Kotewicz \n * @date 2014\n */\n\nvar utils = require('../utils/utils');\nvar coder = require('../solidity/coder');\nvar web3 = require('../web3');\nvar formatters = require('./formatters');\n\n/**\n * This prototype should be used to create event filters\n */\nvar SolidityEvent = function (json, address) {\n this._params = json.inputs;\n this._name = utils.transformToFullName(json);\n this._address = address;\n this._anonymous = json.anonymous;\n};\n\n/**\n * Should be used to get filtered param types\n *\n * @method types\n * @param {Bool} decide if returned typed should be indexed\n * @return {Array} array of types\n */\nSolidityEvent.prototype.types = function (indexed) {\n return this._params.filter(function (i) {\n return i.indexed === indexed;\n }).map(function (i) {\n return i.type;\n });\n};\n\n/**\n * Should be used to get event display name\n *\n * @method displayName\n * @return {String} event display name\n */\nSolidityEvent.prototype.displayName = function () {\n return utils.extractDisplayName(this._name);\n};\n\n/**\n * Should be used to get event type name\n *\n * @method typeName\n * @return {String} event type name\n */\nSolidityEvent.prototype.typeName = function () {\n return utils.extractTypeName(this._name);\n};\n\n/**\n * Should be used to get event signature\n *\n * @method signature\n * @return {String} event signature\n */\nSolidityEvent.prototype.signature = function () {\n return web3.sha3(web3.fromAscii(this._name)).slice(2);\n};\n\n/**\n * Should be used to encode indexed params and options to one final object\n * \n * @method encode\n * @param {Object} indexed\n * @param {Object} options\n * @return {Object} everything combined together and encoded\n */\nSolidityEvent.prototype.encode = function (indexed, options) {\n indexed = indexed || {};\n options = options || {};\n var result = {};\n\n ['fromBlock', 'toBlock'].filter(function (f) {\n return options[f] !== undefined;\n }).forEach(function (f) {\n result[f] = formatters.inputBlockNumberFormatter(options[f]);\n });\n\n result.topics = [];\n\n if (!this._anonymous) {\n result.address = this._address;\n result.topics.push('0x' + this.signature());\n }\n\n var indexedTopics = this._params.filter(function (i) {\n return i.indexed === true;\n }).map(function (i) {\n var value = indexed[i.name];\n if (value === undefined || value === null) {\n return null;\n }\n \n if (utils.isArray(value)) {\n return value.map(function (v) {\n return '0x' + coder.encodeParam(i.type, v);\n });\n }\n return '0x' + coder.encodeParam(i.type, value);\n });\n\n result.topics = result.topics.concat(indexedTopics);\n\n return result;\n};\n\n/**\n * Should be used to decode indexed params and options\n *\n * @method decode\n * @param {Object} data\n * @return {Object} result object with decoded indexed && not indexed params\n */\nSolidityEvent.prototype.decode = function (data) {\n \n data.data = data.data || '';\n data.topics = data.topics || [];\n\n var argTopics = this._anonymous ? data.topics : data.topics.slice(1);\n var indexedData = argTopics.map(function (topics) { return topics.slice(2); }).join(\"\");\n var indexedParams = coder.decodeParams(this.types(true), indexedData); \n\n var notIndexedData = data.data.slice(2);\n var notIndexedParams = coder.decodeParams(this.types(false), notIndexedData);\n \n var result = formatters.outputLogFormatter(data);\n result.event = this.displayName();\n result.address = data.address;\n\n result.args = this._params.reduce(function (acc, current) {\n acc[current.name] = current.indexed ? indexedParams.shift() : notIndexedParams.shift();\n return acc;\n }, {});\n\n delete result.data;\n delete result.topics;\n\n return result;\n};\n\n/**\n * Should be used to create new filter object from event\n *\n * @method execute\n * @param {Object} indexed\n * @param {Object} options\n * @return {Object} filter object\n */\nSolidityEvent.prototype.execute = function (indexed, options) {\n var o = this.encode(indexed, options);\n var formatter = this.decode.bind(this);\n return web3.eth.filter(o, undefined, undefined, formatter);\n};\n\n/**\n * Should be used to attach event to contract object\n *\n * @method attachToContract\n * @param {Contract}\n */\nSolidityEvent.prototype.attachToContract = function (contract) {\n var execute = this.execute.bind(this);\n var displayName = this.displayName();\n if (!contract[displayName]) {\n contract[displayName] = execute;\n }\n contract[displayName][this.typeName()] = this.execute.bind(this, contract);\n};\n\nmodule.exports = SolidityEvent;\n\n", "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** @file filter.js\n * @authors:\n * Jeffrey Wilcke \n * Marek Kotewicz \n * Marian Oancea \n * Fabian Vogelsteller \n * Gav Wood \n * @date 2014\n */\n\nvar RequestManager = require('./requestmanager');\nvar formatters = require('./formatters');\nvar utils = require('../utils/utils');\n\n/**\n* Converts a given topic to a hex string, but also allows null values.\n*\n* @param {Mixed} value\n* @return {String}\n*/\nvar toTopic = function(value){\n\n if(value === null || typeof value === 'undefined')\n return null;\n\n value = String(value);\n\n if(value.indexOf('0x') === 0)\n return value;\n else\n return utils.fromAscii(value);\n};\n\n/// This method should be called on options object, to verify deprecated properties && lazy load dynamic ones\n/// @param should be string or object\n/// @returns options string or object\nvar getOptions = function (options) {\n\n if (utils.isString(options)) {\n return options;\n } \n\n options = options || {};\n\n // make sure topics, get converted to hex\n options.topics = options.topics || [];\n options.topics = options.topics.map(function(topic){\n return (utils.isArray(topic)) ? topic.map(toTopic) : toTopic(topic);\n });\n\n // lazy load\n return {\n topics: options.topics,\n to: options.to,\n address: options.address,\n fromBlock: formatters.inputBlockNumberFormatter(options.fromBlock),\n toBlock: formatters.inputBlockNumberFormatter(options.toBlock) \n }; \n};\n\nvar Filter = function (options, methods, formatter) {\n var implementation = {};\n methods.forEach(function (method) {\n method.attachToObject(implementation);\n });\n this.options = getOptions(options);\n this.implementation = implementation;\n this.callbacks = [];\n this.formatter = formatter;\n this.filterId = this.implementation.newFilter(this.options);\n};\n\nFilter.prototype.watch = function (callback) {\n this.callbacks.push(callback);\n var self = this;\n\n var onMessage = function (error, messages) {\n if (error) {\n return self.callbacks.forEach(function (callback) {\n callback(error);\n });\n }\n\n messages.forEach(function (message) {\n message = self.formatter ? self.formatter(message) : message;\n self.callbacks.forEach(function (callback) {\n callback(null, message);\n });\n });\n };\n\n // call getFilterLogs on start\n if (!utils.isString(this.options)) {\n this.get(function (err, messages) {\n // don't send all the responses to all the watches again... just to this one\n if (err) {\n callback(err);\n }\n\n messages.forEach(function (message) {\n callback(null, message);\n });\n });\n }\n\n RequestManager.getInstance().startPolling({\n method: this.implementation.poll.call,\n params: [this.filterId],\n }, this.filterId, onMessage, this.stopWatching.bind(this));\n};\n\nFilter.prototype.stopWatching = function () {\n RequestManager.getInstance().stopPolling(this.filterId);\n this.implementation.uninstallFilter(this.filterId);\n this.callbacks = [];\n};\n\nFilter.prototype.get = function (callback) {\n var self = this;\n if (utils.isFunction(callback)) {\n this.implementation.getLogs(this.filterId, function(err, res){\n if (err) {\n callback(err);\n } else {\n callback(null, res.map(function (log) {\n return self.formatter ? self.formatter(log) : log;\n }));\n }\n });\n } else {\n var logs = this.implementation.getLogs(this.filterId);\n return logs.map(function (log) {\n return self.formatter ? self.formatter(log) : log;\n });\n }\n};\n\nmodule.exports = Filter;\n\n", "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file formatters.js\n * @author Marek Kotewicz \n * @author Fabian Vogelsteller \n * @date 2015\n */\n\nvar utils = require('../utils/utils');\nvar config = require('../utils/config');\n\n/**\n * Should the format output to a big number\n *\n * @method outputBigNumberFormatter\n * @param {String|Number|BigNumber}\n * @returns {BigNumber} object\n */\nvar outputBigNumberFormatter = function (number) {\n return utils.toBigNumber(number);\n};\n\nvar isPredefinedBlockNumber = function (blockNumber) {\n return blockNumber === 'latest' || blockNumber === 'pending' || blockNumber === 'earliest';\n};\n\nvar inputDefaultBlockNumberFormatter = function (blockNumber) {\n if (blockNumber === undefined) {\n return config.defaultBlock;\n }\n return inputBlockNumberFormatter(blockNumber);\n};\n\nvar inputBlockNumberFormatter = function (blockNumber) {\n if (blockNumber === undefined) {\n return undefined;\n } else if (isPredefinedBlockNumber(blockNumber)) {\n return blockNumber;\n }\n return utils.toHex(blockNumber);\n};\n\n/**\n * Formats the input of a transaction and converts all values to HEX\n *\n * @method inputTransactionFormatter\n * @param {Object} transaction options\n * @returns object\n*/\nvar inputTransactionFormatter = function (options){\n\n options.from = options.from || config.defaultAccount;\n\n // make code -> data\n if (options.code) {\n options.data = options.code;\n delete options.code;\n }\n\n ['gasPrice', 'gas', 'value', 'nonce'].filter(function (key) {\n return options[key] !== undefined;\n }).forEach(function(key){\n options[key] = utils.fromDecimal(options[key]);\n });\n\n return options; \n};\n\n/**\n * Formats the output of a transaction to its proper values\n * \n * @method outputTransactionFormatter\n * @param {Object} transaction\n * @returns {Object} transaction\n*/\nvar outputTransactionFormatter = function (tx){\n tx.blockNumber = utils.toDecimal(tx.blockNumber);\n tx.transactionIndex = utils.toDecimal(tx.transactionIndex);\n tx.nonce = utils.toDecimal(tx.nonce);\n tx.gas = utils.toDecimal(tx.gas);\n tx.gasPrice = utils.toBigNumber(tx.gasPrice);\n tx.value = utils.toBigNumber(tx.value);\n return tx;\n};\n\n/**\n * Formats the output of a block to its proper values\n *\n * @method outputBlockFormatter\n * @param {Object} block object \n * @returns {Object} block object\n*/\nvar outputBlockFormatter = function(block) {\n\n // transform to number\n block.gasLimit = utils.toDecimal(block.gasLimit);\n block.gasUsed = utils.toDecimal(block.gasUsed);\n block.size = utils.toDecimal(block.size);\n block.timestamp = utils.toDecimal(block.timestamp);\n block.number = utils.toDecimal(block.number);\n\n block.difficulty = utils.toBigNumber(block.difficulty);\n block.totalDifficulty = utils.toBigNumber(block.totalDifficulty);\n\n if (utils.isArray(block.transactions)) {\n block.transactions.forEach(function(item){\n if(!utils.isString(item))\n return outputTransactionFormatter(item);\n });\n }\n\n return block;\n};\n\n/**\n * Formats the output of a log\n * \n * @method outputLogFormatter\n * @param {Object} log object\n * @returns {Object} log\n*/\nvar outputLogFormatter = function(log) {\n if (log === null) { // 'pending' && 'latest' filters are nulls\n return null;\n }\n\n log.blockNumber = utils.toDecimal(log.blockNumber);\n log.transactionIndex = utils.toDecimal(log.transactionIndex);\n log.logIndex = utils.toDecimal(log.logIndex);\n\n return log;\n};\n\n/**\n * Formats the input of a whisper post and converts all values to HEX\n *\n * @method inputPostFormatter\n * @param {Object} transaction object\n * @returns {Object}\n*/\nvar inputPostFormatter = function(post) {\n\n post.payload = utils.toHex(post.payload);\n post.ttl = utils.fromDecimal(post.ttl);\n post.workToProve = utils.fromDecimal(post.workToProve);\n post.priority = utils.fromDecimal(post.priority);\n\n // fallback\n if (!utils.isArray(post.topics)) {\n post.topics = post.topics ? [post.topics] : [];\n }\n\n // format the following options\n post.topics = post.topics.map(function(topic){\n return utils.fromAscii(topic);\n });\n\n return post; \n};\n\n/**\n * Formats the output of a received post message\n *\n * @method outputPostFormatter\n * @param {Object}\n * @returns {Object}\n */\nvar outputPostFormatter = function(post){\n\n post.expiry = utils.toDecimal(post.expiry);\n post.sent = utils.toDecimal(post.sent);\n post.ttl = utils.toDecimal(post.ttl);\n post.workProved = utils.toDecimal(post.workProved);\n post.payloadRaw = post.payload;\n post.payload = utils.toAscii(post.payload);\n\n if (utils.isJson(post.payload)) {\n post.payload = JSON.parse(post.payload);\n }\n\n // format the following options\n if (!post.topics) {\n post.topics = [];\n }\n post.topics = post.topics.map(function(topic){\n return utils.toAscii(topic);\n });\n\n return post;\n};\n\nmodule.exports = {\n inputDefaultBlockNumberFormatter: inputDefaultBlockNumberFormatter,\n inputBlockNumberFormatter: inputBlockNumberFormatter,\n inputTransactionFormatter: inputTransactionFormatter,\n inputPostFormatter: inputPostFormatter,\n outputBigNumberFormatter: outputBigNumberFormatter,\n outputTransactionFormatter: outputTransactionFormatter,\n outputBlockFormatter: outputBlockFormatter,\n outputLogFormatter: outputLogFormatter,\n outputPostFormatter: outputPostFormatter\n};\n\n", - "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file function.js\n * @author Marek Kotewicz \n * @date 2015\n */\n\nvar web3 = require('../web3');\nvar coder = require('../solidity/coder');\nvar utils = require('../utils/utils');\n\n/**\n * This prototype should be used to call/sendTransaction to solidity functions\n */\nvar SolidityFunction = function (json, address) {\n this._inputTypes = json.inputs.map(function (i) {\n return i.type;\n });\n this._outputTypes = json.outputs.map(function (i) {\n return i.type;\n });\n this._constant = json.constant;\n this._name = utils.transformToFullName(json);\n this._address = address;\n};\n\n/**\n * Should be used to create payload from arguments\n *\n * @method toPayload\n * @param {...} solidity function params\n * @param {Object} optional payload options\n */\nSolidityFunction.prototype.toPayload = function () {\n var args = Array.prototype.slice.call(arguments);\n var options = {};\n if (args.length > this._inputTypes.length && utils.isObject(args[args.length -1])) {\n options = args.pop();\n }\n options.to = this._address;\n options.data = '0x' + this.signature() + coder.encodeParams(this._inputTypes, args);\n return options;\n};\n\n/**\n * Should be used to get function signature\n *\n * @method signature\n * @return {String} function signature\n */\nSolidityFunction.prototype.signature = function () {\n return web3.sha3(web3.fromAscii(this._name)).slice(2, 10);\n};\n\n/**\n * Should be used to call function\n * \n * @method call\n * @param {Object} options\n * @return {String} output bytes\n */\nSolidityFunction.prototype.call = function () {\n var payload = this.toPayload.apply(this, Array.prototype.slice.call(arguments));\n var output = web3.eth.call(payload);\n output = output.length >= 2 ? output.slice(2) : output;\n var result = coder.decodeParams(this._outputTypes, output);\n return result.length === 1 ? result[0] : result;\n};\n\n/**\n * Should be used to sendTransaction to solidity function\n *\n * @method sendTransaction\n * @param {Object} options\n */\nSolidityFunction.prototype.sendTransaction = function () {\n var payload = this.toPayload.apply(this, Array.prototype.slice.call(arguments));\n web3.eth.sendTransaction(payload);\n};\n\n/**\n * Should be used to get function display name\n *\n * @method displayName\n * @return {String} display name of the function\n */\nSolidityFunction.prototype.displayName = function () {\n return utils.extractDisplayName(this._name);\n};\n\n/**\n * Should be used to get function type name\n * \n * @method typeName\n * @return {String} type name of the function\n */\nSolidityFunction.prototype.typeName = function () {\n return utils.extractTypeName(this._name);\n};\n\n/**\n * Should be called to execute function\n *\n * @method execute\n */\nSolidityFunction.prototype.execute = function () {\n var transaction = !this._constant;\n \n // send transaction\n if (transaction) {\n return this.sendTransaction.apply(this, Array.prototype.slice.call(arguments));\n }\n\n // call\n return this.call.apply(this, Array.prototype.slice.call(arguments));\n};\n\n/**\n * Should be called to attach function to contract\n *\n * @method attachToContract\n * @param {Contract}\n */\nSolidityFunction.prototype.attachToContract = function (contract) {\n var execute = this.execute.bind(this);\n execute.call = this.call.bind(this);\n execute.sendTransaction = this.sendTransaction.bind(this);\n var displayName = this.displayName();\n if (!contract[displayName]) {\n contract[displayName] = execute;\n }\n contract[displayName][this.typeName()] = execute; // circular!!!!\n};\n\nmodule.exports = SolidityFunction;\n\n", + "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/**\n * @file function.js\n * @author Marek Kotewicz \n * @date 2015\n */\n\nvar web3 = require('../web3');\nvar coder = require('../solidity/coder');\nvar utils = require('../utils/utils');\n\n/**\n * This prototype should be used to call/sendTransaction to solidity functions\n */\nvar SolidityFunction = function (json, address) {\n this._inputTypes = json.inputs.map(function (i) {\n return i.type;\n });\n this._outputTypes = json.outputs.map(function (i) {\n return i.type;\n });\n this._constant = json.constant;\n this._name = utils.transformToFullName(json);\n this._address = address;\n};\n\nSolidityFunction.prototype.extractCallback = function (args) {\n if (utils.isFunction(args[args.length - 1])) {\n return args.pop(); // modify the args array!\n }\n};\n\n/**\n * Should be used to create payload from arguments\n *\n * @method toPayload\n * @param {Array} solidity function params\n * @param {Object} optional payload options\n */\nSolidityFunction.prototype.toPayload = function (args) {\n var options = {};\n if (args.length > this._inputTypes.length && utils.isObject(args[args.length -1])) {\n options = args[args.length - 1];\n }\n options.to = this._address;\n options.data = '0x' + this.signature() + coder.encodeParams(this._inputTypes, args);\n return options;\n};\n\n/**\n * Should be used to get function signature\n *\n * @method signature\n * @return {String} function signature\n */\nSolidityFunction.prototype.signature = function () {\n return web3.sha3(web3.fromAscii(this._name)).slice(2, 10);\n};\n\n\nSolidityFunction.prototype.unpackOutput = function (output) {\n if (output === null) {\n return;\n }\n\n output = output.length >= 2 ? output.slice(2) : output;\n var result = coder.decodeParams(this._outputTypes, output);\n return result.length === 1 ? result[0] : result;\n};\n\n/**\n * Calls a contract function.\n *\n * @method call\n * @param {...Object} Contract function arguments\n * @param {function} If the last argument is a function, the contract function\n * call will be asynchronous, and the callback will be passed the\n * error and result.\n * @return {String} output bytes\n */\nSolidityFunction.prototype.call = function () {\n var args = Array.prototype.slice.call(arguments);\n var callback = this.extractCallback(args);\n var payload = this.toPayload(args);\n\n if (!callback) {\n var output = web3.eth.call(payload);\n return this.unpackOutput(output);\n } \n \n var self = this;\n web3.eth.call(payload, function (error, output) {\n callback(error, self.unpackOutput(output));\n });\n};\n\n/**\n * Should be used to sendTransaction to solidity function\n *\n * @method sendTransaction\n * @param {Object} options\n */\nSolidityFunction.prototype.sendTransaction = function () {\n var args = Array.prototype.slice.call(arguments);\n var callback = this.extractCallback(args);\n var payload = this.toPayload(args);\n\n if (!callback) {\n web3.eth.sendTransaction(payload);\n return;\n }\n\n web3.eth.sendTransaction(payload, callback);\n};\n\n/**\n * Should be used to get function display name\n *\n * @method displayName\n * @return {String} display name of the function\n */\nSolidityFunction.prototype.displayName = function () {\n return utils.extractDisplayName(this._name);\n};\n\n/**\n * Should be used to get function type name\n *\n * @method typeName\n * @return {String} type name of the function\n */\nSolidityFunction.prototype.typeName = function () {\n return utils.extractTypeName(this._name);\n};\n\n/**\n * Should be called to get rpc requests from solidity function\n *\n * @method request\n * @returns {Object}\n */\nSolidityFunction.prototype.request = function () {\n var args = Array.prototype.slice.call(arguments);\n var callback = this.extractCallback(args);\n var payload = this.toPayload(args);\n var format = this.unpackOutput.bind(this);\n \n return {\n callback: callback,\n payload: payload, \n format: format\n };\n};\n\n/**\n * Should be called to execute function\n *\n * @method execute\n */\nSolidityFunction.prototype.execute = function () {\n var transaction = !this._constant;\n\n // send transaction\n if (transaction) {\n return this.sendTransaction.apply(this, Array.prototype.slice.call(arguments));\n }\n\n // call\n return this.call.apply(this, Array.prototype.slice.call(arguments));\n};\n\n/**\n * Should be called to attach function to contract\n *\n * @method attachToContract\n * @param {Contract}\n */\nSolidityFunction.prototype.attachToContract = function (contract) {\n var execute = this.execute.bind(this);\n execute.request = this.request.bind(this);\n execute.call = this.call.bind(this);\n execute.sendTransaction = this.sendTransaction.bind(this);\n var displayName = this.displayName();\n if (!contract[displayName]) {\n contract[displayName] = execute;\n }\n contract[displayName][this.typeName()] = execute; // circular!!!!\n};\n\nmodule.exports = SolidityFunction;\n\n", "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** @file httpprovider.js\n * @authors:\n * Marek Kotewicz \n * Marian Oancea \n * Fabian Vogelsteller \n * @date 2014\n */\n\n\"use strict\";\n\nvar XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest; // jshint ignore:line\nvar errors = require('./errors');\n\nvar HttpProvider = function (host) {\n this.host = host || 'http://localhost:8545';\n};\n\nHttpProvider.prototype.send = function (payload) {\n var request = new XMLHttpRequest();\n\n request.open('POST', this.host, false);\n \n try {\n request.send(JSON.stringify(payload));\n } catch(error) {\n throw errors.InvalidConnection(this.host);\n }\n\n\n // check request.status\n // TODO: throw an error here! it cannot silently fail!!!\n //if (request.status !== 200) {\n //return;\n //}\n\n var result = request.responseText;\n\n try {\n result = JSON.parse(result);\n } catch(e) {\n throw errors.InvalidResponse(result); \n }\n\n return result;\n};\n\nHttpProvider.prototype.sendAsync = function (payload, callback) {\n var request = new XMLHttpRequest();\n request.onreadystatechange = function() {\n if (request.readyState === 4) {\n var result = request.responseText;\n var error = null;\n\n try {\n result = JSON.parse(result);\n } catch(e) {\n error = errors.InvalidResponse(result); \n }\n\n callback(error, result);\n }\n };\n\n request.open('POST', this.host, true);\n\n try {\n request.send(JSON.stringify(payload));\n } catch(error) {\n callback(errors.InvalidConnection(this.host));\n }\n};\n\nmodule.exports = HttpProvider;\n\n", "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** @file jsonrpc.js\n * @authors:\n * Marek Kotewicz \n * @date 2015\n */\n\nvar Jsonrpc = function () {\n // singleton pattern\n if (arguments.callee._singletonInstance) {\n return arguments.callee._singletonInstance;\n }\n arguments.callee._singletonInstance = this;\n\n this.messageId = 1;\n};\n\n/**\n * @return {Jsonrpc} singleton\n */\nJsonrpc.getInstance = function () {\n var instance = new Jsonrpc();\n return instance;\n};\n\n/**\n * Should be called to valid json create payload object\n *\n * @method toPayload\n * @param {Function} method of jsonrpc call, required\n * @param {Array} params, an array of method params, optional\n * @returns {Object} valid jsonrpc payload object\n */\nJsonrpc.prototype.toPayload = function (method, params) {\n if (!method)\n console.error('jsonrpc method should be specified!');\n\n return {\n jsonrpc: '2.0',\n method: method,\n params: params || [],\n id: this.messageId++\n };\n};\n\n/**\n * Should be called to check if jsonrpc response is valid\n *\n * @method isValidResponse\n * @param {Object}\n * @returns {Boolean} true if response is valid, otherwise false\n */\nJsonrpc.prototype.isValidResponse = function (response) {\n return !!response &&\n !response.error &&\n response.jsonrpc === '2.0' &&\n typeof response.id === 'number' &&\n response.result !== undefined; // only undefined is not valid json object\n};\n\n/**\n * Should be called to create batch payload object\n *\n * @method toBatchPayload\n * @param {Array} messages, an array of objects with method (required) and params (optional) fields\n * @returns {Array} batch payload\n */\nJsonrpc.prototype.toBatchPayload = function (messages) {\n var self = this;\n return messages.map(function (message) {\n return self.toPayload(message.method, message.params);\n });\n};\n\nmodule.exports = Jsonrpc;\n\n", - "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/**\n * @file method.js\n * @author Marek Kotewicz \n * @date 2015\n */\n\nvar RequestManager = require('./requestmanager');\nvar utils = require('../utils/utils');\nvar errors = require('./errors');\n\nvar Method = function (options) {\n this.name = options.name;\n this.call = options.call;\n this.params = options.params || 0;\n this.inputFormatter = options.inputFormatter;\n this.outputFormatter = options.outputFormatter;\n};\n\n/**\n * Should be used to determine name of the jsonrpc method based on arguments\n *\n * @method getCall\n * @param {Array} arguments\n * @return {String} name of jsonrpc method\n */\nMethod.prototype.getCall = function (args) {\n return utils.isFunction(this.call) ? this.call(args) : this.call;\n};\n\n/**\n * Should be used to extract callback from array of arguments. Modifies input param\n *\n * @method extractCallback\n * @param {Array} arguments\n * @return {Function|Null} callback, if exists\n */\nMethod.prototype.extractCallback = function (args) {\n if (utils.isFunction(args[args.length - 1])) {\n return args.pop(); // modify the args array!\n }\n return null;\n};\n\n/**\n * Should be called to check if the number of arguments is correct\n * \n * @method validateArgs\n * @param {Array} arguments\n * @throws {Error} if it is not\n */\nMethod.prototype.validateArgs = function (args) {\n if (args.length !== this.params) {\n throw errors.InvalidNumberOfParams();\n }\n};\n\n/**\n * Should be called to format input args of method\n * \n * @method formatInput\n * @param {Array}\n * @return {Array}\n */\nMethod.prototype.formatInput = function (args) {\n if (!this.inputFormatter) {\n return args;\n }\n\n return this.inputFormatter.map(function (formatter, index) {\n return formatter ? formatter(args[index]) : args[index];\n });\n};\n\n/**\n * Should be called to format output(result) of method\n *\n * @method formatOutput\n * @param {Object}\n * @return {Object}\n */\nMethod.prototype.formatOutput = function (result) {\n return this.outputFormatter && result !== null ? this.outputFormatter(result) : result;\n};\n\n/**\n * Should attach function to method\n * \n * @method attachToObject\n * @param {Object}\n * @param {Function}\n */\nMethod.prototype.attachToObject = function (obj) {\n var func = this.send.bind(this);\n func.call = this.call; // that's ugly. filter.js uses it\n var name = this.name.split('.');\n if (name.length > 1) {\n obj[name[0]] = obj[name[0]] || {};\n obj[name[0]][name[1]] = func;\n } else {\n obj[name[0]] = func; \n }\n};\n\n/**\n * Should create payload from given input args\n *\n * @method toPayload\n * @param {Array} args\n * @return {Object}\n */\nMethod.prototype.toPayload = function (args) {\n var call = this.getCall(args);\n var callback = this.extractCallback(args);\n var params = this.formatInput(args);\n this.validateArgs(params);\n\n return {\n method: call,\n params: params,\n callback: callback\n };\n};\n\n/**\n * Should send request to the API\n *\n * @method send\n * @param list of params\n * @return result\n */\nMethod.prototype.send = function () {\n var payload = this.toPayload(Array.prototype.slice.call(arguments));\n if (payload.callback) {\n var self = this;\n return RequestManager.getInstance().sendAsync(payload, function (err, result) {\n payload.callback(null, self.formatOutput(result));\n });\n }\n return this.formatOutput(RequestManager.getInstance().send(payload));\n};\n\nmodule.exports = Method;\n\n", + "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/**\n * @file method.js\n * @author Marek Kotewicz \n * @date 2015\n */\n\nvar RequestManager = require('./requestmanager');\nvar utils = require('../utils/utils');\nvar errors = require('./errors');\n\nvar Method = function (options) {\n this.name = options.name;\n this.call = options.call;\n this.params = options.params || 0;\n this.inputFormatter = options.inputFormatter;\n this.outputFormatter = options.outputFormatter;\n};\n\n/**\n * Should be used to determine name of the jsonrpc method based on arguments\n *\n * @method getCall\n * @param {Array} arguments\n * @return {String} name of jsonrpc method\n */\nMethod.prototype.getCall = function (args) {\n return utils.isFunction(this.call) ? this.call(args) : this.call;\n};\n\n/**\n * Should be used to extract callback from array of arguments. Modifies input param\n *\n * @method extractCallback\n * @param {Array} arguments\n * @return {Function|Null} callback, if exists\n */\nMethod.prototype.extractCallback = function (args) {\n if (utils.isFunction(args[args.length - 1])) {\n return args.pop(); // modify the args array!\n }\n};\n\n/**\n * Should be called to check if the number of arguments is correct\n * \n * @method validateArgs\n * @param {Array} arguments\n * @throws {Error} if it is not\n */\nMethod.prototype.validateArgs = function (args) {\n if (args.length !== this.params) {\n throw errors.InvalidNumberOfParams();\n }\n};\n\n/**\n * Should be called to format input args of method\n * \n * @method formatInput\n * @param {Array}\n * @return {Array}\n */\nMethod.prototype.formatInput = function (args) {\n if (!this.inputFormatter) {\n return args;\n }\n\n return this.inputFormatter.map(function (formatter, index) {\n return formatter ? formatter(args[index]) : args[index];\n });\n};\n\n/**\n * Should be called to format output(result) of method\n *\n * @method formatOutput\n * @param {Object}\n * @return {Object}\n */\nMethod.prototype.formatOutput = function (result) {\n return this.outputFormatter && result !== null ? this.outputFormatter(result) : result;\n};\n\n/**\n * Should attach function to method\n * \n * @method attachToObject\n * @param {Object}\n * @param {Function}\n */\nMethod.prototype.attachToObject = function (obj) {\n var func = this.send.bind(this);\n func.request = this.request.bind(this);\n func.call = this.call; // that's ugly. filter.js uses it\n var name = this.name.split('.');\n if (name.length > 1) {\n obj[name[0]] = obj[name[0]] || {};\n obj[name[0]][name[1]] = func;\n } else {\n obj[name[0]] = func; \n }\n};\n\n/**\n * Should create payload from given input args\n *\n * @method toPayload\n * @param {Array} args\n * @return {Object}\n */\nMethod.prototype.toPayload = function (args) {\n var call = this.getCall(args);\n var callback = this.extractCallback(args);\n var params = this.formatInput(args);\n this.validateArgs(params);\n\n return {\n method: call,\n params: params,\n callback: callback\n };\n};\n\n/**\n * Should be called to create pure JSONRPC request which can be used in batch request\n *\n * @method request\n * @param {...} params\n * @return {Object} jsonrpc request\n */\nMethod.prototype.request = function () {\n var payload = this.toPayload(Array.prototype.slice.call(arguments));\n payload.format = this.formatOutput.bind(this);\n return payload;\n};\n\n/**\n * Should send request to the API\n *\n * @method send\n * @param list of params\n * @return result\n */\nMethod.prototype.send = function () {\n var payload = this.toPayload(Array.prototype.slice.call(arguments));\n if (payload.callback) {\n var self = this;\n return RequestManager.getInstance().sendAsync(payload, function (err, result) {\n payload.callback(err, self.formatOutput(result));\n });\n }\n return this.formatOutput(RequestManager.getInstance().send(payload));\n};\n\nmodule.exports = Method;\n\n", "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** @file eth.js\n * @authors:\n * Marek Kotewicz \n * @date 2015\n */\n\nvar utils = require('../utils/utils');\nvar Property = require('./property');\n\n/// @returns an array of objects describing web3.eth api methods\nvar methods = [\n];\n\n/// @returns an array of objects describing web3.eth api properties\nvar properties = [\n new Property({\n name: 'listening',\n getter: 'net_listening'\n }),\n new Property({\n name: 'peerCount',\n getter: 'net_peerCount',\n outputFormatter: utils.toDecimal\n })\n];\n\n\nmodule.exports = {\n methods: methods,\n properties: properties\n};\n\n", - "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/**\n * @file property.js\n * @author Fabian Vogelsteller \n * @author Marek Kotewicz \n * @date 2015\n */\n\nvar RequestManager = require('./requestmanager');\n\nvar Property = function (options) {\n this.name = options.name;\n this.getter = options.getter;\n this.setter = options.setter;\n this.outputFormatter = options.outputFormatter;\n this.inputFormatter = options.inputFormatter;\n};\n\n/**\n * Should be called to format input args of method\n * \n * @method formatInput\n * @param {Array}\n * @return {Array}\n */\nProperty.prototype.formatInput = function (arg) {\n return this.inputFormatter ? this.inputFormatter(arg) : arg;\n};\n\n/**\n * Should be called to format output(result) of method\n *\n * @method formatOutput\n * @param {Object}\n * @return {Object}\n */\nProperty.prototype.formatOutput = function (result) {\n return this.outputFormatter && result !== null ? this.outputFormatter(result) : result;\n};\n\n/**\n * Should attach function to method\n * \n * @method attachToObject\n * @param {Object}\n * @param {Function}\n */\nProperty.prototype.attachToObject = function (obj) {\n var proto = {\n get: this.get.bind(this),\n set: this.set.bind(this)\n };\n\n var name = this.name.split('.');\n if (name.length > 1) {\n obj[name[0]] = obj[name[0]] || {};\n Object.defineProperty(obj[name[0]], name[1], proto); \n } else {\n Object.defineProperty(obj, name[0], proto);\n }\n};\n\n/**\n * Should be used to get value of the property\n *\n * @method get\n * @return {Object} value of the property\n */\nProperty.prototype.get = function () {\n return this.formatOutput(RequestManager.getInstance().send({\n method: this.getter\n }));\n};\n\n/**\n * Should be used to set value of the property\n *\n * @method set\n * @param {Object} new value of the property\n */\nProperty.prototype.set = function (value) {\n return RequestManager.getInstance().send({\n method: this.setter,\n params: [this.formatInput(value)]\n });\n};\n\nmodule.exports = Property;\n\n", + "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/**\n * @file property.js\n * @author Fabian Vogelsteller \n * @author Marek Kotewicz \n * @date 2015\n */\n\nvar RequestManager = require('./requestmanager');\n\nvar Property = function (options) {\n this.name = options.name;\n this.getter = options.getter;\n this.setter = options.setter;\n this.outputFormatter = options.outputFormatter;\n this.inputFormatter = options.inputFormatter;\n};\n\n/**\n * Should be called to format input args of method\n * \n * @method formatInput\n * @param {Array}\n * @return {Array}\n */\nProperty.prototype.formatInput = function (arg) {\n return this.inputFormatter ? this.inputFormatter(arg) : arg;\n};\n\n/**\n * Should be called to format output(result) of method\n *\n * @method formatOutput\n * @param {Object}\n * @return {Object}\n */\nProperty.prototype.formatOutput = function (result) {\n return this.outputFormatter && result !== null ? this.outputFormatter(result) : result;\n};\n\n/**\n * Should attach function to method\n * \n * @method attachToObject\n * @param {Object}\n * @param {Function}\n */\nProperty.prototype.attachToObject = function (obj) {\n var proto = {\n get: this.get.bind(this),\n };\n\n var names = this.name.split('.');\n var name = names[0];\n if (names.length > 1) {\n obj[names[0]] = obj[names[0]] || {};\n obj = obj[names[0]];\n name = names[1];\n }\n \n Object.defineProperty(obj, name, proto);\n\n var toAsyncName = function (prefix, name) {\n return prefix + name.charAt(0).toUpperCase() + name.slice(1);\n };\n\n obj[toAsyncName('get', name)] = this.getAsync.bind(this);\n};\n\n/**\n * Should be used to get value of the property\n *\n * @method get\n * @return {Object} value of the property\n */\nProperty.prototype.get = function () {\n return this.formatOutput(RequestManager.getInstance().send({\n method: this.getter\n }));\n};\n\n/**\n * Should be used to asynchrounously get value of property\n *\n * @method getAsync\n * @param {Function}\n */\nProperty.prototype.getAsync = function (callback) {\n var self = this;\n RequestManager.getInstance().sendAsync({\n method: this.getter\n }, function (err, result) {\n if (err) {\n return callback(err);\n }\n callback(err, self.formatOutput(result));\n });\n};\n\nmodule.exports = Property;\n\n", "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** @file qtsync.js\n * @authors:\n * Marek Kotewicz \n * Marian Oancea \n * @date 2014\n */\n\nvar QtSyncProvider = function () {\n};\n\nQtSyncProvider.prototype.send = function (payload) {\n var result = navigator.qt.callMethod(JSON.stringify(payload));\n return JSON.parse(result);\n};\n\nmodule.exports = QtSyncProvider;\n\n", - "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file requestmanager.js\n * @author Jeffrey Wilcke \n * @author Marek Kotewicz \n * @author Marian Oancea \n * @author Fabian Vogelsteller \n * @author Gav Wood \n * @date 2014\n */\n\nvar Jsonrpc = require('./jsonrpc');\nvar utils = require('../utils/utils');\nvar c = require('../utils/config');\nvar errors = require('./errors');\n\n/**\n * It's responsible for passing messages to providers\n * It's also responsible for polling the ethereum node for incoming messages\n * Default poll timeout is 1 second\n * Singleton\n */\nvar RequestManager = function (provider) {\n // singleton pattern\n if (arguments.callee._singletonInstance) {\n return arguments.callee._singletonInstance;\n }\n arguments.callee._singletonInstance = this;\n\n this.provider = provider;\n this.polls = [];\n this.timeout = null;\n this.poll();\n};\n\n/**\n * @return {RequestManager} singleton\n */\nRequestManager.getInstance = function () {\n var instance = new RequestManager();\n return instance;\n};\n\n/**\n * Should be used to synchronously send request\n *\n * @method send\n * @param {Object} data\n * @return {Object}\n */\nRequestManager.prototype.send = function (data) {\n if (!this.provider) {\n console.error(errors.InvalidProvider());\n return null;\n }\n\n var payload = Jsonrpc.getInstance().toPayload(data.method, data.params);\n var result = this.provider.send(payload);\n\n if (!Jsonrpc.getInstance().isValidResponse(result)) {\n throw errors.InvalidResponse(result);\n }\n\n return result.result;\n};\n\n/**\n * Should be used to asynchronously send request\n *\n * @method sendAsync\n * @param {Object} data\n * @param {Function} callback\n */\nRequestManager.prototype.sendAsync = function (data, callback) {\n if (!this.provider) {\n return callback(errors.InvalidProvider());\n }\n\n var payload = Jsonrpc.getInstance().toPayload(data.method, data.params);\n this.provider.sendAsync(payload, function (err, result) {\n if (err) {\n return callback(err);\n }\n \n if (!Jsonrpc.getInstance().isValidResponse(result)) {\n return callback(errors.InvalidResponse(result));\n }\n\n callback(null, result.result);\n });\n};\n\n/**\n * Should be used to set provider of request manager\n *\n * @method setProvider\n * @param {Object}\n */\nRequestManager.prototype.setProvider = function (p) {\n this.provider = p;\n};\n\n/*jshint maxparams:4 */\n\n/**\n * Should be used to start polling\n *\n * @method startPolling\n * @param {Object} data\n * @param {Number} pollId\n * @param {Function} callback\n * @param {Function} uninstall\n *\n * @todo cleanup number of params\n */\nRequestManager.prototype.startPolling = function (data, pollId, callback, uninstall) {\n this.polls.push({data: data, id: pollId, callback: callback, uninstall: uninstall});\n};\n/*jshint maxparams:3 */\n\n/**\n * Should be used to stop polling for filter with given id\n *\n * @method stopPolling\n * @param {Number} pollId\n */\nRequestManager.prototype.stopPolling = function (pollId) {\n for (var i = this.polls.length; i--;) {\n var poll = this.polls[i];\n if (poll.id === pollId) {\n this.polls.splice(i, 1);\n }\n }\n};\n\n/**\n * Should be called to reset polling mechanism of request manager\n *\n * @method reset\n */\nRequestManager.prototype.reset = function () {\n this.polls.forEach(function (poll) {\n poll.uninstall(poll.id); \n });\n this.polls = [];\n\n if (this.timeout) {\n clearTimeout(this.timeout);\n this.timeout = null;\n }\n this.poll();\n};\n\n/**\n * Should be called to poll for changes on filter with given id\n *\n * @method poll\n */\nRequestManager.prototype.poll = function () {\n this.timeout = setTimeout(this.poll.bind(this), c.ETH_POLLING_TIMEOUT);\n\n if (!this.polls.length) {\n return;\n }\n\n if (!this.provider) {\n console.error(errors.InvalidProvider());\n return;\n }\n\n var payload = Jsonrpc.getInstance().toBatchPayload(this.polls.map(function (data) {\n return data.data;\n }));\n\n var self = this;\n this.provider.sendAsync(payload, function (error, results) {\n // TODO: console log?\n if (error) {\n return;\n }\n \n if (!utils.isArray(results)) {\n throw errors.InvalidResponse(results);\n }\n\n results.map(function (result, index) {\n result.callback = self.polls[index].callback;\n return result;\n }).filter(function (result) {\n var valid = Jsonrpc.getInstance().isValidResponse(result);\n if (!valid) {\n result.callback(errors.InvalidResponse(result));\n }\n return valid;\n }).filter(function (result) {\n return utils.isArray(result.result) && result.result.length > 0;\n }).forEach(function (result) {\n result.callback(null, result.result);\n });\n });\n};\n\nmodule.exports = RequestManager;\n\n", + "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file requestmanager.js\n * @author Jeffrey Wilcke \n * @author Marek Kotewicz \n * @author Marian Oancea \n * @author Fabian Vogelsteller \n * @author Gav Wood \n * @date 2014\n */\n\nvar Jsonrpc = require('./jsonrpc');\nvar utils = require('../utils/utils');\nvar c = require('../utils/config');\nvar errors = require('./errors');\n\n/**\n * It's responsible for passing messages to providers\n * It's also responsible for polling the ethereum node for incoming messages\n * Default poll timeout is 1 second\n * Singleton\n */\nvar RequestManager = function (provider) {\n // singleton pattern\n if (arguments.callee._singletonInstance) {\n return arguments.callee._singletonInstance;\n }\n arguments.callee._singletonInstance = this;\n\n this.provider = provider;\n this.polls = [];\n this.timeout = null;\n this.poll();\n};\n\n/**\n * @return {RequestManager} singleton\n */\nRequestManager.getInstance = function () {\n var instance = new RequestManager();\n return instance;\n};\n\n/**\n * Should be used to synchronously send request\n *\n * @method send\n * @param {Object} data\n * @return {Object}\n */\nRequestManager.prototype.send = function (data) {\n if (!this.provider) {\n console.error(errors.InvalidProvider());\n return null;\n }\n\n var payload = Jsonrpc.getInstance().toPayload(data.method, data.params);\n var result = this.provider.send(payload);\n\n if (!Jsonrpc.getInstance().isValidResponse(result)) {\n throw errors.InvalidResponse(result);\n }\n\n return result.result;\n};\n\n/**\n * Should be used to asynchronously send request\n *\n * @method sendAsync\n * @param {Object} data\n * @param {Function} callback\n */\nRequestManager.prototype.sendAsync = function (data, callback) {\n if (!this.provider) {\n return callback(errors.InvalidProvider());\n }\n\n var payload = Jsonrpc.getInstance().toPayload(data.method, data.params);\n this.provider.sendAsync(payload, function (err, result) {\n if (err) {\n return callback(err);\n }\n \n if (!Jsonrpc.getInstance().isValidResponse(result)) {\n return callback(errors.InvalidResponse(result));\n }\n\n callback(null, result.result);\n });\n};\n\n/**\n * Should be called to asynchronously send batch request\n *\n * @method sendBatch\n * @param {Array} batch data\n * @param {Function} callback\n */\nRequestManager.prototype.sendBatch = function (data, callback) {\n if (!this.provider) {\n return callback(errors.InvalidProvider());\n }\n\n var payload = Jsonrpc.getInstance().toBatchPayload(data);\n\n this.provider.sendAsync(payload, function (err, results) {\n if (err) {\n return callback(err);\n }\n\n if (!utils.isArray(results)) {\n return callback(errors.InvalidResponse(results));\n }\n\n callback(err, results);\n }); \n};\n\n/**\n * Should be used to set provider of request manager\n *\n * @method setProvider\n * @param {Object}\n */\nRequestManager.prototype.setProvider = function (p) {\n this.provider = p;\n};\n\n/*jshint maxparams:4 */\n\n/**\n * Should be used to start polling\n *\n * @method startPolling\n * @param {Object} data\n * @param {Number} pollId\n * @param {Function} callback\n * @param {Function} uninstall\n *\n * @todo cleanup number of params\n */\nRequestManager.prototype.startPolling = function (data, pollId, callback, uninstall) {\n this.polls.push({data: data, id: pollId, callback: callback, uninstall: uninstall});\n};\n/*jshint maxparams:3 */\n\n/**\n * Should be used to stop polling for filter with given id\n *\n * @method stopPolling\n * @param {Number} pollId\n */\nRequestManager.prototype.stopPolling = function (pollId) {\n for (var i = this.polls.length; i--;) {\n var poll = this.polls[i];\n if (poll.id === pollId) {\n this.polls.splice(i, 1);\n }\n }\n};\n\n/**\n * Should be called to reset polling mechanism of request manager\n *\n * @method reset\n */\nRequestManager.prototype.reset = function () {\n this.polls.forEach(function (poll) {\n poll.uninstall(poll.id); \n });\n this.polls = [];\n\n if (this.timeout) {\n clearTimeout(this.timeout);\n this.timeout = null;\n }\n this.poll();\n};\n\n/**\n * Should be called to poll for changes on filter with given id\n *\n * @method poll\n */\nRequestManager.prototype.poll = function () {\n this.timeout = setTimeout(this.poll.bind(this), c.ETH_POLLING_TIMEOUT);\n\n if (!this.polls.length) {\n return;\n }\n\n if (!this.provider) {\n console.error(errors.InvalidProvider());\n return;\n }\n\n var payload = Jsonrpc.getInstance().toBatchPayload(this.polls.map(function (data) {\n return data.data;\n }));\n\n var self = this;\n this.provider.sendAsync(payload, function (error, results) {\n // TODO: console log?\n if (error) {\n return;\n }\n \n if (!utils.isArray(results)) {\n throw errors.InvalidResponse(results);\n }\n\n results.map(function (result, index) {\n result.callback = self.polls[index].callback;\n return result;\n }).filter(function (result) {\n var valid = Jsonrpc.getInstance().isValidResponse(result);\n if (!valid) {\n result.callback(errors.InvalidResponse(result));\n }\n return valid;\n }).filter(function (result) {\n return utils.isArray(result.result) && result.result.length > 0;\n }).forEach(function (result) {\n result.callback(null, result.result);\n });\n });\n};\n\nmodule.exports = RequestManager;\n\n", "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** @file shh.js\n * @authors:\n * Marek Kotewicz \n * @date 2015\n */\n\nvar Method = require('./method');\nvar formatters = require('./formatters');\n\nvar post = new Method({\n name: 'post', \n call: 'shh_post', \n params: 1,\n inputFormatter: [formatters.inputPostFormatter]\n});\n\nvar newIdentity = new Method({\n name: 'newIdentity',\n call: 'shh_newIdentity',\n params: 0\n});\n\nvar hasIdentity = new Method({\n name: 'hasIdentity',\n call: 'shh_hasIdentity',\n params: 1\n});\n\nvar newGroup = new Method({\n name: 'newGroup',\n call: 'shh_newGroup',\n params: 0\n});\n\nvar addToGroup = new Method({\n name: 'addToGroup',\n call: 'shh_addToGroup',\n params: 0\n});\n\nvar methods = [\n post,\n newIdentity,\n hasIdentity,\n newGroup,\n addToGroup\n];\n\nmodule.exports = {\n methods: methods\n};\n\n", - "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** @file watches.js\n * @authors:\n * Marek Kotewicz \n * @date 2015\n */\n\nvar Method = require('./method');\n\n/// @returns an array of objects describing web3.eth.filter api methods\nvar eth = function () {\n var newFilterCall = function (args) {\n return typeof args[0] === 'string' ? 'eth_newBlockFilter' : 'eth_newFilter';\n };\n\n var newFilter = new Method({\n name: 'newFilter',\n call: newFilterCall,\n params: 1\n });\n\n var uninstallFilter = new Method({\n name: 'uninstallFilter',\n call: 'eth_uninstallFilter',\n params: 1\n });\n\n var getLogs = new Method({\n name: 'getLogs',\n call: 'eth_getFilterLogs',\n params: 1\n });\n\n var poll = new Method({\n name: 'poll',\n call: 'eth_getFilterChanges',\n params: 1\n });\n\n return [\n newFilter,\n uninstallFilter,\n getLogs,\n poll\n ];\n};\n\n/// @returns an array of objects describing web3.shh.watch api methods\nvar shh = function () {\n var newFilter = new Method({\n name: 'newFilter',\n call: 'shh_newFilter',\n params: 1\n });\n\n var uninstallFilter = new Method({\n name: 'uninstallFilter',\n call: 'shh_uninstallFilter',\n params: 1\n });\n\n var getLogs = new Method({\n name: 'getLogs',\n call: 'shh_getMessages',\n params: 1\n });\n\n var poll = new Method({\n name: 'poll',\n call: 'shh_getFilterChanges',\n params: 1\n });\n\n return [\n newFilter,\n uninstallFilter,\n getLogs,\n poll\n ];\n};\n\nmodule.exports = {\n eth: eth,\n shh: shh\n};\n\n", + "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** @file watches.js\n * @authors:\n * Marek Kotewicz \n * @date 2015\n */\n\nvar Method = require('./method');\n\n/// @returns an array of objects describing web3.eth.filter api methods\nvar eth = function () {\n var newFilterCall = function (args) {\n var type = args[0];\n\n switch(type) {\n case 'latest':\n args.pop();\n this.params = 0;\n return 'eth_newBlockFilter';\n case 'pending':\n args.pop();\n this.params = 0;\n return 'eth_newPendingTransactionFilter';\n default:\n return 'eth_newFilter';\n }\n };\n\n var newFilter = new Method({\n name: 'newFilter',\n call: newFilterCall,\n params: 1\n });\n\n var uninstallFilter = new Method({\n name: 'uninstallFilter',\n call: 'eth_uninstallFilter',\n params: 1\n });\n\n var getLogs = new Method({\n name: 'getLogs',\n call: 'eth_getFilterLogs',\n params: 1\n });\n\n var poll = new Method({\n name: 'poll',\n call: 'eth_getFilterChanges',\n params: 1\n });\n\n return [\n newFilter,\n uninstallFilter,\n getLogs,\n poll\n ];\n};\n\n/// @returns an array of objects describing web3.shh.watch api methods\nvar shh = function () {\n var newFilter = new Method({\n name: 'newFilter',\n call: 'shh_newFilter',\n params: 1\n });\n\n var uninstallFilter = new Method({\n name: 'uninstallFilter',\n call: 'shh_uninstallFilter',\n params: 1\n });\n\n var getLogs = new Method({\n name: 'getLogs',\n call: 'shh_getMessages',\n params: 1\n });\n\n var poll = new Method({\n name: 'poll',\n call: 'shh_getFilterChanges',\n params: 1\n });\n\n return [\n newFilter,\n uninstallFilter,\n getLogs,\n poll\n ];\n};\n\nmodule.exports = {\n eth: eth,\n shh: shh\n};\n\n", null, "'use strict';\n\nmodule.exports = BigNumber; // jshint ignore:line\n\n", - "var web3 = require('./lib/web3');\nweb3.providers.HttpProvider = require('./lib/web3/httpprovider');\nweb3.providers.QtSyncProvider = require('./lib/web3/qtsync');\nweb3.eth.contract = require('./lib/web3/contract');\nweb3.abi = require('./lib/solidity/abi');\n\n// dont override global variable\nif (typeof window !== 'undefined' && typeof window.web3 === 'undefined') {\n window.web3 = web3;\n}\n\nmodule.exports = web3;\n\n" + "var web3 = require('./lib/web3');\nweb3.providers.HttpProvider = require('./lib/web3/httpprovider');\nweb3.providers.QtSyncProvider = require('./lib/web3/qtsync');\nweb3.eth.contract = require('./lib/web3/contract');\n\n// dont override global variable\nif (typeof window !== 'undefined' && typeof window.web3 === 'undefined') {\n window.web3 = web3;\n}\n\nmodule.exports = web3;\n\n" ] } \ No newline at end of file diff --git a/dist/web3-light.min.js b/dist/web3-light.min.js index 4c0fd2930..22527f18e 100644 --- a/dist/web3-light.min.js +++ b/dist/web3-light.min.js @@ -1,2 +1,2 @@ -require=function t(e,r,n){function o(a,s){if(!r[a]){if(!e[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var l=r[a]={exports:{}};e[a][0].call(l.exports,function(t){var r=e[a][1][t];return o(r?r:t)},l,l.exports,t,e,r,n)}return r[a].exports}for(var i="function"==typeof require&&require,a=0;a0&&console.warn("didn't found matching constructor, using default one"),"")};e.exports={formatConstructorParams:i}},{"./coder":2,"./utils":5}],2:[function(t,e,r){var n=t("bignumber.js"),o=t("../utils/utils"),i=t("./formatters"),a=t("./param"),s=function(t){return"[]"===t.slice(-2)},u=function(t){this._name=t.name,this._match=t.match,this._mode=t.mode,this._inputFormatter=t.inputFormatter,this._outputFormatter=t.outputFormatter};u.prototype.isType=function(t){return"strict"===this._match?this._name===t||0===t.indexOf(this._name)&&"[]"===t.slice(this._name.length):"prefix"===this._match?0===t.indexOf(this._name):void 0},u.prototype.formatInput=function(t,e){if(o.isArray(t)&&e){var r=this;return t.map(function(t){return r._inputFormatter(t)}).reduce(function(t,e){return t.combine(e)},i.formatInputInt(t.length)).withOffset(32)}return this._inputFormatter(t)},u.prototype.formatOutput=function(t,e){if(e){for(var r=[],o=new n(t.dynamicPart().slice(0,64),16),i=0;64*o>i;i+=64)r.push(this._outputFormatter(new a(t.dynamicPart().substr(i+64,64))));return r}return this._outputFormatter(t)},u.prototype.sliceParam=function(t,e,r){return"bytes"===this._mode?a.decodeBytes(t,e):s(r)?a.decodeArray(t,e):a.decodeParam(t,e)};var c=function(t){this._types=t};c.prototype._requireType=function(t){var e=this._types.filter(function(e){return e.isType(t)})[0];if(!e)throw Error("invalid solidity type!: "+t);return e},c.prototype._formatInput=function(t,e){return this._requireType(t).formatInput(e,s(t))},c.prototype.encodeParam=function(t,e){return this._formatInput(t,e).encode()},c.prototype.encodeParams=function(t,e){var r=this,n=t.map(function(t,n){return r._formatInput(t,e[n])});return a.encodeList(n)},c.prototype.decodeParam=function(t,e){return this.decodeParams([t],e)[0]},c.prototype.decodeParams=function(t,e){var r=this;return t.map(function(t,n){var o=r._requireType(t),i=o.sliceParam(e,n,t);return o.formatOutput(i,s(t))})};var l=new c([new u({name:"address",match:"strict",mode:"value",inputFormatter:i.formatInputInt,outputFormatter:i.formatOutputAddress}),new u({name:"bool",match:"strict",mode:"value",inputFormatter:i.formatInputBool,outputFormatter:i.formatOutputBool}),new u({name:"int",match:"prefix",mode:"value",inputFormatter:i.formatInputInt,outputFormatter:i.formatOutputInt}),new u({name:"uint",match:"prefix",mode:"value",inputFormatter:i.formatInputInt,outputFormatter:i.formatOutputUInt}),new u({name:"bytes",match:"strict",mode:"bytes",inputFormatter:i.formatInputDynamicBytes,outputFormatter:i.formatOutputDynamicBytes}),new u({name:"bytes",match:"prefix",mode:"value",inputFormatter:i.formatInputBytes,outputFormatter:i.formatOutputBytes}),new u({name:"real",match:"prefix",mode:"value",inputFormatter:i.formatInputReal,outputFormatter:i.formatOutputReal}),new u({name:"ureal",match:"prefix",mode:"value",inputFormatter:i.formatInputReal,outputFormatter:i.formatOutputUReal})]);e.exports=l},{"../utils/utils":8,"./formatters":3,"./param":4,"bignumber.js":"bignumber.js"}],3:[function(t,e,r){var n=t("bignumber.js"),o=t("../utils/utils"),i=t("../utils/config"),a=t("./param"),s=function(t){var e=2*i.ETH_PADDING;n.config(i.ETH_BIGNUMBER_ROUNDING_MODE);var r=o.padLeft(o.toTwosComplement(t).round().toString(16),e);return new a(r)},u=function(t){var e=o.fromAscii(t,i.ETH_PADDING).substr(2);return new a(e)},c=function(t){var e=o.fromAscii(t,i.ETH_PADDING).substr(2);return new a(s(t.length).value+e,32)},l=function(t){var e="000000000000000000000000000000000000000000000000000000000000000"+(t?"1":"0");return new a(e)},p=function(t){return s(new n(t).times(new n(2).pow(128)))},f=function(t){return"1"===new n(t.substr(0,1),16).toString(2).substr(0,1)},m=function(t){var e=t.staticPart()||"0";return f(e)?new n(e,16).minus(new n("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16)).minus(1):new n(e,16)},h=function(t){var e=t.staticPart()||"0";return new n(e,16)},d=function(t){return m(t).dividedBy(new n(2).pow(128))},y=function(t){return h(t).dividedBy(new n(2).pow(128))},g=function(t){return"0000000000000000000000000000000000000000000000000000000000000001"===t.staticPart()?!0:!1},b=function(t){return o.toAscii(t.staticPart())},v=function(t){return o.toAscii(t.dynamicPart().slice(64))},w=function(t){var e=t.staticPart();return"0x"+e.slice(e.length-40,e.length)};e.exports={formatInputInt:s,formatInputBytes:u,formatInputDynamicBytes:c,formatInputBool:l,formatInputReal:p,formatOutputInt:m,formatOutputUInt:h,formatOutputReal:d,formatOutputUReal:y,formatOutputBool:g,formatOutputBytes:b,formatOutputDynamicBytes:v,formatOutputAddress:w}},{"../utils/config":7,"../utils/utils":8,"./param":4,"bignumber.js":"bignumber.js"}],4:[function(t,e,r){var n=t("../utils/utils"),o=function(t,e){this.value=t||"",this.offset=e};o.prototype.dynamicPartLength=function(){return this.dynamicPart().length/2},o.prototype.withOffset=function(t){return new o(this.value,t)},o.prototype.combine=function(t){return new o(this.value+t.value)},o.prototype.isDynamic=function(){return this.value.length>64},o.prototype.offsetAsBytes=function(){return this.isDynamic()?n.padLeft(n.toTwosComplement(this.offset).toString(16),64):""},o.prototype.staticPart=function(){return this.isDynamic()?this.offsetAsBytes():this.value},o.prototype.dynamicPart=function(){return this.isDynamic()?this.value:""},o.prototype.encode=function(){return this.staticPart()+this.dynamicPart()},o.encodeList=function(t){var e=32*t.length,r=t.map(function(t){if(!t.isDynamic())return t;var r=e;return e+=t.dynamicPartLength(),t.withOffset(r)});return r.reduce(function(t,e){return t+e.dynamicPart()},r.reduce(function(t,e){return t+e.staticPart()},""))},o.decodeParam=function(t,e){return e=e||0,new o(t.substr(64*e,64))};var i=function(t,e){return parseInt("0x"+t.substr(64*e,64))};o.decodeBytes=function(t,e){e=e||0;var r=i(t,e);return new o(t.substr(2*r,128))},o.decodeArray=function(t,e){e=e||0;var r=i(t,e),n=parseInt("0x"+t.substr(2*r,64));return new o(t.substr(2*r,64*(n+1)))},e.exports=o},{"../utils/utils":8}],5:[function(t,e,r){var n=function(t,e){return t.filter(function(t){return"constructor"===t.type&&t.inputs.length===e})[0]};e.exports={getConstructor:n}},{}],6:[function(t,e,r){"use strict";r.XMLHttpRequest="undefined"==typeof XMLHttpRequest?{}:XMLHttpRequest},{}],7:[function(t,e,r){var n=t("bignumber.js"),o=["wei","Kwei","Mwei","Gwei","szabo","finney","ether","grand","Mether","Gether","Tether","Pether","Eether","Zether","Yether","Nether","Dether","Vether","Uether"];e.exports={ETH_PADDING:32,ETH_SIGNATURE_LENGTH:4,ETH_UNITS:o,ETH_BIGNUMBER_ROUNDING_MODE:{ROUNDING_MODE:n.ROUND_DOWN},ETH_POLLING_TIMEOUT:1e3,defaultBlock:"latest",defaultAccount:void 0}},{"bignumber.js":"bignumber.js"}],8:[function(t,e,r){var n=t("bignumber.js"),o={wei:"1",kwei:"1000",ada:"1000",mwei:"1000000",babbage:"1000000",gwei:"1000000000",shannon:"1000000000",szabo:"1000000000000",finney:"1000000000000000",ether:"1000000000000000000",kether:"1000000000000000000000",grand:"1000000000000000000000",einstein:"1000000000000000000000",mether:"1000000000000000000000000",gether:"1000000000000000000000000000",tether:"1000000000000000000000000000000"},i=function(t,e,r){return new Array(e-t.length+1).join(r?r:"0")+t},a=function(t){var e="",r=0,n=t.length;for("0x"===t.substring(0,2)&&(r=2);n>r;r+=2){var o=parseInt(t.substr(r,2),16);if(0===o)break;e+=String.fromCharCode(o)}return e},s=function(t){for(var e="",r=0;rthis._inputTypes.length&&i.isObject(t[t.length-1])&&(e=t.pop()),e.to=this._address,e.data="0x"+this.signature()+o.encodeParams(this._inputTypes,t),e},a.prototype.signature=function(){return n.sha3(n.fromAscii(this._name)).slice(2,10)},a.prototype.call=function(){var t=this.toPayload.apply(this,Array.prototype.slice.call(arguments)),e=n.eth.call(t);e=e.length>=2?e.slice(2):e;var r=o.decodeParams(this._outputTypes,e);return 1===r.length?r[0]:r},a.prototype.sendTransaction=function(){var t=this.toPayload.apply(this,Array.prototype.slice.call(arguments));n.eth.sendTransaction(t)},a.prototype.displayName=function(){return i.extractDisplayName(this._name)},a.prototype.typeName=function(){return i.extractTypeName(this._name)},a.prototype.execute=function(){var t=!this._constant;return t?this.sendTransaction.apply(this,Array.prototype.slice.call(arguments)):this.call.apply(this,Array.prototype.slice.call(arguments))},a.prototype.attachToContract=function(t){var e=this.execute.bind(this);e.call=this.call.bind(this),e.sendTransaction=this.sendTransaction.bind(this);var r=this.displayName();t[r]||(t[r]=e),t[r][this.typeName()]=e},e.exports=a},{"../solidity/coder":2,"../utils/utils":8,"../web3":10}],19:[function(t,e,r){"use strict";var n=t("xmlhttprequest").XMLHttpRequest,o=t("./errors"),i=function(t){this.host=t||"http://localhost:8545"};i.prototype.send=function(t){var e=new n;e.open("POST",this.host,!1);try{e.send(JSON.stringify(t))}catch(r){throw o.InvalidConnection(this.host)}var i=e.responseText;try{i=JSON.parse(i)}catch(a){throw o.InvalidResponse(i)}return i},i.prototype.sendAsync=function(t,e){var r=new n;r.onreadystatechange=function(){if(4===r.readyState){var t=r.responseText,n=null;try{t=JSON.parse(t)}catch(i){n=o.InvalidResponse(t)}e(n,t)}},r.open("POST",this.host,!0);try{r.send(JSON.stringify(t))}catch(i){e(o.InvalidConnection(this.host))}},e.exports=i},{"./errors":13,xmlhttprequest:6}],20:[function(t,e,r){var n=function(){return arguments.callee._singletonInstance?arguments.callee._singletonInstance:(arguments.callee._singletonInstance=this,void(this.messageId=1))};n.getInstance=function(){var t=new n;return t},n.prototype.toPayload=function(t,e){return t||console.error("jsonrpc method should be specified!"),{jsonrpc:"2.0",method:t,params:e||[],id:this.messageId++}},n.prototype.isValidResponse=function(t){return!!t&&!t.error&&"2.0"===t.jsonrpc&&"number"==typeof t.id&&void 0!==t.result},n.prototype.toBatchPayload=function(t){var e=this;return t.map(function(t){return e.toPayload(t.method,t.params)})},e.exports=n},{}],21:[function(t,e,r){var n=t("./requestmanager"),o=t("../utils/utils"),i=t("./errors"),a=function(t){this.name=t.name,this.call=t.call,this.params=t.params||0,this.inputFormatter=t.inputFormatter,this.outputFormatter=t.outputFormatter};a.prototype.getCall=function(t){return o.isFunction(this.call)?this.call(t):this.call},a.prototype.extractCallback=function(t){return o.isFunction(t[t.length-1])?t.pop():null},a.prototype.validateArgs=function(t){if(t.length!==this.params)throw i.InvalidNumberOfParams()},a.prototype.formatInput=function(t){return this.inputFormatter?this.inputFormatter.map(function(e,r){return e?e(t[r]):t[r]}):t},a.prototype.formatOutput=function(t){return this.outputFormatter&&null!==t?this.outputFormatter(t):t},a.prototype.attachToObject=function(t){var e=this.send.bind(this);e.call=this.call;var r=this.name.split(".");r.length>1?(t[r[0]]=t[r[0]]||{},t[r[0]][r[1]]=e):t[r[0]]=e},a.prototype.toPayload=function(t){var e=this.getCall(t),r=this.extractCallback(t),n=this.formatInput(t);return this.validateArgs(n),{method:e,params:n,callback:r}},a.prototype.send=function(){var t=this.toPayload(Array.prototype.slice.call(arguments));if(t.callback){var e=this;return n.getInstance().sendAsync(t,function(r,n){t.callback(null,e.formatOutput(n))})}return this.formatOutput(n.getInstance().send(t))},e.exports=a},{"../utils/utils":8,"./errors":13,"./requestmanager":25}],22:[function(t,e,r){var n=t("../utils/utils"),o=t("./property"),i=[],a=[new o({name:"listening",getter:"net_listening"}),new o({name:"peerCount",getter:"net_peerCount",outputFormatter:n.toDecimal})];e.exports={methods:i,properties:a}},{"../utils/utils":8,"./property":23}],23:[function(t,e,r){var n=t("./requestmanager"),o=function(t){this.name=t.name,this.getter=t.getter,this.setter=t.setter,this.outputFormatter=t.outputFormatter,this.inputFormatter=t.inputFormatter};o.prototype.formatInput=function(t){return this.inputFormatter?this.inputFormatter(t):t},o.prototype.formatOutput=function(t){return this.outputFormatter&&null!==t?this.outputFormatter(t):t},o.prototype.attachToObject=function(t){var e={get:this.get.bind(this),set:this.set.bind(this)},r=this.name.split(".");r.length>1?(t[r[0]]=t[r[0]]||{},Object.defineProperty(t[r[0]],r[1],e)):Object.defineProperty(t,r[0],e)},o.prototype.get=function(){return this.formatOutput(n.getInstance().send({method:this.getter}))},o.prototype.set=function(t){return n.getInstance().send({method:this.setter,params:[this.formatInput(t)]})},e.exports=o},{"./requestmanager":25}],24:[function(t,e,r){var n=function(){};n.prototype.send=function(t){var e=navigator.qt.callMethod(JSON.stringify(t));return JSON.parse(e)},e.exports=n},{}],25:[function(t,e,r){var n=t("./jsonrpc"),o=t("../utils/utils"),i=t("../utils/config"),a=t("./errors"),s=function(t){return arguments.callee._singletonInstance?arguments.callee._singletonInstance:(arguments.callee._singletonInstance=this,this.provider=t,this.polls=[],this.timeout=null,void this.poll())};s.getInstance=function(){var t=new s;return t},s.prototype.send=function(t){if(!this.provider)return console.error(a.InvalidProvider()),null;var e=n.getInstance().toPayload(t.method,t.params),r=this.provider.send(e);if(!n.getInstance().isValidResponse(r))throw a.InvalidResponse(r);return r.result},s.prototype.sendAsync=function(t,e){if(!this.provider)return e(a.InvalidProvider());var r=n.getInstance().toPayload(t.method,t.params);this.provider.sendAsync(r,function(t,r){return t?e(t):n.getInstance().isValidResponse(r)?void e(null,r.result):e(a.InvalidResponse(r))})},s.prototype.setProvider=function(t){this.provider=t},s.prototype.startPolling=function(t,e,r,n){this.polls.push({data:t,id:e,callback:r,uninstall:n})},s.prototype.stopPolling=function(t){for(var e=this.polls.length;e--;){var r=this.polls[e];r.id===t&&this.polls.splice(e,1)}},s.prototype.reset=function(){this.polls.forEach(function(t){t.uninstall(t.id)}),this.polls=[],this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.poll()},s.prototype.poll=function(){if(this.timeout=setTimeout(this.poll.bind(this),i.ETH_POLLING_TIMEOUT),this.polls.length){if(!this.provider)return void console.error(a.InvalidProvider());var t=n.getInstance().toBatchPayload(this.polls.map(function(t){return t.data})),e=this;this.provider.sendAsync(t,function(t,r){if(!t){if(!o.isArray(r))throw a.InvalidResponse(r);r.map(function(t,r){return t.callback=e.polls[r].callback,t}).filter(function(t){var e=n.getInstance().isValidResponse(t);return e||t.callback(a.InvalidResponse(t)),e}).filter(function(t){return o.isArray(t.result)&&t.result.length>0}).forEach(function(t){t.callback(null,t.result)})}})}},e.exports=s},{"../utils/config":7,"../utils/utils":8,"./errors":13,"./jsonrpc":20}],26:[function(t,e,r){var n=t("./method"),o=t("./formatters"),i=new n({name:"post",call:"shh_post",params:1,inputFormatter:[o.inputPostFormatter]}),a=new n({name:"newIdentity",call:"shh_newIdentity",params:0}),s=new n({name:"hasIdentity",call:"shh_hasIdentity",params:1}),u=new n({name:"newGroup",call:"shh_newGroup",params:0}),c=new n({name:"addToGroup",call:"shh_addToGroup",params:0}),l=[i,a,s,u,c];e.exports={methods:l}},{"./formatters":17,"./method":21}],27:[function(t,e,r){var n=t("./method"),o=function(){var t=function(t){return"string"==typeof t[0]?"eth_newBlockFilter":"eth_newFilter"},e=new n({name:"newFilter",call:t,params:1}),r=new n({name:"uninstallFilter",call:"eth_uninstallFilter",params:1}),o=new n({name:"getLogs",call:"eth_getFilterLogs",params:1}),i=new n({name:"poll",call:"eth_getFilterChanges",params:1});return[e,r,o,i]},i=function(){var t=new n({name:"newFilter",call:"shh_newFilter",params:1}),e=new n({name:"uninstallFilter",call:"shh_uninstallFilter",params:1}),r=new n({name:"getLogs",call:"shh_getMessages",params:1}),o=new n({name:"poll",call:"shh_getFilterChanges",params:1 -});return[t,e,r,o]};e.exports={eth:o,shh:i}},{"./method":21}],28:[function(t,e,r){},{}],"bignumber.js":[function(t,e,r){"use strict";e.exports=BigNumber},{}],web3:[function(t,e,r){var n=t("./lib/web3");n.providers.HttpProvider=t("./lib/web3/httpprovider"),n.providers.QtSyncProvider=t("./lib/web3/qtsync"),n.eth.contract=t("./lib/web3/contract"),n.abi=t("./lib/solidity/abi"),"undefined"!=typeof window&&"undefined"==typeof window.web3&&(window.web3=n),e.exports=n},{"./lib/solidity/abi":1,"./lib/web3":10,"./lib/web3/contract":11,"./lib/web3/httpprovider":19,"./lib/web3/qtsync":24}]},{},["web3"]); \ No newline at end of file +require=function t(e,n,r){function o(a,s){if(!n[a]){if(!e[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[a]={exports:{}};e[a][0].call(l.exports,function(t){var n=e[a][1][t];return o(n?n:t)},l,l.exports,t,e,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;ai;i+=64)n.push(this._outputFormatter(new a(t.dynamicPart().substr(i+64,64))));return n}return this._outputFormatter(t)},u.prototype.sliceParam=function(t,e,n){return"bytes"===this._mode?a.decodeBytes(t,e):s(n)?a.decodeArray(t,e):a.decodeParam(t,e)};var c=function(t){this._types=t};c.prototype._requireType=function(t){var e=this._types.filter(function(e){return e.isType(t)})[0];if(!e)throw Error("invalid solidity type!: "+t);return e},c.prototype._formatInput=function(t,e){return this._requireType(t).formatInput(e,s(t))},c.prototype.encodeParam=function(t,e){return this._formatInput(t,e).encode()},c.prototype.encodeParams=function(t,e){var n=this,r=t.map(function(t,r){return n._formatInput(t,e[r])});return a.encodeList(r)},c.prototype.decodeParam=function(t,e){return this.decodeParams([t],e)[0]},c.prototype.decodeParams=function(t,e){var n=this;return t.map(function(t,r){var o=n._requireType(t),i=o.sliceParam(e,r,t);return o.formatOutput(i,s(t))})};var l=new c([new u({name:"address",match:"strict",mode:"value",inputFormatter:i.formatInputInt,outputFormatter:i.formatOutputAddress}),new u({name:"bool",match:"strict",mode:"value",inputFormatter:i.formatInputBool,outputFormatter:i.formatOutputBool}),new u({name:"int",match:"prefix",mode:"value",inputFormatter:i.formatInputInt,outputFormatter:i.formatOutputInt}),new u({name:"uint",match:"prefix",mode:"value",inputFormatter:i.formatInputInt,outputFormatter:i.formatOutputUInt}),new u({name:"bytes",match:"strict",mode:"bytes",inputFormatter:i.formatInputDynamicBytes,outputFormatter:i.formatOutputDynamicBytes}),new u({name:"bytes",match:"prefix",mode:"value",inputFormatter:i.formatInputBytes,outputFormatter:i.formatOutputBytes}),new u({name:"real",match:"prefix",mode:"value",inputFormatter:i.formatInputReal,outputFormatter:i.formatOutputReal}),new u({name:"ureal",match:"prefix",mode:"value",inputFormatter:i.formatInputReal,outputFormatter:i.formatOutputUReal})]);e.exports=l},{"../utils/utils":6,"./formatters":2,"./param":3,"bignumber.js":"bignumber.js"}],2:[function(t,e,n){var r=t("bignumber.js"),o=t("../utils/utils"),i=t("../utils/config"),a=t("./param"),s=function(t){var e=2*i.ETH_PADDING;r.config(i.ETH_BIGNUMBER_ROUNDING_MODE);var n=o.padLeft(o.toTwosComplement(t).round().toString(16),e);return new a(n)},u=function(t){var e=o.fromAscii(t,i.ETH_PADDING).substr(2);return new a(e)},c=function(t){var e=o.fromAscii(t,i.ETH_PADDING).substr(2);return new a(s(t.length).value+e,32)},l=function(t){var e="000000000000000000000000000000000000000000000000000000000000000"+(t?"1":"0");return new a(e)},p=function(t){return s(new r(t).times(new r(2).pow(128)))},f=function(t){return"1"===new r(t.substr(0,1),16).toString(2).substr(0,1)},m=function(t){var e=t.staticPart()||"0";return f(e)?new r(e,16).minus(new r("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16)).minus(1):new r(e,16)},h=function(t){var e=t.staticPart()||"0";return new r(e,16)},d=function(t){return m(t).dividedBy(new r(2).pow(128))},y=function(t){return h(t).dividedBy(new r(2).pow(128))},g=function(t){return"0000000000000000000000000000000000000000000000000000000000000001"===t.staticPart()?!0:!1},v=function(t){return o.toAscii(t.staticPart())},b=function(t){return o.toAscii(t.dynamicPart().slice(64))},w=function(t){var e=t.staticPart();return"0x"+e.slice(e.length-40,e.length)};e.exports={formatInputInt:s,formatInputBytes:u,formatInputDynamicBytes:c,formatInputBool:l,formatInputReal:p,formatOutputInt:m,formatOutputUInt:h,formatOutputReal:d,formatOutputUReal:y,formatOutputBool:g,formatOutputBytes:v,formatOutputDynamicBytes:b,formatOutputAddress:w}},{"../utils/config":5,"../utils/utils":6,"./param":3,"bignumber.js":"bignumber.js"}],3:[function(t,e,n){var r=t("../utils/utils"),o=function(t,e){this.value=t||"",this.offset=e};o.prototype.dynamicPartLength=function(){return this.dynamicPart().length/2},o.prototype.withOffset=function(t){return new o(this.value,t)},o.prototype.combine=function(t){return new o(this.value+t.value)},o.prototype.isDynamic=function(){return this.value.length>64},o.prototype.offsetAsBytes=function(){return this.isDynamic()?r.padLeft(r.toTwosComplement(this.offset).toString(16),64):""},o.prototype.staticPart=function(){return this.isDynamic()?this.offsetAsBytes():this.value},o.prototype.dynamicPart=function(){return this.isDynamic()?this.value:""},o.prototype.encode=function(){return this.staticPart()+this.dynamicPart()},o.encodeList=function(t){var e=32*t.length,n=t.map(function(t){if(!t.isDynamic())return t;var n=e;return e+=t.dynamicPartLength(),t.withOffset(n)});return n.reduce(function(t,e){return t+e.dynamicPart()},n.reduce(function(t,e){return t+e.staticPart()},""))},o.decodeParam=function(t,e){return e=e||0,new o(t.substr(64*e,64))};var i=function(t,e){return parseInt("0x"+t.substr(64*e,64))};o.decodeBytes=function(t,e){e=e||0;var n=i(t,e);return new o(t.substr(2*n,128))},o.decodeArray=function(t,e){e=e||0;var n=i(t,e),r=parseInt("0x"+t.substr(2*n,64));return new o(t.substr(2*n,64*(r+1)))},e.exports=o},{"../utils/utils":6}],4:[function(t,e,n){"use strict";n.XMLHttpRequest="undefined"==typeof XMLHttpRequest?{}:XMLHttpRequest},{}],5:[function(t,e,n){var r=t("bignumber.js"),o=["wei","Kwei","Mwei","Gwei","szabo","finney","ether","grand","Mether","Gether","Tether","Pether","Eether","Zether","Yether","Nether","Dether","Vether","Uether"];e.exports={ETH_PADDING:32,ETH_SIGNATURE_LENGTH:4,ETH_UNITS:o,ETH_BIGNUMBER_ROUNDING_MODE:{ROUNDING_MODE:r.ROUND_DOWN},ETH_POLLING_TIMEOUT:1e3,defaultBlock:"latest",defaultAccount:void 0}},{"bignumber.js":"bignumber.js"}],6:[function(t,e,n){var r=t("bignumber.js"),o={wei:"1",kwei:"1000",ada:"1000",mwei:"1000000",babbage:"1000000",gwei:"1000000000",shannon:"1000000000",szabo:"1000000000000",finney:"1000000000000000",ether:"1000000000000000000",kether:"1000000000000000000000",grand:"1000000000000000000000",einstein:"1000000000000000000000",mether:"1000000000000000000000000",gether:"1000000000000000000000000000",tether:"1000000000000000000000000000000"},i=function(t,e,n){return new Array(e-t.length+1).join(n?n:"0")+t},a=function(t){var e="",n=0,r=t.length;for("0x"===t.substring(0,2)&&(n=2);r>n;n+=2){var o=parseInt(t.substr(n,2),16);if(0===o)break;e+=String.fromCharCode(o)}return e},s=function(t){for(var e="",n=0;nthis._inputTypes.length&&i.isObject(t[t.length-1])&&(e=t[t.length-1]),e.to=this._address,e.data="0x"+this.signature()+o.encodeParams(this._inputTypes,t),e},a.prototype.signature=function(){return r.sha3(r.fromAscii(this._name)).slice(2,10)},a.prototype.unpackOutput=function(t){if(null!==t){t=t.length>=2?t.slice(2):t;var e=o.decodeParams(this._outputTypes,t);return 1===e.length?e[0]:e}},a.prototype.call=function(){var t=Array.prototype.slice.call(arguments),e=this.extractCallback(t),n=this.toPayload(t);if(!e){var o=r.eth.call(n);return this.unpackOutput(o)}var i=this;r.eth.call(n,function(t,n){e(t,i.unpackOutput(n))})},a.prototype.sendTransaction=function(){var t=Array.prototype.slice.call(arguments),e=this.extractCallback(t),n=this.toPayload(t);return e?void r.eth.sendTransaction(n,e):void r.eth.sendTransaction(n)},a.prototype.displayName=function(){return i.extractDisplayName(this._name)},a.prototype.typeName=function(){return i.extractTypeName(this._name)},a.prototype.request=function(){var t=Array.prototype.slice.call(arguments),e=this.extractCallback(t),n=this.toPayload(t),r=this.unpackOutput.bind(this);return{callback:e,payload:n,format:r}},a.prototype.execute=function(){var t=!this._constant;return t?this.sendTransaction.apply(this,Array.prototype.slice.call(arguments)):this.call.apply(this,Array.prototype.slice.call(arguments))},a.prototype.attachToContract=function(t){var e=this.execute.bind(this);e.request=this.request.bind(this),e.call=this.call.bind(this),e.sendTransaction=this.sendTransaction.bind(this);var n=this.displayName();t[n]||(t[n]=e),t[n][this.typeName()]=e},e.exports=a},{"../solidity/coder":1,"../utils/utils":6,"../web3":8}],18:[function(t,e,n){"use strict";var r=t("xmlhttprequest").XMLHttpRequest,o=t("./errors"),i=function(t){this.host=t||"http://localhost:8545"};i.prototype.send=function(t){var e=new r;e.open("POST",this.host,!1);try{e.send(JSON.stringify(t))}catch(n){throw o.InvalidConnection(this.host)}var i=e.responseText;try{i=JSON.parse(i)}catch(a){throw o.InvalidResponse(i)}return i},i.prototype.sendAsync=function(t,e){var n=new r;n.onreadystatechange=function(){if(4===n.readyState){var t=n.responseText,r=null;try{t=JSON.parse(t)}catch(i){r=o.InvalidResponse(t)}e(r,t)}},n.open("POST",this.host,!0);try{n.send(JSON.stringify(t))}catch(i){e(o.InvalidConnection(this.host))}},e.exports=i},{"./errors":12,xmlhttprequest:4}],19:[function(t,e,n){var r=function(){return arguments.callee._singletonInstance?arguments.callee._singletonInstance:(arguments.callee._singletonInstance=this,void(this.messageId=1))};r.getInstance=function(){var t=new r;return t},r.prototype.toPayload=function(t,e){return t||console.error("jsonrpc method should be specified!"),{jsonrpc:"2.0",method:t,params:e||[],id:this.messageId++}},r.prototype.isValidResponse=function(t){return!!t&&!t.error&&"2.0"===t.jsonrpc&&"number"==typeof t.id&&void 0!==t.result},r.prototype.toBatchPayload=function(t){var e=this;return t.map(function(t){return e.toPayload(t.method,t.params)})},e.exports=r},{}],20:[function(t,e,n){var r=t("./requestmanager"),o=t("../utils/utils"),i=t("./errors"),a=function(t){this.name=t.name,this.call=t.call,this.params=t.params||0,this.inputFormatter=t.inputFormatter,this.outputFormatter=t.outputFormatter};a.prototype.getCall=function(t){return o.isFunction(this.call)?this.call(t):this.call},a.prototype.extractCallback=function(t){return o.isFunction(t[t.length-1])?t.pop():void 0},a.prototype.validateArgs=function(t){if(t.length!==this.params)throw i.InvalidNumberOfParams()},a.prototype.formatInput=function(t){return this.inputFormatter?this.inputFormatter.map(function(e,n){return e?e(t[n]):t[n]}):t},a.prototype.formatOutput=function(t){return this.outputFormatter&&null!==t?this.outputFormatter(t):t},a.prototype.attachToObject=function(t){var e=this.send.bind(this);e.request=this.request.bind(this),e.call=this.call;var n=this.name.split(".");n.length>1?(t[n[0]]=t[n[0]]||{},t[n[0]][n[1]]=e):t[n[0]]=e},a.prototype.toPayload=function(t){var e=this.getCall(t),n=this.extractCallback(t),r=this.formatInput(t);return this.validateArgs(r),{method:e,params:r,callback:n}},a.prototype.request=function(){var t=this.toPayload(Array.prototype.slice.call(arguments));return t.format=this.formatOutput.bind(this),t},a.prototype.send=function(){var t=this.toPayload(Array.prototype.slice.call(arguments));if(t.callback){var e=this;return r.getInstance().sendAsync(t,function(n,r){t.callback(n,e.formatOutput(r))})}return this.formatOutput(r.getInstance().send(t))},e.exports=a},{"../utils/utils":6,"./errors":12,"./requestmanager":24}],21:[function(t,e,n){var r=t("../utils/utils"),o=t("./property"),i=[],a=[new o({name:"listening",getter:"net_listening"}),new o({name:"peerCount",getter:"net_peerCount",outputFormatter:r.toDecimal})];e.exports={methods:i,properties:a}},{"../utils/utils":6,"./property":22}],22:[function(t,e,n){var r=t("./requestmanager"),o=function(t){this.name=t.name,this.getter=t.getter,this.setter=t.setter,this.outputFormatter=t.outputFormatter,this.inputFormatter=t.inputFormatter};o.prototype.formatInput=function(t){return this.inputFormatter?this.inputFormatter(t):t},o.prototype.formatOutput=function(t){return this.outputFormatter&&null!==t?this.outputFormatter(t):t},o.prototype.attachToObject=function(t){var e={get:this.get.bind(this)},n=this.name.split("."),r=n[0];n.length>1&&(t[n[0]]=t[n[0]]||{},t=t[n[0]],r=n[1]),Object.defineProperty(t,r,e);var o=function(t,e){return t+e.charAt(0).toUpperCase()+e.slice(1)};t[o("get",r)]=this.getAsync.bind(this)},o.prototype.get=function(){return this.formatOutput(r.getInstance().send({method:this.getter}))},o.prototype.getAsync=function(t){var e=this;r.getInstance().sendAsync({method:this.getter},function(n,r){return n?t(n):void t(n,e.formatOutput(r))})},e.exports=o},{"./requestmanager":24}],23:[function(t,e,n){var r=function(){};r.prototype.send=function(t){var e=navigator.qt.callMethod(JSON.stringify(t));return JSON.parse(e)},e.exports=r},{}],24:[function(t,e,n){var r=t("./jsonrpc"),o=t("../utils/utils"),i=t("../utils/config"),a=t("./errors"),s=function(t){return arguments.callee._singletonInstance?arguments.callee._singletonInstance:(arguments.callee._singletonInstance=this,this.provider=t,this.polls=[],this.timeout=null,void this.poll())};s.getInstance=function(){var t=new s;return t},s.prototype.send=function(t){if(!this.provider)return console.error(a.InvalidProvider()),null;var e=r.getInstance().toPayload(t.method,t.params),n=this.provider.send(e);if(!r.getInstance().isValidResponse(n))throw a.InvalidResponse(n);return n.result},s.prototype.sendAsync=function(t,e){if(!this.provider)return e(a.InvalidProvider());var n=r.getInstance().toPayload(t.method,t.params);this.provider.sendAsync(n,function(t,n){return t?e(t):r.getInstance().isValidResponse(n)?void e(null,n.result):e(a.InvalidResponse(n))})},s.prototype.sendBatch=function(t,e){if(!this.provider)return e(a.InvalidProvider());var n=r.getInstance().toBatchPayload(t);this.provider.sendAsync(n,function(t,n){return t?e(t):o.isArray(n)?void e(t,n):e(a.InvalidResponse(n))})},s.prototype.setProvider=function(t){this.provider=t},s.prototype.startPolling=function(t,e,n,r){this.polls.push({data:t,id:e,callback:n,uninstall:r})},s.prototype.stopPolling=function(t){for(var e=this.polls.length;e--;){var n=this.polls[e];n.id===t&&this.polls.splice(e,1)}},s.prototype.reset=function(){this.polls.forEach(function(t){t.uninstall(t.id)}),this.polls=[],this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.poll()},s.prototype.poll=function(){if(this.timeout=setTimeout(this.poll.bind(this),i.ETH_POLLING_TIMEOUT),this.polls.length){if(!this.provider)return void console.error(a.InvalidProvider());var t=r.getInstance().toBatchPayload(this.polls.map(function(t){ +return t.data})),e=this;this.provider.sendAsync(t,function(t,n){if(!t){if(!o.isArray(n))throw a.InvalidResponse(n);n.map(function(t,n){return t.callback=e.polls[n].callback,t}).filter(function(t){var e=r.getInstance().isValidResponse(t);return e||t.callback(a.InvalidResponse(t)),e}).filter(function(t){return o.isArray(t.result)&&t.result.length>0}).forEach(function(t){t.callback(null,t.result)})}})}},e.exports=s},{"../utils/config":5,"../utils/utils":6,"./errors":12,"./jsonrpc":19}],25:[function(t,e,n){var r=t("./method"),o=t("./formatters"),i=new r({name:"post",call:"shh_post",params:1,inputFormatter:[o.inputPostFormatter]}),a=new r({name:"newIdentity",call:"shh_newIdentity",params:0}),s=new r({name:"hasIdentity",call:"shh_hasIdentity",params:1}),u=new r({name:"newGroup",call:"shh_newGroup",params:0}),c=new r({name:"addToGroup",call:"shh_addToGroup",params:0}),l=[i,a,s,u,c];e.exports={methods:l}},{"./formatters":16,"./method":20}],26:[function(t,e,n){var r=t("./method"),o=function(){var t=function(t){var e=t[0];switch(e){case"latest":return t.pop(),this.params=0,"eth_newBlockFilter";case"pending":return t.pop(),this.params=0,"eth_newPendingTransactionFilter";default:return"eth_newFilter"}},e=new r({name:"newFilter",call:t,params:1}),n=new r({name:"uninstallFilter",call:"eth_uninstallFilter",params:1}),o=new r({name:"getLogs",call:"eth_getFilterLogs",params:1}),i=new r({name:"poll",call:"eth_getFilterChanges",params:1});return[e,n,o,i]},i=function(){var t=new r({name:"newFilter",call:"shh_newFilter",params:1}),e=new r({name:"uninstallFilter",call:"shh_uninstallFilter",params:1}),n=new r({name:"getLogs",call:"shh_getMessages",params:1}),o=new r({name:"poll",call:"shh_getFilterChanges",params:1});return[t,e,n,o]};e.exports={eth:o,shh:i}},{"./method":20}],27:[function(t,e,n){},{}],"bignumber.js":[function(t,e,n){"use strict";e.exports=BigNumber},{}],web3:[function(t,e,n){var r=t("./lib/web3");r.providers.HttpProvider=t("./lib/web3/httpprovider"),r.providers.QtSyncProvider=t("./lib/web3/qtsync"),r.eth.contract=t("./lib/web3/contract"),"undefined"!=typeof window&&"undefined"==typeof window.web3&&(window.web3=r),e.exports=r},{"./lib/web3":8,"./lib/web3/contract":10,"./lib/web3/httpprovider":18,"./lib/web3/qtsync":23}]},{},["web3"]); \ No newline at end of file diff --git a/dist/web3.js b/dist/web3.js index ec66a38d8..2745ab36f 100644 --- a/dist/web3.js +++ b/dist/web3.js @@ -15,52 +15,6 @@ require=(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof requ You should have received a copy of the GNU Lesser General Public License along with ethereum.js. If not, see . */ -/** - * @file abi.js - * @author Marek Kotewicz - * @author Gav Wood - * @date 2014 - */ - -var coder = require('./coder'); -var utils = require('./utils'); - -var formatConstructorParams = function (abi, params) { - var constructor = utils.getConstructor(abi, params.length); - if (!constructor) { - if (params.length > 0) { - console.warn("didn't found matching constructor, using default one"); - } - return ''; - } - - return coder.encodeParams(constructor.inputs.map(function (input) { - return input.type; - }), params); -}; - -module.exports = { - formatConstructorParams: formatConstructorParams -}; - - -},{"./coder":2,"./utils":5}],2:[function(require,module,exports){ -/* - This file is part of ethereum.js. - - ethereum.js is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - ethereum.js is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with ethereum.js. If not, see . -*/ /** * @file coder.js * @author Marek Kotewicz @@ -328,7 +282,7 @@ var coder = new SolidityCoder([ module.exports = coder; -},{"../utils/utils":8,"./formatters":3,"./param":4,"bignumber.js":"bignumber.js"}],3:[function(require,module,exports){ +},{"../utils/utils":6,"./formatters":2,"./param":3,"bignumber.js":"bignumber.js"}],2:[function(require,module,exports){ /* This file is part of ethereum.js. @@ -548,7 +502,7 @@ module.exports = { }; -},{"../utils/config":7,"../utils/utils":8,"./param":4,"bignumber.js":"bignumber.js"}],4:[function(require,module,exports){ +},{"../utils/config":5,"../utils/utils":6,"./param":3,"bignumber.js":"bignumber.js"}],3:[function(require,module,exports){ /* This file is part of ethereum.js. @@ -760,54 +714,7 @@ SolidityParam.decodeArray = function (bytes, index) { module.exports = SolidityParam; -},{"../utils/utils":8}],5:[function(require,module,exports){ -/* - This file is part of ethereum.js. - - ethereum.js is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - ethereum.js is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with ethereum.js. If not, see . -*/ -/** - * @file utils.js - * @author Marek Kotewicz - * @date 2015 - */ - -/** - * Returns the contstructor with matching number of arguments - * - * @method getConstructor - * @param {Array} abi - * @param {Number} numberOfArgs - * @returns {Object} constructor function abi - */ -var getConstructor = function (abi, numberOfArgs) { - return abi.filter(function (f) { - return f.type === 'constructor' && f.inputs.length === numberOfArgs; - })[0]; -}; - -//var getSupremeType = function (type) { - //return type.substr(0, type.indexOf('[')) + ']'; -//}; - - -module.exports = { - getConstructor: getConstructor -}; - - -},{}],6:[function(require,module,exports){ +},{"../utils/utils":6}],4:[function(require,module,exports){ 'use strict'; // go env doesn't have and need XMLHttpRequest @@ -818,7 +725,7 @@ if (typeof XMLHttpRequest === 'undefined') { } -},{}],7:[function(require,module,exports){ +},{}],5:[function(require,module,exports){ /* This file is part of ethereum.js. @@ -890,7 +797,7 @@ module.exports = { }; -},{"bignumber.js":"bignumber.js"}],8:[function(require,module,exports){ +},{"bignumber.js":"bignumber.js"}],6:[function(require,module,exports){ /* This file is part of ethereum.js. @@ -1256,6 +1163,7 @@ var toAddress = function (address) { return '0x' + padLeft(toHex(address).substr(2), 40); }; + /** * Returns true if object is BigNumber, otherwise false * @@ -1366,12 +1274,12 @@ module.exports = { }; -},{"bignumber.js":"bignumber.js"}],9:[function(require,module,exports){ +},{"bignumber.js":"bignumber.js"}],7:[function(require,module,exports){ module.exports={ - "version": "0.3.6" + "version": "0.4.2" } -},{}],10:[function(require,module,exports){ +},{}],8:[function(require,module,exports){ /* This file is part of ethereum.js. @@ -1411,6 +1319,7 @@ var RequestManager = require('./web3/requestmanager'); var c = require('./utils/config'); var Method = require('./web3/method'); var Property = require('./web3/property'); +var Batch = require('./web3/batch'); var web3Methods = [ new Method({ @@ -1503,6 +1412,9 @@ web3.toBigNumber = utils.toBigNumber; web3.toWei = utils.toWei; web3.fromWei = utils.fromWei; web3.isAddress = utils.isAddress; +web3.createBatch = function () { + return new Batch(); +}; // ADD defaultblock Object.defineProperty(web3.eth, 'defaultBlock', { @@ -1538,7 +1450,70 @@ setupMethods(web3.shh, shh.methods); module.exports = web3; -},{"./utils/config":7,"./utils/utils":8,"./version.json":9,"./web3/db":12,"./web3/eth":14,"./web3/filter":16,"./web3/formatters":17,"./web3/method":21,"./web3/net":22,"./web3/property":23,"./web3/requestmanager":25,"./web3/shh":26,"./web3/watches":27}],11:[function(require,module,exports){ +},{"./utils/config":5,"./utils/utils":6,"./version.json":7,"./web3/batch":9,"./web3/db":11,"./web3/eth":13,"./web3/filter":15,"./web3/formatters":16,"./web3/method":20,"./web3/net":21,"./web3/property":22,"./web3/requestmanager":24,"./web3/shh":25,"./web3/watches":26}],9:[function(require,module,exports){ +/* + This file is part of ethereum.js. + + ethereum.js is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ethereum.js is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with ethereum.js. If not, see . +*/ +/** + * @file batch.js + * @author Marek Kotewicz + * @date 2015 + */ + +var RequestManager = require('./requestmanager'); + +var Batch = function () { + this.requests = []; +}; + +/** + * Should be called to add create new request to batch request + * + * @method add + * @param {Object} jsonrpc requet object + */ +Batch.prototype.add = function (request) { + this.requests.push(request); +}; + +/** + * Should be called to execute batch request + * + * @method execute + */ +Batch.prototype.execute = function () { + var requests = this.requests; + RequestManager.getInstance().sendBatch(requests, function (err, results) { + results = results || []; + requests.map(function (request, index) { + return results[index] || {}; + }).map(function (result, index) { + return requests[index].format ? requests[index].format(result.result) : result.result; + }).forEach(function (result, index) { + if (requests[index].callback) { + requests[index].callback(err, result); + } + }); + }); +}; + +module.exports = Batch; + + +},{"./requestmanager":24}],10:[function(require,module,exports){ /* This file is part of ethereum.js. @@ -1562,13 +1537,39 @@ module.exports = web3; */ var web3 = require('../web3'); -var solAbi = require('../solidity/abi'); var utils = require('../utils/utils'); +var coder = require('../solidity/coder'); var SolidityEvent = require('./event'); var SolidityFunction = require('./function'); -var addFunctionsToContract = function (contract, desc) { - desc.filter(function (json) { +/** + * Should be called to encode constructor params + * + * @method encodeConstructorParams + * @param {Array} abi + * @param {Array} constructor params + */ +var encodeConstructorParams = function (abi, params) { + return abi.filter(function (json) { + return json.type === 'constructor' && json.inputs.length === params.length; + }).map(function (json) { + return json.inputs.map(function (input) { + return input.type; + }); + }).map(function (types) { + return coder.encodeParams(types, params); + })[0] || ''; +}; + +/** + * Should be called to add functions to contract object + * + * @method addFunctionsToContract + * @param {Contract} contract + * @param {Array} abi + */ +var addFunctionsToContract = function (contract, abi) { + abi.filter(function (json) { return json.type === 'function'; }).map(function (json) { return new SolidityFunction(json, contract.address); @@ -1577,8 +1578,15 @@ var addFunctionsToContract = function (contract, desc) { }); }; -var addEventsToContract = function (contract, desc) { - desc.filter(function (json) { +/** + * Should be called to add events to contract object + * + * @method addEventsToContract + * @param {Contract} contract + * @param {Array} abi + */ +var addEventsToContract = function (contract, abi) { + abi.filter(function (json) { return json.type === 'event'; }).map(function (json) { return new SolidityEvent(json, contract.address); @@ -1588,65 +1596,106 @@ var addEventsToContract = function (contract, desc) { }; /** - * This method should be called when we want to call / transact some solidity method from javascript - * it returns an object which has same methods available as solidity contract description - * usage example: - * - * var abi = [{ - * name: 'myMethod', - * inputs: [{ name: 'a', type: 'string' }], - * outputs: [{name: 'd', type: 'string' }] - * }]; // contract abi - * - * var MyContract = web3.eth.contract(abi); // creation of contract prototype + * Should be called to create new ContractFactory * - * var contractInstance = new MyContract('0x0123123121'); - * - * contractInstance.myMethod('this is test string param for call'); // myMethod call (implicit, default) - * contractInstance.call().myMethod('this is test string param for call'); // myMethod call (explicit) - * contractInstance.sendTransaction().myMethod('this is test string param for transact'); // myMethod sendTransaction - * - * @param abi - abi json description of the contract, which is being created - * @returns contract object + * @method contract + * @param {Array} abi + * @returns {ContractFactory} new contract factory */ var contract = function (abi) { + return new ContractFactory(abi); +}; - // return prototype - return Contract.bind(null, abi); +/** + * Should be called to create new ContractFactory instance + * + * @method ContractFactory + * @param {Array} abi + */ +var ContractFactory = function (abi) { + this.abi = abi; }; -var Contract = function (abi, options) { +/** + * Should be called to create new contract on a blockchain + * + * @method new + * @param {Any} contract constructor param1 (optional) + * @param {Any} contract constructor param2 (optional) + * @param {Object} contract transaction object (required) + * @param {Function} callback + * @returns {Contract} returns contract if no callback was passed, + * otherwise calls callback function (err, contract) + */ +ContractFactory.prototype.new = function () { + // parse arguments + var options = {}; // required! + var callback; - this.address = ''; - if (utils.isAddress(options)) { - this.address = options; - } else { // is an object! - // TODO, parse the rest of the args - options = options || {}; - var args = Array.prototype.slice.call(arguments, 2); - var bytes = solAbi.formatConstructorParams(abi, args); - options.data += bytes; - this.address = web3.eth.sendTransaction(options); + var args = Array.prototype.slice.call(arguments); + if (utils.isFunction(args[args.length - 1])) { + callback = args.pop(); } - addFunctionsToContract(this, abi); - addEventsToContract(this, abi); + var last = args[args.length - 1]; + if (utils.isObject(last) && !utils.isArray(last)) { + options = args.pop(); + } + + // throw an error if there are no options + + var bytes = encodeConstructorParams(this.abi, args); + options.data += bytes; + + if (!callback) { + var address = web3.eth.sendTransaction(options); + return this.at(address); + } + + var self = this; + web3.eth.sendTransaction(options, function (err, address) { + if (err) { + callback(err); + } + self.at(address, callback); + }); }; -Contract.prototype.call = function () { - console.error('contract.call is deprecated'); - return this; +/** + * Should be called to get access to existing contract on a blockchain + * + * @method at + * @param {Address} contract address (required) + * @param {Function} callback {optional) + * @returns {Contract} returns contract if no callback was passed, + * otherwise calls callback function (err, contract) + */ +ContractFactory.prototype.at = function (address, callback) { + // TODO: address is required + + if (callback) { + callback(null, new Contract(this.abi, address)); + } + return new Contract(this.abi, address); }; -Contract.prototype.sendTransaction = function () { - console.error('contract.sendTransact is deprecated'); - return this; +/** + * Should be called to create new contract instance + * + * @method Contract + * @param {Array} abi + * @param {Address} contract address + */ +var Contract = function (abi, address) { + this.address = address; + addFunctionsToContract(this, abi); + addEventsToContract(this, abi); }; module.exports = contract; -},{"../solidity/abi":1,"../utils/utils":8,"../web3":10,"./event":15,"./function":18}],12:[function(require,module,exports){ +},{"../solidity/coder":1,"../utils/utils":6,"../web3":8,"./event":14,"./function":17}],11:[function(require,module,exports){ /* This file is part of ethereum.js. @@ -1704,7 +1753,7 @@ module.exports = { methods: methods }; -},{"./method":21}],13:[function(require,module,exports){ +},{"./method":20}],12:[function(require,module,exports){ /* This file is part of ethereum.js. @@ -1744,7 +1793,7 @@ module.exports = { }; -},{}],14:[function(require,module,exports){ +},{}],13:[function(require,module,exports){ /* This file is part of ethereum.js. @@ -1921,6 +1970,14 @@ var call = new Method({ inputFormatter: [formatters.inputTransactionFormatter, formatters.inputDefaultBlockNumberFormatter] }); +var estimateGas = new Method({ + name: 'estimateGas', + call: 'eth_estimateGas', + params: 1, + inputFormatter: [formatters.inputTransactionFormatter], + outputFormatter: utils.toDecimal +}); + var compileSolidity = new Method({ name: 'compile.solidity', call: 'eth_compileSolidity', @@ -1939,6 +1996,18 @@ var compileSerpent = new Method({ params: 1 }); +var submitWork = new Method({ + name: 'submitWork', + call: 'eth_submitWork', + params: 3 +}); + +var getWork = new Method({ + name: 'getWork', + call: 'eth_getWork', + params: 0 +}); + var methods = [ getBalance, getStorageAt, @@ -1952,10 +2021,13 @@ var methods = [ getTransactionFromBlock, getTransactionCount, call, + estimateGas, sendTransaction, compileSolidity, compileLLL, compileSerpent, + submitWork, + getWork ]; /// @returns an array of objects describing web3.eth api properties @@ -1998,7 +2070,7 @@ module.exports = { }; -},{"../utils/utils":8,"./formatters":17,"./method":21,"./property":23}],15:[function(require,module,exports){ +},{"../utils/utils":6,"./formatters":16,"./method":20,"./property":22}],14:[function(require,module,exports){ /* This file is part of ethereum.js. @@ -2194,7 +2266,7 @@ SolidityEvent.prototype.attachToContract = function (contract) { module.exports = SolidityEvent; -},{"../solidity/coder":2,"../utils/utils":8,"../web3":10,"./formatters":17}],16:[function(require,module,exports){ +},{"../solidity/coder":1,"../utils/utils":6,"../web3":8,"./formatters":16}],15:[function(require,module,exports){ /* This file is part of ethereum.js. @@ -2351,7 +2423,7 @@ Filter.prototype.get = function (callback) { module.exports = Filter; -},{"../utils/utils":8,"./formatters":17,"./requestmanager":25}],17:[function(require,module,exports){ +},{"../utils/utils":6,"./formatters":16,"./requestmanager":24}],16:[function(require,module,exports){ /* This file is part of ethereum.js. @@ -2571,7 +2643,7 @@ module.exports = { }; -},{"../utils/config":7,"../utils/utils":8}],18:[function(require,module,exports){ +},{"../utils/config":5,"../utils/utils":6}],17:[function(require,module,exports){ /* This file is part of ethereum.js. @@ -2588,7 +2660,7 @@ module.exports = { You should have received a copy of the GNU Lesser General Public License along with ethereum.js. If not, see . */ -/** +/** * @file function.js * @author Marek Kotewicz * @date 2015 @@ -2613,18 +2685,23 @@ var SolidityFunction = function (json, address) { this._address = address; }; +SolidityFunction.prototype.extractCallback = function (args) { + if (utils.isFunction(args[args.length - 1])) { + return args.pop(); // modify the args array! + } +}; + /** * Should be used to create payload from arguments * * @method toPayload - * @param {...} solidity function params + * @param {Array} solidity function params * @param {Object} optional payload options */ -SolidityFunction.prototype.toPayload = function () { - var args = Array.prototype.slice.call(arguments); +SolidityFunction.prototype.toPayload = function (args) { var options = {}; if (args.length > this._inputTypes.length && utils.isObject(args[args.length -1])) { - options = args.pop(); + options = args[args.length - 1]; } options.to = this._address; options.data = '0x' + this.signature() + coder.encodeParams(this._inputTypes, args); @@ -2641,19 +2718,41 @@ SolidityFunction.prototype.signature = function () { return web3.sha3(web3.fromAscii(this._name)).slice(2, 10); }; + +SolidityFunction.prototype.unpackOutput = function (output) { + if (output === null) { + return; + } + + output = output.length >= 2 ? output.slice(2) : output; + var result = coder.decodeParams(this._outputTypes, output); + return result.length === 1 ? result[0] : result; +}; + /** - * Should be used to call function - * + * Calls a contract function. + * * @method call - * @param {Object} options + * @param {...Object} Contract function arguments + * @param {function} If the last argument is a function, the contract function + * call will be asynchronous, and the callback will be passed the + * error and result. * @return {String} output bytes */ SolidityFunction.prototype.call = function () { - var payload = this.toPayload.apply(this, Array.prototype.slice.call(arguments)); - var output = web3.eth.call(payload); - output = output.length >= 2 ? output.slice(2) : output; - var result = coder.decodeParams(this._outputTypes, output); - return result.length === 1 ? result[0] : result; + var args = Array.prototype.slice.call(arguments); + var callback = this.extractCallback(args); + var payload = this.toPayload(args); + + if (!callback) { + var output = web3.eth.call(payload); + return this.unpackOutput(output); + } + + var self = this; + web3.eth.call(payload, function (error, output) { + callback(error, self.unpackOutput(output)); + }); }; /** @@ -2663,8 +2762,16 @@ SolidityFunction.prototype.call = function () { * @param {Object} options */ SolidityFunction.prototype.sendTransaction = function () { - var payload = this.toPayload.apply(this, Array.prototype.slice.call(arguments)); - web3.eth.sendTransaction(payload); + var args = Array.prototype.slice.call(arguments); + var callback = this.extractCallback(args); + var payload = this.toPayload(args); + + if (!callback) { + web3.eth.sendTransaction(payload); + return; + } + + web3.eth.sendTransaction(payload, callback); }; /** @@ -2679,7 +2786,7 @@ SolidityFunction.prototype.displayName = function () { /** * Should be used to get function type name - * + * * @method typeName * @return {String} type name of the function */ @@ -2687,6 +2794,25 @@ SolidityFunction.prototype.typeName = function () { return utils.extractTypeName(this._name); }; +/** + * Should be called to get rpc requests from solidity function + * + * @method request + * @returns {Object} + */ +SolidityFunction.prototype.request = function () { + var args = Array.prototype.slice.call(arguments); + var callback = this.extractCallback(args); + var payload = this.toPayload(args); + var format = this.unpackOutput.bind(this); + + return { + callback: callback, + payload: payload, + format: format + }; +}; + /** * Should be called to execute function * @@ -2694,7 +2820,7 @@ SolidityFunction.prototype.typeName = function () { */ SolidityFunction.prototype.execute = function () { var transaction = !this._constant; - + // send transaction if (transaction) { return this.sendTransaction.apply(this, Array.prototype.slice.call(arguments)); @@ -2712,6 +2838,7 @@ SolidityFunction.prototype.execute = function () { */ SolidityFunction.prototype.attachToContract = function (contract) { var execute = this.execute.bind(this); + execute.request = this.request.bind(this); execute.call = this.call.bind(this); execute.sendTransaction = this.sendTransaction.bind(this); var displayName = this.displayName(); @@ -2724,7 +2851,7 @@ SolidityFunction.prototype.attachToContract = function (contract) { module.exports = SolidityFunction; -},{"../solidity/coder":2,"../utils/utils":8,"../web3":10}],19:[function(require,module,exports){ +},{"../solidity/coder":1,"../utils/utils":6,"../web3":8}],18:[function(require,module,exports){ /* This file is part of ethereum.js. @@ -2816,7 +2943,7 @@ HttpProvider.prototype.sendAsync = function (payload, callback) { module.exports = HttpProvider; -},{"./errors":13,"xmlhttprequest":6}],20:[function(require,module,exports){ +},{"./errors":12,"xmlhttprequest":4}],19:[function(require,module,exports){ /* This file is part of ethereum.js. @@ -2909,7 +3036,7 @@ Jsonrpc.prototype.toBatchPayload = function (messages) { module.exports = Jsonrpc; -},{}],21:[function(require,module,exports){ +},{}],20:[function(require,module,exports){ /* This file is part of ethereum.js. @@ -2966,7 +3093,6 @@ Method.prototype.extractCallback = function (args) { if (utils.isFunction(args[args.length - 1])) { return args.pop(); // modify the args array! } - return null; }; /** @@ -3019,6 +3145,7 @@ Method.prototype.formatOutput = function (result) { */ Method.prototype.attachToObject = function (obj) { var func = this.send.bind(this); + func.request = this.request.bind(this); func.call = this.call; // that's ugly. filter.js uses it var name = this.name.split('.'); if (name.length > 1) { @@ -3049,6 +3176,19 @@ Method.prototype.toPayload = function (args) { }; }; +/** + * Should be called to create pure JSONRPC request which can be used in batch request + * + * @method request + * @param {...} params + * @return {Object} jsonrpc request + */ +Method.prototype.request = function () { + var payload = this.toPayload(Array.prototype.slice.call(arguments)); + payload.format = this.formatOutput.bind(this); + return payload; +}; + /** * Should send request to the API * @@ -3061,7 +3201,7 @@ Method.prototype.send = function () { if (payload.callback) { var self = this; return RequestManager.getInstance().sendAsync(payload, function (err, result) { - payload.callback(null, self.formatOutput(result)); + payload.callback(err, self.formatOutput(result)); }); } return this.formatOutput(RequestManager.getInstance().send(payload)); @@ -3070,7 +3210,7 @@ Method.prototype.send = function () { module.exports = Method; -},{"../utils/utils":8,"./errors":13,"./requestmanager":25}],22:[function(require,module,exports){ +},{"../utils/utils":6,"./errors":12,"./requestmanager":24}],21:[function(require,module,exports){ /* This file is part of ethereum.js. @@ -3120,7 +3260,7 @@ module.exports = { }; -},{"../utils/utils":8,"./property":23}],23:[function(require,module,exports){ +},{"../utils/utils":6,"./property":22}],22:[function(require,module,exports){ /* This file is part of ethereum.js. @@ -3186,16 +3326,23 @@ Property.prototype.formatOutput = function (result) { Property.prototype.attachToObject = function (obj) { var proto = { get: this.get.bind(this), - set: this.set.bind(this) }; - var name = this.name.split('.'); - if (name.length > 1) { - obj[name[0]] = obj[name[0]] || {}; - Object.defineProperty(obj[name[0]], name[1], proto); - } else { - Object.defineProperty(obj, name[0], proto); + var names = this.name.split('.'); + var name = names[0]; + if (names.length > 1) { + obj[names[0]] = obj[names[0]] || {}; + obj = obj[names[0]]; + name = names[1]; } + + Object.defineProperty(obj, name, proto); + + var toAsyncName = function (prefix, name) { + return prefix + name.charAt(0).toUpperCase() + name.slice(1); + }; + + obj[toAsyncName('get', name)] = this.getAsync.bind(this); }; /** @@ -3211,22 +3358,27 @@ Property.prototype.get = function () { }; /** - * Should be used to set value of the property + * Should be used to asynchrounously get value of property * - * @method set - * @param {Object} new value of the property + * @method getAsync + * @param {Function} */ -Property.prototype.set = function (value) { - return RequestManager.getInstance().send({ - method: this.setter, - params: [this.formatInput(value)] +Property.prototype.getAsync = function (callback) { + var self = this; + RequestManager.getInstance().sendAsync({ + method: this.getter + }, function (err, result) { + if (err) { + return callback(err); + } + callback(err, self.formatOutput(result)); }); }; module.exports = Property; -},{"./requestmanager":25}],24:[function(require,module,exports){ +},{"./requestmanager":24}],23:[function(require,module,exports){ /* This file is part of ethereum.js. @@ -3261,7 +3413,7 @@ QtSyncProvider.prototype.send = function (payload) { module.exports = QtSyncProvider; -},{}],25:[function(require,module,exports){ +},{}],24:[function(require,module,exports){ /* This file is part of ethereum.js. @@ -3369,6 +3521,33 @@ RequestManager.prototype.sendAsync = function (data, callback) { }); }; +/** + * Should be called to asynchronously send batch request + * + * @method sendBatch + * @param {Array} batch data + * @param {Function} callback + */ +RequestManager.prototype.sendBatch = function (data, callback) { + if (!this.provider) { + return callback(errors.InvalidProvider()); + } + + var payload = Jsonrpc.getInstance().toBatchPayload(data); + + this.provider.sendAsync(payload, function (err, results) { + if (err) { + return callback(err); + } + + if (!utils.isArray(results)) { + return callback(errors.InvalidResponse(results)); + } + + callback(err, results); + }); +}; + /** * Should be used to set provider of request manager * @@ -3482,7 +3661,7 @@ RequestManager.prototype.poll = function () { module.exports = RequestManager; -},{"../utils/config":7,"../utils/utils":8,"./errors":13,"./jsonrpc":20}],26:[function(require,module,exports){ +},{"../utils/config":5,"../utils/utils":6,"./errors":12,"./jsonrpc":19}],25:[function(require,module,exports){ /* This file is part of ethereum.js. @@ -3552,7 +3731,7 @@ module.exports = { }; -},{"./formatters":17,"./method":21}],27:[function(require,module,exports){ +},{"./formatters":16,"./method":20}],26:[function(require,module,exports){ /* This file is part of ethereum.js. @@ -3580,7 +3759,20 @@ var Method = require('./method'); /// @returns an array of objects describing web3.eth.filter api methods var eth = function () { var newFilterCall = function (args) { - return typeof args[0] === 'string' ? 'eth_newBlockFilter' : 'eth_newFilter'; + var type = args[0]; + + switch(type) { + case 'latest': + args.pop(); + this.params = 0; + return 'eth_newBlockFilter'; + case 'pending': + args.pop(); + this.params = 0; + return 'eth_newPendingTransactionFilter'; + default: + return 'eth_newFilter'; + } }; var newFilter = new Method({ @@ -3655,7 +3847,7 @@ module.exports = { }; -},{"./method":21}],28:[function(require,module,exports){ +},{"./method":20}],27:[function(require,module,exports){ },{}],"bignumber.js":[function(require,module,exports){ /*! bignumber.js v2.0.7 https://github.com/MikeMcl/bignumber.js/LICENCE */ @@ -6342,12 +6534,11 @@ module.exports = { } })(this); -},{"crypto":28}],"web3":[function(require,module,exports){ +},{"crypto":27}],"web3":[function(require,module,exports){ var web3 = require('./lib/web3'); web3.providers.HttpProvider = require('./lib/web3/httpprovider'); web3.providers.QtSyncProvider = require('./lib/web3/qtsync'); web3.eth.contract = require('./lib/web3/contract'); -web3.abi = require('./lib/solidity/abi'); // dont override global variable if (typeof window !== 'undefined' && typeof window.web3 === 'undefined') { @@ -6357,7 +6548,7 @@ if (typeof window !== 'undefined' && typeof window.web3 === 'undefined') { module.exports = web3; -},{"./lib/solidity/abi":1,"./lib/web3":10,"./lib/web3/contract":11,"./lib/web3/httpprovider":19,"./lib/web3/qtsync":24}]},{},["web3"]) +},{"./lib/web3":8,"./lib/web3/contract":10,"./lib/web3/httpprovider":18,"./lib/web3/qtsync":23}]},{},["web3"]) //# sourceMappingURL=web3.js.map \ No newline at end of file diff --git a/dist/web3.js.map b/dist/web3.js.map index 4efb07df1..e25fa3aed 100644 --- a/dist/web3.js.map +++ b/dist/web3.js.map @@ -2,16 +2,15 @@ "version": 3, "sources": [ "node_modules/browserify/node_modules/browser-pack/_prelude.js", - "lib/solidity/abi.js", "lib/solidity/coder.js", "lib/solidity/formatters.js", "lib/solidity/param.js", - "lib/solidity/utils.js", "lib/utils/browser-xhr.js", "lib/utils/config.js", "lib/utils/utils.js", "lib/version.json", "lib/web3.js", + "lib/web3/batch.js", "lib/web3/contract.js", "lib/web3/db.js", "lib/web3/errors.js", @@ -34,40 +33,39 @@ "index.js" ], "names": [], - "mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1RA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7CA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1dA;AACA;AACA;AACA;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1GA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5PA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACvJA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC/JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACrGA;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3nFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA", + "mappings": "AAAA;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1RA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClNA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACTA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3dA;AACA;AACA;AACA;;ACHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACzKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC7DA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACxDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACnRA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3JA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1NA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC9MA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC1FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3FA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC5KA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AChDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpHA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACjCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACtPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;ACpEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AClHA;;ACAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AC3nFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA", "file": "generated.js", "sourceRoot": "", "sourcesContent": [ "(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require==\"function\"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error(\"Cannot find module '\"+o+\"'\");throw f.code=\"MODULE_NOT_FOUND\",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require==\"function\"&&require;for(var o=0;o.\n*/\n/** \n * @file abi.js\n * @author Marek Kotewicz \n * @author Gav Wood \n * @date 2014\n */\n\nvar coder = require('./coder');\nvar utils = require('./utils');\n\nvar formatConstructorParams = function (abi, params) {\n var constructor = utils.getConstructor(abi, params.length);\n if (!constructor) {\n if (params.length > 0) {\n console.warn(\"didn't found matching constructor, using default one\");\n }\n return '';\n }\n\n return coder.encodeParams(constructor.inputs.map(function (input) {\n return input.type;\n }), params);\n};\n\nmodule.exports = {\n formatConstructorParams: formatConstructorParams\n};\n\n", "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file coder.js\n * @author Marek Kotewicz \n * @date 2015\n */\n\nvar BigNumber = require('bignumber.js');\nvar utils = require('../utils/utils');\nvar f = require('./formatters');\nvar SolidityParam = require('./param');\n\n/**\n * Should be used to check if a type is an array type\n *\n * @method isArrayType\n * @param {String} type\n * @return {Bool} true is the type is an array, otherwise false\n */\nvar isArrayType = function (type) {\n return type.slice(-2) === '[]';\n};\n\n/**\n * SolidityType prototype is used to encode/decode solidity params of certain type\n */\nvar SolidityType = function (config) {\n this._name = config.name;\n this._match = config.match;\n this._mode = config.mode;\n this._inputFormatter = config.inputFormatter;\n this._outputFormatter = config.outputFormatter;\n};\n\n/**\n * Should be used to determine if this SolidityType do match given type\n *\n * @method isType\n * @param {String} name\n * @return {Bool} true if type match this SolidityType, otherwise false\n */\nSolidityType.prototype.isType = function (name) {\n if (this._match === 'strict') {\n return this._name === name || (name.indexOf(this._name) === 0 && name.slice(this._name.length) === '[]');\n } else if (this._match === 'prefix') {\n // TODO better type detection!\n return name.indexOf(this._name) === 0;\n }\n};\n\n/**\n * Should be used to transform plain param to SolidityParam object\n *\n * @method formatInput\n * @param {Object} param - plain object, or an array of objects\n * @param {Bool} arrayType - true if a param should be encoded as an array\n * @return {SolidityParam} encoded param wrapped in SolidityParam object \n */\nSolidityType.prototype.formatInput = function (param, arrayType) {\n if (utils.isArray(param) && arrayType) { // TODO: should fail if this two are not the same\n var self = this;\n return param.map(function (p) {\n return self._inputFormatter(p);\n }).reduce(function (acc, current) {\n return acc.combine(current);\n }, f.formatInputInt(param.length)).withOffset(32);\n } \n return this._inputFormatter(param);\n};\n\n/**\n * Should be used to transoform SolidityParam to plain param\n *\n * @method formatOutput\n * @param {SolidityParam} byteArray\n * @param {Bool} arrayType - true if a param should be decoded as an array\n * @return {Object} plain decoded param\n */\nSolidityType.prototype.formatOutput = function (param, arrayType) {\n if (arrayType) {\n // let's assume, that we solidity will never return long arrays :P \n var result = [];\n var length = new BigNumber(param.dynamicPart().slice(0, 64), 16);\n for (var i = 0; i < length * 64; i += 64) {\n result.push(this._outputFormatter(new SolidityParam(param.dynamicPart().substr(i + 64, 64))));\n }\n return result;\n }\n return this._outputFormatter(param);\n};\n\n/**\n * Should be used to slice single param from bytes\n *\n * @method sliceParam\n * @param {String} bytes\n * @param {Number} index of param to slice\n * @param {String} type\n * @returns {SolidityParam} param\n */\nSolidityType.prototype.sliceParam = function (bytes, index, type) {\n if (this._mode === 'bytes') {\n return SolidityParam.decodeBytes(bytes, index);\n } else if (isArrayType(type)) {\n return SolidityParam.decodeArray(bytes, index);\n }\n return SolidityParam.decodeParam(bytes, index);\n};\n\n/**\n * SolidityCoder prototype should be used to encode/decode solidity params of any type\n */\nvar SolidityCoder = function (types) {\n this._types = types;\n};\n\n/**\n * This method should be used to transform type to SolidityType\n *\n * @method _requireType\n * @param {String} type\n * @returns {SolidityType} \n * @throws {Error} throws if no matching type is found\n */\nSolidityCoder.prototype._requireType = function (type) {\n var solidityType = this._types.filter(function (t) {\n return t.isType(type);\n })[0];\n\n if (!solidityType) {\n throw Error('invalid solidity type!: ' + type);\n }\n\n return solidityType;\n};\n\n/**\n * Should be used to transform plain param of given type to SolidityParam\n *\n * @method _formatInput\n * @param {String} type of param\n * @param {Object} plain param\n * @return {SolidityParam}\n */\nSolidityCoder.prototype._formatInput = function (type, param) {\n return this._requireType(type).formatInput(param, isArrayType(type));\n};\n\n/**\n * Should be used to encode plain param\n *\n * @method encodeParam\n * @param {String} type\n * @param {Object} plain param\n * @return {String} encoded plain param\n */\nSolidityCoder.prototype.encodeParam = function (type, param) {\n return this._formatInput(type, param).encode();\n};\n\n/**\n * Should be used to encode list of params\n *\n * @method encodeParams\n * @param {Array} types\n * @param {Array} params\n * @return {String} encoded list of params\n */\nSolidityCoder.prototype.encodeParams = function (types, params) {\n var self = this;\n var solidityParams = types.map(function (type, index) {\n return self._formatInput(type, params[index]);\n });\n\n return SolidityParam.encodeList(solidityParams);\n};\n\n/**\n * Should be used to decode bytes to plain param\n *\n * @method decodeParam\n * @param {String} type\n * @param {String} bytes\n * @return {Object} plain param\n */\nSolidityCoder.prototype.decodeParam = function (type, bytes) {\n return this.decodeParams([type], bytes)[0];\n};\n\n/**\n * Should be used to decode list of params\n *\n * @method decodeParam\n * @param {Array} types\n * @param {String} bytes\n * @return {Array} array of plain params\n */\nSolidityCoder.prototype.decodeParams = function (types, bytes) {\n var self = this;\n return types.map(function (type, index) {\n var solidityType = self._requireType(type);\n var p = solidityType.sliceParam(bytes, index, type);\n return solidityType.formatOutput(p, isArrayType(type));\n });\n};\n\nvar coder = new SolidityCoder([\n new SolidityType({\n name: 'address',\n match: 'strict',\n mode: 'value',\n inputFormatter: f.formatInputInt,\n outputFormatter: f.formatOutputAddress\n }),\n new SolidityType({\n name: 'bool',\n match: 'strict',\n mode: 'value',\n inputFormatter: f.formatInputBool,\n outputFormatter: f.formatOutputBool\n }),\n new SolidityType({\n name: 'int',\n match: 'prefix',\n mode: 'value',\n inputFormatter: f.formatInputInt,\n outputFormatter: f.formatOutputInt,\n }),\n new SolidityType({\n name: 'uint',\n match: 'prefix',\n mode: 'value',\n inputFormatter: f.formatInputInt,\n outputFormatter: f.formatOutputUInt\n }),\n new SolidityType({\n name: 'bytes',\n match: 'strict',\n mode: 'bytes',\n inputFormatter: f.formatInputDynamicBytes,\n outputFormatter: f.formatOutputDynamicBytes\n }),\n new SolidityType({\n name: 'bytes',\n match: 'prefix',\n mode: 'value',\n inputFormatter: f.formatInputBytes,\n outputFormatter: f.formatOutputBytes\n }),\n new SolidityType({\n name: 'real',\n match: 'prefix',\n mode: 'value',\n inputFormatter: f.formatInputReal,\n outputFormatter: f.formatOutputReal\n }),\n new SolidityType({\n name: 'ureal',\n match: 'prefix',\n mode: 'value',\n inputFormatter: f.formatInputReal,\n outputFormatter: f.formatOutputUReal\n })\n]);\n\nmodule.exports = coder;\n\n", "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file formatters.js\n * @author Marek Kotewicz \n * @date 2015\n */\n\nvar BigNumber = require('bignumber.js');\nvar utils = require('../utils/utils');\nvar c = require('../utils/config');\nvar SolidityParam = require('./param');\n\n\n/**\n * Formats input value to byte representation of int\n * If value is negative, return it's two's complement\n * If the value is floating point, round it down\n *\n * @method formatInputInt\n * @param {String|Number|BigNumber} value that needs to be formatted\n * @returns {SolidityParam}\n */\nvar formatInputInt = function (value) {\n var padding = c.ETH_PADDING * 2;\n BigNumber.config(c.ETH_BIGNUMBER_ROUNDING_MODE);\n var result = utils.padLeft(utils.toTwosComplement(value).round().toString(16), padding);\n return new SolidityParam(result);\n};\n\n/**\n * Formats input value to byte representation of string\n *\n * @method formatInputBytes\n * @param {String}\n * @returns {SolidityParam}\n */\nvar formatInputBytes = function (value) {\n var result = utils.fromAscii(value, c.ETH_PADDING).substr(2);\n return new SolidityParam(result);\n};\n\n/**\n * Formats input value to byte representation of string\n *\n * @method formatInputDynamicBytes\n * @param {String}\n * @returns {SolidityParam}\n */\nvar formatInputDynamicBytes = function (value) {\n var result = utils.fromAscii(value, c.ETH_PADDING).substr(2);\n return new SolidityParam(formatInputInt(value.length).value + result, 32);\n};\n\n/**\n * Formats input value to byte representation of bool\n *\n * @method formatInputBool\n * @param {Boolean}\n * @returns {SolidityParam}\n */\nvar formatInputBool = function (value) {\n var result = '000000000000000000000000000000000000000000000000000000000000000' + (value ? '1' : '0');\n return new SolidityParam(result);\n};\n\n/**\n * Formats input value to byte representation of real\n * Values are multiplied by 2^m and encoded as integers\n *\n * @method formatInputReal\n * @param {String|Number|BigNumber}\n * @returns {SolidityParam}\n */\nvar formatInputReal = function (value) {\n return formatInputInt(new BigNumber(value).times(new BigNumber(2).pow(128)));\n};\n\n/**\n * Check if input value is negative\n *\n * @method signedIsNegative\n * @param {String} value is hex format\n * @returns {Boolean} true if it is negative, otherwise false\n */\nvar signedIsNegative = function (value) {\n return (new BigNumber(value.substr(0, 1), 16).toString(2).substr(0, 1)) === '1';\n};\n\n/**\n * Formats right-aligned output bytes to int\n *\n * @method formatOutputInt\n * @param {SolidityParam} param\n * @returns {BigNumber} right-aligned output bytes formatted to big number\n */\nvar formatOutputInt = function (param) {\n var value = param.staticPart() || \"0\";\n\n // check if it's negative number\n // it it is, return two's complement\n if (signedIsNegative(value)) {\n return new BigNumber(value, 16).minus(new BigNumber('ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff', 16)).minus(1);\n }\n return new BigNumber(value, 16);\n};\n\n/**\n * Formats right-aligned output bytes to uint\n *\n * @method formatOutputUInt\n * @param {SolidityParam}\n * @returns {BigNumeber} right-aligned output bytes formatted to uint\n */\nvar formatOutputUInt = function (param) {\n var value = param.staticPart() || \"0\";\n return new BigNumber(value, 16);\n};\n\n/**\n * Formats right-aligned output bytes to real\n *\n * @method formatOutputReal\n * @param {SolidityParam}\n * @returns {BigNumber} input bytes formatted to real\n */\nvar formatOutputReal = function (param) {\n return formatOutputInt(param).dividedBy(new BigNumber(2).pow(128)); \n};\n\n/**\n * Formats right-aligned output bytes to ureal\n *\n * @method formatOutputUReal\n * @param {SolidityParam}\n * @returns {BigNumber} input bytes formatted to ureal\n */\nvar formatOutputUReal = function (param) {\n return formatOutputUInt(param).dividedBy(new BigNumber(2).pow(128)); \n};\n\n/**\n * Should be used to format output bool\n *\n * @method formatOutputBool\n * @param {SolidityParam}\n * @returns {Boolean} right-aligned input bytes formatted to bool\n */\nvar formatOutputBool = function (param) {\n return param.staticPart() === '0000000000000000000000000000000000000000000000000000000000000001' ? true : false;\n};\n\n/**\n * Should be used to format output string\n *\n * @method formatOutputBytes\n * @param {SolidityParam} left-aligned hex representation of string\n * @returns {String} ascii string\n */\nvar formatOutputBytes = function (param) {\n // length might also be important!\n return utils.toAscii(param.staticPart());\n};\n\n/**\n * Should be used to format output string\n *\n * @method formatOutputDynamicBytes\n * @param {SolidityParam} left-aligned hex representation of string\n * @returns {String} ascii string\n */\nvar formatOutputDynamicBytes = function (param) {\n // length might also be important!\n return utils.toAscii(param.dynamicPart().slice(64));\n};\n\n/**\n * Should be used to format output address\n *\n * @method formatOutputAddress\n * @param {SolidityParam} right-aligned input bytes\n * @returns {String} address\n */\nvar formatOutputAddress = function (param) {\n var value = param.staticPart();\n return \"0x\" + value.slice(value.length - 40, value.length);\n};\n\nmodule.exports = {\n formatInputInt: formatInputInt,\n formatInputBytes: formatInputBytes,\n formatInputDynamicBytes: formatInputDynamicBytes,\n formatInputBool: formatInputBool,\n formatInputReal: formatInputReal,\n formatOutputInt: formatOutputInt,\n formatOutputUInt: formatOutputUInt,\n formatOutputReal: formatOutputReal,\n formatOutputUReal: formatOutputUReal,\n formatOutputBool: formatOutputBool,\n formatOutputBytes: formatOutputBytes,\n formatOutputDynamicBytes: formatOutputDynamicBytes,\n formatOutputAddress: formatOutputAddress\n};\n\n", "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file param.js\n * @author Marek Kotewicz \n * @date 2015\n */\n\nvar utils = require('../utils/utils');\n\n/**\n * SolidityParam object prototype.\n * Should be used when encoding, decoding solidity bytes\n */\nvar SolidityParam = function (value, offset) {\n this.value = value || '';\n this.offset = offset; // offset in bytes\n};\n\n/**\n * This method should be used to get length of params's dynamic part\n * \n * @method dynamicPartLength\n * @returns {Number} length of dynamic part (in bytes)\n */\nSolidityParam.prototype.dynamicPartLength = function () {\n return this.dynamicPart().length / 2;\n};\n\n/**\n * This method should be used to create copy of solidity param with different offset\n *\n * @method withOffset\n * @param {Number} offset length in bytes\n * @returns {SolidityParam} new solidity param with applied offset\n */\nSolidityParam.prototype.withOffset = function (offset) {\n return new SolidityParam(this.value, offset);\n};\n\n/**\n * This method should be used to combine solidity params together\n * eg. when appending an array\n *\n * @method combine\n * @param {SolidityParam} param with which we should combine\n * @param {SolidityParam} result of combination\n */\nSolidityParam.prototype.combine = function (param) {\n return new SolidityParam(this.value + param.value); \n};\n\n/**\n * This method should be called to check if param has dynamic size.\n * If it has, it returns true, otherwise false\n *\n * @method isDynamic\n * @returns {Boolean}\n */\nSolidityParam.prototype.isDynamic = function () {\n return this.value.length > 64;\n};\n\n/**\n * This method should be called to transform offset to bytes\n *\n * @method offsetAsBytes\n * @returns {String} bytes representation of offset\n */\nSolidityParam.prototype.offsetAsBytes = function () {\n return !this.isDynamic() ? '' : utils.padLeft(utils.toTwosComplement(this.offset).toString(16), 64);\n};\n\n/**\n * This method should be called to get static part of param\n *\n * @method staticPart\n * @returns {String} offset if it is a dynamic param, otherwise value\n */\nSolidityParam.prototype.staticPart = function () {\n if (!this.isDynamic()) {\n return this.value; \n } \n return this.offsetAsBytes();\n};\n\n/**\n * This method should be called to get dynamic part of param\n *\n * @method dynamicPart\n * @returns {String} returns a value if it is a dynamic param, otherwise empty string\n */\nSolidityParam.prototype.dynamicPart = function () {\n return this.isDynamic() ? this.value : '';\n};\n\n/**\n * This method should be called to encode param\n *\n * @method encode\n * @returns {String}\n */\nSolidityParam.prototype.encode = function () {\n return this.staticPart() + this.dynamicPart();\n};\n\n/**\n * This method should be called to encode array of params\n *\n * @method encodeList\n * @param {Array[SolidityParam]} params\n * @returns {String}\n */\nSolidityParam.encodeList = function (params) {\n \n // updating offsets\n var totalOffset = params.length * 32;\n var offsetParams = params.map(function (param) {\n if (!param.isDynamic()) {\n return param;\n }\n var offset = totalOffset;\n totalOffset += param.dynamicPartLength();\n return param.withOffset(offset);\n });\n\n // encode everything!\n return offsetParams.reduce(function (result, param) {\n return result + param.dynamicPart();\n }, offsetParams.reduce(function (result, param) {\n return result + param.staticPart();\n }, ''));\n};\n\n/**\n * This method should be used to decode plain (static) solidity param at given index\n *\n * @method decodeParam\n * @param {String} bytes\n * @param {Number} index\n * @returns {SolidityParam}\n */\nSolidityParam.decodeParam = function (bytes, index) {\n index = index || 0;\n return new SolidityParam(bytes.substr(index * 64, 64)); \n};\n\n/**\n * This method should be called to get offset value from bytes at given index\n *\n * @method getOffset\n * @param {String} bytes\n * @param {Number} index\n * @returns {Number} offset as number\n */\nvar getOffset = function (bytes, index) {\n // we can do this cause offset is rather small\n return parseInt('0x' + bytes.substr(index * 64, 64));\n};\n\n/**\n * This method should be called to decode solidity bytes param at given index\n *\n * @method decodeBytes\n * @param {String} bytes\n * @param {Number} index\n * @returns {SolidityParam}\n */\nSolidityParam.decodeBytes = function (bytes, index) {\n index = index || 0;\n //TODO add support for strings longer than 32 bytes\n //var length = parseInt('0x' + bytes.substr(offset * 64, 64));\n\n var offset = getOffset(bytes, index);\n\n // 2 * , cause we also parse length\n return new SolidityParam(bytes.substr(offset * 2, 2 * 64));\n};\n\n/**\n * This method should be used to decode solidity array at given index\n *\n * @method decodeArray\n * @param {String} bytes\n * @param {Number} index\n * @returns {SolidityParam}\n */\nSolidityParam.decodeArray = function (bytes, index) {\n index = index || 0;\n var offset = getOffset(bytes, index);\n var length = parseInt('0x' + bytes.substr(offset * 2, 64));\n return new SolidityParam(bytes.substr(offset * 2, (length + 1) * 64));\n};\n\nmodule.exports = SolidityParam;\n\n", - "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/**\n * @file utils.js\n * @author Marek Kotewicz \n * @date 2015\n */\n\n/**\n * Returns the contstructor with matching number of arguments\n *\n * @method getConstructor\n * @param {Array} abi\n * @param {Number} numberOfArgs\n * @returns {Object} constructor function abi\n */\nvar getConstructor = function (abi, numberOfArgs) {\n return abi.filter(function (f) {\n return f.type === 'constructor' && f.inputs.length === numberOfArgs;\n })[0];\n};\n\n//var getSupremeType = function (type) {\n //return type.substr(0, type.indexOf('[')) + ']';\n//};\n\n\nmodule.exports = {\n getConstructor: getConstructor\n};\n\n", "'use strict';\n\n// go env doesn't have and need XMLHttpRequest\nif (typeof XMLHttpRequest === 'undefined') {\n exports.XMLHttpRequest = {};\n} else {\n exports.XMLHttpRequest = XMLHttpRequest; // jshint ignore:line\n}\n\n", "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** @file config.js\n * @authors:\n * Marek Kotewicz \n * @date 2015\n */\n\n/**\n * Utils\n * \n * @module utils\n */\n\n/**\n * Utility functions\n * \n * @class [utils] config\n * @constructor\n */\n\n/// required to define ETH_BIGNUMBER_ROUNDING_MODE\nvar BigNumber = require('bignumber.js');\n\nvar ETH_UNITS = [ \n 'wei', \n 'Kwei', \n 'Mwei', \n 'Gwei', \n 'szabo', \n 'finney', \n 'ether', \n 'grand', \n 'Mether', \n 'Gether', \n 'Tether', \n 'Pether', \n 'Eether', \n 'Zether', \n 'Yether', \n 'Nether', \n 'Dether', \n 'Vether', \n 'Uether' \n];\n\nmodule.exports = {\n ETH_PADDING: 32,\n ETH_SIGNATURE_LENGTH: 4,\n ETH_UNITS: ETH_UNITS,\n ETH_BIGNUMBER_ROUNDING_MODE: { ROUNDING_MODE: BigNumber.ROUND_DOWN },\n ETH_POLLING_TIMEOUT: 1000,\n defaultBlock: 'latest',\n defaultAccount: undefined\n};\n\n", - "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file utils.js\n * @author Marek Kotewicz \n * @date 2015\n */\n\n/**\n * Utils\n * \n * @module utils\n */\n\n/**\n * Utility functions\n * \n * @class [utils] utils\n * @constructor\n */\n\nvar BigNumber = require('bignumber.js');\n\nvar unitMap = {\n 'wei': '1',\n 'kwei': '1000',\n 'ada': '1000',\n 'mwei': '1000000',\n 'babbage': '1000000',\n 'gwei': '1000000000',\n 'shannon': '1000000000',\n 'szabo': '1000000000000',\n 'finney': '1000000000000000',\n 'ether': '1000000000000000000',\n 'kether': '1000000000000000000000',\n 'grand': '1000000000000000000000',\n 'einstein': '1000000000000000000000',\n 'mether': '1000000000000000000000000',\n 'gether': '1000000000000000000000000000',\n 'tether': '1000000000000000000000000000000'\n};\n\n/**\n * Should be called to pad string to expected length\n *\n * @method padLeft\n * @param {String} string to be padded\n * @param {Number} characters that result string should have\n * @param {String} sign, by default 0\n * @returns {String} right aligned string\n */\nvar padLeft = function (string, chars, sign) {\n return new Array(chars - string.length + 1).join(sign ? sign : \"0\") + string;\n};\n\n/** \n * Should be called to get sting from it's hex representation\n *\n * @method toAscii\n * @param {String} string in hex\n * @returns {String} ascii string representation of hex value\n */\nvar toAscii = function(hex) {\n// Find termination\n var str = \"\";\n var i = 0, l = hex.length;\n if (hex.substring(0, 2) === '0x') {\n i = 2;\n }\n for (; i < l; i+=2) {\n var code = parseInt(hex.substr(i, 2), 16);\n if (code === 0) {\n break;\n }\n\n str += String.fromCharCode(code);\n }\n\n return str;\n};\n \n/**\n * Shold be called to get hex representation (prefixed by 0x) of ascii string \n *\n * @method toHexNative\n * @param {String} string\n * @returns {String} hex representation of input string\n */\nvar toHexNative = function(str) {\n var hex = \"\";\n for(var i = 0; i < str.length; i++) {\n var n = str.charCodeAt(i).toString(16);\n hex += n.length < 2 ? '0' + n : n;\n }\n\n return hex;\n};\n\n/**\n * Shold be called to get hex representation (prefixed by 0x) of ascii string \n *\n * @method fromAscii\n * @param {String} string\n * @param {Number} optional padding\n * @returns {String} hex representation of input string\n */\nvar fromAscii = function(str, pad) {\n pad = pad === undefined ? 0 : pad;\n var hex = toHexNative(str);\n while (hex.length < pad*2)\n hex += \"00\";\n return \"0x\" + hex;\n};\n\n/**\n * Should be used to create full function/event name from json abi\n *\n * @method transformToFullName\n * @param {Object} json-abi\n * @return {String} full fnction/event name\n */\nvar transformToFullName = function (json) {\n if (json.name.indexOf('(') !== -1) {\n return json.name;\n }\n\n var typeName = json.inputs.map(function(i){return i.type; }).join();\n return json.name + '(' + typeName + ')';\n};\n\n/**\n * Should be called to get display name of contract function\n * \n * @method extractDisplayName\n * @param {String} name of function/event\n * @returns {String} display name for function/event eg. multiply(uint256) -> multiply\n */\nvar extractDisplayName = function (name) {\n var length = name.indexOf('('); \n return length !== -1 ? name.substr(0, length) : name;\n};\n\n/// @returns overloaded part of function/event name\nvar extractTypeName = function (name) {\n /// TODO: make it invulnerable\n var length = name.indexOf('(');\n return length !== -1 ? name.substr(length + 1, name.length - 1 - (length + 1)).replace(' ', '') : \"\";\n};\n\n/**\n * Converts value to it's decimal representation in string\n *\n * @method toDecimal\n * @param {String|Number|BigNumber}\n * @return {String}\n */\nvar toDecimal = function (value) {\n return toBigNumber(value).toNumber();\n};\n\n/**\n * Converts value to it's hex representation\n *\n * @method fromDecimal\n * @param {String|Number|BigNumber}\n * @return {String}\n */\nvar fromDecimal = function (value) {\n var number = toBigNumber(value);\n var result = number.toString(16);\n\n return number.lessThan(0) ? '-0x' + result.substr(1) : '0x' + result;\n};\n\n/**\n * Auto converts any given value into it's hex representation.\n *\n * And even stringifys objects before.\n *\n * @method toHex\n * @param {String|Number|BigNumber|Object}\n * @return {String}\n */\nvar toHex = function (val) {\n /*jshint maxcomplexity:7 */\n\n if (isBoolean(val))\n return fromDecimal(+val);\n\n if (isBigNumber(val))\n return fromDecimal(val);\n\n if (isObject(val))\n return fromAscii(JSON.stringify(val));\n\n // if its a negative number, pass it through fromDecimal\n if (isString(val)) {\n if (val.indexOf('-0x') === 0)\n return fromDecimal(val);\n else if (!isFinite(val))\n return fromAscii(val);\n }\n\n return fromDecimal(val);\n};\n\n/**\n * Returns value of unit in Wei\n *\n * @method getValueOfUnit\n * @param {String} unit the unit to convert to, default ether\n * @returns {BigNumber} value of the unit (in Wei)\n * @throws error if the unit is not correct:w\n */\nvar getValueOfUnit = function (unit) {\n unit = unit ? unit.toLowerCase() : 'ether';\n var unitValue = unitMap[unit];\n if (unitValue === undefined) {\n throw new Error('This unit doesn\\'t exists, please use the one of the following units' + JSON.stringify(unitMap, null, 2));\n }\n return new BigNumber(unitValue, 10);\n};\n\n/**\n * Takes a number of wei and converts it to any other ether unit.\n *\n * Possible units are:\n * - kwei/ada\n * - mwei/babbage\n * - gwei/shannon\n * - szabo\n * - finney\n * - ether\n * - kether/grand/einstein\n * - mether\n * - gether\n * - tether\n *\n * @method fromWei\n * @param {Number|String} number can be a number, number string or a HEX of a decimal\n * @param {String} unit the unit to convert to, default ether\n * @return {String|Object} When given a BigNumber object it returns one as well, otherwise a number\n*/\nvar fromWei = function(number, unit) {\n var returnValue = toBigNumber(number).dividedBy(getValueOfUnit(unit));\n\n return isBigNumber(number) ? returnValue : returnValue.toString(10); \n};\n\n/**\n * Takes a number of a unit and converts it to wei.\n *\n * Possible units are:\n * - kwei/ada\n * - mwei/babbage\n * - gwei/shannon\n * - szabo\n * - finney\n * - ether\n * - kether/grand/einstein\n * - mether\n * - gether\n * - tether\n *\n * @method toWei\n * @param {Number|String|BigNumber} number can be a number, number string or a HEX of a decimal\n * @param {String} unit the unit to convert from, default ether\n * @return {String|Object} When given a BigNumber object it returns one as well, otherwise a number\n*/\nvar toWei = function(number, unit) {\n var returnValue = toBigNumber(number).times(getValueOfUnit(unit));\n\n return isBigNumber(number) ? returnValue : returnValue.toString(10); \n};\n\n/**\n * Takes an input and transforms it into an bignumber\n *\n * @method toBigNumber\n * @param {Number|String|BigNumber} a number, string, HEX string or BigNumber\n * @return {BigNumber} BigNumber\n*/\nvar toBigNumber = function(number) {\n /*jshint maxcomplexity:5 */\n number = number || 0;\n if (isBigNumber(number))\n return number;\n\n if (isString(number) && (number.indexOf('0x') === 0 || number.indexOf('-0x') === 0)) {\n return new BigNumber(number.replace('0x',''), 16);\n }\n \n return new BigNumber(number.toString(10), 10);\n};\n\n/**\n * Takes and input transforms it into bignumber and if it is negative value, into two's complement\n *\n * @method toTwosComplement\n * @param {Number|String|BigNumber}\n * @return {BigNumber}\n */\nvar toTwosComplement = function (number) {\n var bigNumber = toBigNumber(number);\n if (bigNumber.lessThan(0)) {\n return new BigNumber(\"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\", 16).plus(bigNumber).plus(1);\n }\n return bigNumber;\n};\n\n/**\n * Checks if the given string is strictly an address\n *\n * @method isStrictAddress\n * @param {String} address the given HEX adress\n * @return {Boolean}\n*/\nvar isStrictAddress = function (address) {\n return /^0x[0-9a-f]{40}$/.test(address);\n};\n\n/**\n * Checks if the given string is an address\n *\n * @method isAddress\n * @param {String} address the given HEX adress\n * @return {Boolean}\n*/\nvar isAddress = function (address) {\n return /^(0x)?[0-9a-f]{40}$/.test(address);\n};\n\n/**\n * Transforms given string to valid 20 bytes-length addres with 0x prefix\n *\n * @method toAddress\n * @param {String} address\n * @return {String} formatted address\n */\nvar toAddress = function (address) {\n if (isStrictAddress(address)) {\n return address;\n }\n \n if (/^[0-9a-f]{40}$/.test(address)) {\n return '0x' + address;\n }\n\n return '0x' + padLeft(toHex(address).substr(2), 40);\n};\n\n/**\n * Returns true if object is BigNumber, otherwise false\n *\n * @method isBigNumber\n * @param {Object}\n * @return {Boolean} \n */\nvar isBigNumber = function (object) {\n return object instanceof BigNumber ||\n (object && object.constructor && object.constructor.name === 'BigNumber');\n};\n\n/**\n * Returns true if object is string, otherwise false\n * \n * @method isString\n * @param {Object}\n * @return {Boolean}\n */\nvar isString = function (object) {\n return typeof object === 'string' ||\n (object && object.constructor && object.constructor.name === 'String');\n};\n\n/**\n * Returns true if object is function, otherwise false\n *\n * @method isFunction\n * @param {Object}\n * @return {Boolean}\n */\nvar isFunction = function (object) {\n return typeof object === 'function';\n};\n\n/**\n * Returns true if object is Objet, otherwise false\n *\n * @method isObject\n * @param {Object}\n * @return {Boolean}\n */\nvar isObject = function (object) {\n return typeof object === 'object';\n};\n\n/**\n * Returns true if object is boolean, otherwise false\n *\n * @method isBoolean\n * @param {Object}\n * @return {Boolean}\n */\nvar isBoolean = function (object) {\n return typeof object === 'boolean';\n};\n\n/**\n * Returns true if object is array, otherwise false\n *\n * @method isArray\n * @param {Object}\n * @return {Boolean}\n */\nvar isArray = function (object) {\n return object instanceof Array; \n};\n\n/**\n * Returns true if given string is valid json object\n * \n * @method isJson\n * @param {String}\n * @return {Boolean}\n */\nvar isJson = function (str) {\n try {\n return !!JSON.parse(str);\n } catch (e) {\n return false;\n }\n};\n\nmodule.exports = {\n padLeft: padLeft,\n toHex: toHex,\n toDecimal: toDecimal,\n fromDecimal: fromDecimal,\n toAscii: toAscii,\n fromAscii: fromAscii,\n transformToFullName: transformToFullName,\n extractDisplayName: extractDisplayName,\n extractTypeName: extractTypeName,\n toWei: toWei,\n fromWei: fromWei,\n toBigNumber: toBigNumber,\n toTwosComplement: toTwosComplement,\n toAddress: toAddress,\n isBigNumber: isBigNumber,\n isStrictAddress: isStrictAddress,\n isAddress: isAddress,\n isFunction: isFunction,\n isString: isString,\n isObject: isObject,\n isBoolean: isBoolean,\n isArray: isArray,\n isJson: isJson\n};\n\n", - "module.exports={\n \"version\": \"0.3.6\"\n}\n", - "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** @file web3.js\n * @authors:\n * Jeffrey Wilcke \n * Marek Kotewicz \n * Marian Oancea \n * Fabian Vogelsteller \n * Gav Wood \n * @date 2014\n */\n\nvar version = require('./version.json');\nvar net = require('./web3/net');\nvar eth = require('./web3/eth');\nvar db = require('./web3/db');\nvar shh = require('./web3/shh');\nvar watches = require('./web3/watches');\nvar Filter = require('./web3/filter');\nvar utils = require('./utils/utils');\nvar formatters = require('./web3/formatters');\nvar RequestManager = require('./web3/requestmanager');\nvar c = require('./utils/config');\nvar Method = require('./web3/method');\nvar Property = require('./web3/property');\n\nvar web3Methods = [\n new Method({\n name: 'sha3',\n call: 'web3_sha3',\n params: 1\n })\n];\n\nvar web3Properties = [\n new Property({\n name: 'version.client',\n getter: 'web3_clientVersion'\n }),\n new Property({\n name: 'version.network',\n getter: 'net_version',\n inputFormatter: utils.toDecimal\n }),\n new Property({\n name: 'version.ethereum',\n getter: 'eth_protocolVersion',\n inputFormatter: utils.toDecimal\n }),\n new Property({\n name: 'version.whisper',\n getter: 'shh_version',\n inputFormatter: utils.toDecimal\n })\n];\n\n/// creates methods in a given object based on method description on input\n/// setups api calls for these methods\nvar setupMethods = function (obj, methods) {\n methods.forEach(function (method) {\n method.attachToObject(obj);\n });\n};\n\n/// creates properties in a given object based on properties description on input\n/// setups api calls for these properties\nvar setupProperties = function (obj, properties) {\n properties.forEach(function (property) {\n property.attachToObject(obj);\n });\n};\n\n/// setups web3 object, and it's in-browser executed methods\nvar web3 = {};\nweb3.providers = {};\nweb3.version = {};\nweb3.version.api = version.version;\nweb3.eth = {};\n\n/*jshint maxparams:4 */\nweb3.eth.filter = function (fil, eventParams, options, formatter) {\n\n // if its event, treat it differently\n // TODO: simplify and remove\n if (fil._isEvent) {\n return fil(eventParams, options);\n }\n\n // what outputLogFormatter? that's wrong\n //return new Filter(fil, watches.eth(), formatters.outputLogFormatter);\n return new Filter(fil, watches.eth(), formatter || formatters.outputLogFormatter);\n};\n/*jshint maxparams:3 */\n\nweb3.shh = {};\nweb3.shh.filter = function (fil) {\n return new Filter(fil, watches.shh(), formatters.outputPostFormatter);\n};\nweb3.net = {};\nweb3.db = {};\nweb3.setProvider = function (provider) {\n RequestManager.getInstance().setProvider(provider);\n};\nweb3.reset = function () {\n RequestManager.getInstance().reset();\n c.defaultBlock = 'latest';\n c.defaultAccount = undefined;\n};\nweb3.toHex = utils.toHex;\nweb3.toAscii = utils.toAscii;\nweb3.fromAscii = utils.fromAscii;\nweb3.toDecimal = utils.toDecimal;\nweb3.fromDecimal = utils.fromDecimal;\nweb3.toBigNumber = utils.toBigNumber;\nweb3.toWei = utils.toWei;\nweb3.fromWei = utils.fromWei;\nweb3.isAddress = utils.isAddress;\n\n// ADD defaultblock\nObject.defineProperty(web3.eth, 'defaultBlock', {\n get: function () {\n return c.defaultBlock;\n },\n set: function (val) {\n c.defaultBlock = val;\n return val;\n }\n});\n\nObject.defineProperty(web3.eth, 'defaultAccount', {\n get: function () {\n return c.defaultAccount;\n },\n set: function (val) {\n c.defaultAccount = val;\n return val;\n }\n});\n\n/// setups all api methods\nsetupMethods(web3, web3Methods);\nsetupProperties(web3, web3Properties);\nsetupMethods(web3.net, net.methods);\nsetupProperties(web3.net, net.properties);\nsetupMethods(web3.eth, eth.methods);\nsetupProperties(web3.eth, eth.properties);\nsetupMethods(web3.db, db.methods);\nsetupMethods(web3.shh, shh.methods);\n\nmodule.exports = web3;\n\n", - "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file contract.js\n * @author Marek Kotewicz \n * @date 2014\n */\n\nvar web3 = require('../web3'); \nvar solAbi = require('../solidity/abi');\nvar utils = require('../utils/utils');\nvar SolidityEvent = require('./event');\nvar SolidityFunction = require('./function');\n\nvar addFunctionsToContract = function (contract, desc) {\n desc.filter(function (json) {\n return json.type === 'function';\n }).map(function (json) {\n return new SolidityFunction(json, contract.address);\n }).forEach(function (f) {\n f.attachToContract(contract);\n });\n};\n\nvar addEventsToContract = function (contract, desc) {\n desc.filter(function (json) {\n return json.type === 'event';\n }).map(function (json) {\n return new SolidityEvent(json, contract.address);\n }).forEach(function (e) {\n e.attachToContract(contract);\n });\n};\n\n/**\n * This method should be called when we want to call / transact some solidity method from javascript\n * it returns an object which has same methods available as solidity contract description\n * usage example: \n *\n * var abi = [{\n * name: 'myMethod',\n * inputs: [{ name: 'a', type: 'string' }],\n * outputs: [{name: 'd', type: 'string' }]\n * }]; // contract abi\n *\n * var MyContract = web3.eth.contract(abi); // creation of contract prototype\n *\n * var contractInstance = new MyContract('0x0123123121');\n *\n * contractInstance.myMethod('this is test string param for call'); // myMethod call (implicit, default)\n * contractInstance.call().myMethod('this is test string param for call'); // myMethod call (explicit)\n * contractInstance.sendTransaction().myMethod('this is test string param for transact'); // myMethod sendTransaction\n *\n * @param abi - abi json description of the contract, which is being created\n * @returns contract object\n */\nvar contract = function (abi) {\n\n // return prototype\n return Contract.bind(null, abi);\n};\n\nvar Contract = function (abi, options) {\n\n this.address = '';\n if (utils.isAddress(options)) {\n this.address = options;\n } else { // is an object!\n // TODO, parse the rest of the args\n options = options || {};\n var args = Array.prototype.slice.call(arguments, 2);\n var bytes = solAbi.formatConstructorParams(abi, args);\n options.data += bytes;\n this.address = web3.eth.sendTransaction(options);\n }\n\n addFunctionsToContract(this, abi);\n addEventsToContract(this, abi);\n};\n\nContract.prototype.call = function () {\n console.error('contract.call is deprecated');\n return this;\n};\n\nContract.prototype.sendTransaction = function () {\n console.error('contract.sendTransact is deprecated');\n return this;\n};\n\nmodule.exports = contract;\n\n", + "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file utils.js\n * @author Marek Kotewicz \n * @date 2015\n */\n\n/**\n * Utils\n * \n * @module utils\n */\n\n/**\n * Utility functions\n * \n * @class [utils] utils\n * @constructor\n */\n\nvar BigNumber = require('bignumber.js');\n\nvar unitMap = {\n 'wei': '1',\n 'kwei': '1000',\n 'ada': '1000',\n 'mwei': '1000000',\n 'babbage': '1000000',\n 'gwei': '1000000000',\n 'shannon': '1000000000',\n 'szabo': '1000000000000',\n 'finney': '1000000000000000',\n 'ether': '1000000000000000000',\n 'kether': '1000000000000000000000',\n 'grand': '1000000000000000000000',\n 'einstein': '1000000000000000000000',\n 'mether': '1000000000000000000000000',\n 'gether': '1000000000000000000000000000',\n 'tether': '1000000000000000000000000000000'\n};\n\n/**\n * Should be called to pad string to expected length\n *\n * @method padLeft\n * @param {String} string to be padded\n * @param {Number} characters that result string should have\n * @param {String} sign, by default 0\n * @returns {String} right aligned string\n */\nvar padLeft = function (string, chars, sign) {\n return new Array(chars - string.length + 1).join(sign ? sign : \"0\") + string;\n};\n\n/** \n * Should be called to get sting from it's hex representation\n *\n * @method toAscii\n * @param {String} string in hex\n * @returns {String} ascii string representation of hex value\n */\nvar toAscii = function(hex) {\n// Find termination\n var str = \"\";\n var i = 0, l = hex.length;\n if (hex.substring(0, 2) === '0x') {\n i = 2;\n }\n for (; i < l; i+=2) {\n var code = parseInt(hex.substr(i, 2), 16);\n if (code === 0) {\n break;\n }\n\n str += String.fromCharCode(code);\n }\n\n return str;\n};\n \n/**\n * Shold be called to get hex representation (prefixed by 0x) of ascii string \n *\n * @method toHexNative\n * @param {String} string\n * @returns {String} hex representation of input string\n */\nvar toHexNative = function(str) {\n var hex = \"\";\n for(var i = 0; i < str.length; i++) {\n var n = str.charCodeAt(i).toString(16);\n hex += n.length < 2 ? '0' + n : n;\n }\n\n return hex;\n};\n\n/**\n * Shold be called to get hex representation (prefixed by 0x) of ascii string \n *\n * @method fromAscii\n * @param {String} string\n * @param {Number} optional padding\n * @returns {String} hex representation of input string\n */\nvar fromAscii = function(str, pad) {\n pad = pad === undefined ? 0 : pad;\n var hex = toHexNative(str);\n while (hex.length < pad*2)\n hex += \"00\";\n return \"0x\" + hex;\n};\n\n/**\n * Should be used to create full function/event name from json abi\n *\n * @method transformToFullName\n * @param {Object} json-abi\n * @return {String} full fnction/event name\n */\nvar transformToFullName = function (json) {\n if (json.name.indexOf('(') !== -1) {\n return json.name;\n }\n\n var typeName = json.inputs.map(function(i){return i.type; }).join();\n return json.name + '(' + typeName + ')';\n};\n\n/**\n * Should be called to get display name of contract function\n * \n * @method extractDisplayName\n * @param {String} name of function/event\n * @returns {String} display name for function/event eg. multiply(uint256) -> multiply\n */\nvar extractDisplayName = function (name) {\n var length = name.indexOf('('); \n return length !== -1 ? name.substr(0, length) : name;\n};\n\n/// @returns overloaded part of function/event name\nvar extractTypeName = function (name) {\n /// TODO: make it invulnerable\n var length = name.indexOf('(');\n return length !== -1 ? name.substr(length + 1, name.length - 1 - (length + 1)).replace(' ', '') : \"\";\n};\n\n/**\n * Converts value to it's decimal representation in string\n *\n * @method toDecimal\n * @param {String|Number|BigNumber}\n * @return {String}\n */\nvar toDecimal = function (value) {\n return toBigNumber(value).toNumber();\n};\n\n/**\n * Converts value to it's hex representation\n *\n * @method fromDecimal\n * @param {String|Number|BigNumber}\n * @return {String}\n */\nvar fromDecimal = function (value) {\n var number = toBigNumber(value);\n var result = number.toString(16);\n\n return number.lessThan(0) ? '-0x' + result.substr(1) : '0x' + result;\n};\n\n/**\n * Auto converts any given value into it's hex representation.\n *\n * And even stringifys objects before.\n *\n * @method toHex\n * @param {String|Number|BigNumber|Object}\n * @return {String}\n */\nvar toHex = function (val) {\n /*jshint maxcomplexity:7 */\n\n if (isBoolean(val))\n return fromDecimal(+val);\n\n if (isBigNumber(val))\n return fromDecimal(val);\n\n if (isObject(val))\n return fromAscii(JSON.stringify(val));\n\n // if its a negative number, pass it through fromDecimal\n if (isString(val)) {\n if (val.indexOf('-0x') === 0)\n return fromDecimal(val);\n else if (!isFinite(val))\n return fromAscii(val);\n }\n\n return fromDecimal(val);\n};\n\n/**\n * Returns value of unit in Wei\n *\n * @method getValueOfUnit\n * @param {String} unit the unit to convert to, default ether\n * @returns {BigNumber} value of the unit (in Wei)\n * @throws error if the unit is not correct:w\n */\nvar getValueOfUnit = function (unit) {\n unit = unit ? unit.toLowerCase() : 'ether';\n var unitValue = unitMap[unit];\n if (unitValue === undefined) {\n throw new Error('This unit doesn\\'t exists, please use the one of the following units' + JSON.stringify(unitMap, null, 2));\n }\n return new BigNumber(unitValue, 10);\n};\n\n/**\n * Takes a number of wei and converts it to any other ether unit.\n *\n * Possible units are:\n * - kwei/ada\n * - mwei/babbage\n * - gwei/shannon\n * - szabo\n * - finney\n * - ether\n * - kether/grand/einstein\n * - mether\n * - gether\n * - tether\n *\n * @method fromWei\n * @param {Number|String} number can be a number, number string or a HEX of a decimal\n * @param {String} unit the unit to convert to, default ether\n * @return {String|Object} When given a BigNumber object it returns one as well, otherwise a number\n*/\nvar fromWei = function(number, unit) {\n var returnValue = toBigNumber(number).dividedBy(getValueOfUnit(unit));\n\n return isBigNumber(number) ? returnValue : returnValue.toString(10); \n};\n\n/**\n * Takes a number of a unit and converts it to wei.\n *\n * Possible units are:\n * - kwei/ada\n * - mwei/babbage\n * - gwei/shannon\n * - szabo\n * - finney\n * - ether\n * - kether/grand/einstein\n * - mether\n * - gether\n * - tether\n *\n * @method toWei\n * @param {Number|String|BigNumber} number can be a number, number string or a HEX of a decimal\n * @param {String} unit the unit to convert from, default ether\n * @return {String|Object} When given a BigNumber object it returns one as well, otherwise a number\n*/\nvar toWei = function(number, unit) {\n var returnValue = toBigNumber(number).times(getValueOfUnit(unit));\n\n return isBigNumber(number) ? returnValue : returnValue.toString(10); \n};\n\n/**\n * Takes an input and transforms it into an bignumber\n *\n * @method toBigNumber\n * @param {Number|String|BigNumber} a number, string, HEX string or BigNumber\n * @return {BigNumber} BigNumber\n*/\nvar toBigNumber = function(number) {\n /*jshint maxcomplexity:5 */\n number = number || 0;\n if (isBigNumber(number))\n return number;\n\n if (isString(number) && (number.indexOf('0x') === 0 || number.indexOf('-0x') === 0)) {\n return new BigNumber(number.replace('0x',''), 16);\n }\n \n return new BigNumber(number.toString(10), 10);\n};\n\n/**\n * Takes and input transforms it into bignumber and if it is negative value, into two's complement\n *\n * @method toTwosComplement\n * @param {Number|String|BigNumber}\n * @return {BigNumber}\n */\nvar toTwosComplement = function (number) {\n var bigNumber = toBigNumber(number);\n if (bigNumber.lessThan(0)) {\n return new BigNumber(\"ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\", 16).plus(bigNumber).plus(1);\n }\n return bigNumber;\n};\n\n/**\n * Checks if the given string is strictly an address\n *\n * @method isStrictAddress\n * @param {String} address the given HEX adress\n * @return {Boolean}\n*/\nvar isStrictAddress = function (address) {\n return /^0x[0-9a-f]{40}$/.test(address);\n};\n\n/**\n * Checks if the given string is an address\n *\n * @method isAddress\n * @param {String} address the given HEX adress\n * @return {Boolean}\n*/\nvar isAddress = function (address) {\n return /^(0x)?[0-9a-f]{40}$/.test(address);\n};\n\n/**\n * Transforms given string to valid 20 bytes-length addres with 0x prefix\n *\n * @method toAddress\n * @param {String} address\n * @return {String} formatted address\n */\nvar toAddress = function (address) {\n if (isStrictAddress(address)) {\n return address;\n }\n \n if (/^[0-9a-f]{40}$/.test(address)) {\n return '0x' + address;\n }\n\n return '0x' + padLeft(toHex(address).substr(2), 40);\n};\n\n\n/**\n * Returns true if object is BigNumber, otherwise false\n *\n * @method isBigNumber\n * @param {Object}\n * @return {Boolean} \n */\nvar isBigNumber = function (object) {\n return object instanceof BigNumber ||\n (object && object.constructor && object.constructor.name === 'BigNumber');\n};\n\n/**\n * Returns true if object is string, otherwise false\n * \n * @method isString\n * @param {Object}\n * @return {Boolean}\n */\nvar isString = function (object) {\n return typeof object === 'string' ||\n (object && object.constructor && object.constructor.name === 'String');\n};\n\n/**\n * Returns true if object is function, otherwise false\n *\n * @method isFunction\n * @param {Object}\n * @return {Boolean}\n */\nvar isFunction = function (object) {\n return typeof object === 'function';\n};\n\n/**\n * Returns true if object is Objet, otherwise false\n *\n * @method isObject\n * @param {Object}\n * @return {Boolean}\n */\nvar isObject = function (object) {\n return typeof object === 'object';\n};\n\n/**\n * Returns true if object is boolean, otherwise false\n *\n * @method isBoolean\n * @param {Object}\n * @return {Boolean}\n */\nvar isBoolean = function (object) {\n return typeof object === 'boolean';\n};\n\n/**\n * Returns true if object is array, otherwise false\n *\n * @method isArray\n * @param {Object}\n * @return {Boolean}\n */\nvar isArray = function (object) {\n return object instanceof Array; \n};\n\n/**\n * Returns true if given string is valid json object\n * \n * @method isJson\n * @param {String}\n * @return {Boolean}\n */\nvar isJson = function (str) {\n try {\n return !!JSON.parse(str);\n } catch (e) {\n return false;\n }\n};\n\nmodule.exports = {\n padLeft: padLeft,\n toHex: toHex,\n toDecimal: toDecimal,\n fromDecimal: fromDecimal,\n toAscii: toAscii,\n fromAscii: fromAscii,\n transformToFullName: transformToFullName,\n extractDisplayName: extractDisplayName,\n extractTypeName: extractTypeName,\n toWei: toWei,\n fromWei: fromWei,\n toBigNumber: toBigNumber,\n toTwosComplement: toTwosComplement,\n toAddress: toAddress,\n isBigNumber: isBigNumber,\n isStrictAddress: isStrictAddress,\n isAddress: isAddress,\n isFunction: isFunction,\n isString: isString,\n isObject: isObject,\n isBoolean: isBoolean,\n isArray: isArray,\n isJson: isJson\n};\n\n", + "module.exports={\n \"version\": \"0.4.2\"\n}\n", + "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** @file web3.js\n * @authors:\n * Jeffrey Wilcke \n * Marek Kotewicz \n * Marian Oancea \n * Fabian Vogelsteller \n * Gav Wood \n * @date 2014\n */\n\nvar version = require('./version.json');\nvar net = require('./web3/net');\nvar eth = require('./web3/eth');\nvar db = require('./web3/db');\nvar shh = require('./web3/shh');\nvar watches = require('./web3/watches');\nvar Filter = require('./web3/filter');\nvar utils = require('./utils/utils');\nvar formatters = require('./web3/formatters');\nvar RequestManager = require('./web3/requestmanager');\nvar c = require('./utils/config');\nvar Method = require('./web3/method');\nvar Property = require('./web3/property');\nvar Batch = require('./web3/batch');\n\nvar web3Methods = [\n new Method({\n name: 'sha3',\n call: 'web3_sha3',\n params: 1\n })\n];\n\nvar web3Properties = [\n new Property({\n name: 'version.client',\n getter: 'web3_clientVersion'\n }),\n new Property({\n name: 'version.network',\n getter: 'net_version',\n inputFormatter: utils.toDecimal\n }),\n new Property({\n name: 'version.ethereum',\n getter: 'eth_protocolVersion',\n inputFormatter: utils.toDecimal\n }),\n new Property({\n name: 'version.whisper',\n getter: 'shh_version',\n inputFormatter: utils.toDecimal\n })\n];\n\n/// creates methods in a given object based on method description on input\n/// setups api calls for these methods\nvar setupMethods = function (obj, methods) {\n methods.forEach(function (method) {\n method.attachToObject(obj);\n });\n};\n\n/// creates properties in a given object based on properties description on input\n/// setups api calls for these properties\nvar setupProperties = function (obj, properties) {\n properties.forEach(function (property) {\n property.attachToObject(obj);\n });\n};\n\n/// setups web3 object, and it's in-browser executed methods\nvar web3 = {};\nweb3.providers = {};\nweb3.version = {};\nweb3.version.api = version.version;\nweb3.eth = {};\n\n/*jshint maxparams:4 */\nweb3.eth.filter = function (fil, eventParams, options, formatter) {\n\n // if its event, treat it differently\n // TODO: simplify and remove\n if (fil._isEvent) {\n return fil(eventParams, options);\n }\n\n // what outputLogFormatter? that's wrong\n //return new Filter(fil, watches.eth(), formatters.outputLogFormatter);\n return new Filter(fil, watches.eth(), formatter || formatters.outputLogFormatter);\n};\n/*jshint maxparams:3 */\n\nweb3.shh = {};\nweb3.shh.filter = function (fil) {\n return new Filter(fil, watches.shh(), formatters.outputPostFormatter);\n};\nweb3.net = {};\nweb3.db = {};\nweb3.setProvider = function (provider) {\n RequestManager.getInstance().setProvider(provider);\n};\nweb3.reset = function () {\n RequestManager.getInstance().reset();\n c.defaultBlock = 'latest';\n c.defaultAccount = undefined;\n};\nweb3.toHex = utils.toHex;\nweb3.toAscii = utils.toAscii;\nweb3.fromAscii = utils.fromAscii;\nweb3.toDecimal = utils.toDecimal;\nweb3.fromDecimal = utils.fromDecimal;\nweb3.toBigNumber = utils.toBigNumber;\nweb3.toWei = utils.toWei;\nweb3.fromWei = utils.fromWei;\nweb3.isAddress = utils.isAddress;\nweb3.createBatch = function () {\n return new Batch();\n};\n\n// ADD defaultblock\nObject.defineProperty(web3.eth, 'defaultBlock', {\n get: function () {\n return c.defaultBlock;\n },\n set: function (val) {\n c.defaultBlock = val;\n return val;\n }\n});\n\nObject.defineProperty(web3.eth, 'defaultAccount', {\n get: function () {\n return c.defaultAccount;\n },\n set: function (val) {\n c.defaultAccount = val;\n return val;\n }\n});\n\n/// setups all api methods\nsetupMethods(web3, web3Methods);\nsetupProperties(web3, web3Properties);\nsetupMethods(web3.net, net.methods);\nsetupProperties(web3.net, net.properties);\nsetupMethods(web3.eth, eth.methods);\nsetupProperties(web3.eth, eth.properties);\nsetupMethods(web3.db, db.methods);\nsetupMethods(web3.shh, shh.methods);\n\nmodule.exports = web3;\n\n", + "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file batch.js\n * @author Marek Kotewicz \n * @date 2015\n */\n\nvar RequestManager = require('./requestmanager');\n\nvar Batch = function () {\n this.requests = [];\n};\n\n/**\n * Should be called to add create new request to batch request\n *\n * @method add\n * @param {Object} jsonrpc requet object\n */\nBatch.prototype.add = function (request) {\n this.requests.push(request);\n};\n\n/**\n * Should be called to execute batch request\n *\n * @method execute\n */\nBatch.prototype.execute = function () {\n var requests = this.requests;\n RequestManager.getInstance().sendBatch(requests, function (err, results) {\n results = results || [];\n requests.map(function (request, index) {\n return results[index] || {};\n }).map(function (result, index) {\n return requests[index].format ? requests[index].format(result.result) : result.result;\n }).forEach(function (result, index) {\n if (requests[index].callback) {\n requests[index].callback(err, result);\n }\n });\n }); \n};\n\nmodule.exports = Batch;\n\n", + "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file contract.js\n * @author Marek Kotewicz \n * @date 2014\n */\n\nvar web3 = require('../web3'); \nvar utils = require('../utils/utils');\nvar coder = require('../solidity/coder');\nvar SolidityEvent = require('./event');\nvar SolidityFunction = require('./function');\n\n/**\n * Should be called to encode constructor params\n *\n * @method encodeConstructorParams\n * @param {Array} abi\n * @param {Array} constructor params\n */\nvar encodeConstructorParams = function (abi, params) {\n return abi.filter(function (json) {\n return json.type === 'constructor' && json.inputs.length === params.length;\n }).map(function (json) {\n return json.inputs.map(function (input) {\n return input.type;\n });\n }).map(function (types) {\n return coder.encodeParams(types, params);\n })[0] || '';\n};\n\n/**\n * Should be called to add functions to contract object\n *\n * @method addFunctionsToContract\n * @param {Contract} contract\n * @param {Array} abi\n */\nvar addFunctionsToContract = function (contract, abi) {\n abi.filter(function (json) {\n return json.type === 'function';\n }).map(function (json) {\n return new SolidityFunction(json, contract.address);\n }).forEach(function (f) {\n f.attachToContract(contract);\n });\n};\n\n/**\n * Should be called to add events to contract object\n *\n * @method addEventsToContract\n * @param {Contract} contract\n * @param {Array} abi\n */\nvar addEventsToContract = function (contract, abi) {\n abi.filter(function (json) {\n return json.type === 'event';\n }).map(function (json) {\n return new SolidityEvent(json, contract.address);\n }).forEach(function (e) {\n e.attachToContract(contract);\n });\n};\n\n/**\n * Should be called to create new ContractFactory\n *\n * @method contract\n * @param {Array} abi\n * @returns {ContractFactory} new contract factory\n */\nvar contract = function (abi) {\n return new ContractFactory(abi);\n};\n\n/**\n * Should be called to create new ContractFactory instance\n *\n * @method ContractFactory\n * @param {Array} abi\n */\nvar ContractFactory = function (abi) {\n this.abi = abi;\n};\n\n/**\n * Should be called to create new contract on a blockchain\n * \n * @method new\n * @param {Any} contract constructor param1 (optional)\n * @param {Any} contract constructor param2 (optional)\n * @param {Object} contract transaction object (required)\n * @param {Function} callback\n * @returns {Contract} returns contract if no callback was passed,\n * otherwise calls callback function (err, contract)\n */\nContractFactory.prototype.new = function () {\n // parse arguments\n var options = {}; // required!\n var callback;\n\n var args = Array.prototype.slice.call(arguments);\n if (utils.isFunction(args[args.length - 1])) {\n callback = args.pop();\n }\n\n var last = args[args.length - 1];\n if (utils.isObject(last) && !utils.isArray(last)) {\n options = args.pop();\n }\n\n // throw an error if there are no options\n\n var bytes = encodeConstructorParams(this.abi, args);\n options.data += bytes;\n\n if (!callback) {\n var address = web3.eth.sendTransaction(options);\n return this.at(address);\n }\n \n var self = this;\n web3.eth.sendTransaction(options, function (err, address) {\n if (err) {\n callback(err);\n }\n self.at(address, callback); \n }); \n};\n\n/**\n * Should be called to get access to existing contract on a blockchain\n *\n * @method at\n * @param {Address} contract address (required)\n * @param {Function} callback {optional)\n * @returns {Contract} returns contract if no callback was passed,\n * otherwise calls callback function (err, contract)\n */\nContractFactory.prototype.at = function (address, callback) {\n // TODO: address is required\n \n if (callback) {\n callback(null, new Contract(this.abi, address));\n } \n return new Contract(this.abi, address);\n};\n\n/**\n * Should be called to create new contract instance\n *\n * @method Contract\n * @param {Array} abi\n * @param {Address} contract address\n */\nvar Contract = function (abi, address) {\n this.address = address;\n addFunctionsToContract(this, abi);\n addEventsToContract(this, abi);\n};\n\nmodule.exports = contract;\n\n", "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** @file db.js\n * @authors:\n * Marek Kotewicz \n * @date 2015\n */\n\nvar Method = require('./method');\n\nvar putString = new Method({\n name: 'putString',\n call: 'db_putString',\n params: 3\n});\n\n\nvar getString = new Method({\n name: 'getString',\n call: 'db_getString',\n params: 2\n});\n\nvar putHex = new Method({\n name: 'putHex',\n call: 'db_putHex',\n params: 3\n});\n\nvar getHex = new Method({\n name: 'getHex',\n call: 'db_getHex',\n params: 2\n});\n\nvar methods = [\n putString, getString, putHex, getHex\n];\n\nmodule.exports = {\n methods: methods\n};\n", "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file errors.js\n * @author Marek Kotewicz \n * @date 2015\n */\n\nmodule.exports = {\n InvalidNumberOfParams: function () {\n return new Error('Invalid number of input parameters');\n },\n InvalidConnection: function (host){\n return new Error('CONNECTION ERROR: Couldn\\'t connect to node '+ host +', is it running?');\n },\n InvalidProvider: function () {\n return new Error('Providor not set or invalid');\n },\n InvalidResponse: function (result){\n var message = !!result && !!result.error && !!result.error.message ? result.error.message : 'Invalid JSON RPC response';\n return new Error(message);\n }\n};\n\n", - "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/**\n * @file eth.js\n * @author Marek Kotewicz \n * @author Fabian Vogelsteller \n * @date 2015\n */\n\n/**\n * Web3\n *\n * @module web3\n */\n\n/**\n * Eth methods and properties\n *\n * An example method object can look as follows:\n *\n * {\n * name: 'getBlock',\n * call: blockCall,\n * params: 2,\n * outputFormatter: formatters.outputBlockFormatter,\n * inputFormatter: [ // can be a formatter funciton or an array of functions. Where each item in the array will be used for one parameter\n * utils.toHex, // formats paramter 1\n * function(param){ return !!param; } // formats paramter 2\n * ]\n * },\n *\n * @class [web3] eth\n * @constructor\n */\n\n\"use strict\";\n\nvar formatters = require('./formatters');\nvar utils = require('../utils/utils');\nvar Method = require('./method');\nvar Property = require('./property');\n\nvar blockCall = function (args) {\n return (utils.isString(args[0]) && args[0].indexOf('0x') === 0) ? \"eth_getBlockByHash\" : \"eth_getBlockByNumber\";\n};\n\nvar transactionFromBlockCall = function (args) {\n return (utils.isString(args[0]) && args[0].indexOf('0x') === 0) ? 'eth_getTransactionByBlockHashAndIndex' : 'eth_getTransactionByBlockNumberAndIndex';\n};\n\nvar uncleCall = function (args) {\n return (utils.isString(args[0]) && args[0].indexOf('0x') === 0) ? 'eth_getUncleByBlockHashAndIndex' : 'eth_getUncleByBlockNumberAndIndex';\n};\n\nvar getBlockTransactionCountCall = function (args) {\n return (utils.isString(args[0]) && args[0].indexOf('0x') === 0) ? 'eth_getBlockTransactionCountByHash' : 'eth_getBlockTransactionCountByNumber';\n};\n\nvar uncleCountCall = function (args) {\n return (utils.isString(args[0]) && args[0].indexOf('0x') === 0) ? 'eth_getUncleCountByBlockHash' : 'eth_getUncleCountByBlockNumber';\n};\n\n/// @returns an array of objects describing web3.eth api methods\n\nvar getBalance = new Method({\n name: 'getBalance',\n call: 'eth_getBalance',\n params: 2,\n inputFormatter: [utils.toAddress, formatters.inputDefaultBlockNumberFormatter],\n outputFormatter: formatters.outputBigNumberFormatter\n});\n\nvar getStorageAt = new Method({\n name: 'getStorageAt',\n call: 'eth_getStorageAt',\n params: 3,\n inputFormatter: [null, utils.toHex, formatters.inputDefaultBlockNumberFormatter]\n});\n\nvar getCode = new Method({\n name: 'getCode',\n call: 'eth_getCode',\n params: 2,\n inputFormatter: [utils.toAddress, formatters.inputDefaultBlockNumberFormatter]\n});\n\nvar getBlock = new Method({\n name: 'getBlock',\n call: blockCall,\n params: 2,\n inputFormatter: [formatters.inputBlockNumberFormatter, function (val) { return !!val; }],\n outputFormatter: formatters.outputBlockFormatter\n});\n\nvar getUncle = new Method({\n name: 'getUncle',\n call: uncleCall,\n params: 2,\n inputFormatter: [formatters.inputBlockNumberFormatter, utils.toHex],\n outputFormatter: formatters.outputBlockFormatter,\n\n});\n\nvar getCompilers = new Method({\n name: 'getCompilers',\n call: 'eth_getCompilers',\n params: 0\n});\n\nvar getBlockTransactionCount = new Method({\n name: 'getBlockTransactionCount',\n call: getBlockTransactionCountCall,\n params: 1,\n inputFormatter: [formatters.inputBlockNumberFormatter],\n outputFormatter: utils.toDecimal\n});\n\nvar getBlockUncleCount = new Method({\n name: 'getBlockUncleCount',\n call: uncleCountCall,\n params: 1,\n inputFormatter: [formatters.inputBlockNumberFormatter],\n outputFormatter: utils.toDecimal\n});\n\nvar getTransaction = new Method({\n name: 'getTransaction',\n call: 'eth_getTransactionByHash',\n params: 1,\n outputFormatter: formatters.outputTransactionFormatter\n});\n\nvar getTransactionFromBlock = new Method({\n name: 'getTransactionFromBlock',\n call: transactionFromBlockCall,\n params: 2,\n inputFormatter: [formatters.inputBlockNumberFormatter, utils.toHex],\n outputFormatter: formatters.outputTransactionFormatter\n});\n\nvar getTransactionCount = new Method({\n name: 'getTransactionCount',\n call: 'eth_getTransactionCount',\n params: 2,\n inputFormatter: [null, formatters.inputDefaultBlockNumberFormatter],\n outputFormatter: utils.toDecimal\n});\n\nvar sendTransaction = new Method({\n name: 'sendTransaction',\n call: 'eth_sendTransaction',\n params: 1,\n inputFormatter: [formatters.inputTransactionFormatter]\n});\n\nvar call = new Method({\n name: 'call',\n call: 'eth_call',\n params: 2,\n inputFormatter: [formatters.inputTransactionFormatter, formatters.inputDefaultBlockNumberFormatter]\n});\n\nvar compileSolidity = new Method({\n name: 'compile.solidity',\n call: 'eth_compileSolidity',\n params: 1\n});\n\nvar compileLLL = new Method({\n name: 'compile.lll',\n call: 'eth_compileLLL',\n params: 1\n});\n\nvar compileSerpent = new Method({\n name: 'compile.serpent',\n call: 'eth_compileSerpent',\n params: 1\n});\n\nvar methods = [\n getBalance,\n getStorageAt,\n getCode,\n getBlock,\n getUncle,\n getCompilers,\n getBlockTransactionCount,\n getBlockUncleCount,\n getTransaction,\n getTransactionFromBlock,\n getTransactionCount,\n call,\n sendTransaction,\n compileSolidity,\n compileLLL,\n compileSerpent,\n];\n\n/// @returns an array of objects describing web3.eth api properties\n\n\n\nvar properties = [\n new Property({\n name: 'coinbase',\n getter: 'eth_coinbase'\n }),\n new Property({\n name: 'mining',\n getter: 'eth_mining'\n }),\n new Property({\n name: 'hashrate',\n getter: 'eth_hashrate',\n outputFormatter: utils.toDecimal\n }),\n new Property({\n name: 'gasPrice',\n getter: 'eth_gasPrice',\n outputFormatter: formatters.outputBigNumberFormatter\n }),\n new Property({\n name: 'accounts',\n getter: 'eth_accounts'\n }),\n new Property({\n name: 'blockNumber',\n getter: 'eth_blockNumber',\n outputFormatter: utils.toDecimal\n })\n];\n\nmodule.exports = {\n methods: methods,\n properties: properties\n};\n\n", + "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/**\n * @file eth.js\n * @author Marek Kotewicz \n * @author Fabian Vogelsteller \n * @date 2015\n */\n\n/**\n * Web3\n *\n * @module web3\n */\n\n/**\n * Eth methods and properties\n *\n * An example method object can look as follows:\n *\n * {\n * name: 'getBlock',\n * call: blockCall,\n * params: 2,\n * outputFormatter: formatters.outputBlockFormatter,\n * inputFormatter: [ // can be a formatter funciton or an array of functions. Where each item in the array will be used for one parameter\n * utils.toHex, // formats paramter 1\n * function(param){ return !!param; } // formats paramter 2\n * ]\n * },\n *\n * @class [web3] eth\n * @constructor\n */\n\n\"use strict\";\n\nvar formatters = require('./formatters');\nvar utils = require('../utils/utils');\nvar Method = require('./method');\nvar Property = require('./property');\n\nvar blockCall = function (args) {\n return (utils.isString(args[0]) && args[0].indexOf('0x') === 0) ? \"eth_getBlockByHash\" : \"eth_getBlockByNumber\";\n};\n\nvar transactionFromBlockCall = function (args) {\n return (utils.isString(args[0]) && args[0].indexOf('0x') === 0) ? 'eth_getTransactionByBlockHashAndIndex' : 'eth_getTransactionByBlockNumberAndIndex';\n};\n\nvar uncleCall = function (args) {\n return (utils.isString(args[0]) && args[0].indexOf('0x') === 0) ? 'eth_getUncleByBlockHashAndIndex' : 'eth_getUncleByBlockNumberAndIndex';\n};\n\nvar getBlockTransactionCountCall = function (args) {\n return (utils.isString(args[0]) && args[0].indexOf('0x') === 0) ? 'eth_getBlockTransactionCountByHash' : 'eth_getBlockTransactionCountByNumber';\n};\n\nvar uncleCountCall = function (args) {\n return (utils.isString(args[0]) && args[0].indexOf('0x') === 0) ? 'eth_getUncleCountByBlockHash' : 'eth_getUncleCountByBlockNumber';\n};\n\n/// @returns an array of objects describing web3.eth api methods\n\nvar getBalance = new Method({\n name: 'getBalance',\n call: 'eth_getBalance',\n params: 2,\n inputFormatter: [utils.toAddress, formatters.inputDefaultBlockNumberFormatter],\n outputFormatter: formatters.outputBigNumberFormatter\n});\n\nvar getStorageAt = new Method({\n name: 'getStorageAt',\n call: 'eth_getStorageAt',\n params: 3,\n inputFormatter: [null, utils.toHex, formatters.inputDefaultBlockNumberFormatter]\n});\n\nvar getCode = new Method({\n name: 'getCode',\n call: 'eth_getCode',\n params: 2,\n inputFormatter: [utils.toAddress, formatters.inputDefaultBlockNumberFormatter]\n});\n\nvar getBlock = new Method({\n name: 'getBlock',\n call: blockCall,\n params: 2,\n inputFormatter: [formatters.inputBlockNumberFormatter, function (val) { return !!val; }],\n outputFormatter: formatters.outputBlockFormatter\n});\n\nvar getUncle = new Method({\n name: 'getUncle',\n call: uncleCall,\n params: 2,\n inputFormatter: [formatters.inputBlockNumberFormatter, utils.toHex],\n outputFormatter: formatters.outputBlockFormatter,\n\n});\n\nvar getCompilers = new Method({\n name: 'getCompilers',\n call: 'eth_getCompilers',\n params: 0\n});\n\nvar getBlockTransactionCount = new Method({\n name: 'getBlockTransactionCount',\n call: getBlockTransactionCountCall,\n params: 1,\n inputFormatter: [formatters.inputBlockNumberFormatter],\n outputFormatter: utils.toDecimal\n});\n\nvar getBlockUncleCount = new Method({\n name: 'getBlockUncleCount',\n call: uncleCountCall,\n params: 1,\n inputFormatter: [formatters.inputBlockNumberFormatter],\n outputFormatter: utils.toDecimal\n});\n\nvar getTransaction = new Method({\n name: 'getTransaction',\n call: 'eth_getTransactionByHash',\n params: 1,\n outputFormatter: formatters.outputTransactionFormatter\n});\n\nvar getTransactionFromBlock = new Method({\n name: 'getTransactionFromBlock',\n call: transactionFromBlockCall,\n params: 2,\n inputFormatter: [formatters.inputBlockNumberFormatter, utils.toHex],\n outputFormatter: formatters.outputTransactionFormatter\n});\n\nvar getTransactionCount = new Method({\n name: 'getTransactionCount',\n call: 'eth_getTransactionCount',\n params: 2,\n inputFormatter: [null, formatters.inputDefaultBlockNumberFormatter],\n outputFormatter: utils.toDecimal\n});\n\nvar sendTransaction = new Method({\n name: 'sendTransaction',\n call: 'eth_sendTransaction',\n params: 1,\n inputFormatter: [formatters.inputTransactionFormatter]\n});\n\nvar call = new Method({\n name: 'call',\n call: 'eth_call',\n params: 2,\n inputFormatter: [formatters.inputTransactionFormatter, formatters.inputDefaultBlockNumberFormatter]\n});\n\nvar estimateGas = new Method({\n name: 'estimateGas',\n call: 'eth_estimateGas',\n params: 1,\n inputFormatter: [formatters.inputTransactionFormatter],\n outputFormatter: utils.toDecimal\n});\n\nvar compileSolidity = new Method({\n name: 'compile.solidity',\n call: 'eth_compileSolidity',\n params: 1\n});\n\nvar compileLLL = new Method({\n name: 'compile.lll',\n call: 'eth_compileLLL',\n params: 1\n});\n\nvar compileSerpent = new Method({\n name: 'compile.serpent',\n call: 'eth_compileSerpent',\n params: 1\n});\n\nvar submitWork = new Method({\n name: 'submitWork',\n call: 'eth_submitWork',\n params: 3\n});\n\nvar getWork = new Method({\n name: 'getWork',\n call: 'eth_getWork',\n params: 0\n});\n\nvar methods = [\n getBalance,\n getStorageAt,\n getCode,\n getBlock,\n getUncle,\n getCompilers,\n getBlockTransactionCount,\n getBlockUncleCount,\n getTransaction,\n getTransactionFromBlock,\n getTransactionCount,\n call,\n estimateGas,\n sendTransaction,\n compileSolidity,\n compileLLL,\n compileSerpent,\n submitWork,\n getWork\n];\n\n/// @returns an array of objects describing web3.eth api properties\n\n\n\nvar properties = [\n new Property({\n name: 'coinbase',\n getter: 'eth_coinbase'\n }),\n new Property({\n name: 'mining',\n getter: 'eth_mining'\n }),\n new Property({\n name: 'hashrate',\n getter: 'eth_hashrate',\n outputFormatter: utils.toDecimal\n }),\n new Property({\n name: 'gasPrice',\n getter: 'eth_gasPrice',\n outputFormatter: formatters.outputBigNumberFormatter\n }),\n new Property({\n name: 'accounts',\n getter: 'eth_accounts'\n }),\n new Property({\n name: 'blockNumber',\n getter: 'eth_blockNumber',\n outputFormatter: utils.toDecimal\n })\n];\n\nmodule.exports = {\n methods: methods,\n properties: properties\n};\n\n", "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file event.js\n * @author Marek Kotewicz \n * @date 2014\n */\n\nvar utils = require('../utils/utils');\nvar coder = require('../solidity/coder');\nvar web3 = require('../web3');\nvar formatters = require('./formatters');\n\n/**\n * This prototype should be used to create event filters\n */\nvar SolidityEvent = function (json, address) {\n this._params = json.inputs;\n this._name = utils.transformToFullName(json);\n this._address = address;\n this._anonymous = json.anonymous;\n};\n\n/**\n * Should be used to get filtered param types\n *\n * @method types\n * @param {Bool} decide if returned typed should be indexed\n * @return {Array} array of types\n */\nSolidityEvent.prototype.types = function (indexed) {\n return this._params.filter(function (i) {\n return i.indexed === indexed;\n }).map(function (i) {\n return i.type;\n });\n};\n\n/**\n * Should be used to get event display name\n *\n * @method displayName\n * @return {String} event display name\n */\nSolidityEvent.prototype.displayName = function () {\n return utils.extractDisplayName(this._name);\n};\n\n/**\n * Should be used to get event type name\n *\n * @method typeName\n * @return {String} event type name\n */\nSolidityEvent.prototype.typeName = function () {\n return utils.extractTypeName(this._name);\n};\n\n/**\n * Should be used to get event signature\n *\n * @method signature\n * @return {String} event signature\n */\nSolidityEvent.prototype.signature = function () {\n return web3.sha3(web3.fromAscii(this._name)).slice(2);\n};\n\n/**\n * Should be used to encode indexed params and options to one final object\n * \n * @method encode\n * @param {Object} indexed\n * @param {Object} options\n * @return {Object} everything combined together and encoded\n */\nSolidityEvent.prototype.encode = function (indexed, options) {\n indexed = indexed || {};\n options = options || {};\n var result = {};\n\n ['fromBlock', 'toBlock'].filter(function (f) {\n return options[f] !== undefined;\n }).forEach(function (f) {\n result[f] = formatters.inputBlockNumberFormatter(options[f]);\n });\n\n result.topics = [];\n\n if (!this._anonymous) {\n result.address = this._address;\n result.topics.push('0x' + this.signature());\n }\n\n var indexedTopics = this._params.filter(function (i) {\n return i.indexed === true;\n }).map(function (i) {\n var value = indexed[i.name];\n if (value === undefined || value === null) {\n return null;\n }\n \n if (utils.isArray(value)) {\n return value.map(function (v) {\n return '0x' + coder.encodeParam(i.type, v);\n });\n }\n return '0x' + coder.encodeParam(i.type, value);\n });\n\n result.topics = result.topics.concat(indexedTopics);\n\n return result;\n};\n\n/**\n * Should be used to decode indexed params and options\n *\n * @method decode\n * @param {Object} data\n * @return {Object} result object with decoded indexed && not indexed params\n */\nSolidityEvent.prototype.decode = function (data) {\n \n data.data = data.data || '';\n data.topics = data.topics || [];\n\n var argTopics = this._anonymous ? data.topics : data.topics.slice(1);\n var indexedData = argTopics.map(function (topics) { return topics.slice(2); }).join(\"\");\n var indexedParams = coder.decodeParams(this.types(true), indexedData); \n\n var notIndexedData = data.data.slice(2);\n var notIndexedParams = coder.decodeParams(this.types(false), notIndexedData);\n \n var result = formatters.outputLogFormatter(data);\n result.event = this.displayName();\n result.address = data.address;\n\n result.args = this._params.reduce(function (acc, current) {\n acc[current.name] = current.indexed ? indexedParams.shift() : notIndexedParams.shift();\n return acc;\n }, {});\n\n delete result.data;\n delete result.topics;\n\n return result;\n};\n\n/**\n * Should be used to create new filter object from event\n *\n * @method execute\n * @param {Object} indexed\n * @param {Object} options\n * @return {Object} filter object\n */\nSolidityEvent.prototype.execute = function (indexed, options) {\n var o = this.encode(indexed, options);\n var formatter = this.decode.bind(this);\n return web3.eth.filter(o, undefined, undefined, formatter);\n};\n\n/**\n * Should be used to attach event to contract object\n *\n * @method attachToContract\n * @param {Contract}\n */\nSolidityEvent.prototype.attachToContract = function (contract) {\n var execute = this.execute.bind(this);\n var displayName = this.displayName();\n if (!contract[displayName]) {\n contract[displayName] = execute;\n }\n contract[displayName][this.typeName()] = this.execute.bind(this, contract);\n};\n\nmodule.exports = SolidityEvent;\n\n", "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** @file filter.js\n * @authors:\n * Jeffrey Wilcke \n * Marek Kotewicz \n * Marian Oancea \n * Fabian Vogelsteller \n * Gav Wood \n * @date 2014\n */\n\nvar RequestManager = require('./requestmanager');\nvar formatters = require('./formatters');\nvar utils = require('../utils/utils');\n\n/**\n* Converts a given topic to a hex string, but also allows null values.\n*\n* @param {Mixed} value\n* @return {String}\n*/\nvar toTopic = function(value){\n\n if(value === null || typeof value === 'undefined')\n return null;\n\n value = String(value);\n\n if(value.indexOf('0x') === 0)\n return value;\n else\n return utils.fromAscii(value);\n};\n\n/// This method should be called on options object, to verify deprecated properties && lazy load dynamic ones\n/// @param should be string or object\n/// @returns options string or object\nvar getOptions = function (options) {\n\n if (utils.isString(options)) {\n return options;\n } \n\n options = options || {};\n\n // make sure topics, get converted to hex\n options.topics = options.topics || [];\n options.topics = options.topics.map(function(topic){\n return (utils.isArray(topic)) ? topic.map(toTopic) : toTopic(topic);\n });\n\n // lazy load\n return {\n topics: options.topics,\n to: options.to,\n address: options.address,\n fromBlock: formatters.inputBlockNumberFormatter(options.fromBlock),\n toBlock: formatters.inputBlockNumberFormatter(options.toBlock) \n }; \n};\n\nvar Filter = function (options, methods, formatter) {\n var implementation = {};\n methods.forEach(function (method) {\n method.attachToObject(implementation);\n });\n this.options = getOptions(options);\n this.implementation = implementation;\n this.callbacks = [];\n this.formatter = formatter;\n this.filterId = this.implementation.newFilter(this.options);\n};\n\nFilter.prototype.watch = function (callback) {\n this.callbacks.push(callback);\n var self = this;\n\n var onMessage = function (error, messages) {\n if (error) {\n return self.callbacks.forEach(function (callback) {\n callback(error);\n });\n }\n\n messages.forEach(function (message) {\n message = self.formatter ? self.formatter(message) : message;\n self.callbacks.forEach(function (callback) {\n callback(null, message);\n });\n });\n };\n\n // call getFilterLogs on start\n if (!utils.isString(this.options)) {\n this.get(function (err, messages) {\n // don't send all the responses to all the watches again... just to this one\n if (err) {\n callback(err);\n }\n\n messages.forEach(function (message) {\n callback(null, message);\n });\n });\n }\n\n RequestManager.getInstance().startPolling({\n method: this.implementation.poll.call,\n params: [this.filterId],\n }, this.filterId, onMessage, this.stopWatching.bind(this));\n};\n\nFilter.prototype.stopWatching = function () {\n RequestManager.getInstance().stopPolling(this.filterId);\n this.implementation.uninstallFilter(this.filterId);\n this.callbacks = [];\n};\n\nFilter.prototype.get = function (callback) {\n var self = this;\n if (utils.isFunction(callback)) {\n this.implementation.getLogs(this.filterId, function(err, res){\n if (err) {\n callback(err);\n } else {\n callback(null, res.map(function (log) {\n return self.formatter ? self.formatter(log) : log;\n }));\n }\n });\n } else {\n var logs = this.implementation.getLogs(this.filterId);\n return logs.map(function (log) {\n return self.formatter ? self.formatter(log) : log;\n });\n }\n};\n\nmodule.exports = Filter;\n\n", "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file formatters.js\n * @author Marek Kotewicz \n * @author Fabian Vogelsteller \n * @date 2015\n */\n\nvar utils = require('../utils/utils');\nvar config = require('../utils/config');\n\n/**\n * Should the format output to a big number\n *\n * @method outputBigNumberFormatter\n * @param {String|Number|BigNumber}\n * @returns {BigNumber} object\n */\nvar outputBigNumberFormatter = function (number) {\n return utils.toBigNumber(number);\n};\n\nvar isPredefinedBlockNumber = function (blockNumber) {\n return blockNumber === 'latest' || blockNumber === 'pending' || blockNumber === 'earliest';\n};\n\nvar inputDefaultBlockNumberFormatter = function (blockNumber) {\n if (blockNumber === undefined) {\n return config.defaultBlock;\n }\n return inputBlockNumberFormatter(blockNumber);\n};\n\nvar inputBlockNumberFormatter = function (blockNumber) {\n if (blockNumber === undefined) {\n return undefined;\n } else if (isPredefinedBlockNumber(blockNumber)) {\n return blockNumber;\n }\n return utils.toHex(blockNumber);\n};\n\n/**\n * Formats the input of a transaction and converts all values to HEX\n *\n * @method inputTransactionFormatter\n * @param {Object} transaction options\n * @returns object\n*/\nvar inputTransactionFormatter = function (options){\n\n options.from = options.from || config.defaultAccount;\n\n // make code -> data\n if (options.code) {\n options.data = options.code;\n delete options.code;\n }\n\n ['gasPrice', 'gas', 'value', 'nonce'].filter(function (key) {\n return options[key] !== undefined;\n }).forEach(function(key){\n options[key] = utils.fromDecimal(options[key]);\n });\n\n return options; \n};\n\n/**\n * Formats the output of a transaction to its proper values\n * \n * @method outputTransactionFormatter\n * @param {Object} transaction\n * @returns {Object} transaction\n*/\nvar outputTransactionFormatter = function (tx){\n tx.blockNumber = utils.toDecimal(tx.blockNumber);\n tx.transactionIndex = utils.toDecimal(tx.transactionIndex);\n tx.nonce = utils.toDecimal(tx.nonce);\n tx.gas = utils.toDecimal(tx.gas);\n tx.gasPrice = utils.toBigNumber(tx.gasPrice);\n tx.value = utils.toBigNumber(tx.value);\n return tx;\n};\n\n/**\n * Formats the output of a block to its proper values\n *\n * @method outputBlockFormatter\n * @param {Object} block object \n * @returns {Object} block object\n*/\nvar outputBlockFormatter = function(block) {\n\n // transform to number\n block.gasLimit = utils.toDecimal(block.gasLimit);\n block.gasUsed = utils.toDecimal(block.gasUsed);\n block.size = utils.toDecimal(block.size);\n block.timestamp = utils.toDecimal(block.timestamp);\n block.number = utils.toDecimal(block.number);\n\n block.difficulty = utils.toBigNumber(block.difficulty);\n block.totalDifficulty = utils.toBigNumber(block.totalDifficulty);\n\n if (utils.isArray(block.transactions)) {\n block.transactions.forEach(function(item){\n if(!utils.isString(item))\n return outputTransactionFormatter(item);\n });\n }\n\n return block;\n};\n\n/**\n * Formats the output of a log\n * \n * @method outputLogFormatter\n * @param {Object} log object\n * @returns {Object} log\n*/\nvar outputLogFormatter = function(log) {\n if (log === null) { // 'pending' && 'latest' filters are nulls\n return null;\n }\n\n log.blockNumber = utils.toDecimal(log.blockNumber);\n log.transactionIndex = utils.toDecimal(log.transactionIndex);\n log.logIndex = utils.toDecimal(log.logIndex);\n\n return log;\n};\n\n/**\n * Formats the input of a whisper post and converts all values to HEX\n *\n * @method inputPostFormatter\n * @param {Object} transaction object\n * @returns {Object}\n*/\nvar inputPostFormatter = function(post) {\n\n post.payload = utils.toHex(post.payload);\n post.ttl = utils.fromDecimal(post.ttl);\n post.workToProve = utils.fromDecimal(post.workToProve);\n post.priority = utils.fromDecimal(post.priority);\n\n // fallback\n if (!utils.isArray(post.topics)) {\n post.topics = post.topics ? [post.topics] : [];\n }\n\n // format the following options\n post.topics = post.topics.map(function(topic){\n return utils.fromAscii(topic);\n });\n\n return post; \n};\n\n/**\n * Formats the output of a received post message\n *\n * @method outputPostFormatter\n * @param {Object}\n * @returns {Object}\n */\nvar outputPostFormatter = function(post){\n\n post.expiry = utils.toDecimal(post.expiry);\n post.sent = utils.toDecimal(post.sent);\n post.ttl = utils.toDecimal(post.ttl);\n post.workProved = utils.toDecimal(post.workProved);\n post.payloadRaw = post.payload;\n post.payload = utils.toAscii(post.payload);\n\n if (utils.isJson(post.payload)) {\n post.payload = JSON.parse(post.payload);\n }\n\n // format the following options\n if (!post.topics) {\n post.topics = [];\n }\n post.topics = post.topics.map(function(topic){\n return utils.toAscii(topic);\n });\n\n return post;\n};\n\nmodule.exports = {\n inputDefaultBlockNumberFormatter: inputDefaultBlockNumberFormatter,\n inputBlockNumberFormatter: inputBlockNumberFormatter,\n inputTransactionFormatter: inputTransactionFormatter,\n inputPostFormatter: inputPostFormatter,\n outputBigNumberFormatter: outputBigNumberFormatter,\n outputTransactionFormatter: outputTransactionFormatter,\n outputBlockFormatter: outputBlockFormatter,\n outputLogFormatter: outputLogFormatter,\n outputPostFormatter: outputPostFormatter\n};\n\n", - "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file function.js\n * @author Marek Kotewicz \n * @date 2015\n */\n\nvar web3 = require('../web3');\nvar coder = require('../solidity/coder');\nvar utils = require('../utils/utils');\n\n/**\n * This prototype should be used to call/sendTransaction to solidity functions\n */\nvar SolidityFunction = function (json, address) {\n this._inputTypes = json.inputs.map(function (i) {\n return i.type;\n });\n this._outputTypes = json.outputs.map(function (i) {\n return i.type;\n });\n this._constant = json.constant;\n this._name = utils.transformToFullName(json);\n this._address = address;\n};\n\n/**\n * Should be used to create payload from arguments\n *\n * @method toPayload\n * @param {...} solidity function params\n * @param {Object} optional payload options\n */\nSolidityFunction.prototype.toPayload = function () {\n var args = Array.prototype.slice.call(arguments);\n var options = {};\n if (args.length > this._inputTypes.length && utils.isObject(args[args.length -1])) {\n options = args.pop();\n }\n options.to = this._address;\n options.data = '0x' + this.signature() + coder.encodeParams(this._inputTypes, args);\n return options;\n};\n\n/**\n * Should be used to get function signature\n *\n * @method signature\n * @return {String} function signature\n */\nSolidityFunction.prototype.signature = function () {\n return web3.sha3(web3.fromAscii(this._name)).slice(2, 10);\n};\n\n/**\n * Should be used to call function\n * \n * @method call\n * @param {Object} options\n * @return {String} output bytes\n */\nSolidityFunction.prototype.call = function () {\n var payload = this.toPayload.apply(this, Array.prototype.slice.call(arguments));\n var output = web3.eth.call(payload);\n output = output.length >= 2 ? output.slice(2) : output;\n var result = coder.decodeParams(this._outputTypes, output);\n return result.length === 1 ? result[0] : result;\n};\n\n/**\n * Should be used to sendTransaction to solidity function\n *\n * @method sendTransaction\n * @param {Object} options\n */\nSolidityFunction.prototype.sendTransaction = function () {\n var payload = this.toPayload.apply(this, Array.prototype.slice.call(arguments));\n web3.eth.sendTransaction(payload);\n};\n\n/**\n * Should be used to get function display name\n *\n * @method displayName\n * @return {String} display name of the function\n */\nSolidityFunction.prototype.displayName = function () {\n return utils.extractDisplayName(this._name);\n};\n\n/**\n * Should be used to get function type name\n * \n * @method typeName\n * @return {String} type name of the function\n */\nSolidityFunction.prototype.typeName = function () {\n return utils.extractTypeName(this._name);\n};\n\n/**\n * Should be called to execute function\n *\n * @method execute\n */\nSolidityFunction.prototype.execute = function () {\n var transaction = !this._constant;\n \n // send transaction\n if (transaction) {\n return this.sendTransaction.apply(this, Array.prototype.slice.call(arguments));\n }\n\n // call\n return this.call.apply(this, Array.prototype.slice.call(arguments));\n};\n\n/**\n * Should be called to attach function to contract\n *\n * @method attachToContract\n * @param {Contract}\n */\nSolidityFunction.prototype.attachToContract = function (contract) {\n var execute = this.execute.bind(this);\n execute.call = this.call.bind(this);\n execute.sendTransaction = this.sendTransaction.bind(this);\n var displayName = this.displayName();\n if (!contract[displayName]) {\n contract[displayName] = execute;\n }\n contract[displayName][this.typeName()] = execute; // circular!!!!\n};\n\nmodule.exports = SolidityFunction;\n\n", + "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/**\n * @file function.js\n * @author Marek Kotewicz \n * @date 2015\n */\n\nvar web3 = require('../web3');\nvar coder = require('../solidity/coder');\nvar utils = require('../utils/utils');\n\n/**\n * This prototype should be used to call/sendTransaction to solidity functions\n */\nvar SolidityFunction = function (json, address) {\n this._inputTypes = json.inputs.map(function (i) {\n return i.type;\n });\n this._outputTypes = json.outputs.map(function (i) {\n return i.type;\n });\n this._constant = json.constant;\n this._name = utils.transformToFullName(json);\n this._address = address;\n};\n\nSolidityFunction.prototype.extractCallback = function (args) {\n if (utils.isFunction(args[args.length - 1])) {\n return args.pop(); // modify the args array!\n }\n};\n\n/**\n * Should be used to create payload from arguments\n *\n * @method toPayload\n * @param {Array} solidity function params\n * @param {Object} optional payload options\n */\nSolidityFunction.prototype.toPayload = function (args) {\n var options = {};\n if (args.length > this._inputTypes.length && utils.isObject(args[args.length -1])) {\n options = args[args.length - 1];\n }\n options.to = this._address;\n options.data = '0x' + this.signature() + coder.encodeParams(this._inputTypes, args);\n return options;\n};\n\n/**\n * Should be used to get function signature\n *\n * @method signature\n * @return {String} function signature\n */\nSolidityFunction.prototype.signature = function () {\n return web3.sha3(web3.fromAscii(this._name)).slice(2, 10);\n};\n\n\nSolidityFunction.prototype.unpackOutput = function (output) {\n if (output === null) {\n return;\n }\n\n output = output.length >= 2 ? output.slice(2) : output;\n var result = coder.decodeParams(this._outputTypes, output);\n return result.length === 1 ? result[0] : result;\n};\n\n/**\n * Calls a contract function.\n *\n * @method call\n * @param {...Object} Contract function arguments\n * @param {function} If the last argument is a function, the contract function\n * call will be asynchronous, and the callback will be passed the\n * error and result.\n * @return {String} output bytes\n */\nSolidityFunction.prototype.call = function () {\n var args = Array.prototype.slice.call(arguments);\n var callback = this.extractCallback(args);\n var payload = this.toPayload(args);\n\n if (!callback) {\n var output = web3.eth.call(payload);\n return this.unpackOutput(output);\n } \n \n var self = this;\n web3.eth.call(payload, function (error, output) {\n callback(error, self.unpackOutput(output));\n });\n};\n\n/**\n * Should be used to sendTransaction to solidity function\n *\n * @method sendTransaction\n * @param {Object} options\n */\nSolidityFunction.prototype.sendTransaction = function () {\n var args = Array.prototype.slice.call(arguments);\n var callback = this.extractCallback(args);\n var payload = this.toPayload(args);\n\n if (!callback) {\n web3.eth.sendTransaction(payload);\n return;\n }\n\n web3.eth.sendTransaction(payload, callback);\n};\n\n/**\n * Should be used to get function display name\n *\n * @method displayName\n * @return {String} display name of the function\n */\nSolidityFunction.prototype.displayName = function () {\n return utils.extractDisplayName(this._name);\n};\n\n/**\n * Should be used to get function type name\n *\n * @method typeName\n * @return {String} type name of the function\n */\nSolidityFunction.prototype.typeName = function () {\n return utils.extractTypeName(this._name);\n};\n\n/**\n * Should be called to get rpc requests from solidity function\n *\n * @method request\n * @returns {Object}\n */\nSolidityFunction.prototype.request = function () {\n var args = Array.prototype.slice.call(arguments);\n var callback = this.extractCallback(args);\n var payload = this.toPayload(args);\n var format = this.unpackOutput.bind(this);\n \n return {\n callback: callback,\n payload: payload, \n format: format\n };\n};\n\n/**\n * Should be called to execute function\n *\n * @method execute\n */\nSolidityFunction.prototype.execute = function () {\n var transaction = !this._constant;\n\n // send transaction\n if (transaction) {\n return this.sendTransaction.apply(this, Array.prototype.slice.call(arguments));\n }\n\n // call\n return this.call.apply(this, Array.prototype.slice.call(arguments));\n};\n\n/**\n * Should be called to attach function to contract\n *\n * @method attachToContract\n * @param {Contract}\n */\nSolidityFunction.prototype.attachToContract = function (contract) {\n var execute = this.execute.bind(this);\n execute.request = this.request.bind(this);\n execute.call = this.call.bind(this);\n execute.sendTransaction = this.sendTransaction.bind(this);\n var displayName = this.displayName();\n if (!contract[displayName]) {\n contract[displayName] = execute;\n }\n contract[displayName][this.typeName()] = execute; // circular!!!!\n};\n\nmodule.exports = SolidityFunction;\n\n", "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** @file httpprovider.js\n * @authors:\n * Marek Kotewicz \n * Marian Oancea \n * Fabian Vogelsteller \n * @date 2014\n */\n\n\"use strict\";\n\nvar XMLHttpRequest = require('xmlhttprequest').XMLHttpRequest; // jshint ignore:line\nvar errors = require('./errors');\n\nvar HttpProvider = function (host) {\n this.host = host || 'http://localhost:8545';\n};\n\nHttpProvider.prototype.send = function (payload) {\n var request = new XMLHttpRequest();\n\n request.open('POST', this.host, false);\n \n try {\n request.send(JSON.stringify(payload));\n } catch(error) {\n throw errors.InvalidConnection(this.host);\n }\n\n\n // check request.status\n // TODO: throw an error here! it cannot silently fail!!!\n //if (request.status !== 200) {\n //return;\n //}\n\n var result = request.responseText;\n\n try {\n result = JSON.parse(result);\n } catch(e) {\n throw errors.InvalidResponse(result); \n }\n\n return result;\n};\n\nHttpProvider.prototype.sendAsync = function (payload, callback) {\n var request = new XMLHttpRequest();\n request.onreadystatechange = function() {\n if (request.readyState === 4) {\n var result = request.responseText;\n var error = null;\n\n try {\n result = JSON.parse(result);\n } catch(e) {\n error = errors.InvalidResponse(result); \n }\n\n callback(error, result);\n }\n };\n\n request.open('POST', this.host, true);\n\n try {\n request.send(JSON.stringify(payload));\n } catch(error) {\n callback(errors.InvalidConnection(this.host));\n }\n};\n\nmodule.exports = HttpProvider;\n\n", "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** @file jsonrpc.js\n * @authors:\n * Marek Kotewicz \n * @date 2015\n */\n\nvar Jsonrpc = function () {\n // singleton pattern\n if (arguments.callee._singletonInstance) {\n return arguments.callee._singletonInstance;\n }\n arguments.callee._singletonInstance = this;\n\n this.messageId = 1;\n};\n\n/**\n * @return {Jsonrpc} singleton\n */\nJsonrpc.getInstance = function () {\n var instance = new Jsonrpc();\n return instance;\n};\n\n/**\n * Should be called to valid json create payload object\n *\n * @method toPayload\n * @param {Function} method of jsonrpc call, required\n * @param {Array} params, an array of method params, optional\n * @returns {Object} valid jsonrpc payload object\n */\nJsonrpc.prototype.toPayload = function (method, params) {\n if (!method)\n console.error('jsonrpc method should be specified!');\n\n return {\n jsonrpc: '2.0',\n method: method,\n params: params || [],\n id: this.messageId++\n };\n};\n\n/**\n * Should be called to check if jsonrpc response is valid\n *\n * @method isValidResponse\n * @param {Object}\n * @returns {Boolean} true if response is valid, otherwise false\n */\nJsonrpc.prototype.isValidResponse = function (response) {\n return !!response &&\n !response.error &&\n response.jsonrpc === '2.0' &&\n typeof response.id === 'number' &&\n response.result !== undefined; // only undefined is not valid json object\n};\n\n/**\n * Should be called to create batch payload object\n *\n * @method toBatchPayload\n * @param {Array} messages, an array of objects with method (required) and params (optional) fields\n * @returns {Array} batch payload\n */\nJsonrpc.prototype.toBatchPayload = function (messages) {\n var self = this;\n return messages.map(function (message) {\n return self.toPayload(message.method, message.params);\n });\n};\n\nmodule.exports = Jsonrpc;\n\n", - "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/**\n * @file method.js\n * @author Marek Kotewicz \n * @date 2015\n */\n\nvar RequestManager = require('./requestmanager');\nvar utils = require('../utils/utils');\nvar errors = require('./errors');\n\nvar Method = function (options) {\n this.name = options.name;\n this.call = options.call;\n this.params = options.params || 0;\n this.inputFormatter = options.inputFormatter;\n this.outputFormatter = options.outputFormatter;\n};\n\n/**\n * Should be used to determine name of the jsonrpc method based on arguments\n *\n * @method getCall\n * @param {Array} arguments\n * @return {String} name of jsonrpc method\n */\nMethod.prototype.getCall = function (args) {\n return utils.isFunction(this.call) ? this.call(args) : this.call;\n};\n\n/**\n * Should be used to extract callback from array of arguments. Modifies input param\n *\n * @method extractCallback\n * @param {Array} arguments\n * @return {Function|Null} callback, if exists\n */\nMethod.prototype.extractCallback = function (args) {\n if (utils.isFunction(args[args.length - 1])) {\n return args.pop(); // modify the args array!\n }\n return null;\n};\n\n/**\n * Should be called to check if the number of arguments is correct\n * \n * @method validateArgs\n * @param {Array} arguments\n * @throws {Error} if it is not\n */\nMethod.prototype.validateArgs = function (args) {\n if (args.length !== this.params) {\n throw errors.InvalidNumberOfParams();\n }\n};\n\n/**\n * Should be called to format input args of method\n * \n * @method formatInput\n * @param {Array}\n * @return {Array}\n */\nMethod.prototype.formatInput = function (args) {\n if (!this.inputFormatter) {\n return args;\n }\n\n return this.inputFormatter.map(function (formatter, index) {\n return formatter ? formatter(args[index]) : args[index];\n });\n};\n\n/**\n * Should be called to format output(result) of method\n *\n * @method formatOutput\n * @param {Object}\n * @return {Object}\n */\nMethod.prototype.formatOutput = function (result) {\n return this.outputFormatter && result !== null ? this.outputFormatter(result) : result;\n};\n\n/**\n * Should attach function to method\n * \n * @method attachToObject\n * @param {Object}\n * @param {Function}\n */\nMethod.prototype.attachToObject = function (obj) {\n var func = this.send.bind(this);\n func.call = this.call; // that's ugly. filter.js uses it\n var name = this.name.split('.');\n if (name.length > 1) {\n obj[name[0]] = obj[name[0]] || {};\n obj[name[0]][name[1]] = func;\n } else {\n obj[name[0]] = func; \n }\n};\n\n/**\n * Should create payload from given input args\n *\n * @method toPayload\n * @param {Array} args\n * @return {Object}\n */\nMethod.prototype.toPayload = function (args) {\n var call = this.getCall(args);\n var callback = this.extractCallback(args);\n var params = this.formatInput(args);\n this.validateArgs(params);\n\n return {\n method: call,\n params: params,\n callback: callback\n };\n};\n\n/**\n * Should send request to the API\n *\n * @method send\n * @param list of params\n * @return result\n */\nMethod.prototype.send = function () {\n var payload = this.toPayload(Array.prototype.slice.call(arguments));\n if (payload.callback) {\n var self = this;\n return RequestManager.getInstance().sendAsync(payload, function (err, result) {\n payload.callback(null, self.formatOutput(result));\n });\n }\n return this.formatOutput(RequestManager.getInstance().send(payload));\n};\n\nmodule.exports = Method;\n\n", + "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/**\n * @file method.js\n * @author Marek Kotewicz \n * @date 2015\n */\n\nvar RequestManager = require('./requestmanager');\nvar utils = require('../utils/utils');\nvar errors = require('./errors');\n\nvar Method = function (options) {\n this.name = options.name;\n this.call = options.call;\n this.params = options.params || 0;\n this.inputFormatter = options.inputFormatter;\n this.outputFormatter = options.outputFormatter;\n};\n\n/**\n * Should be used to determine name of the jsonrpc method based on arguments\n *\n * @method getCall\n * @param {Array} arguments\n * @return {String} name of jsonrpc method\n */\nMethod.prototype.getCall = function (args) {\n return utils.isFunction(this.call) ? this.call(args) : this.call;\n};\n\n/**\n * Should be used to extract callback from array of arguments. Modifies input param\n *\n * @method extractCallback\n * @param {Array} arguments\n * @return {Function|Null} callback, if exists\n */\nMethod.prototype.extractCallback = function (args) {\n if (utils.isFunction(args[args.length - 1])) {\n return args.pop(); // modify the args array!\n }\n};\n\n/**\n * Should be called to check if the number of arguments is correct\n * \n * @method validateArgs\n * @param {Array} arguments\n * @throws {Error} if it is not\n */\nMethod.prototype.validateArgs = function (args) {\n if (args.length !== this.params) {\n throw errors.InvalidNumberOfParams();\n }\n};\n\n/**\n * Should be called to format input args of method\n * \n * @method formatInput\n * @param {Array}\n * @return {Array}\n */\nMethod.prototype.formatInput = function (args) {\n if (!this.inputFormatter) {\n return args;\n }\n\n return this.inputFormatter.map(function (formatter, index) {\n return formatter ? formatter(args[index]) : args[index];\n });\n};\n\n/**\n * Should be called to format output(result) of method\n *\n * @method formatOutput\n * @param {Object}\n * @return {Object}\n */\nMethod.prototype.formatOutput = function (result) {\n return this.outputFormatter && result !== null ? this.outputFormatter(result) : result;\n};\n\n/**\n * Should attach function to method\n * \n * @method attachToObject\n * @param {Object}\n * @param {Function}\n */\nMethod.prototype.attachToObject = function (obj) {\n var func = this.send.bind(this);\n func.request = this.request.bind(this);\n func.call = this.call; // that's ugly. filter.js uses it\n var name = this.name.split('.');\n if (name.length > 1) {\n obj[name[0]] = obj[name[0]] || {};\n obj[name[0]][name[1]] = func;\n } else {\n obj[name[0]] = func; \n }\n};\n\n/**\n * Should create payload from given input args\n *\n * @method toPayload\n * @param {Array} args\n * @return {Object}\n */\nMethod.prototype.toPayload = function (args) {\n var call = this.getCall(args);\n var callback = this.extractCallback(args);\n var params = this.formatInput(args);\n this.validateArgs(params);\n\n return {\n method: call,\n params: params,\n callback: callback\n };\n};\n\n/**\n * Should be called to create pure JSONRPC request which can be used in batch request\n *\n * @method request\n * @param {...} params\n * @return {Object} jsonrpc request\n */\nMethod.prototype.request = function () {\n var payload = this.toPayload(Array.prototype.slice.call(arguments));\n payload.format = this.formatOutput.bind(this);\n return payload;\n};\n\n/**\n * Should send request to the API\n *\n * @method send\n * @param list of params\n * @return result\n */\nMethod.prototype.send = function () {\n var payload = this.toPayload(Array.prototype.slice.call(arguments));\n if (payload.callback) {\n var self = this;\n return RequestManager.getInstance().sendAsync(payload, function (err, result) {\n payload.callback(err, self.formatOutput(result));\n });\n }\n return this.formatOutput(RequestManager.getInstance().send(payload));\n};\n\nmodule.exports = Method;\n\n", "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** @file eth.js\n * @authors:\n * Marek Kotewicz \n * @date 2015\n */\n\nvar utils = require('../utils/utils');\nvar Property = require('./property');\n\n/// @returns an array of objects describing web3.eth api methods\nvar methods = [\n];\n\n/// @returns an array of objects describing web3.eth api properties\nvar properties = [\n new Property({\n name: 'listening',\n getter: 'net_listening'\n }),\n new Property({\n name: 'peerCount',\n getter: 'net_peerCount',\n outputFormatter: utils.toDecimal\n })\n];\n\n\nmodule.exports = {\n methods: methods,\n properties: properties\n};\n\n", - "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/**\n * @file property.js\n * @author Fabian Vogelsteller \n * @author Marek Kotewicz \n * @date 2015\n */\n\nvar RequestManager = require('./requestmanager');\n\nvar Property = function (options) {\n this.name = options.name;\n this.getter = options.getter;\n this.setter = options.setter;\n this.outputFormatter = options.outputFormatter;\n this.inputFormatter = options.inputFormatter;\n};\n\n/**\n * Should be called to format input args of method\n * \n * @method formatInput\n * @param {Array}\n * @return {Array}\n */\nProperty.prototype.formatInput = function (arg) {\n return this.inputFormatter ? this.inputFormatter(arg) : arg;\n};\n\n/**\n * Should be called to format output(result) of method\n *\n * @method formatOutput\n * @param {Object}\n * @return {Object}\n */\nProperty.prototype.formatOutput = function (result) {\n return this.outputFormatter && result !== null ? this.outputFormatter(result) : result;\n};\n\n/**\n * Should attach function to method\n * \n * @method attachToObject\n * @param {Object}\n * @param {Function}\n */\nProperty.prototype.attachToObject = function (obj) {\n var proto = {\n get: this.get.bind(this),\n set: this.set.bind(this)\n };\n\n var name = this.name.split('.');\n if (name.length > 1) {\n obj[name[0]] = obj[name[0]] || {};\n Object.defineProperty(obj[name[0]], name[1], proto); \n } else {\n Object.defineProperty(obj, name[0], proto);\n }\n};\n\n/**\n * Should be used to get value of the property\n *\n * @method get\n * @return {Object} value of the property\n */\nProperty.prototype.get = function () {\n return this.formatOutput(RequestManager.getInstance().send({\n method: this.getter\n }));\n};\n\n/**\n * Should be used to set value of the property\n *\n * @method set\n * @param {Object} new value of the property\n */\nProperty.prototype.set = function (value) {\n return RequestManager.getInstance().send({\n method: this.setter,\n params: [this.formatInput(value)]\n });\n};\n\nmodule.exports = Property;\n\n", + "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/**\n * @file property.js\n * @author Fabian Vogelsteller \n * @author Marek Kotewicz \n * @date 2015\n */\n\nvar RequestManager = require('./requestmanager');\n\nvar Property = function (options) {\n this.name = options.name;\n this.getter = options.getter;\n this.setter = options.setter;\n this.outputFormatter = options.outputFormatter;\n this.inputFormatter = options.inputFormatter;\n};\n\n/**\n * Should be called to format input args of method\n * \n * @method formatInput\n * @param {Array}\n * @return {Array}\n */\nProperty.prototype.formatInput = function (arg) {\n return this.inputFormatter ? this.inputFormatter(arg) : arg;\n};\n\n/**\n * Should be called to format output(result) of method\n *\n * @method formatOutput\n * @param {Object}\n * @return {Object}\n */\nProperty.prototype.formatOutput = function (result) {\n return this.outputFormatter && result !== null ? this.outputFormatter(result) : result;\n};\n\n/**\n * Should attach function to method\n * \n * @method attachToObject\n * @param {Object}\n * @param {Function}\n */\nProperty.prototype.attachToObject = function (obj) {\n var proto = {\n get: this.get.bind(this),\n };\n\n var names = this.name.split('.');\n var name = names[0];\n if (names.length > 1) {\n obj[names[0]] = obj[names[0]] || {};\n obj = obj[names[0]];\n name = names[1];\n }\n \n Object.defineProperty(obj, name, proto);\n\n var toAsyncName = function (prefix, name) {\n return prefix + name.charAt(0).toUpperCase() + name.slice(1);\n };\n\n obj[toAsyncName('get', name)] = this.getAsync.bind(this);\n};\n\n/**\n * Should be used to get value of the property\n *\n * @method get\n * @return {Object} value of the property\n */\nProperty.prototype.get = function () {\n return this.formatOutput(RequestManager.getInstance().send({\n method: this.getter\n }));\n};\n\n/**\n * Should be used to asynchrounously get value of property\n *\n * @method getAsync\n * @param {Function}\n */\nProperty.prototype.getAsync = function (callback) {\n var self = this;\n RequestManager.getInstance().sendAsync({\n method: this.getter\n }, function (err, result) {\n if (err) {\n return callback(err);\n }\n callback(err, self.formatOutput(result));\n });\n};\n\nmodule.exports = Property;\n\n", "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** @file qtsync.js\n * @authors:\n * Marek Kotewicz \n * Marian Oancea \n * @date 2014\n */\n\nvar QtSyncProvider = function () {\n};\n\nQtSyncProvider.prototype.send = function (payload) {\n var result = navigator.qt.callMethod(JSON.stringify(payload));\n return JSON.parse(result);\n};\n\nmodule.exports = QtSyncProvider;\n\n", - "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file requestmanager.js\n * @author Jeffrey Wilcke \n * @author Marek Kotewicz \n * @author Marian Oancea \n * @author Fabian Vogelsteller \n * @author Gav Wood \n * @date 2014\n */\n\nvar Jsonrpc = require('./jsonrpc');\nvar utils = require('../utils/utils');\nvar c = require('../utils/config');\nvar errors = require('./errors');\n\n/**\n * It's responsible for passing messages to providers\n * It's also responsible for polling the ethereum node for incoming messages\n * Default poll timeout is 1 second\n * Singleton\n */\nvar RequestManager = function (provider) {\n // singleton pattern\n if (arguments.callee._singletonInstance) {\n return arguments.callee._singletonInstance;\n }\n arguments.callee._singletonInstance = this;\n\n this.provider = provider;\n this.polls = [];\n this.timeout = null;\n this.poll();\n};\n\n/**\n * @return {RequestManager} singleton\n */\nRequestManager.getInstance = function () {\n var instance = new RequestManager();\n return instance;\n};\n\n/**\n * Should be used to synchronously send request\n *\n * @method send\n * @param {Object} data\n * @return {Object}\n */\nRequestManager.prototype.send = function (data) {\n if (!this.provider) {\n console.error(errors.InvalidProvider());\n return null;\n }\n\n var payload = Jsonrpc.getInstance().toPayload(data.method, data.params);\n var result = this.provider.send(payload);\n\n if (!Jsonrpc.getInstance().isValidResponse(result)) {\n throw errors.InvalidResponse(result);\n }\n\n return result.result;\n};\n\n/**\n * Should be used to asynchronously send request\n *\n * @method sendAsync\n * @param {Object} data\n * @param {Function} callback\n */\nRequestManager.prototype.sendAsync = function (data, callback) {\n if (!this.provider) {\n return callback(errors.InvalidProvider());\n }\n\n var payload = Jsonrpc.getInstance().toPayload(data.method, data.params);\n this.provider.sendAsync(payload, function (err, result) {\n if (err) {\n return callback(err);\n }\n \n if (!Jsonrpc.getInstance().isValidResponse(result)) {\n return callback(errors.InvalidResponse(result));\n }\n\n callback(null, result.result);\n });\n};\n\n/**\n * Should be used to set provider of request manager\n *\n * @method setProvider\n * @param {Object}\n */\nRequestManager.prototype.setProvider = function (p) {\n this.provider = p;\n};\n\n/*jshint maxparams:4 */\n\n/**\n * Should be used to start polling\n *\n * @method startPolling\n * @param {Object} data\n * @param {Number} pollId\n * @param {Function} callback\n * @param {Function} uninstall\n *\n * @todo cleanup number of params\n */\nRequestManager.prototype.startPolling = function (data, pollId, callback, uninstall) {\n this.polls.push({data: data, id: pollId, callback: callback, uninstall: uninstall});\n};\n/*jshint maxparams:3 */\n\n/**\n * Should be used to stop polling for filter with given id\n *\n * @method stopPolling\n * @param {Number} pollId\n */\nRequestManager.prototype.stopPolling = function (pollId) {\n for (var i = this.polls.length; i--;) {\n var poll = this.polls[i];\n if (poll.id === pollId) {\n this.polls.splice(i, 1);\n }\n }\n};\n\n/**\n * Should be called to reset polling mechanism of request manager\n *\n * @method reset\n */\nRequestManager.prototype.reset = function () {\n this.polls.forEach(function (poll) {\n poll.uninstall(poll.id); \n });\n this.polls = [];\n\n if (this.timeout) {\n clearTimeout(this.timeout);\n this.timeout = null;\n }\n this.poll();\n};\n\n/**\n * Should be called to poll for changes on filter with given id\n *\n * @method poll\n */\nRequestManager.prototype.poll = function () {\n this.timeout = setTimeout(this.poll.bind(this), c.ETH_POLLING_TIMEOUT);\n\n if (!this.polls.length) {\n return;\n }\n\n if (!this.provider) {\n console.error(errors.InvalidProvider());\n return;\n }\n\n var payload = Jsonrpc.getInstance().toBatchPayload(this.polls.map(function (data) {\n return data.data;\n }));\n\n var self = this;\n this.provider.sendAsync(payload, function (error, results) {\n // TODO: console log?\n if (error) {\n return;\n }\n \n if (!utils.isArray(results)) {\n throw errors.InvalidResponse(results);\n }\n\n results.map(function (result, index) {\n result.callback = self.polls[index].callback;\n return result;\n }).filter(function (result) {\n var valid = Jsonrpc.getInstance().isValidResponse(result);\n if (!valid) {\n result.callback(errors.InvalidResponse(result));\n }\n return valid;\n }).filter(function (result) {\n return utils.isArray(result.result) && result.result.length > 0;\n }).forEach(function (result) {\n result.callback(null, result.result);\n });\n });\n};\n\nmodule.exports = RequestManager;\n\n", + "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** \n * @file requestmanager.js\n * @author Jeffrey Wilcke \n * @author Marek Kotewicz \n * @author Marian Oancea \n * @author Fabian Vogelsteller \n * @author Gav Wood \n * @date 2014\n */\n\nvar Jsonrpc = require('./jsonrpc');\nvar utils = require('../utils/utils');\nvar c = require('../utils/config');\nvar errors = require('./errors');\n\n/**\n * It's responsible for passing messages to providers\n * It's also responsible for polling the ethereum node for incoming messages\n * Default poll timeout is 1 second\n * Singleton\n */\nvar RequestManager = function (provider) {\n // singleton pattern\n if (arguments.callee._singletonInstance) {\n return arguments.callee._singletonInstance;\n }\n arguments.callee._singletonInstance = this;\n\n this.provider = provider;\n this.polls = [];\n this.timeout = null;\n this.poll();\n};\n\n/**\n * @return {RequestManager} singleton\n */\nRequestManager.getInstance = function () {\n var instance = new RequestManager();\n return instance;\n};\n\n/**\n * Should be used to synchronously send request\n *\n * @method send\n * @param {Object} data\n * @return {Object}\n */\nRequestManager.prototype.send = function (data) {\n if (!this.provider) {\n console.error(errors.InvalidProvider());\n return null;\n }\n\n var payload = Jsonrpc.getInstance().toPayload(data.method, data.params);\n var result = this.provider.send(payload);\n\n if (!Jsonrpc.getInstance().isValidResponse(result)) {\n throw errors.InvalidResponse(result);\n }\n\n return result.result;\n};\n\n/**\n * Should be used to asynchronously send request\n *\n * @method sendAsync\n * @param {Object} data\n * @param {Function} callback\n */\nRequestManager.prototype.sendAsync = function (data, callback) {\n if (!this.provider) {\n return callback(errors.InvalidProvider());\n }\n\n var payload = Jsonrpc.getInstance().toPayload(data.method, data.params);\n this.provider.sendAsync(payload, function (err, result) {\n if (err) {\n return callback(err);\n }\n \n if (!Jsonrpc.getInstance().isValidResponse(result)) {\n return callback(errors.InvalidResponse(result));\n }\n\n callback(null, result.result);\n });\n};\n\n/**\n * Should be called to asynchronously send batch request\n *\n * @method sendBatch\n * @param {Array} batch data\n * @param {Function} callback\n */\nRequestManager.prototype.sendBatch = function (data, callback) {\n if (!this.provider) {\n return callback(errors.InvalidProvider());\n }\n\n var payload = Jsonrpc.getInstance().toBatchPayload(data);\n\n this.provider.sendAsync(payload, function (err, results) {\n if (err) {\n return callback(err);\n }\n\n if (!utils.isArray(results)) {\n return callback(errors.InvalidResponse(results));\n }\n\n callback(err, results);\n }); \n};\n\n/**\n * Should be used to set provider of request manager\n *\n * @method setProvider\n * @param {Object}\n */\nRequestManager.prototype.setProvider = function (p) {\n this.provider = p;\n};\n\n/*jshint maxparams:4 */\n\n/**\n * Should be used to start polling\n *\n * @method startPolling\n * @param {Object} data\n * @param {Number} pollId\n * @param {Function} callback\n * @param {Function} uninstall\n *\n * @todo cleanup number of params\n */\nRequestManager.prototype.startPolling = function (data, pollId, callback, uninstall) {\n this.polls.push({data: data, id: pollId, callback: callback, uninstall: uninstall});\n};\n/*jshint maxparams:3 */\n\n/**\n * Should be used to stop polling for filter with given id\n *\n * @method stopPolling\n * @param {Number} pollId\n */\nRequestManager.prototype.stopPolling = function (pollId) {\n for (var i = this.polls.length; i--;) {\n var poll = this.polls[i];\n if (poll.id === pollId) {\n this.polls.splice(i, 1);\n }\n }\n};\n\n/**\n * Should be called to reset polling mechanism of request manager\n *\n * @method reset\n */\nRequestManager.prototype.reset = function () {\n this.polls.forEach(function (poll) {\n poll.uninstall(poll.id); \n });\n this.polls = [];\n\n if (this.timeout) {\n clearTimeout(this.timeout);\n this.timeout = null;\n }\n this.poll();\n};\n\n/**\n * Should be called to poll for changes on filter with given id\n *\n * @method poll\n */\nRequestManager.prototype.poll = function () {\n this.timeout = setTimeout(this.poll.bind(this), c.ETH_POLLING_TIMEOUT);\n\n if (!this.polls.length) {\n return;\n }\n\n if (!this.provider) {\n console.error(errors.InvalidProvider());\n return;\n }\n\n var payload = Jsonrpc.getInstance().toBatchPayload(this.polls.map(function (data) {\n return data.data;\n }));\n\n var self = this;\n this.provider.sendAsync(payload, function (error, results) {\n // TODO: console log?\n if (error) {\n return;\n }\n \n if (!utils.isArray(results)) {\n throw errors.InvalidResponse(results);\n }\n\n results.map(function (result, index) {\n result.callback = self.polls[index].callback;\n return result;\n }).filter(function (result) {\n var valid = Jsonrpc.getInstance().isValidResponse(result);\n if (!valid) {\n result.callback(errors.InvalidResponse(result));\n }\n return valid;\n }).filter(function (result) {\n return utils.isArray(result.result) && result.result.length > 0;\n }).forEach(function (result) {\n result.callback(null, result.result);\n });\n });\n};\n\nmodule.exports = RequestManager;\n\n", "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** @file shh.js\n * @authors:\n * Marek Kotewicz \n * @date 2015\n */\n\nvar Method = require('./method');\nvar formatters = require('./formatters');\n\nvar post = new Method({\n name: 'post', \n call: 'shh_post', \n params: 1,\n inputFormatter: [formatters.inputPostFormatter]\n});\n\nvar newIdentity = new Method({\n name: 'newIdentity',\n call: 'shh_newIdentity',\n params: 0\n});\n\nvar hasIdentity = new Method({\n name: 'hasIdentity',\n call: 'shh_hasIdentity',\n params: 1\n});\n\nvar newGroup = new Method({\n name: 'newGroup',\n call: 'shh_newGroup',\n params: 0\n});\n\nvar addToGroup = new Method({\n name: 'addToGroup',\n call: 'shh_addToGroup',\n params: 0\n});\n\nvar methods = [\n post,\n newIdentity,\n hasIdentity,\n newGroup,\n addToGroup\n];\n\nmodule.exports = {\n methods: methods\n};\n\n", - "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** @file watches.js\n * @authors:\n * Marek Kotewicz \n * @date 2015\n */\n\nvar Method = require('./method');\n\n/// @returns an array of objects describing web3.eth.filter api methods\nvar eth = function () {\n var newFilterCall = function (args) {\n return typeof args[0] === 'string' ? 'eth_newBlockFilter' : 'eth_newFilter';\n };\n\n var newFilter = new Method({\n name: 'newFilter',\n call: newFilterCall,\n params: 1\n });\n\n var uninstallFilter = new Method({\n name: 'uninstallFilter',\n call: 'eth_uninstallFilter',\n params: 1\n });\n\n var getLogs = new Method({\n name: 'getLogs',\n call: 'eth_getFilterLogs',\n params: 1\n });\n\n var poll = new Method({\n name: 'poll',\n call: 'eth_getFilterChanges',\n params: 1\n });\n\n return [\n newFilter,\n uninstallFilter,\n getLogs,\n poll\n ];\n};\n\n/// @returns an array of objects describing web3.shh.watch api methods\nvar shh = function () {\n var newFilter = new Method({\n name: 'newFilter',\n call: 'shh_newFilter',\n params: 1\n });\n\n var uninstallFilter = new Method({\n name: 'uninstallFilter',\n call: 'shh_uninstallFilter',\n params: 1\n });\n\n var getLogs = new Method({\n name: 'getLogs',\n call: 'shh_getMessages',\n params: 1\n });\n\n var poll = new Method({\n name: 'poll',\n call: 'shh_getFilterChanges',\n params: 1\n });\n\n return [\n newFilter,\n uninstallFilter,\n getLogs,\n poll\n ];\n};\n\nmodule.exports = {\n eth: eth,\n shh: shh\n};\n\n", + "/*\n This file is part of ethereum.js.\n\n ethereum.js is free software: you can redistribute it and/or modify\n it under the terms of the GNU Lesser General Public License as published by\n the Free Software Foundation, either version 3 of the License, or\n (at your option) any later version.\n\n ethereum.js is distributed in the hope that it will be useful,\n but WITHOUT ANY WARRANTY; without even the implied warranty of\n MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n GNU Lesser General Public License for more details.\n\n You should have received a copy of the GNU Lesser General Public License\n along with ethereum.js. If not, see .\n*/\n/** @file watches.js\n * @authors:\n * Marek Kotewicz \n * @date 2015\n */\n\nvar Method = require('./method');\n\n/// @returns an array of objects describing web3.eth.filter api methods\nvar eth = function () {\n var newFilterCall = function (args) {\n var type = args[0];\n\n switch(type) {\n case 'latest':\n args.pop();\n this.params = 0;\n return 'eth_newBlockFilter';\n case 'pending':\n args.pop();\n this.params = 0;\n return 'eth_newPendingTransactionFilter';\n default:\n return 'eth_newFilter';\n }\n };\n\n var newFilter = new Method({\n name: 'newFilter',\n call: newFilterCall,\n params: 1\n });\n\n var uninstallFilter = new Method({\n name: 'uninstallFilter',\n call: 'eth_uninstallFilter',\n params: 1\n });\n\n var getLogs = new Method({\n name: 'getLogs',\n call: 'eth_getFilterLogs',\n params: 1\n });\n\n var poll = new Method({\n name: 'poll',\n call: 'eth_getFilterChanges',\n params: 1\n });\n\n return [\n newFilter,\n uninstallFilter,\n getLogs,\n poll\n ];\n};\n\n/// @returns an array of objects describing web3.shh.watch api methods\nvar shh = function () {\n var newFilter = new Method({\n name: 'newFilter',\n call: 'shh_newFilter',\n params: 1\n });\n\n var uninstallFilter = new Method({\n name: 'uninstallFilter',\n call: 'shh_uninstallFilter',\n params: 1\n });\n\n var getLogs = new Method({\n name: 'getLogs',\n call: 'shh_getMessages',\n params: 1\n });\n\n var poll = new Method({\n name: 'poll',\n call: 'shh_getFilterChanges',\n params: 1\n });\n\n return [\n newFilter,\n uninstallFilter,\n getLogs,\n poll\n ];\n};\n\nmodule.exports = {\n eth: eth,\n shh: shh\n};\n\n", null, "/*! bignumber.js v2.0.7 https://github.com/MikeMcl/bignumber.js/LICENCE */\n\n;(function (global) {\n 'use strict';\n\n /*\n bignumber.js v2.0.7\n A JavaScript library for arbitrary-precision arithmetic.\n https://github.com/MikeMcl/bignumber.js\n Copyright (c) 2015 Michael Mclaughlin \n MIT Expat Licence\n */\n\n\n var BigNumber, crypto, parseNumeric,\n isNumeric = /^-?(\\d+(\\.\\d*)?|\\.\\d+)(e[+-]?\\d+)?$/i,\n mathceil = Math.ceil,\n mathfloor = Math.floor,\n notBool = ' not a boolean or binary digit',\n roundingMode = 'rounding mode',\n tooManyDigits = 'number type has more than 15 significant digits',\n ALPHABET = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_',\n BASE = 1e14,\n LOG_BASE = 14,\n MAX_SAFE_INTEGER = 0x1fffffffffffff, // 2^53 - 1\n // MAX_INT32 = 0x7fffffff, // 2^31 - 1\n POWS_TEN = [1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13],\n SQRT_BASE = 1e7,\n\n /*\n * The limit on the value of DECIMAL_PLACES, TO_EXP_NEG, TO_EXP_POS, MIN_EXP, MAX_EXP, and\n * the arguments to toExponential, toFixed, toFormat, and toPrecision, beyond which an\n * exception is thrown (if ERRORS is true).\n */\n MAX = 1E9; // 0 to MAX_INT32\n\n\n /*\n * Create and return a BigNumber constructor.\n */\n function another(configObj) {\n var div,\n\n // id tracks the caller function, so its name can be included in error messages.\n id = 0,\n P = BigNumber.prototype,\n ONE = new BigNumber(1),\n\n\n /********************************* EDITABLE DEFAULTS **********************************/\n\n\n /*\n * The default values below must be integers within the inclusive ranges stated.\n * The values can also be changed at run-time using BigNumber.config.\n */\n\n // The maximum number of decimal places for operations involving division.\n DECIMAL_PLACES = 20, // 0 to MAX\n\n /*\n * The rounding mode used when rounding to the above decimal places, and when using\n * toExponential, toFixed, toFormat and toPrecision, and round (default value).\n * UP 0 Away from zero.\n * DOWN 1 Towards zero.\n * CEIL 2 Towards +Infinity.\n * FLOOR 3 Towards -Infinity.\n * HALF_UP 4 Towards nearest neighbour. If equidistant, up.\n * HALF_DOWN 5 Towards nearest neighbour. If equidistant, down.\n * HALF_EVEN 6 Towards nearest neighbour. If equidistant, towards even neighbour.\n * HALF_CEIL 7 Towards nearest neighbour. If equidistant, towards +Infinity.\n * HALF_FLOOR 8 Towards nearest neighbour. If equidistant, towards -Infinity.\n */\n ROUNDING_MODE = 4, // 0 to 8\n\n // EXPONENTIAL_AT : [TO_EXP_NEG , TO_EXP_POS]\n\n // The exponent value at and beneath which toString returns exponential notation.\n // Number type: -7\n TO_EXP_NEG = -7, // 0 to -MAX\n\n // The exponent value at and above which toString returns exponential notation.\n // Number type: 21\n TO_EXP_POS = 21, // 0 to MAX\n\n // RANGE : [MIN_EXP, MAX_EXP]\n\n // The minimum exponent value, beneath which underflow to zero occurs.\n // Number type: -324 (5e-324)\n MIN_EXP = -1e7, // -1 to -MAX\n\n // The maximum exponent value, above which overflow to Infinity occurs.\n // Number type: 308 (1.7976931348623157e+308)\n // For MAX_EXP > 1e7, e.g. new BigNumber('1e100000000').plus(1) may be slow.\n MAX_EXP = 1e7, // 1 to MAX\n\n // Whether BigNumber Errors are ever thrown.\n ERRORS = true, // true or false\n\n // Change to intValidatorNoErrors if ERRORS is false.\n isValidInt = intValidatorWithErrors, // intValidatorWithErrors/intValidatorNoErrors\n\n // Whether to use cryptographically-secure random number generation, if available.\n CRYPTO = false, // true or false\n\n /*\n * The modulo mode used when calculating the modulus: a mod n.\n * The quotient (q = a / n) is calculated according to the corresponding rounding mode.\n * The remainder (r) is calculated as: r = a - n * q.\n *\n * UP 0 The remainder is positive if the dividend is negative, else is negative.\n * DOWN 1 The remainder has the same sign as the dividend.\n * This modulo mode is commonly known as 'truncated division' and is\n * equivalent to (a % n) in JavaScript.\n * FLOOR 3 The remainder has the same sign as the divisor (Python %).\n * HALF_EVEN 6 This modulo mode implements the IEEE 754 remainder function.\n * EUCLID 9 Euclidian division. q = sign(n) * floor(a / abs(n)).\n * The remainder is always positive.\n *\n * The truncated division, floored division, Euclidian division and IEEE 754 remainder\n * modes are commonly used for the modulus operation.\n * Although the other rounding modes can also be used, they may not give useful results.\n */\n MODULO_MODE = 1, // 0 to 9\n\n // The maximum number of significant digits of the result of the toPower operation.\n // If POW_PRECISION is 0, there will be unlimited significant digits.\n POW_PRECISION = 100, // 0 to MAX\n\n // The format specification used by the BigNumber.prototype.toFormat method.\n FORMAT = {\n decimalSeparator: '.',\n groupSeparator: ',',\n groupSize: 3,\n secondaryGroupSize: 0,\n fractionGroupSeparator: '\\xA0', // non-breaking space\n fractionGroupSize: 0\n };\n\n\n /******************************************************************************************/\n\n\n // CONSTRUCTOR\n\n\n /*\n * The BigNumber constructor and exported function.\n * Create and return a new instance of a BigNumber object.\n *\n * n {number|string|BigNumber} A numeric value.\n * [b] {number} The base of n. Integer, 2 to 64 inclusive.\n */\n function BigNumber( n, b ) {\n var c, e, i, num, len, str,\n x = this;\n\n // Enable constructor usage without new.\n if ( !( x instanceof BigNumber ) ) {\n\n // 'BigNumber() constructor call without new: {n}'\n if (ERRORS) raise( 26, 'constructor call without new', n );\n return new BigNumber( n, b );\n }\n\n // 'new BigNumber() base not an integer: {b}'\n // 'new BigNumber() base out of range: {b}'\n if ( b == null || !isValidInt( b, 2, 64, id, 'base' ) ) {\n\n // Duplicate.\n if ( n instanceof BigNumber ) {\n x.s = n.s;\n x.e = n.e;\n x.c = ( n = n.c ) ? n.slice() : n;\n id = 0;\n return;\n }\n\n if ( ( num = typeof n == 'number' ) && n * 0 == 0 ) {\n x.s = 1 / n < 0 ? ( n = -n, -1 ) : 1;\n\n // Fast path for integers.\n if ( n === ~~n ) {\n for ( e = 0, i = n; i >= 10; i /= 10, e++ );\n x.e = e;\n x.c = [n];\n id = 0;\n return;\n }\n\n str = n + '';\n } else {\n if ( !isNumeric.test( str = n + '' ) ) return parseNumeric( x, str, num );\n x.s = str.charCodeAt(0) === 45 ? ( str = str.slice(1), -1 ) : 1;\n }\n } else {\n b = b | 0;\n str = n + '';\n\n // Ensure return value is rounded to DECIMAL_PLACES as with other bases.\n // Allow exponential notation to be used with base 10 argument.\n if ( b == 10 ) {\n x = new BigNumber( n instanceof BigNumber ? n : str );\n return round( x, DECIMAL_PLACES + x.e + 1, ROUNDING_MODE );\n }\n\n // Avoid potential interpretation of Infinity and NaN as base 44+ values.\n // Any number in exponential form will fail due to the [Ee][+-].\n if ( ( num = typeof n == 'number' ) && n * 0 != 0 ||\n !( new RegExp( '^-?' + ( c = '[' + ALPHABET.slice( 0, b ) + ']+' ) +\n '(?:\\\\.' + c + ')?$',b < 37 ? 'i' : '' ) ).test(str) ) {\n return parseNumeric( x, str, num, b );\n }\n\n if (num) {\n x.s = 1 / n < 0 ? ( str = str.slice(1), -1 ) : 1;\n\n if ( ERRORS && str.replace( /^0\\.0*|\\./, '' ).length > 15 ) {\n\n // 'new BigNumber() number type has more than 15 significant digits: {n}'\n raise( id, tooManyDigits, n );\n }\n\n // Prevent later check for length on converted number.\n num = false;\n } else {\n x.s = str.charCodeAt(0) === 45 ? ( str = str.slice(1), -1 ) : 1;\n }\n\n str = convertBase( str, 10, b, x.s );\n }\n\n // Decimal point?\n if ( ( e = str.indexOf('.') ) > -1 ) str = str.replace( '.', '' );\n\n // Exponential form?\n if ( ( i = str.search( /e/i ) ) > 0 ) {\n\n // Determine exponent.\n if ( e < 0 ) e = i;\n e += +str.slice( i + 1 );\n str = str.substring( 0, i );\n } else if ( e < 0 ) {\n\n // Integer.\n e = str.length;\n }\n\n // Determine leading zeros.\n for ( i = 0; str.charCodeAt(i) === 48; i++ );\n\n // Determine trailing zeros.\n for ( len = str.length; str.charCodeAt(--len) === 48; );\n str = str.slice( i, len + 1 );\n\n if (str) {\n len = str.length;\n\n // Disallow numbers with over 15 significant digits if number type.\n // 'new BigNumber() number type has more than 15 significant digits: {n}'\n if ( num && ERRORS && len > 15 ) raise( id, tooManyDigits, x.s * n );\n\n e = e - i - 1;\n\n // Overflow?\n if ( e > MAX_EXP ) {\n\n // Infinity.\n x.c = x.e = null;\n\n // Underflow?\n } else if ( e < MIN_EXP ) {\n\n // Zero.\n x.c = [ x.e = 0 ];\n } else {\n x.e = e;\n x.c = [];\n\n // Transform base\n\n // e is the base 10 exponent.\n // i is where to slice str to get the first element of the coefficient array.\n i = ( e + 1 ) % LOG_BASE;\n if ( e < 0 ) i += LOG_BASE;\n\n if ( i < len ) {\n if (i) x.c.push( +str.slice( 0, i ) );\n\n for ( len -= LOG_BASE; i < len; ) {\n x.c.push( +str.slice( i, i += LOG_BASE ) );\n }\n\n str = str.slice(i);\n i = LOG_BASE - str.length;\n } else {\n i -= len;\n }\n\n for ( ; i--; str += '0' );\n x.c.push( +str );\n }\n } else {\n\n // Zero.\n x.c = [ x.e = 0 ];\n }\n\n id = 0;\n }\n\n\n // CONSTRUCTOR PROPERTIES\n\n\n BigNumber.another = another;\n\n BigNumber.ROUND_UP = 0;\n BigNumber.ROUND_DOWN = 1;\n BigNumber.ROUND_CEIL = 2;\n BigNumber.ROUND_FLOOR = 3;\n BigNumber.ROUND_HALF_UP = 4;\n BigNumber.ROUND_HALF_DOWN = 5;\n BigNumber.ROUND_HALF_EVEN = 6;\n BigNumber.ROUND_HALF_CEIL = 7;\n BigNumber.ROUND_HALF_FLOOR = 8;\n BigNumber.EUCLID = 9;\n\n\n /*\n * Configure infrequently-changing library-wide settings.\n *\n * Accept an object or an argument list, with one or many of the following properties or\n * parameters respectively:\n *\n * DECIMAL_PLACES {number} Integer, 0 to MAX inclusive\n * ROUNDING_MODE {number} Integer, 0 to 8 inclusive\n * EXPONENTIAL_AT {number|number[]} Integer, -MAX to MAX inclusive or\n * [integer -MAX to 0 incl., 0 to MAX incl.]\n * RANGE {number|number[]} Non-zero integer, -MAX to MAX inclusive or\n * [integer -MAX to -1 incl., integer 1 to MAX incl.]\n * ERRORS {boolean|number} true, false, 1 or 0\n * CRYPTO {boolean|number} true, false, 1 or 0\n * MODULO_MODE {number} 0 to 9 inclusive\n * POW_PRECISION {number} 0 to MAX inclusive\n * FORMAT {object} See BigNumber.prototype.toFormat\n * decimalSeparator {string}\n * groupSeparator {string}\n * groupSize {number}\n * secondaryGroupSize {number}\n * fractionGroupSeparator {string}\n * fractionGroupSize {number}\n *\n * (The values assigned to the above FORMAT object properties are not checked for validity.)\n *\n * E.g.\n * BigNumber.config(20, 4) is equivalent to\n * BigNumber.config({ DECIMAL_PLACES : 20, ROUNDING_MODE : 4 })\n *\n * Ignore properties/parameters set to null or undefined.\n * Return an object with the properties current values.\n */\n BigNumber.config = function () {\n var v, p,\n i = 0,\n r = {},\n a = arguments,\n o = a[0],\n has = o && typeof o == 'object'\n ? function () { if ( o.hasOwnProperty(p) ) return ( v = o[p] ) != null; }\n : function () { if ( a.length > i ) return ( v = a[i++] ) != null; };\n\n // DECIMAL_PLACES {number} Integer, 0 to MAX inclusive.\n // 'config() DECIMAL_PLACES not an integer: {v}'\n // 'config() DECIMAL_PLACES out of range: {v}'\n if ( has( p = 'DECIMAL_PLACES' ) && isValidInt( v, 0, MAX, 2, p ) ) {\n DECIMAL_PLACES = v | 0;\n }\n r[p] = DECIMAL_PLACES;\n\n // ROUNDING_MODE {number} Integer, 0 to 8 inclusive.\n // 'config() ROUNDING_MODE not an integer: {v}'\n // 'config() ROUNDING_MODE out of range: {v}'\n if ( has( p = 'ROUNDING_MODE' ) && isValidInt( v, 0, 8, 2, p ) ) {\n ROUNDING_MODE = v | 0;\n }\n r[p] = ROUNDING_MODE;\n\n // EXPONENTIAL_AT {number|number[]}\n // Integer, -MAX to MAX inclusive or [integer -MAX to 0 inclusive, 0 to MAX inclusive].\n // 'config() EXPONENTIAL_AT not an integer: {v}'\n // 'config() EXPONENTIAL_AT out of range: {v}'\n if ( has( p = 'EXPONENTIAL_AT' ) ) {\n\n if ( isArray(v) ) {\n if ( isValidInt( v[0], -MAX, 0, 2, p ) && isValidInt( v[1], 0, MAX, 2, p ) ) {\n TO_EXP_NEG = v[0] | 0;\n TO_EXP_POS = v[1] | 0;\n }\n } else if ( isValidInt( v, -MAX, MAX, 2, p ) ) {\n TO_EXP_NEG = -( TO_EXP_POS = ( v < 0 ? -v : v ) | 0 );\n }\n }\n r[p] = [ TO_EXP_NEG, TO_EXP_POS ];\n\n // RANGE {number|number[]} Non-zero integer, -MAX to MAX inclusive or\n // [integer -MAX to -1 inclusive, integer 1 to MAX inclusive].\n // 'config() RANGE not an integer: {v}'\n // 'config() RANGE cannot be zero: {v}'\n // 'config() RANGE out of range: {v}'\n if ( has( p = 'RANGE' ) ) {\n\n if ( isArray(v) ) {\n if ( isValidInt( v[0], -MAX, -1, 2, p ) && isValidInt( v[1], 1, MAX, 2, p ) ) {\n MIN_EXP = v[0] | 0;\n MAX_EXP = v[1] | 0;\n }\n } else if ( isValidInt( v, -MAX, MAX, 2, p ) ) {\n if ( v | 0 ) MIN_EXP = -( MAX_EXP = ( v < 0 ? -v : v ) | 0 );\n else if (ERRORS) raise( 2, p + ' cannot be zero', v );\n }\n }\n r[p] = [ MIN_EXP, MAX_EXP ];\n\n // ERRORS {boolean|number} true, false, 1 or 0.\n // 'config() ERRORS not a boolean or binary digit: {v}'\n if ( has( p = 'ERRORS' ) ) {\n\n if ( v === !!v || v === 1 || v === 0 ) {\n id = 0;\n isValidInt = ( ERRORS = !!v ) ? intValidatorWithErrors : intValidatorNoErrors;\n } else if (ERRORS) {\n raise( 2, p + notBool, v );\n }\n }\n r[p] = ERRORS;\n\n // CRYPTO {boolean|number} true, false, 1 or 0.\n // 'config() CRYPTO not a boolean or binary digit: {v}'\n // 'config() crypto unavailable: {crypto}'\n if ( has( p = 'CRYPTO' ) ) {\n\n if ( v === !!v || v === 1 || v === 0 ) {\n CRYPTO = !!( v && crypto && typeof crypto == 'object' );\n if ( v && !CRYPTO && ERRORS ) raise( 2, 'crypto unavailable', crypto );\n } else if (ERRORS) {\n raise( 2, p + notBool, v );\n }\n }\n r[p] = CRYPTO;\n\n // MODULO_MODE {number} Integer, 0 to 9 inclusive.\n // 'config() MODULO_MODE not an integer: {v}'\n // 'config() MODULO_MODE out of range: {v}'\n if ( has( p = 'MODULO_MODE' ) && isValidInt( v, 0, 9, 2, p ) ) {\n MODULO_MODE = v | 0;\n }\n r[p] = MODULO_MODE;\n\n // POW_PRECISION {number} Integer, 0 to MAX inclusive.\n // 'config() POW_PRECISION not an integer: {v}'\n // 'config() POW_PRECISION out of range: {v}'\n if ( has( p = 'POW_PRECISION' ) && isValidInt( v, 0, MAX, 2, p ) ) {\n POW_PRECISION = v | 0;\n }\n r[p] = POW_PRECISION;\n\n // FORMAT {object}\n // 'config() FORMAT not an object: {v}'\n if ( has( p = 'FORMAT' ) ) {\n\n if ( typeof v == 'object' ) {\n FORMAT = v;\n } else if (ERRORS) {\n raise( 2, p + ' not an object', v );\n }\n }\n r[p] = FORMAT;\n\n return r;\n };\n\n\n /*\n * Return a new BigNumber whose value is the maximum of the arguments.\n *\n * arguments {number|string|BigNumber}\n */\n BigNumber.max = function () { return maxOrMin( arguments, P.lt ); };\n\n\n /*\n * Return a new BigNumber whose value is the minimum of the arguments.\n *\n * arguments {number|string|BigNumber}\n */\n BigNumber.min = function () { return maxOrMin( arguments, P.gt ); };\n\n\n /*\n * Return a new BigNumber with a random value equal to or greater than 0 and less than 1,\n * and with dp, or DECIMAL_PLACES if dp is omitted, decimal places (or less if trailing\n * zeros are produced).\n *\n * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.\n *\n * 'random() decimal places not an integer: {dp}'\n * 'random() decimal places out of range: {dp}'\n * 'random() crypto unavailable: {crypto}'\n */\n BigNumber.random = (function () {\n var pow2_53 = 0x20000000000000;\n\n // Return a 53 bit integer n, where 0 <= n < 9007199254740992.\n // Check if Math.random() produces more than 32 bits of randomness.\n // If it does, assume at least 53 bits are produced, otherwise assume at least 30 bits.\n // 0x40000000 is 2^30, 0x800000 is 2^23, 0x1fffff is 2^21 - 1.\n var random53bitInt = (Math.random() * pow2_53) & 0x1fffff\n ? function () { return mathfloor( Math.random() * pow2_53 ); }\n : function () { return ((Math.random() * 0x40000000 | 0) * 0x800000) +\n (Math.random() * 0x800000 | 0); };\n\n return function (dp) {\n var a, b, e, k, v,\n i = 0,\n c = [],\n rand = new BigNumber(ONE);\n\n dp = dp == null || !isValidInt( dp, 0, MAX, 14 ) ? DECIMAL_PLACES : dp | 0;\n k = mathceil( dp / LOG_BASE );\n\n if (CRYPTO) {\n\n // Browsers supporting crypto.getRandomValues.\n if ( crypto && crypto.getRandomValues ) {\n\n a = crypto.getRandomValues( new Uint32Array( k *= 2 ) );\n\n for ( ; i < k; ) {\n\n // 53 bits:\n // ((Math.pow(2, 32) - 1) * Math.pow(2, 21)).toString(2)\n // 11111 11111111 11111111 11111111 11100000 00000000 00000000\n // ((Math.pow(2, 32) - 1) >>> 11).toString(2)\n // 11111 11111111 11111111\n // 0x20000 is 2^21.\n v = a[i] * 0x20000 + (a[i + 1] >>> 11);\n\n // Rejection sampling:\n // 0 <= v < 9007199254740992\n // Probability that v >= 9e15, is\n // 7199254740992 / 9007199254740992 ~= 0.0008, i.e. 1 in 1251\n if ( v >= 9e15 ) {\n b = crypto.getRandomValues( new Uint32Array(2) );\n a[i] = b[0];\n a[i + 1] = b[1];\n } else {\n\n // 0 <= v <= 8999999999999999\n // 0 <= (v % 1e14) <= 99999999999999\n c.push( v % 1e14 );\n i += 2;\n }\n }\n i = k / 2;\n\n // Node.js supporting crypto.randomBytes.\n } else if ( crypto && crypto.randomBytes ) {\n\n // buffer\n a = crypto.randomBytes( k *= 7 );\n\n for ( ; i < k; ) {\n\n // 0x1000000000000 is 2^48, 0x10000000000 is 2^40\n // 0x100000000 is 2^32, 0x1000000 is 2^24\n // 11111 11111111 11111111 11111111 11111111 11111111 11111111\n // 0 <= v < 9007199254740992\n v = ( ( a[i] & 31 ) * 0x1000000000000 ) + ( a[i + 1] * 0x10000000000 ) +\n ( a[i + 2] * 0x100000000 ) + ( a[i + 3] * 0x1000000 ) +\n ( a[i + 4] << 16 ) + ( a[i + 5] << 8 ) + a[i + 6];\n\n if ( v >= 9e15 ) {\n crypto.randomBytes(7).copy( a, i );\n } else {\n\n // 0 <= (v % 1e14) <= 99999999999999\n c.push( v % 1e14 );\n i += 7;\n }\n }\n i = k / 7;\n } else if (ERRORS) {\n raise( 14, 'crypto unavailable', crypto );\n }\n }\n\n // Use Math.random: CRYPTO is false or crypto is unavailable and ERRORS is false.\n if (!i) {\n\n for ( ; i < k; ) {\n v = random53bitInt();\n if ( v < 9e15 ) c[i++] = v % 1e14;\n }\n }\n\n k = c[--i];\n dp %= LOG_BASE;\n\n // Convert trailing digits to zeros according to dp.\n if ( k && dp ) {\n v = POWS_TEN[LOG_BASE - dp];\n c[i] = mathfloor( k / v ) * v;\n }\n\n // Remove trailing elements which are zero.\n for ( ; c[i] === 0; c.pop(), i-- );\n\n // Zero?\n if ( i < 0 ) {\n c = [ e = 0 ];\n } else {\n\n // Remove leading elements which are zero and adjust exponent accordingly.\n for ( e = -1 ; c[0] === 0; c.shift(), e -= LOG_BASE);\n\n // Count the digits of the first element of c to determine leading zeros, and...\n for ( i = 1, v = c[0]; v >= 10; v /= 10, i++);\n\n // adjust the exponent accordingly.\n if ( i < LOG_BASE ) e -= LOG_BASE - i;\n }\n\n rand.e = e;\n rand.c = c;\n return rand;\n };\n })();\n\n\n // PRIVATE FUNCTIONS\n\n\n // Convert a numeric string of baseIn to a numeric string of baseOut.\n function convertBase( str, baseOut, baseIn, sign ) {\n var d, e, k, r, x, xc, y,\n i = str.indexOf( '.' ),\n dp = DECIMAL_PLACES,\n rm = ROUNDING_MODE;\n\n if ( baseIn < 37 ) str = str.toLowerCase();\n\n // Non-integer.\n if ( i >= 0 ) {\n k = POW_PRECISION;\n\n // Unlimited precision.\n POW_PRECISION = 0;\n str = str.replace( '.', '' );\n y = new BigNumber(baseIn);\n x = y.pow( str.length - i );\n POW_PRECISION = k;\n\n // Convert str as if an integer, then restore the fraction part by dividing the\n // result by its base raised to a power.\n y.c = toBaseOut( toFixedPoint( coeffToString( x.c ), x.e ), 10, baseOut );\n y.e = y.c.length;\n }\n\n // Convert the number as integer.\n xc = toBaseOut( str, baseIn, baseOut );\n e = k = xc.length;\n\n // Remove trailing zeros.\n for ( ; xc[--k] == 0; xc.pop() );\n if ( !xc[0] ) return '0';\n\n if ( i < 0 ) {\n --e;\n } else {\n x.c = xc;\n x.e = e;\n\n // sign is needed for correct rounding.\n x.s = sign;\n x = div( x, y, dp, rm, baseOut );\n xc = x.c;\n r = x.r;\n e = x.e;\n }\n\n d = e + dp + 1;\n\n // The rounding digit, i.e. the digit to the right of the digit that may be rounded up.\n i = xc[d];\n k = baseOut / 2;\n r = r || d < 0 || xc[d + 1] != null;\n\n r = rm < 4 ? ( i != null || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\n : i > k || i == k &&( rm == 4 || r || rm == 6 && xc[d - 1] & 1 ||\n rm == ( x.s < 0 ? 8 : 7 ) );\n\n if ( d < 1 || !xc[0] ) {\n\n // 1^-dp or 0.\n str = r ? toFixedPoint( '1', -dp ) : '0';\n } else {\n xc.length = d;\n\n if (r) {\n\n // Rounding up may mean the previous digit has to be rounded up and so on.\n for ( --baseOut; ++xc[--d] > baseOut; ) {\n xc[d] = 0;\n\n if ( !d ) {\n ++e;\n xc.unshift(1);\n }\n }\n }\n\n // Determine trailing zeros.\n for ( k = xc.length; !xc[--k]; );\n\n // E.g. [4, 11, 15] becomes 4bf.\n for ( i = 0, str = ''; i <= k; str += ALPHABET.charAt( xc[i++] ) );\n str = toFixedPoint( str, e );\n }\n\n // The caller will add the sign.\n return str;\n }\n\n\n // Perform division in the specified base. Called by div and convertBase.\n div = (function () {\n\n // Assume non-zero x and k.\n function multiply( x, k, base ) {\n var m, temp, xlo, xhi,\n carry = 0,\n i = x.length,\n klo = k % SQRT_BASE,\n khi = k / SQRT_BASE | 0;\n\n for ( x = x.slice(); i--; ) {\n xlo = x[i] % SQRT_BASE;\n xhi = x[i] / SQRT_BASE | 0;\n m = khi * xlo + xhi * klo;\n temp = klo * xlo + ( ( m % SQRT_BASE ) * SQRT_BASE ) + carry;\n carry = ( temp / base | 0 ) + ( m / SQRT_BASE | 0 ) + khi * xhi;\n x[i] = temp % base;\n }\n\n if (carry) x.unshift(carry);\n\n return x;\n }\n\n function compare( a, b, aL, bL ) {\n var i, cmp;\n\n if ( aL != bL ) {\n cmp = aL > bL ? 1 : -1;\n } else {\n\n for ( i = cmp = 0; i < aL; i++ ) {\n\n if ( a[i] != b[i] ) {\n cmp = a[i] > b[i] ? 1 : -1;\n break;\n }\n }\n }\n return cmp;\n }\n\n function subtract( a, b, aL, base ) {\n var i = 0;\n\n // Subtract b from a.\n for ( ; aL--; ) {\n a[aL] -= i;\n i = a[aL] < b[aL] ? 1 : 0;\n a[aL] = i * base + a[aL] - b[aL];\n }\n\n // Remove leading zeros.\n for ( ; !a[0] && a.length > 1; a.shift() );\n }\n\n // x: dividend, y: divisor.\n return function ( x, y, dp, rm, base ) {\n var cmp, e, i, more, n, prod, prodL, q, qc, rem, remL, rem0, xi, xL, yc0,\n yL, yz,\n s = x.s == y.s ? 1 : -1,\n xc = x.c,\n yc = y.c;\n\n // Either NaN, Infinity or 0?\n if ( !xc || !xc[0] || !yc || !yc[0] ) {\n\n return new BigNumber(\n\n // Return NaN if either NaN, or both Infinity or 0.\n !x.s || !y.s || ( xc ? yc && xc[0] == yc[0] : !yc ) ? NaN :\n\n // Return ±0 if x is ±0 or y is ±Infinity, or return ±Infinity as y is ±0.\n xc && xc[0] == 0 || !yc ? s * 0 : s / 0\n );\n }\n\n q = new BigNumber(s);\n qc = q.c = [];\n e = x.e - y.e;\n s = dp + e + 1;\n\n if ( !base ) {\n base = BASE;\n e = bitFloor( x.e / LOG_BASE ) - bitFloor( y.e / LOG_BASE );\n s = s / LOG_BASE | 0;\n }\n\n // Result exponent may be one less then the current value of e.\n // The coefficients of the BigNumbers from convertBase may have trailing zeros.\n for ( i = 0; yc[i] == ( xc[i] || 0 ); i++ );\n if ( yc[i] > ( xc[i] || 0 ) ) e--;\n\n if ( s < 0 ) {\n qc.push(1);\n more = true;\n } else {\n xL = xc.length;\n yL = yc.length;\n i = 0;\n s += 2;\n\n // Normalise xc and yc so highest order digit of yc is >= base / 2.\n\n n = mathfloor( base / ( yc[0] + 1 ) );\n\n // Not necessary, but to handle odd bases where yc[0] == ( base / 2 ) - 1.\n // if ( n > 1 || n++ == 1 && yc[0] < base / 2 ) {\n if ( n > 1 ) {\n yc = multiply( yc, n, base );\n xc = multiply( xc, n, base );\n yL = yc.length;\n xL = xc.length;\n }\n\n xi = yL;\n rem = xc.slice( 0, yL );\n remL = rem.length;\n\n // Add zeros to make remainder as long as divisor.\n for ( ; remL < yL; rem[remL++] = 0 );\n yz = yc.slice();\n yz.unshift(0);\n yc0 = yc[0];\n if ( yc[1] >= base / 2 ) yc0++;\n // Not necessary, but to prevent trial digit n > base, when using base 3.\n // else if ( base == 3 && yc0 == 1 ) yc0 = 1 + 1e-15;\n\n do {\n n = 0;\n\n // Compare divisor and remainder.\n cmp = compare( yc, rem, yL, remL );\n\n // If divisor < remainder.\n if ( cmp < 0 ) {\n\n // Calculate trial digit, n.\n\n rem0 = rem[0];\n if ( yL != remL ) rem0 = rem0 * base + ( rem[1] || 0 );\n\n // n is how many times the divisor goes into the current remainder.\n n = mathfloor( rem0 / yc0 );\n\n // Algorithm:\n // 1. product = divisor * trial digit (n)\n // 2. if product > remainder: product -= divisor, n--\n // 3. remainder -= product\n // 4. if product was < remainder at 2:\n // 5. compare new remainder and divisor\n // 6. If remainder > divisor: remainder -= divisor, n++\n\n if ( n > 1 ) {\n\n // n may be > base only when base is 3.\n if (n >= base) n = base - 1;\n\n // product = divisor * trial digit.\n prod = multiply( yc, n, base );\n prodL = prod.length;\n remL = rem.length;\n\n // Compare product and remainder.\n // If product > remainder.\n // Trial digit n too high.\n // n is 1 too high about 5% of the time, and is not known to have\n // ever been more than 1 too high.\n while ( compare( prod, rem, prodL, remL ) == 1 ) {\n n--;\n\n // Subtract divisor from product.\n subtract( prod, yL < prodL ? yz : yc, prodL, base );\n prodL = prod.length;\n cmp = 1;\n }\n } else {\n\n // n is 0 or 1, cmp is -1.\n // If n is 0, there is no need to compare yc and rem again below,\n // so change cmp to 1 to avoid it.\n // If n is 1, leave cmp as -1, so yc and rem are compared again.\n if ( n == 0 ) {\n\n // divisor < remainder, so n must be at least 1.\n cmp = n = 1;\n }\n\n // product = divisor\n prod = yc.slice();\n prodL = prod.length;\n }\n\n if ( prodL < remL ) prod.unshift(0);\n\n // Subtract product from remainder.\n subtract( rem, prod, remL, base );\n remL = rem.length;\n\n // If product was < remainder.\n if ( cmp == -1 ) {\n\n // Compare divisor and new remainder.\n // If divisor < new remainder, subtract divisor from remainder.\n // Trial digit n too low.\n // n is 1 too low about 5% of the time, and very rarely 2 too low.\n while ( compare( yc, rem, yL, remL ) < 1 ) {\n n++;\n\n // Subtract divisor from remainder.\n subtract( rem, yL < remL ? yz : yc, remL, base );\n remL = rem.length;\n }\n }\n } else if ( cmp === 0 ) {\n n++;\n rem = [0];\n } // else cmp === 1 and n will be 0\n\n // Add the next digit, n, to the result array.\n qc[i++] = n;\n\n // Update the remainder.\n if ( rem[0] ) {\n rem[remL++] = xc[xi] || 0;\n } else {\n rem = [ xc[xi] ];\n remL = 1;\n }\n } while ( ( xi++ < xL || rem[0] != null ) && s-- );\n\n more = rem[0] != null;\n\n // Leading zero?\n if ( !qc[0] ) qc.shift();\n }\n\n if ( base == BASE ) {\n\n // To calculate q.e, first get the number of digits of qc[0].\n for ( i = 1, s = qc[0]; s >= 10; s /= 10, i++ );\n round( q, dp + ( q.e = i + e * LOG_BASE - 1 ) + 1, rm, more );\n\n // Caller is convertBase.\n } else {\n q.e = e;\n q.r = +more;\n }\n\n return q;\n };\n })();\n\n\n /*\n * Return a string representing the value of BigNumber n in fixed-point or exponential\n * notation rounded to the specified decimal places or significant digits.\n *\n * n is a BigNumber.\n * i is the index of the last digit required (i.e. the digit that may be rounded up).\n * rm is the rounding mode.\n * caller is caller id: toExponential 19, toFixed 20, toFormat 21, toPrecision 24.\n */\n function format( n, i, rm, caller ) {\n var c0, e, ne, len, str;\n\n rm = rm != null && isValidInt( rm, 0, 8, caller, roundingMode )\n ? rm | 0 : ROUNDING_MODE;\n\n if ( !n.c ) return n.toString();\n c0 = n.c[0];\n ne = n.e;\n\n if ( i == null ) {\n str = coeffToString( n.c );\n str = caller == 19 || caller == 24 && ne <= TO_EXP_NEG\n ? toExponential( str, ne )\n : toFixedPoint( str, ne );\n } else {\n n = round( new BigNumber(n), i, rm );\n\n // n.e may have changed if the value was rounded up.\n e = n.e;\n\n str = coeffToString( n.c );\n len = str.length;\n\n // toPrecision returns exponential notation if the number of significant digits\n // specified is less than the number of digits necessary to represent the integer\n // part of the value in fixed-point notation.\n\n // Exponential notation.\n if ( caller == 19 || caller == 24 && ( i <= e || e <= TO_EXP_NEG ) ) {\n\n // Append zeros?\n for ( ; len < i; str += '0', len++ );\n str = toExponential( str, e );\n\n // Fixed-point notation.\n } else {\n i -= ne;\n str = toFixedPoint( str, e );\n\n // Append zeros?\n if ( e + 1 > len ) {\n if ( --i > 0 ) for ( str += '.'; i--; str += '0' );\n } else {\n i += e - len;\n if ( i > 0 ) {\n if ( e + 1 == len ) str += '.';\n for ( ; i--; str += '0' );\n }\n }\n }\n }\n\n return n.s < 0 && c0 ? '-' + str : str;\n }\n\n\n // Handle BigNumber.max and BigNumber.min.\n function maxOrMin( args, method ) {\n var m, n,\n i = 0;\n\n if ( isArray( args[0] ) ) args = args[0];\n m = new BigNumber( args[0] );\n\n for ( ; ++i < args.length; ) {\n n = new BigNumber( args[i] );\n\n // If any number is NaN, return NaN.\n if ( !n.s ) {\n m = n;\n break;\n } else if ( method.call( m, n ) ) {\n m = n;\n }\n }\n\n return m;\n }\n\n\n /*\n * Return true if n is an integer in range, otherwise throw.\n * Use for argument validation when ERRORS is true.\n */\n function intValidatorWithErrors( n, min, max, caller, name ) {\n if ( n < min || n > max || n != truncate(n) ) {\n raise( caller, ( name || 'decimal places' ) +\n ( n < min || n > max ? ' out of range' : ' not an integer' ), n );\n }\n\n return true;\n }\n\n\n /*\n * Strip trailing zeros, calculate base 10 exponent and check against MIN_EXP and MAX_EXP.\n * Called by minus, plus and times.\n */\n function normalise( n, c, e ) {\n var i = 1,\n j = c.length;\n\n // Remove trailing zeros.\n for ( ; !c[--j]; c.pop() );\n\n // Calculate the base 10 exponent. First get the number of digits of c[0].\n for ( j = c[0]; j >= 10; j /= 10, i++ );\n\n // Overflow?\n if ( ( e = i + e * LOG_BASE - 1 ) > MAX_EXP ) {\n\n // Infinity.\n n.c = n.e = null;\n\n // Underflow?\n } else if ( e < MIN_EXP ) {\n\n // Zero.\n n.c = [ n.e = 0 ];\n } else {\n n.e = e;\n n.c = c;\n }\n\n return n;\n }\n\n\n // Handle values that fail the validity test in BigNumber.\n parseNumeric = (function () {\n var basePrefix = /^(-?)0([xbo])/i,\n dotAfter = /^([^.]+)\\.$/,\n dotBefore = /^\\.([^.]+)$/,\n isInfinityOrNaN = /^-?(Infinity|NaN)$/,\n whitespaceOrPlus = /^\\s*\\+|^\\s+|\\s+$/g;\n\n return function ( x, str, num, b ) {\n var base,\n s = num ? str : str.replace( whitespaceOrPlus, '' );\n\n // No exception on ±Infinity or NaN.\n if ( isInfinityOrNaN.test(s) ) {\n x.s = isNaN(s) ? null : s < 0 ? -1 : 1;\n } else {\n if ( !num ) {\n\n // basePrefix = /^(-?)0([xbo])(?=\\w[\\w.]*$)/i\n s = s.replace( basePrefix, function ( m, p1, p2 ) {\n base = ( p2 = p2.toLowerCase() ) == 'x' ? 16 : p2 == 'b' ? 2 : 8;\n return !b || b == base ? p1 : m;\n });\n\n if (b) {\n base = b;\n\n // E.g. '1.' to '1', '.1' to '0.1'\n s = s.replace( dotAfter, '$1' ).replace( dotBefore, '0.$1' );\n }\n\n if ( str != s ) return new BigNumber( s, base );\n }\n\n // 'new BigNumber() not a number: {n}'\n // 'new BigNumber() not a base {b} number: {n}'\n if (ERRORS) raise( id, 'not a' + ( b ? ' base ' + b : '' ) + ' number', str );\n x.s = null;\n }\n\n x.c = x.e = null;\n id = 0;\n }\n })();\n\n\n // Throw a BigNumber Error.\n function raise( caller, msg, val ) {\n var error = new Error( [\n 'new BigNumber', // 0\n 'cmp', // 1\n 'config', // 2\n 'div', // 3\n 'divToInt', // 4\n 'eq', // 5\n 'gt', // 6\n 'gte', // 7\n 'lt', // 8\n 'lte', // 9\n 'minus', // 10\n 'mod', // 11\n 'plus', // 12\n 'precision', // 13\n 'random', // 14\n 'round', // 15\n 'shift', // 16\n 'times', // 17\n 'toDigits', // 18\n 'toExponential', // 19\n 'toFixed', // 20\n 'toFormat', // 21\n 'toFraction', // 22\n 'pow', // 23\n 'toPrecision', // 24\n 'toString', // 25\n 'BigNumber' // 26\n ][caller] + '() ' + msg + ': ' + val );\n\n error.name = 'BigNumber Error';\n id = 0;\n throw error;\n }\n\n\n /*\n * Round x to sd significant digits using rounding mode rm. Check for over/under-flow.\n * If r is truthy, it is known that there are more digits after the rounding digit.\n */\n function round( x, sd, rm, r ) {\n var d, i, j, k, n, ni, rd,\n xc = x.c,\n pows10 = POWS_TEN;\n\n // if x is not Infinity or NaN...\n if (xc) {\n\n // rd is the rounding digit, i.e. the digit after the digit that may be rounded up.\n // n is a base 1e14 number, the value of the element of array x.c containing rd.\n // ni is the index of n within x.c.\n // d is the number of digits of n.\n // i is the index of rd within n including leading zeros.\n // j is the actual index of rd within n (if < 0, rd is a leading zero).\n out: {\n\n // Get the number of digits of the first element of xc.\n for ( d = 1, k = xc[0]; k >= 10; k /= 10, d++ );\n i = sd - d;\n\n // If the rounding digit is in the first element of xc...\n if ( i < 0 ) {\n i += LOG_BASE;\n j = sd;\n n = xc[ ni = 0 ];\n\n // Get the rounding digit at index j of n.\n rd = n / pows10[ d - j - 1 ] % 10 | 0;\n } else {\n ni = mathceil( ( i + 1 ) / LOG_BASE );\n\n if ( ni >= xc.length ) {\n\n if (r) {\n\n // Needed by sqrt.\n for ( ; xc.length <= ni; xc.push(0) );\n n = rd = 0;\n d = 1;\n i %= LOG_BASE;\n j = i - LOG_BASE + 1;\n } else {\n break out;\n }\n } else {\n n = k = xc[ni];\n\n // Get the number of digits of n.\n for ( d = 1; k >= 10; k /= 10, d++ );\n\n // Get the index of rd within n.\n i %= LOG_BASE;\n\n // Get the index of rd within n, adjusted for leading zeros.\n // The number of leading zeros of n is given by LOG_BASE - d.\n j = i - LOG_BASE + d;\n\n // Get the rounding digit at index j of n.\n rd = j < 0 ? 0 : n / pows10[ d - j - 1 ] % 10 | 0;\n }\n }\n\n r = r || sd < 0 ||\n\n // Are there any non-zero digits after the rounding digit?\n // The expression n % pows10[ d - j - 1 ] returns all digits of n to the right\n // of the digit at j, e.g. if n is 908714 and j is 2, the expression gives 714.\n xc[ni + 1] != null || ( j < 0 ? n : n % pows10[ d - j - 1 ] );\n\n r = rm < 4\n ? ( rd || r ) && ( rm == 0 || rm == ( x.s < 0 ? 3 : 2 ) )\n : rd > 5 || rd == 5 && ( rm == 4 || r || rm == 6 &&\n\n // Check whether the digit to the left of the rounding digit is odd.\n ( ( i > 0 ? j > 0 ? n / pows10[ d - j ] : 0 : xc[ni - 1] ) % 10 ) & 1 ||\n rm == ( x.s < 0 ? 8 : 7 ) );\n\n if ( sd < 1 || !xc[0] ) {\n xc.length = 0;\n\n if (r) {\n\n // Convert sd to decimal places.\n sd -= x.e + 1;\n\n // 1, 0.1, 0.01, 0.001, 0.0001 etc.\n xc[0] = pows10[ sd % LOG_BASE ];\n x.e = -sd || 0;\n } else {\n\n // Zero.\n xc[0] = x.e = 0;\n }\n\n return x;\n }\n\n // Remove excess digits.\n if ( i == 0 ) {\n xc.length = ni;\n k = 1;\n ni--;\n } else {\n xc.length = ni + 1;\n k = pows10[ LOG_BASE - i ];\n\n // E.g. 56700 becomes 56000 if 7 is the rounding digit.\n // j > 0 means i > number of leading zeros of n.\n xc[ni] = j > 0 ? mathfloor( n / pows10[ d - j ] % pows10[j] ) * k : 0;\n }\n\n // Round up?\n if (r) {\n\n for ( ; ; ) {\n\n // If the digit to be rounded up is in the first element of xc...\n if ( ni == 0 ) {\n\n // i will be the length of xc[0] before k is added.\n for ( i = 1, j = xc[0]; j >= 10; j /= 10, i++ );\n j = xc[0] += k;\n for ( k = 1; j >= 10; j /= 10, k++ );\n\n // if i != k the length has increased.\n if ( i != k ) {\n x.e++;\n if ( xc[0] == BASE ) xc[0] = 1;\n }\n\n break;\n } else {\n xc[ni] += k;\n if ( xc[ni] != BASE ) break;\n xc[ni--] = 0;\n k = 1;\n }\n }\n }\n\n // Remove trailing zeros.\n for ( i = xc.length; xc[--i] === 0; xc.pop() );\n }\n\n // Overflow? Infinity.\n if ( x.e > MAX_EXP ) {\n x.c = x.e = null;\n\n // Underflow? Zero.\n } else if ( x.e < MIN_EXP ) {\n x.c = [ x.e = 0 ];\n }\n }\n\n return x;\n }\n\n\n // PROTOTYPE/INSTANCE METHODS\n\n\n /*\n * Return a new BigNumber whose value is the absolute value of this BigNumber.\n */\n P.absoluteValue = P.abs = function () {\n var x = new BigNumber(this);\n if ( x.s < 0 ) x.s = 1;\n return x;\n };\n\n\n /*\n * Return a new BigNumber whose value is the value of this BigNumber rounded to a whole\n * number in the direction of Infinity.\n */\n P.ceil = function () {\n return round( new BigNumber(this), this.e + 1, 2 );\n };\n\n\n /*\n * Return\n * 1 if the value of this BigNumber is greater than the value of BigNumber(y, b),\n * -1 if the value of this BigNumber is less than the value of BigNumber(y, b),\n * 0 if they have the same value,\n * or null if the value of either is NaN.\n */\n P.comparedTo = P.cmp = function ( y, b ) {\n id = 1;\n return compare( this, new BigNumber( y, b ) );\n };\n\n\n /*\n * Return the number of decimal places of the value of this BigNumber, or null if the value\n * of this BigNumber is ±Infinity or NaN.\n */\n P.decimalPlaces = P.dp = function () {\n var n, v,\n c = this.c;\n\n if ( !c ) return null;\n n = ( ( v = c.length - 1 ) - bitFloor( this.e / LOG_BASE ) ) * LOG_BASE;\n\n // Subtract the number of trailing zeros of the last number.\n if ( v = c[v] ) for ( ; v % 10 == 0; v /= 10, n-- );\n if ( n < 0 ) n = 0;\n\n return n;\n };\n\n\n /*\n * n / 0 = I\n * n / N = N\n * n / I = 0\n * 0 / n = 0\n * 0 / 0 = N\n * 0 / N = N\n * 0 / I = 0\n * N / n = N\n * N / 0 = N\n * N / N = N\n * N / I = N\n * I / n = I\n * I / 0 = I\n * I / N = N\n * I / I = N\n *\n * Return a new BigNumber whose value is the value of this BigNumber divided by the value of\n * BigNumber(y, b), rounded according to DECIMAL_PLACES and ROUNDING_MODE.\n */\n P.dividedBy = P.div = function ( y, b ) {\n id = 3;\n return div( this, new BigNumber( y, b ), DECIMAL_PLACES, ROUNDING_MODE );\n };\n\n\n /*\n * Return a new BigNumber whose value is the integer part of dividing the value of this\n * BigNumber by the value of BigNumber(y, b).\n */\n P.dividedToIntegerBy = P.divToInt = function ( y, b ) {\n id = 4;\n return div( this, new BigNumber( y, b ), 0, 1 );\n };\n\n\n /*\n * Return true if the value of this BigNumber is equal to the value of BigNumber(y, b),\n * otherwise returns false.\n */\n P.equals = P.eq = function ( y, b ) {\n id = 5;\n return compare( this, new BigNumber( y, b ) ) === 0;\n };\n\n\n /*\n * Return a new BigNumber whose value is the value of this BigNumber rounded to a whole\n * number in the direction of -Infinity.\n */\n P.floor = function () {\n return round( new BigNumber(this), this.e + 1, 3 );\n };\n\n\n /*\n * Return true if the value of this BigNumber is greater than the value of BigNumber(y, b),\n * otherwise returns false.\n */\n P.greaterThan = P.gt = function ( y, b ) {\n id = 6;\n return compare( this, new BigNumber( y, b ) ) > 0;\n };\n\n\n /*\n * Return true if the value of this BigNumber is greater than or equal to the value of\n * BigNumber(y, b), otherwise returns false.\n */\n P.greaterThanOrEqualTo = P.gte = function ( y, b ) {\n id = 7;\n return ( b = compare( this, new BigNumber( y, b ) ) ) === 1 || b === 0;\n\n };\n\n\n /*\n * Return true if the value of this BigNumber is a finite number, otherwise returns false.\n */\n P.isFinite = function () {\n return !!this.c;\n };\n\n\n /*\n * Return true if the value of this BigNumber is an integer, otherwise return false.\n */\n P.isInteger = P.isInt = function () {\n return !!this.c && bitFloor( this.e / LOG_BASE ) > this.c.length - 2;\n };\n\n\n /*\n * Return true if the value of this BigNumber is NaN, otherwise returns false.\n */\n P.isNaN = function () {\n return !this.s;\n };\n\n\n /*\n * Return true if the value of this BigNumber is negative, otherwise returns false.\n */\n P.isNegative = P.isNeg = function () {\n return this.s < 0;\n };\n\n\n /*\n * Return true if the value of this BigNumber is 0 or -0, otherwise returns false.\n */\n P.isZero = function () {\n return !!this.c && this.c[0] == 0;\n };\n\n\n /*\n * Return true if the value of this BigNumber is less than the value of BigNumber(y, b),\n * otherwise returns false.\n */\n P.lessThan = P.lt = function ( y, b ) {\n id = 8;\n return compare( this, new BigNumber( y, b ) ) < 0;\n };\n\n\n /*\n * Return true if the value of this BigNumber is less than or equal to the value of\n * BigNumber(y, b), otherwise returns false.\n */\n P.lessThanOrEqualTo = P.lte = function ( y, b ) {\n id = 9;\n return ( b = compare( this, new BigNumber( y, b ) ) ) === -1 || b === 0;\n };\n\n\n /*\n * n - 0 = n\n * n - N = N\n * n - I = -I\n * 0 - n = -n\n * 0 - 0 = 0\n * 0 - N = N\n * 0 - I = -I\n * N - n = N\n * N - 0 = N\n * N - N = N\n * N - I = N\n * I - n = I\n * I - 0 = I\n * I - N = N\n * I - I = N\n *\n * Return a new BigNumber whose value is the value of this BigNumber minus the value of\n * BigNumber(y, b).\n */\n P.minus = P.sub = function ( y, b ) {\n var i, j, t, xLTy,\n x = this,\n a = x.s;\n\n id = 10;\n y = new BigNumber( y, b );\n b = y.s;\n\n // Either NaN?\n if ( !a || !b ) return new BigNumber(NaN);\n\n // Signs differ?\n if ( a != b ) {\n y.s = -b;\n return x.plus(y);\n }\n\n var xe = x.e / LOG_BASE,\n ye = y.e / LOG_BASE,\n xc = x.c,\n yc = y.c;\n\n if ( !xe || !ye ) {\n\n // Either Infinity?\n if ( !xc || !yc ) return xc ? ( y.s = -b, y ) : new BigNumber( yc ? x : NaN );\n\n // Either zero?\n if ( !xc[0] || !yc[0] ) {\n\n // Return y if y is non-zero, x if x is non-zero, or zero if both are zero.\n return yc[0] ? ( y.s = -b, y ) : new BigNumber( xc[0] ? x :\n\n // IEEE 754 (2008) 6.3: n - n = -0 when rounding to -Infinity\n ROUNDING_MODE == 3 ? -0 : 0 );\n }\n }\n\n xe = bitFloor(xe);\n ye = bitFloor(ye);\n xc = xc.slice();\n\n // Determine which is the bigger number.\n if ( a = xe - ye ) {\n\n if ( xLTy = a < 0 ) {\n a = -a;\n t = xc;\n } else {\n ye = xe;\n t = yc;\n }\n\n t.reverse();\n\n // Prepend zeros to equalise exponents.\n for ( b = a; b--; t.push(0) );\n t.reverse();\n } else {\n\n // Exponents equal. Check digit by digit.\n j = ( xLTy = ( a = xc.length ) < ( b = yc.length ) ) ? a : b;\n\n for ( a = b = 0; b < j; b++ ) {\n\n if ( xc[b] != yc[b] ) {\n xLTy = xc[b] < yc[b];\n break;\n }\n }\n }\n\n // x < y? Point xc to the array of the bigger number.\n if (xLTy) t = xc, xc = yc, yc = t, y.s = -y.s;\n\n b = ( j = yc.length ) - ( i = xc.length );\n\n // Append zeros to xc if shorter.\n // No need to add zeros to yc if shorter as subtract only needs to start at yc.length.\n if ( b > 0 ) for ( ; b--; xc[i++] = 0 );\n b = BASE - 1;\n\n // Subtract yc from xc.\n for ( ; j > a; ) {\n\n if ( xc[--j] < yc[j] ) {\n for ( i = j; i && !xc[--i]; xc[i] = b );\n --xc[i];\n xc[j] += BASE;\n }\n\n xc[j] -= yc[j];\n }\n\n // Remove leading zeros and adjust exponent accordingly.\n for ( ; xc[0] == 0; xc.shift(), --ye );\n\n // Zero?\n if ( !xc[0] ) {\n\n // Following IEEE 754 (2008) 6.3,\n // n - n = +0 but n - n = -0 when rounding towards -Infinity.\n y.s = ROUNDING_MODE == 3 ? -1 : 1;\n y.c = [ y.e = 0 ];\n return y;\n }\n\n // No need to check for Infinity as +x - +y != Infinity && -x - -y != Infinity\n // for finite x and y.\n return normalise( y, xc, ye );\n };\n\n\n /*\n * n % 0 = N\n * n % N = N\n * n % I = n\n * 0 % n = 0\n * -0 % n = -0\n * 0 % 0 = N\n * 0 % N = N\n * 0 % I = 0\n * N % n = N\n * N % 0 = N\n * N % N = N\n * N % I = N\n * I % n = N\n * I % 0 = N\n * I % N = N\n * I % I = N\n *\n * Return a new BigNumber whose value is the value of this BigNumber modulo the value of\n * BigNumber(y, b). The result depends on the value of MODULO_MODE.\n */\n P.modulo = P.mod = function ( y, b ) {\n var q, s,\n x = this;\n\n id = 11;\n y = new BigNumber( y, b );\n\n // Return NaN if x is Infinity or NaN, or y is NaN or zero.\n if ( !x.c || !y.s || y.c && !y.c[0] ) {\n return new BigNumber(NaN);\n\n // Return x if y is Infinity or x is zero.\n } else if ( !y.c || x.c && !x.c[0] ) {\n return new BigNumber(x);\n }\n\n if ( MODULO_MODE == 9 ) {\n\n // Euclidian division: q = sign(y) * floor(x / abs(y))\n // r = x - qy where 0 <= r < abs(y)\n s = y.s;\n y.s = 1;\n q = div( x, y, 0, 3 );\n y.s = s;\n q.s *= s;\n } else {\n q = div( x, y, 0, MODULO_MODE );\n }\n\n return x.minus( q.times(y) );\n };\n\n\n /*\n * Return a new BigNumber whose value is the value of this BigNumber negated,\n * i.e. multiplied by -1.\n */\n P.negated = P.neg = function () {\n var x = new BigNumber(this);\n x.s = -x.s || null;\n return x;\n };\n\n\n /*\n * n + 0 = n\n * n + N = N\n * n + I = I\n * 0 + n = n\n * 0 + 0 = 0\n * 0 + N = N\n * 0 + I = I\n * N + n = N\n * N + 0 = N\n * N + N = N\n * N + I = N\n * I + n = I\n * I + 0 = I\n * I + N = N\n * I + I = I\n *\n * Return a new BigNumber whose value is the value of this BigNumber plus the value of\n * BigNumber(y, b).\n */\n P.plus = P.add = function ( y, b ) {\n var t,\n x = this,\n a = x.s;\n\n id = 12;\n y = new BigNumber( y, b );\n b = y.s;\n\n // Either NaN?\n if ( !a || !b ) return new BigNumber(NaN);\n\n // Signs differ?\n if ( a != b ) {\n y.s = -b;\n return x.minus(y);\n }\n\n var xe = x.e / LOG_BASE,\n ye = y.e / LOG_BASE,\n xc = x.c,\n yc = y.c;\n\n if ( !xe || !ye ) {\n\n // Return ±Infinity if either ±Infinity.\n if ( !xc || !yc ) return new BigNumber( a / 0 );\n\n // Either zero?\n // Return y if y is non-zero, x if x is non-zero, or zero if both are zero.\n if ( !xc[0] || !yc[0] ) return yc[0] ? y : new BigNumber( xc[0] ? x : a * 0 );\n }\n\n xe = bitFloor(xe);\n ye = bitFloor(ye);\n xc = xc.slice();\n\n // Prepend zeros to equalise exponents. Faster to use reverse then do unshifts.\n if ( a = xe - ye ) {\n if ( a > 0 ) {\n ye = xe;\n t = yc;\n } else {\n a = -a;\n t = xc;\n }\n\n t.reverse();\n for ( ; a--; t.push(0) );\n t.reverse();\n }\n\n a = xc.length;\n b = yc.length;\n\n // Point xc to the longer array, and b to the shorter length.\n if ( a - b < 0 ) t = yc, yc = xc, xc = t, b = a;\n\n // Only start adding at yc.length - 1 as the further digits of xc can be ignored.\n for ( a = 0; b; ) {\n a = ( xc[--b] = xc[b] + yc[b] + a ) / BASE | 0;\n xc[b] %= BASE;\n }\n\n if (a) {\n xc.unshift(a);\n ++ye;\n }\n\n // No need to check for zero, as +x + +y != 0 && -x + -y != 0\n // ye = MAX_EXP + 1 possible\n return normalise( y, xc, ye );\n };\n\n\n /*\n * Return the number of significant digits of the value of this BigNumber.\n *\n * [z] {boolean|number} Whether to count integer-part trailing zeros: true, false, 1 or 0.\n */\n P.precision = P.sd = function (z) {\n var n, v,\n x = this,\n c = x.c;\n\n // 'precision() argument not a boolean or binary digit: {z}'\n if ( z != null && z !== !!z && z !== 1 && z !== 0 ) {\n if (ERRORS) raise( 13, 'argument' + notBool, z );\n if ( z != !!z ) z = null;\n }\n\n if ( !c ) return null;\n v = c.length - 1;\n n = v * LOG_BASE + 1;\n\n if ( v = c[v] ) {\n\n // Subtract the number of trailing zeros of the last element.\n for ( ; v % 10 == 0; v /= 10, n-- );\n\n // Add the number of digits of the first element.\n for ( v = c[0]; v >= 10; v /= 10, n++ );\n }\n\n if ( z && x.e + 1 > n ) n = x.e + 1;\n\n return n;\n };\n\n\n /*\n * Return a new BigNumber whose value is the value of this BigNumber rounded to a maximum of\n * dp decimal places using rounding mode rm, or to 0 and ROUNDING_MODE respectively if\n * omitted.\n *\n * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\n *\n * 'round() decimal places out of range: {dp}'\n * 'round() decimal places not an integer: {dp}'\n * 'round() rounding mode not an integer: {rm}'\n * 'round() rounding mode out of range: {rm}'\n */\n P.round = function ( dp, rm ) {\n var n = new BigNumber(this);\n\n if ( dp == null || isValidInt( dp, 0, MAX, 15 ) ) {\n round( n, ~~dp + this.e + 1, rm == null ||\n !isValidInt( rm, 0, 8, 15, roundingMode ) ? ROUNDING_MODE : rm | 0 );\n }\n\n return n;\n };\n\n\n /*\n * Return a new BigNumber whose value is the value of this BigNumber shifted by k places\n * (powers of 10). Shift to the right if n > 0, and to the left if n < 0.\n *\n * k {number} Integer, -MAX_SAFE_INTEGER to MAX_SAFE_INTEGER inclusive.\n *\n * If k is out of range and ERRORS is false, the result will be ±0 if k < 0, or ±Infinity\n * otherwise.\n *\n * 'shift() argument not an integer: {k}'\n * 'shift() argument out of range: {k}'\n */\n P.shift = function (k) {\n var n = this;\n return isValidInt( k, -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER, 16, 'argument' )\n\n // k < 1e+21, or truncate(k) will produce exponential notation.\n ? n.times( '1e' + truncate(k) )\n : new BigNumber( n.c && n.c[0] && ( k < -MAX_SAFE_INTEGER || k > MAX_SAFE_INTEGER )\n ? n.s * ( k < 0 ? 0 : 1 / 0 )\n : n );\n };\n\n\n /*\n * sqrt(-n) = N\n * sqrt( N) = N\n * sqrt(-I) = N\n * sqrt( I) = I\n * sqrt( 0) = 0\n * sqrt(-0) = -0\n *\n * Return a new BigNumber whose value is the square root of the value of this BigNumber,\n * rounded according to DECIMAL_PLACES and ROUNDING_MODE.\n */\n P.squareRoot = P.sqrt = function () {\n var m, n, r, rep, t,\n x = this,\n c = x.c,\n s = x.s,\n e = x.e,\n dp = DECIMAL_PLACES + 4,\n half = new BigNumber('0.5');\n\n // Negative/NaN/Infinity/zero?\n if ( s !== 1 || !c || !c[0] ) {\n return new BigNumber( !s || s < 0 && ( !c || c[0] ) ? NaN : c ? x : 1 / 0 );\n }\n\n // Initial estimate.\n s = Math.sqrt( +x );\n\n // Math.sqrt underflow/overflow?\n // Pass x to Math.sqrt as integer, then adjust the exponent of the result.\n if ( s == 0 || s == 1 / 0 ) {\n n = coeffToString(c);\n if ( ( n.length + e ) % 2 == 0 ) n += '0';\n s = Math.sqrt(n);\n e = bitFloor( ( e + 1 ) / 2 ) - ( e < 0 || e % 2 );\n\n if ( s == 1 / 0 ) {\n n = '1e' + e;\n } else {\n n = s.toExponential();\n n = n.slice( 0, n.indexOf('e') + 1 ) + e;\n }\n\n r = new BigNumber(n);\n } else {\n r = new BigNumber( s + '' );\n }\n\n // Check for zero.\n // r could be zero if MIN_EXP is changed after the this value was created.\n // This would cause a division by zero (x/t) and hence Infinity below, which would cause\n // coeffToString to throw.\n if ( r.c[0] ) {\n e = r.e;\n s = e + dp;\n if ( s < 3 ) s = 0;\n\n // Newton-Raphson iteration.\n for ( ; ; ) {\n t = r;\n r = half.times( t.plus( div( x, t, dp, 1 ) ) );\n\n if ( coeffToString( t.c ).slice( 0, s ) === ( n =\n coeffToString( r.c ) ).slice( 0, s ) ) {\n\n // The exponent of r may here be one less than the final result exponent,\n // e.g 0.0009999 (e-4) --> 0.001 (e-3), so adjust s so the rounding digits\n // are indexed correctly.\n if ( r.e < e ) --s;\n n = n.slice( s - 3, s + 1 );\n\n // The 4th rounding digit may be in error by -1 so if the 4 rounding digits\n // are 9999 or 4999 (i.e. approaching a rounding boundary) continue the\n // iteration.\n if ( n == '9999' || !rep && n == '4999' ) {\n\n // On the first iteration only, check to see if rounding up gives the\n // exact result as the nines may infinitely repeat.\n if ( !rep ) {\n round( t, t.e + DECIMAL_PLACES + 2, 0 );\n\n if ( t.times(t).eq(x) ) {\n r = t;\n break;\n }\n }\n\n dp += 4;\n s += 4;\n rep = 1;\n } else {\n\n // If rounding digits are null, 0{0,4} or 50{0,3}, check for exact\n // result. If not, then there are further digits and m will be truthy.\n if ( !+n || !+n.slice(1) && n.charAt(0) == '5' ) {\n\n // Truncate to the first rounding digit.\n round( r, r.e + DECIMAL_PLACES + 2, 1 );\n m = !r.times(r).eq(x);\n }\n\n break;\n }\n }\n }\n }\n\n return round( r, r.e + DECIMAL_PLACES + 1, ROUNDING_MODE, m );\n };\n\n\n /*\n * n * 0 = 0\n * n * N = N\n * n * I = I\n * 0 * n = 0\n * 0 * 0 = 0\n * 0 * N = N\n * 0 * I = N\n * N * n = N\n * N * 0 = N\n * N * N = N\n * N * I = N\n * I * n = I\n * I * 0 = N\n * I * N = N\n * I * I = I\n *\n * Return a new BigNumber whose value is the value of this BigNumber times the value of\n * BigNumber(y, b).\n */\n P.times = P.mul = function ( y, b ) {\n var c, e, i, j, k, m, xcL, xlo, xhi, ycL, ylo, yhi, zc,\n base, sqrtBase,\n x = this,\n xc = x.c,\n yc = ( id = 17, y = new BigNumber( y, b ) ).c;\n\n // Either NaN, ±Infinity or ±0?\n if ( !xc || !yc || !xc[0] || !yc[0] ) {\n\n // Return NaN if either is NaN, or one is 0 and the other is Infinity.\n if ( !x.s || !y.s || xc && !xc[0] && !yc || yc && !yc[0] && !xc ) {\n y.c = y.e = y.s = null;\n } else {\n y.s *= x.s;\n\n // Return ±Infinity if either is ±Infinity.\n if ( !xc || !yc ) {\n y.c = y.e = null;\n\n // Return ±0 if either is ±0.\n } else {\n y.c = [0];\n y.e = 0;\n }\n }\n\n return y;\n }\n\n e = bitFloor( x.e / LOG_BASE ) + bitFloor( y.e / LOG_BASE );\n y.s *= x.s;\n xcL = xc.length;\n ycL = yc.length;\n\n // Ensure xc points to longer array and xcL to its length.\n if ( xcL < ycL ) zc = xc, xc = yc, yc = zc, i = xcL, xcL = ycL, ycL = i;\n\n // Initialise the result array with zeros.\n for ( i = xcL + ycL, zc = []; i--; zc.push(0) );\n\n base = BASE;\n sqrtBase = SQRT_BASE;\n\n for ( i = ycL; --i >= 0; ) {\n c = 0;\n ylo = yc[i] % sqrtBase;\n yhi = yc[i] / sqrtBase | 0;\n\n for ( k = xcL, j = i + k; j > i; ) {\n xlo = xc[--k] % sqrtBase;\n xhi = xc[k] / sqrtBase | 0;\n m = yhi * xlo + xhi * ylo;\n xlo = ylo * xlo + ( ( m % sqrtBase ) * sqrtBase ) + zc[j] + c;\n c = ( xlo / base | 0 ) + ( m / sqrtBase | 0 ) + yhi * xhi;\n zc[j--] = xlo % base;\n }\n\n zc[j] = c;\n }\n\n if (c) {\n ++e;\n } else {\n zc.shift();\n }\n\n return normalise( y, zc, e );\n };\n\n\n /*\n * Return a new BigNumber whose value is the value of this BigNumber rounded to a maximum of\n * sd significant digits using rounding mode rm, or ROUNDING_MODE if rm is omitted.\n *\n * [sd] {number} Significant digits. Integer, 1 to MAX inclusive.\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\n *\n * 'toDigits() precision out of range: {sd}'\n * 'toDigits() precision not an integer: {sd}'\n * 'toDigits() rounding mode not an integer: {rm}'\n * 'toDigits() rounding mode out of range: {rm}'\n */\n P.toDigits = function ( sd, rm ) {\n var n = new BigNumber(this);\n sd = sd == null || !isValidInt( sd, 1, MAX, 18, 'precision' ) ? null : sd | 0;\n rm = rm == null || !isValidInt( rm, 0, 8, 18, roundingMode ) ? ROUNDING_MODE : rm | 0;\n return sd ? round( n, sd, rm ) : n;\n };\n\n\n /*\n * Return a string representing the value of this BigNumber in exponential notation and\n * rounded using ROUNDING_MODE to dp fixed decimal places.\n *\n * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\n *\n * 'toExponential() decimal places not an integer: {dp}'\n * 'toExponential() decimal places out of range: {dp}'\n * 'toExponential() rounding mode not an integer: {rm}'\n * 'toExponential() rounding mode out of range: {rm}'\n */\n P.toExponential = function ( dp, rm ) {\n return format( this,\n dp != null && isValidInt( dp, 0, MAX, 19 ) ? ~~dp + 1 : null, rm, 19 );\n };\n\n\n /*\n * Return a string representing the value of this BigNumber in fixed-point notation rounding\n * to dp fixed decimal places using rounding mode rm, or ROUNDING_MODE if rm is omitted.\n *\n * Note: as with JavaScript's number type, (-0).toFixed(0) is '0',\n * but e.g. (-0.00001).toFixed(0) is '-0'.\n *\n * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\n *\n * 'toFixed() decimal places not an integer: {dp}'\n * 'toFixed() decimal places out of range: {dp}'\n * 'toFixed() rounding mode not an integer: {rm}'\n * 'toFixed() rounding mode out of range: {rm}'\n */\n P.toFixed = function ( dp, rm ) {\n return format( this, dp != null && isValidInt( dp, 0, MAX, 20 )\n ? ~~dp + this.e + 1 : null, rm, 20 );\n };\n\n\n /*\n * Return a string representing the value of this BigNumber in fixed-point notation rounded\n * using rm or ROUNDING_MODE to dp decimal places, and formatted according to the properties\n * of the FORMAT object (see BigNumber.config).\n *\n * FORMAT = {\n * decimalSeparator : '.',\n * groupSeparator : ',',\n * groupSize : 3,\n * secondaryGroupSize : 0,\n * fractionGroupSeparator : '\\xA0', // non-breaking space\n * fractionGroupSize : 0\n * };\n *\n * [dp] {number} Decimal places. Integer, 0 to MAX inclusive.\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\n *\n * 'toFormat() decimal places not an integer: {dp}'\n * 'toFormat() decimal places out of range: {dp}'\n * 'toFormat() rounding mode not an integer: {rm}'\n * 'toFormat() rounding mode out of range: {rm}'\n */\n P.toFormat = function ( dp, rm ) {\n var str = format( this, dp != null && isValidInt( dp, 0, MAX, 21 )\n ? ~~dp + this.e + 1 : null, rm, 21 );\n\n if ( this.c ) {\n var i,\n arr = str.split('.'),\n g1 = +FORMAT.groupSize,\n g2 = +FORMAT.secondaryGroupSize,\n groupSeparator = FORMAT.groupSeparator,\n intPart = arr[0],\n fractionPart = arr[1],\n isNeg = this.s < 0,\n intDigits = isNeg ? intPart.slice(1) : intPart,\n len = intDigits.length;\n\n if (g2) i = g1, g1 = g2, g2 = i, len -= i;\n\n if ( g1 > 0 && len > 0 ) {\n i = len % g1 || g1;\n intPart = intDigits.substr( 0, i );\n\n for ( ; i < len; i += g1 ) {\n intPart += groupSeparator + intDigits.substr( i, g1 );\n }\n\n if ( g2 > 0 ) intPart += groupSeparator + intDigits.slice(i);\n if (isNeg) intPart = '-' + intPart;\n }\n\n str = fractionPart\n ? intPart + FORMAT.decimalSeparator + ( ( g2 = +FORMAT.fractionGroupSize )\n ? fractionPart.replace( new RegExp( '\\\\d{' + g2 + '}\\\\B', 'g' ),\n '$&' + FORMAT.fractionGroupSeparator )\n : fractionPart )\n : intPart;\n }\n\n return str;\n };\n\n\n /*\n * Return a string array representing the value of this BigNumber as a simple fraction with\n * an integer numerator and an integer denominator. The denominator will be a positive\n * non-zero value less than or equal to the specified maximum denominator. If a maximum\n * denominator is not specified, the denominator will be the lowest value necessary to\n * represent the number exactly.\n *\n * [md] {number|string|BigNumber} Integer >= 1 and < Infinity. The maximum denominator.\n *\n * 'toFraction() max denominator not an integer: {md}'\n * 'toFraction() max denominator out of range: {md}'\n */\n P.toFraction = function (md) {\n var arr, d0, d2, e, exp, n, n0, q, s,\n k = ERRORS,\n x = this,\n xc = x.c,\n d = new BigNumber(ONE),\n n1 = d0 = new BigNumber(ONE),\n d1 = n0 = new BigNumber(ONE);\n\n if ( md != null ) {\n ERRORS = false;\n n = new BigNumber(md);\n ERRORS = k;\n\n if ( !( k = n.isInt() ) || n.lt(ONE) ) {\n\n if (ERRORS) {\n raise( 22,\n 'max denominator ' + ( k ? 'out of range' : 'not an integer' ), md );\n }\n\n // ERRORS is false:\n // If md is a finite non-integer >= 1, round it to an integer and use it.\n md = !k && n.c && round( n, n.e + 1, 1 ).gte(ONE) ? n : null;\n }\n }\n\n if ( !xc ) return x.toString();\n s = coeffToString(xc);\n\n // Determine initial denominator.\n // d is a power of 10 and the minimum max denominator that specifies the value exactly.\n e = d.e = s.length - x.e - 1;\n d.c[0] = POWS_TEN[ ( exp = e % LOG_BASE ) < 0 ? LOG_BASE + exp : exp ];\n md = !md || n.cmp(d) > 0 ? ( e > 0 ? d : n1 ) : n;\n\n exp = MAX_EXP;\n MAX_EXP = 1 / 0;\n n = new BigNumber(s);\n\n // n0 = d1 = 0\n n0.c[0] = 0;\n\n for ( ; ; ) {\n q = div( n, d, 0, 1 );\n d2 = d0.plus( q.times(d1) );\n if ( d2.cmp(md) == 1 ) break;\n d0 = d1;\n d1 = d2;\n n1 = n0.plus( q.times( d2 = n1 ) );\n n0 = d2;\n d = n.minus( q.times( d2 = d ) );\n n = d2;\n }\n\n d2 = div( md.minus(d0), d1, 0, 1 );\n n0 = n0.plus( d2.times(n1) );\n d0 = d0.plus( d2.times(d1) );\n n0.s = n1.s = x.s;\n e *= 2;\n\n // Determine which fraction is closer to x, n0/d0 or n1/d1\n arr = div( n1, d1, e, ROUNDING_MODE ).minus(x).abs().cmp(\n div( n0, d0, e, ROUNDING_MODE ).minus(x).abs() ) < 1\n ? [ n1.toString(), d1.toString() ]\n : [ n0.toString(), d0.toString() ];\n\n MAX_EXP = exp;\n return arr;\n };\n\n\n /*\n * Return the value of this BigNumber converted to a number primitive.\n */\n P.toNumber = function () {\n var x = this;\n\n // Ensure zero has correct sign.\n return +x || ( x.s ? x.s * 0 : NaN );\n };\n\n\n /*\n * Return a BigNumber whose value is the value of this BigNumber raised to the power n.\n * If n is negative round according to DECIMAL_PLACES and ROUNDING_MODE.\n * If POW_PRECISION is not 0, round to POW_PRECISION using ROUNDING_MODE.\n *\n * n {number} Integer, -9007199254740992 to 9007199254740992 inclusive.\n * (Performs 54 loop iterations for n of 9007199254740992.)\n *\n * 'pow() exponent not an integer: {n}'\n * 'pow() exponent out of range: {n}'\n */\n P.toPower = P.pow = function (n) {\n var k, y,\n i = mathfloor( n < 0 ? -n : +n ),\n x = this;\n\n // Pass ±Infinity to Math.pow if exponent is out of range.\n if ( !isValidInt( n, -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER, 23, 'exponent' ) &&\n ( !isFinite(n) || i > MAX_SAFE_INTEGER && ( n /= 0 ) ||\n parseFloat(n) != n && !( n = NaN ) ) ) {\n return new BigNumber( Math.pow( +x, n ) );\n }\n\n // Truncating each coefficient array to a length of k after each multiplication equates\n // to truncating significant digits to POW_PRECISION + [28, 41], i.e. there will be a\n // minimum of 28 guard digits retained. (Using + 1.5 would give [9, 21] guard digits.)\n k = POW_PRECISION ? mathceil( POW_PRECISION / LOG_BASE + 2 ) : 0;\n y = new BigNumber(ONE);\n\n for ( ; ; ) {\n\n if ( i % 2 ) {\n y = y.times(x);\n if ( !y.c ) break;\n if ( k && y.c.length > k ) y.c.length = k;\n }\n\n i = mathfloor( i / 2 );\n if ( !i ) break;\n\n x = x.times(x);\n if ( k && x.c && x.c.length > k ) x.c.length = k;\n }\n\n if ( n < 0 ) y = ONE.div(y);\n return k ? round( y, POW_PRECISION, ROUNDING_MODE ) : y;\n };\n\n\n /*\n * Return a string representing the value of this BigNumber rounded to sd significant digits\n * using rounding mode rm or ROUNDING_MODE. If sd is less than the number of digits\n * necessary to represent the integer part of the value in fixed-point notation, then use\n * exponential notation.\n *\n * [sd] {number} Significant digits. Integer, 1 to MAX inclusive.\n * [rm] {number} Rounding mode. Integer, 0 to 8 inclusive.\n *\n * 'toPrecision() precision not an integer: {sd}'\n * 'toPrecision() precision out of range: {sd}'\n * 'toPrecision() rounding mode not an integer: {rm}'\n * 'toPrecision() rounding mode out of range: {rm}'\n */\n P.toPrecision = function ( sd, rm ) {\n return format( this, sd != null && isValidInt( sd, 1, MAX, 24, 'precision' )\n ? sd | 0 : null, rm, 24 );\n };\n\n\n /*\n * Return a string representing the value of this BigNumber in base b, or base 10 if b is\n * omitted. If a base is specified, including base 10, round according to DECIMAL_PLACES and\n * ROUNDING_MODE. If a base is not specified, and this BigNumber has a positive exponent\n * that is equal to or greater than TO_EXP_POS, or a negative exponent equal to or less than\n * TO_EXP_NEG, return exponential notation.\n *\n * [b] {number} Integer, 2 to 64 inclusive.\n *\n * 'toString() base not an integer: {b}'\n * 'toString() base out of range: {b}'\n */\n P.toString = function (b) {\n var str,\n n = this,\n s = n.s,\n e = n.e;\n\n // Infinity or NaN?\n if ( e === null ) {\n\n if (s) {\n str = 'Infinity';\n if ( s < 0 ) str = '-' + str;\n } else {\n str = 'NaN';\n }\n } else {\n str = coeffToString( n.c );\n\n if ( b == null || !isValidInt( b, 2, 64, 25, 'base' ) ) {\n str = e <= TO_EXP_NEG || e >= TO_EXP_POS\n ? toExponential( str, e )\n : toFixedPoint( str, e );\n } else {\n str = convertBase( toFixedPoint( str, e ), b | 0, 10, s );\n }\n\n if ( s < 0 && n.c[0] ) str = '-' + str;\n }\n\n return str;\n };\n\n\n /*\n * Return a new BigNumber whose value is the value of this BigNumber truncated to a whole\n * number.\n */\n P.truncated = P.trunc = function () {\n return round( new BigNumber(this), this.e + 1, 1 );\n };\n\n\n\n /*\n * Return as toString, but do not accept a base argument.\n */\n P.valueOf = P.toJSON = function () {\n return this.toString();\n };\n\n\n // Aliases for BigDecimal methods.\n //P.add = P.plus; // P.add included above\n //P.subtract = P.minus; // P.sub included above\n //P.multiply = P.times; // P.mul included above\n //P.divide = P.div;\n //P.remainder = P.mod;\n //P.compareTo = P.cmp;\n //P.negate = P.neg;\n\n\n if ( configObj != null ) BigNumber.config(configObj);\n\n return BigNumber;\n }\n\n\n // PRIVATE HELPER FUNCTIONS\n\n\n function bitFloor(n) {\n var i = n | 0;\n return n > 0 || n === i ? i : i - 1;\n }\n\n\n // Return a coefficient array as a string of base 10 digits.\n function coeffToString(a) {\n var s, z,\n i = 1,\n j = a.length,\n r = a[0] + '';\n\n for ( ; i < j; ) {\n s = a[i++] + '';\n z = LOG_BASE - s.length;\n for ( ; z--; s = '0' + s );\n r += s;\n }\n\n // Determine trailing zeros.\n for ( j = r.length; r.charCodeAt(--j) === 48; );\n return r.slice( 0, j + 1 || 1 );\n }\n\n\n // Compare the value of BigNumbers x and y.\n function compare( x, y ) {\n var a, b,\n xc = x.c,\n yc = y.c,\n i = x.s,\n j = y.s,\n k = x.e,\n l = y.e;\n\n // Either NaN?\n if ( !i || !j ) return null;\n\n a = xc && !xc[0];\n b = yc && !yc[0];\n\n // Either zero?\n if ( a || b ) return a ? b ? 0 : -j : i;\n\n // Signs differ?\n if ( i != j ) return i;\n\n a = i < 0;\n b = k == l;\n\n // Either Infinity?\n if ( !xc || !yc ) return b ? 0 : !xc ^ a ? 1 : -1;\n\n // Compare exponents.\n if ( !b ) return k > l ^ a ? 1 : -1;\n\n j = ( k = xc.length ) < ( l = yc.length ) ? k : l;\n\n // Compare digit by digit.\n for ( i = 0; i < j; i++ ) if ( xc[i] != yc[i] ) return xc[i] > yc[i] ^ a ? 1 : -1;\n\n // Compare lengths.\n return k == l ? 0 : k > l ^ a ? 1 : -1;\n }\n\n\n /*\n * Return true if n is a valid number in range, otherwise false.\n * Use for argument validation when ERRORS is false.\n * Note: parseInt('1e+1') == 1 but parseFloat('1e+1') == 10.\n */\n function intValidatorNoErrors( n, min, max ) {\n return ( n = truncate(n) ) >= min && n <= max;\n }\n\n\n function isArray(obj) {\n return Object.prototype.toString.call(obj) == '[object Array]';\n }\n\n\n /*\n * Convert string of baseIn to an array of numbers of baseOut.\n * Eg. convertBase('255', 10, 16) returns [15, 15].\n * Eg. convertBase('ff', 16, 10) returns [2, 5, 5].\n */\n function toBaseOut( str, baseIn, baseOut ) {\n var j,\n arr = [0],\n arrL,\n i = 0,\n len = str.length;\n\n for ( ; i < len; ) {\n for ( arrL = arr.length; arrL--; arr[arrL] *= baseIn );\n arr[ j = 0 ] += ALPHABET.indexOf( str.charAt( i++ ) );\n\n for ( ; j < arr.length; j++ ) {\n\n if ( arr[j] > baseOut - 1 ) {\n if ( arr[j + 1] == null ) arr[j + 1] = 0;\n arr[j + 1] += arr[j] / baseOut | 0;\n arr[j] %= baseOut;\n }\n }\n }\n\n return arr.reverse();\n }\n\n\n function toExponential( str, e ) {\n return ( str.length > 1 ? str.charAt(0) + '.' + str.slice(1) : str ) +\n ( e < 0 ? 'e' : 'e+' ) + e;\n }\n\n\n function toFixedPoint( str, e ) {\n var len, z;\n\n // Negative exponent?\n if ( e < 0 ) {\n\n // Prepend zeros.\n for ( z = '0.'; ++e; z += '0' );\n str = z + str;\n\n // Positive exponent\n } else {\n len = str.length;\n\n // Append zeros.\n if ( ++e > len ) {\n for ( z = '0', e -= len; --e; z += '0' );\n str += z;\n } else if ( e < len ) {\n str = str.slice( 0, e ) + '.' + str.slice(e);\n }\n }\n\n return str;\n }\n\n\n function truncate(n) {\n n = parseFloat(n);\n return n < 0 ? mathceil(n) : mathfloor(n);\n }\n\n\n // EXPORT\n\n\n BigNumber = another();\n\n // AMD.\n if ( typeof define == 'function' && define.amd ) {\n define( function () { return BigNumber; } );\n\n // Node and other environments that support module.exports.\n } else if ( typeof module != 'undefined' && module.exports ) {\n module.exports = BigNumber;\n if ( !crypto ) try { crypto = require('crypto'); } catch (e) {}\n\n // Browser.\n } else {\n global.BigNumber = BigNumber;\n }\n})(this);\n", - "var web3 = require('./lib/web3');\nweb3.providers.HttpProvider = require('./lib/web3/httpprovider');\nweb3.providers.QtSyncProvider = require('./lib/web3/qtsync');\nweb3.eth.contract = require('./lib/web3/contract');\nweb3.abi = require('./lib/solidity/abi');\n\n// dont override global variable\nif (typeof window !== 'undefined' && typeof window.web3 === 'undefined') {\n window.web3 = web3;\n}\n\nmodule.exports = web3;\n\n" + "var web3 = require('./lib/web3');\nweb3.providers.HttpProvider = require('./lib/web3/httpprovider');\nweb3.providers.QtSyncProvider = require('./lib/web3/qtsync');\nweb3.eth.contract = require('./lib/web3/contract');\n\n// dont override global variable\nif (typeof window !== 'undefined' && typeof window.web3 === 'undefined') {\n window.web3 = web3;\n}\n\nmodule.exports = web3;\n\n" ] } \ No newline at end of file diff --git a/dist/web3.min.js b/dist/web3.min.js index b02f1f966..eb4052b6c 100644 --- a/dist/web3.min.js +++ b/dist/web3.min.js @@ -1,2 +1,2 @@ -require=function t(e,n,r){function o(a,s){if(!n[a]){if(!e[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[a]={exports:{}};e[a][0].call(l.exports,function(t){var n=e[a][1][t];return o(n?n:t)},l,l.exports,t,e,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;a0&&console.warn("didn't found matching constructor, using default one"),"")};e.exports={formatConstructorParams:i}},{"./coder":2,"./utils":5}],2:[function(t,e,n){var r=t("bignumber.js"),o=t("../utils/utils"),i=t("./formatters"),a=t("./param"),s=function(t){return"[]"===t.slice(-2)},u=function(t){this._name=t.name,this._match=t.match,this._mode=t.mode,this._inputFormatter=t.inputFormatter,this._outputFormatter=t.outputFormatter};u.prototype.isType=function(t){return"strict"===this._match?this._name===t||0===t.indexOf(this._name)&&"[]"===t.slice(this._name.length):"prefix"===this._match?0===t.indexOf(this._name):void 0},u.prototype.formatInput=function(t,e){if(o.isArray(t)&&e){var n=this;return t.map(function(t){return n._inputFormatter(t)}).reduce(function(t,e){return t.combine(e)},i.formatInputInt(t.length)).withOffset(32)}return this._inputFormatter(t)},u.prototype.formatOutput=function(t,e){if(e){for(var n=[],o=new r(t.dynamicPart().slice(0,64),16),i=0;64*o>i;i+=64)n.push(this._outputFormatter(new a(t.dynamicPart().substr(i+64,64))));return n}return this._outputFormatter(t)},u.prototype.sliceParam=function(t,e,n){return"bytes"===this._mode?a.decodeBytes(t,e):s(n)?a.decodeArray(t,e):a.decodeParam(t,e)};var c=function(t){this._types=t};c.prototype._requireType=function(t){var e=this._types.filter(function(e){return e.isType(t)})[0];if(!e)throw Error("invalid solidity type!: "+t);return e},c.prototype._formatInput=function(t,e){return this._requireType(t).formatInput(e,s(t))},c.prototype.encodeParam=function(t,e){return this._formatInput(t,e).encode()},c.prototype.encodeParams=function(t,e){var n=this,r=t.map(function(t,r){return n._formatInput(t,e[r])});return a.encodeList(r)},c.prototype.decodeParam=function(t,e){return this.decodeParams([t],e)[0]},c.prototype.decodeParams=function(t,e){var n=this;return t.map(function(t,r){var o=n._requireType(t),i=o.sliceParam(e,r,t);return o.formatOutput(i,s(t))})};var l=new c([new u({name:"address",match:"strict",mode:"value",inputFormatter:i.formatInputInt,outputFormatter:i.formatOutputAddress}),new u({name:"bool",match:"strict",mode:"value",inputFormatter:i.formatInputBool,outputFormatter:i.formatOutputBool}),new u({name:"int",match:"prefix",mode:"value",inputFormatter:i.formatInputInt,outputFormatter:i.formatOutputInt}),new u({name:"uint",match:"prefix",mode:"value",inputFormatter:i.formatInputInt,outputFormatter:i.formatOutputUInt}),new u({name:"bytes",match:"strict",mode:"bytes",inputFormatter:i.formatInputDynamicBytes,outputFormatter:i.formatOutputDynamicBytes}),new u({name:"bytes",match:"prefix",mode:"value",inputFormatter:i.formatInputBytes,outputFormatter:i.formatOutputBytes}),new u({name:"real",match:"prefix",mode:"value",inputFormatter:i.formatInputReal,outputFormatter:i.formatOutputReal}),new u({name:"ureal",match:"prefix",mode:"value",inputFormatter:i.formatInputReal,outputFormatter:i.formatOutputUReal})]);e.exports=l},{"../utils/utils":8,"./formatters":3,"./param":4,"bignumber.js":"bignumber.js"}],3:[function(t,e,n){var r=t("bignumber.js"),o=t("../utils/utils"),i=t("../utils/config"),a=t("./param"),s=function(t){var e=2*i.ETH_PADDING;r.config(i.ETH_BIGNUMBER_ROUNDING_MODE);var n=o.padLeft(o.toTwosComplement(t).round().toString(16),e);return new a(n)},u=function(t){var e=o.fromAscii(t,i.ETH_PADDING).substr(2);return new a(e)},c=function(t){var e=o.fromAscii(t,i.ETH_PADDING).substr(2);return new a(s(t.length).value+e,32)},l=function(t){var e="000000000000000000000000000000000000000000000000000000000000000"+(t?"1":"0");return new a(e)},f=function(t){return s(new r(t).times(new r(2).pow(128)))},p=function(t){return"1"===new r(t.substr(0,1),16).toString(2).substr(0,1)},m=function(t){var e=t.staticPart()||"0";return p(e)?new r(e,16).minus(new r("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16)).minus(1):new r(e,16)},h=function(t){var e=t.staticPart()||"0";return new r(e,16)},d=function(t){return m(t).dividedBy(new r(2).pow(128))},g=function(t){return h(t).dividedBy(new r(2).pow(128))},y=function(t){return"0000000000000000000000000000000000000000000000000000000000000001"===t.staticPart()?!0:!1},v=function(t){return o.toAscii(t.staticPart())},b=function(t){return o.toAscii(t.dynamicPart().slice(64))},w=function(t){var e=t.staticPart();return"0x"+e.slice(e.length-40,e.length)};e.exports={formatInputInt:s,formatInputBytes:u,formatInputDynamicBytes:c,formatInputBool:l,formatInputReal:f,formatOutputInt:m,formatOutputUInt:h,formatOutputReal:d,formatOutputUReal:g,formatOutputBool:y,formatOutputBytes:v,formatOutputDynamicBytes:b,formatOutputAddress:w}},{"../utils/config":7,"../utils/utils":8,"./param":4,"bignumber.js":"bignumber.js"}],4:[function(t,e,n){var r=t("../utils/utils"),o=function(t,e){this.value=t||"",this.offset=e};o.prototype.dynamicPartLength=function(){return this.dynamicPart().length/2},o.prototype.withOffset=function(t){return new o(this.value,t)},o.prototype.combine=function(t){return new o(this.value+t.value)},o.prototype.isDynamic=function(){return this.value.length>64},o.prototype.offsetAsBytes=function(){return this.isDynamic()?r.padLeft(r.toTwosComplement(this.offset).toString(16),64):""},o.prototype.staticPart=function(){return this.isDynamic()?this.offsetAsBytes():this.value},o.prototype.dynamicPart=function(){return this.isDynamic()?this.value:""},o.prototype.encode=function(){return this.staticPart()+this.dynamicPart()},o.encodeList=function(t){var e=32*t.length,n=t.map(function(t){if(!t.isDynamic())return t;var n=e;return e+=t.dynamicPartLength(),t.withOffset(n)});return n.reduce(function(t,e){return t+e.dynamicPart()},n.reduce(function(t,e){return t+e.staticPart()},""))},o.decodeParam=function(t,e){return e=e||0,new o(t.substr(64*e,64))};var i=function(t,e){return parseInt("0x"+t.substr(64*e,64))};o.decodeBytes=function(t,e){e=e||0;var n=i(t,e);return new o(t.substr(2*n,128))},o.decodeArray=function(t,e){e=e||0;var n=i(t,e),r=parseInt("0x"+t.substr(2*n,64));return new o(t.substr(2*n,64*(r+1)))},e.exports=o},{"../utils/utils":8}],5:[function(t,e,n){var r=function(t,e){return t.filter(function(t){return"constructor"===t.type&&t.inputs.length===e})[0]};e.exports={getConstructor:r}},{}],6:[function(t,e,n){"use strict";n.XMLHttpRequest="undefined"==typeof XMLHttpRequest?{}:XMLHttpRequest},{}],7:[function(t,e,n){var r=t("bignumber.js"),o=["wei","Kwei","Mwei","Gwei","szabo","finney","ether","grand","Mether","Gether","Tether","Pether","Eether","Zether","Yether","Nether","Dether","Vether","Uether"];e.exports={ETH_PADDING:32,ETH_SIGNATURE_LENGTH:4,ETH_UNITS:o,ETH_BIGNUMBER_ROUNDING_MODE:{ROUNDING_MODE:r.ROUND_DOWN},ETH_POLLING_TIMEOUT:1e3,defaultBlock:"latest",defaultAccount:void 0}},{"bignumber.js":"bignumber.js"}],8:[function(t,e,n){var r=t("bignumber.js"),o={wei:"1",kwei:"1000",ada:"1000",mwei:"1000000",babbage:"1000000",gwei:"1000000000",shannon:"1000000000",szabo:"1000000000000",finney:"1000000000000000",ether:"1000000000000000000",kether:"1000000000000000000000",grand:"1000000000000000000000",einstein:"1000000000000000000000",mether:"1000000000000000000000000",gether:"1000000000000000000000000000",tether:"1000000000000000000000000000000"},i=function(t,e,n){return new Array(e-t.length+1).join(n?n:"0")+t},a=function(t){var e="",n=0,r=t.length;for("0x"===t.substring(0,2)&&(n=2);r>n;n+=2){var o=parseInt(t.substr(n,2),16);if(0===o)break;e+=String.fromCharCode(o)}return e},s=function(t){for(var e="",n=0;nthis._inputTypes.length&&i.isObject(t[t.length-1])&&(e=t.pop()),e.to=this._address,e.data="0x"+this.signature()+o.encodeParams(this._inputTypes,t),e},a.prototype.signature=function(){return r.sha3(r.fromAscii(this._name)).slice(2,10)},a.prototype.call=function(){var t=this.toPayload.apply(this,Array.prototype.slice.call(arguments)),e=r.eth.call(t);e=e.length>=2?e.slice(2):e;var n=o.decodeParams(this._outputTypes,e);return 1===n.length?n[0]:n},a.prototype.sendTransaction=function(){var t=this.toPayload.apply(this,Array.prototype.slice.call(arguments));r.eth.sendTransaction(t)},a.prototype.displayName=function(){return i.extractDisplayName(this._name)},a.prototype.typeName=function(){return i.extractTypeName(this._name)},a.prototype.execute=function(){var t=!this._constant;return t?this.sendTransaction.apply(this,Array.prototype.slice.call(arguments)):this.call.apply(this,Array.prototype.slice.call(arguments))},a.prototype.attachToContract=function(t){var e=this.execute.bind(this);e.call=this.call.bind(this),e.sendTransaction=this.sendTransaction.bind(this);var n=this.displayName();t[n]||(t[n]=e),t[n][this.typeName()]=e},e.exports=a},{"../solidity/coder":2,"../utils/utils":8,"../web3":10}],19:[function(t,e,n){"use strict";var r=t("xmlhttprequest").XMLHttpRequest,o=t("./errors"),i=function(t){this.host=t||"http://localhost:8545"};i.prototype.send=function(t){var e=new r;e.open("POST",this.host,!1);try{e.send(JSON.stringify(t))}catch(n){throw o.InvalidConnection(this.host)}var i=e.responseText;try{i=JSON.parse(i)}catch(a){throw o.InvalidResponse(i)}return i},i.prototype.sendAsync=function(t,e){var n=new r;n.onreadystatechange=function(){if(4===n.readyState){var t=n.responseText,r=null;try{t=JSON.parse(t)}catch(i){r=o.InvalidResponse(t)}e(r,t)}},n.open("POST",this.host,!0);try{n.send(JSON.stringify(t))}catch(i){e(o.InvalidConnection(this.host))}},e.exports=i},{"./errors":13,xmlhttprequest:6}],20:[function(t,e,n){var r=function(){return arguments.callee._singletonInstance?arguments.callee._singletonInstance:(arguments.callee._singletonInstance=this,void(this.messageId=1))};r.getInstance=function(){var t=new r;return t},r.prototype.toPayload=function(t,e){return t||console.error("jsonrpc method should be specified!"),{jsonrpc:"2.0",method:t,params:e||[],id:this.messageId++}},r.prototype.isValidResponse=function(t){return!!t&&!t.error&&"2.0"===t.jsonrpc&&"number"==typeof t.id&&void 0!==t.result},r.prototype.toBatchPayload=function(t){var e=this;return t.map(function(t){return e.toPayload(t.method,t.params)})},e.exports=r},{}],21:[function(t,e,n){var r=t("./requestmanager"),o=t("../utils/utils"),i=t("./errors"),a=function(t){this.name=t.name,this.call=t.call,this.params=t.params||0,this.inputFormatter=t.inputFormatter,this.outputFormatter=t.outputFormatter};a.prototype.getCall=function(t){return o.isFunction(this.call)?this.call(t):this.call},a.prototype.extractCallback=function(t){return o.isFunction(t[t.length-1])?t.pop():null},a.prototype.validateArgs=function(t){if(t.length!==this.params)throw i.InvalidNumberOfParams()},a.prototype.formatInput=function(t){return this.inputFormatter?this.inputFormatter.map(function(e,n){return e?e(t[n]):t[n]}):t},a.prototype.formatOutput=function(t){return this.outputFormatter&&null!==t?this.outputFormatter(t):t},a.prototype.attachToObject=function(t){var e=this.send.bind(this);e.call=this.call;var n=this.name.split(".");n.length>1?(t[n[0]]=t[n[0]]||{},t[n[0]][n[1]]=e):t[n[0]]=e},a.prototype.toPayload=function(t){var e=this.getCall(t),n=this.extractCallback(t),r=this.formatInput(t);return this.validateArgs(r),{method:e,params:r,callback:n}},a.prototype.send=function(){var t=this.toPayload(Array.prototype.slice.call(arguments));if(t.callback){var e=this;return r.getInstance().sendAsync(t,function(n,r){t.callback(null,e.formatOutput(r))})}return this.formatOutput(r.getInstance().send(t))},e.exports=a},{"../utils/utils":8,"./errors":13,"./requestmanager":25}],22:[function(t,e,n){var r=t("../utils/utils"),o=t("./property"),i=[],a=[new o({name:"listening",getter:"net_listening"}),new o({name:"peerCount",getter:"net_peerCount",outputFormatter:r.toDecimal})];e.exports={methods:i,properties:a}},{"../utils/utils":8,"./property":23}],23:[function(t,e,n){var r=t("./requestmanager"),o=function(t){this.name=t.name,this.getter=t.getter,this.setter=t.setter,this.outputFormatter=t.outputFormatter,this.inputFormatter=t.inputFormatter};o.prototype.formatInput=function(t){return this.inputFormatter?this.inputFormatter(t):t},o.prototype.formatOutput=function(t){return this.outputFormatter&&null!==t?this.outputFormatter(t):t},o.prototype.attachToObject=function(t){var e={get:this.get.bind(this),set:this.set.bind(this)},n=this.name.split(".");n.length>1?(t[n[0]]=t[n[0]]||{},Object.defineProperty(t[n[0]],n[1],e)):Object.defineProperty(t,n[0],e)},o.prototype.get=function(){return this.formatOutput(r.getInstance().send({method:this.getter}))},o.prototype.set=function(t){return r.getInstance().send({method:this.setter,params:[this.formatInput(t)]})},e.exports=o},{"./requestmanager":25}],24:[function(t,e,n){var r=function(){};r.prototype.send=function(t){var e=navigator.qt.callMethod(JSON.stringify(t));return JSON.parse(e)},e.exports=r},{}],25:[function(t,e,n){var r=t("./jsonrpc"),o=t("../utils/utils"),i=t("../utils/config"),a=t("./errors"),s=function(t){return arguments.callee._singletonInstance?arguments.callee._singletonInstance:(arguments.callee._singletonInstance=this,this.provider=t,this.polls=[],this.timeout=null,void this.poll())};s.getInstance=function(){var t=new s;return t},s.prototype.send=function(t){if(!this.provider)return console.error(a.InvalidProvider()),null;var e=r.getInstance().toPayload(t.method,t.params),n=this.provider.send(e);if(!r.getInstance().isValidResponse(n))throw a.InvalidResponse(n);return n.result},s.prototype.sendAsync=function(t,e){if(!this.provider)return e(a.InvalidProvider());var n=r.getInstance().toPayload(t.method,t.params);this.provider.sendAsync(n,function(t,n){return t?e(t):r.getInstance().isValidResponse(n)?void e(null,n.result):e(a.InvalidResponse(n))})},s.prototype.setProvider=function(t){this.provider=t},s.prototype.startPolling=function(t,e,n,r){this.polls.push({data:t,id:e,callback:n,uninstall:r})},s.prototype.stopPolling=function(t){for(var e=this.polls.length;e--;){var n=this.polls[e];n.id===t&&this.polls.splice(e,1)}},s.prototype.reset=function(){this.polls.forEach(function(t){t.uninstall(t.id)}),this.polls=[],this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.poll()},s.prototype.poll=function(){if(this.timeout=setTimeout(this.poll.bind(this),i.ETH_POLLING_TIMEOUT),this.polls.length){if(!this.provider)return void console.error(a.InvalidProvider());var t=r.getInstance().toBatchPayload(this.polls.map(function(t){return t.data})),e=this;this.provider.sendAsync(t,function(t,n){if(!t){if(!o.isArray(n))throw a.InvalidResponse(n);n.map(function(t,n){return t.callback=e.polls[n].callback,t}).filter(function(t){var e=r.getInstance().isValidResponse(t);return e||t.callback(a.InvalidResponse(t)),e}).filter(function(t){return o.isArray(t.result)&&t.result.length>0}).forEach(function(t){t.callback(null,t.result)})}})}},e.exports=s},{"../utils/config":7,"../utils/utils":8,"./errors":13,"./jsonrpc":20}],26:[function(t,e,n){var r=t("./method"),o=t("./formatters"),i=new r({name:"post",call:"shh_post",params:1,inputFormatter:[o.inputPostFormatter]}),a=new r({name:"newIdentity",call:"shh_newIdentity",params:0}),s=new r({name:"hasIdentity",call:"shh_hasIdentity",params:1}),u=new r({name:"newGroup",call:"shh_newGroup",params:0}),c=new r({name:"addToGroup",call:"shh_addToGroup",params:0}),l=[i,a,s,u,c];e.exports={methods:l}},{"./formatters":17,"./method":21}],27:[function(t,e,n){var r=t("./method"),o=function(){var t=function(t){return"string"==typeof t[0]?"eth_newBlockFilter":"eth_newFilter"},e=new r({name:"newFilter",call:t,params:1}),n=new r({name:"uninstallFilter",call:"eth_uninstallFilter",params:1}),o=new r({name:"getLogs",call:"eth_getFilterLogs",params:1}),i=new r({name:"poll",call:"eth_getFilterChanges",params:1});return[e,n,o,i]},i=function(){var t=new r({name:"newFilter",call:"shh_newFilter",params:1}),e=new r({name:"uninstallFilter",call:"shh_uninstallFilter",params:1}),n=new r({name:"getLogs",call:"shh_getMessages",params:1}),o=new r({name:"poll",call:"shh_getFilterChanges",params:1 -});return[t,e,n,o]};e.exports={eth:o,shh:i}},{"./method":21}],28:[function(t,e,n){},{}],"bignumber.js":[function(t,e,n){!function(n){"use strict";function r(t){function e(t,r){var o,i,a,s,u,c,l=this;if(!(l instanceof e))return J&&k(26,"constructor call without new",t),new e(t,r);if(null!=r&&V(r,2,64,R,"base")){if(r=0|r,c=t+"",10==r)return l=new e(t instanceof e?t:c),S(l,j+l.e+1,U);if((s="number"==typeof t)&&0*t!=0||!new RegExp("^-?"+(o="["+F.slice(0,r)+"]+")+"(?:\\."+o+")?$",37>r?"i":"").test(c))return d(l,c,s,r);s?(l.s=0>1/t?(c=c.slice(1),-1):1,J&&c.replace(/^0\.0*|\./,"").length>15&&k(R,_,t),s=!1):l.s=45===c.charCodeAt(0)?(c=c.slice(1),-1):1,c=n(c,10,r,l.s)}else{if(t instanceof e)return l.s=t.s,l.e=t.e,l.c=(t=t.c)?t.slice():t,void(R=0);if((s="number"==typeof t)&&0*t==0){if(l.s=0>1/t?(t=-t,-1):1,t===~~t){for(i=0,a=t;a>=10;a/=10,i++);return l.e=i,l.c=[t],void(R=0)}c=t+""}else{if(!g.test(c=t+""))return d(l,c,s);l.s=45===c.charCodeAt(0)?(c=c.slice(1),-1):1}}for((i=c.indexOf("."))>-1&&(c=c.replace(".","")),(a=c.search(/e/i))>0?(0>i&&(i=a),i+=+c.slice(a+1),c=c.substring(0,a)):0>i&&(i=c.length),a=0;48===c.charCodeAt(a);a++);for(u=c.length;48===c.charCodeAt(--u););if(c=c.slice(a,u+1))if(u=c.length,s&&J&&u>15&&k(R,_,l.s*t),i=i-a-1,i>G)l.c=l.e=null;else if(M>i)l.c=[l.e=0];else{if(l.e=i,l.c=[],a=(i+1)%I,0>i&&(a+=I),u>a){for(a&&l.c.push(+c.slice(0,a)),u-=I;u>a;)l.c.push(+c.slice(a,a+=I));c=c.slice(a),a=I-c.length}else a-=u;for(;a--;c+="0");l.c.push(+c)}else l.c=[l.e=0];R=0}function n(t,n,r,o){var a,s,u,l,p,m,h,d=t.indexOf("."),g=j,y=U;for(37>r&&(t=t.toLowerCase()),d>=0&&(u=z,z=0,t=t.replace(".",""),h=new e(r),p=h.pow(t.length-d),z=u,h.c=c(f(i(p.c),p.e),10,n),h.e=h.c.length),m=c(t,r,n),s=u=m.length;0==m[--u];m.pop());if(!m[0])return"0";if(0>d?--s:(p.c=m,p.e=s,p.s=o,p=E(p,h,g,y,n),m=p.c,l=p.r,s=p.e),a=s+g+1,d=m[a],u=n/2,l=l||0>a||null!=m[a+1],l=4>y?(null!=d||l)&&(0==y||y==(p.s<0?3:2)):d>u||d==u&&(4==y||l||6==y&&1&m[a-1]||y==(p.s<0?8:7)),1>a||!m[0])t=l?f("1",-g):"0";else{if(m.length=a,l)for(--n;++m[--a]>n;)m[a]=0,a||(++s,m.unshift(1));for(u=m.length;!m[--u];);for(d=0,t="";u>=d;t+=F.charAt(m[d++]));t=f(t,s)}return t}function m(t,n,r,o){var a,s,u,c,p;if(r=null!=r&&V(r,0,8,o,w)?0|r:U,!t.c)return t.toString();if(a=t.c[0],u=t.e,null==n)p=i(t.c),p=19==o||24==o&&H>=u?l(p,u):f(p,u);else if(t=S(new e(t),n,r),s=t.e,p=i(t.c),c=p.length,19==o||24==o&&(s>=n||H>=s)){for(;n>c;p+="0",c++);p=l(p,s)}else if(n-=u,p=f(p,s),s+1>c){if(--n>0)for(p+=".";n--;p+="0");}else if(n+=s-c,n>0)for(s+1==c&&(p+=".");n--;p+="0");return t.s<0&&a?"-"+p:p}function T(t,n){var r,o,i=0;for(u(t[0])&&(t=t[0]),r=new e(t[0]);++it||t>n||t!=p(t))&&k(r,(o||"decimal places")+(e>t||t>n?" out of range":" not an integer"),t),!0}function D(t,e,n){for(var r=1,o=e.length;!e[--o];e.pop());for(o=e[0];o>=10;o/=10,r++);return(n=r+n*I-1)>G?t.c=t.e=null:M>n?t.c=[t.e=0]:(t.e=n,t.c=e),t}function k(t,e,n){var r=new Error(["new BigNumber","cmp","config","div","divToInt","eq","gt","gte","lt","lte","minus","mod","plus","precision","random","round","shift","times","toDigits","toExponential","toFixed","toFormat","toFraction","pow","toPrecision","toString","BigNumber"][t]+"() "+e+": "+n);throw r.name="BigNumber Error",R=0,r}function S(t,e,n,r){var o,i,a,s,u,c,l,f=t.c,p=O;if(f){t:{for(o=1,s=f[0];s>=10;s/=10,o++);if(i=e-o,0>i)i+=I,a=e,u=f[c=0],l=u/p[o-a-1]%10|0;else if(c=y((i+1)/I),c>=f.length){if(!r)break t;for(;f.length<=c;f.push(0));u=l=0,o=1,i%=I,a=i-I+1}else{for(u=s=f[c],o=1;s>=10;s/=10,o++);i%=I,a=i-I+o,l=0>a?0:u/p[o-a-1]%10|0}if(r=r||0>e||null!=f[c+1]||(0>a?u:u%p[o-a-1]),r=4>n?(l||r)&&(0==n||n==(t.s<0?3:2)):l>5||5==l&&(4==n||r||6==n&&(i>0?a>0?u/p[o-a]:0:f[c-1])%10&1||n==(t.s<0?8:7)),1>e||!f[0])return f.length=0,r?(e-=t.e+1,f[0]=p[e%I],t.e=-e||0):f[0]=t.e=0,t;if(0==i?(f.length=c,s=1,c--):(f.length=c+1,s=p[I-i],f[c]=a>0?v(u/p[o-a]%p[a])*s:0),r)for(;;){if(0==c){for(i=1,a=f[0];a>=10;a/=10,i++);for(a=f[0]+=s,s=1;a>=10;a/=10,s++);i!=s&&(t.e++,f[0]==x&&(f[0]=1));break}if(f[c]+=s,f[c]!=x)break;f[c--]=0,s=1}for(i=f.length;0===f[--i];f.pop());}t.e>G?t.c=t.e=null:t.en?null!=(t=o[n++]):void 0};return a(e="DECIMAL_PLACES")&&V(t,0,P,2,e)&&(j=0|t),r[e]=j,a(e="ROUNDING_MODE")&&V(t,0,8,2,e)&&(U=0|t),r[e]=U,a(e="EXPONENTIAL_AT")&&(u(t)?V(t[0],-P,0,2,e)&&V(t[1],0,P,2,e)&&(H=0|t[0],q=0|t[1]):V(t,-P,P,2,e)&&(H=-(q=0|(0>t?-t:t)))),r[e]=[H,q],a(e="RANGE")&&(u(t)?V(t[0],-P,-1,2,e)&&V(t[1],1,P,2,e)&&(M=0|t[0],G=0|t[1]):V(t,-P,P,2,e)&&(0|t?M=-(G=0|(0>t?-t:t)):J&&k(2,e+" cannot be zero",t))),r[e]=[M,G],a(e="ERRORS")&&(t===!!t||1===t||0===t?(R=0,V=(J=!!t)?A:s):J&&k(2,e+b,t)),r[e]=J,a(e="CRYPTO")&&(t===!!t||1===t||0===t?(W=!(!t||!h||"object"!=typeof h),t&&!W&&J&&k(2,"crypto unavailable",h)):J&&k(2,e+b,t)),r[e]=W,a(e="MODULO_MODE")&&V(t,0,9,2,e)&&($=0|t),r[e]=$,a(e="POW_PRECISION")&&V(t,0,P,2,e)&&(z=0|t),r[e]=z,a(e="FORMAT")&&("object"==typeof t?X=t:J&&k(2,e+" not an object",t)),r[e]=X,r},e.max=function(){return T(arguments,C.lt)},e.min=function(){return T(arguments,C.gt)},e.random=function(){var t=9007199254740992,n=Math.random()*t&2097151?function(){return v(Math.random()*t)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)};return function(t){var r,o,i,a,s,u=0,c=[],l=new e(L);if(t=null!=t&&V(t,0,P,14)?0|t:j,a=y(t/I),W)if(h&&h.getRandomValues){for(r=h.getRandomValues(new Uint32Array(a*=2));a>u;)s=131072*r[u]+(r[u+1]>>>11),s>=9e15?(o=h.getRandomValues(new Uint32Array(2)),r[u]=o[0],r[u+1]=o[1]):(c.push(s%1e14),u+=2);u=a/2}else if(h&&h.randomBytes){for(r=h.randomBytes(a*=7);a>u;)s=281474976710656*(31&r[u])+1099511627776*r[u+1]+4294967296*r[u+2]+16777216*r[u+3]+(r[u+4]<<16)+(r[u+5]<<8)+r[u+6],s>=9e15?h.randomBytes(7).copy(r,u):(c.push(s%1e14),u+=7);u=a/7}else J&&k(14,"crypto unavailable",h);if(!u)for(;a>u;)s=n(),9e15>s&&(c[u++]=s%1e14);for(a=c[--u],t%=I,a&&t&&(s=O[I-t],c[u]=v(a/s)*s);0===c[u];c.pop(),u--);if(0>u)c=[i=0];else{for(i=-1;0===c[0];c.shift(),i-=I);for(u=1,s=c[0];s>=10;s/=10,u++);I>u&&(i-=I-u)}return l.e=i,l.c=c,l}}(),E=function(){function t(t,e,n){var r,o,i,a,s=0,u=t.length,c=e%B,l=e/B|0;for(t=t.slice();u--;)i=t[u]%B,a=t[u]/B|0,r=l*i+a*c,o=c*i+r%B*B+s,s=(o/n|0)+(r/B|0)+l*a,t[u]=o%n;return s&&t.unshift(s),t}function n(t,e,n,r){var o,i;if(n!=r)i=n>r?1:-1;else for(o=i=0;n>o;o++)if(t[o]!=e[o]){i=t[o]>e[o]?1:-1;break}return i}function r(t,e,n,r){for(var o=0;n--;)t[n]-=o,o=t[n]1;t.shift());}return function(i,a,s,u,c){var l,f,p,m,h,d,g,y,b,w,_,F,N,O,B,P,T,A=i.s==a.s?1:-1,D=i.c,k=a.c;if(!(D&&D[0]&&k&&k[0]))return new e(i.s&&a.s&&(D?!k||D[0]!=k[0]:k)?D&&0==D[0]||!k?0*A:A/0:0/0);for(y=new e(A),b=y.c=[],f=i.e-a.e,A=s+f+1,c||(c=x,f=o(i.e/I)-o(a.e/I),A=A/I|0),p=0;k[p]==(D[p]||0);p++);if(k[p]>(D[p]||0)&&f--,0>A)b.push(1),m=!0;else{for(O=D.length,P=k.length,p=0,A+=2,h=v(c/(k[0]+1)),h>1&&(k=t(k,h,c),D=t(D,h,c),P=k.length,O=D.length),N=P,w=D.slice(0,P),_=w.length;P>_;w[_++]=0);T=k.slice(),T.unshift(0),B=k[0],k[1]>=c/2&&B++;do{if(h=0,l=n(k,w,P,_),0>l){if(F=w[0],P!=_&&(F=F*c+(w[1]||0)),h=v(F/B),h>1)for(h>=c&&(h=c-1),d=t(k,h,c),g=d.length,_=w.length;1==n(d,w,g,_);)h--,r(d,g>P?T:k,g,c),g=d.length,l=1;else 0==h&&(l=h=1),d=k.slice(),g=d.length;if(_>g&&d.unshift(0),r(w,d,_,c),_=w.length,-1==l)for(;n(k,w,P,_)<1;)h++,r(w,_>P?T:k,_,c),_=w.length}else 0===l&&(h++,w=[0]);b[p++]=h,w[0]?w[_++]=D[N]||0:(w=[D[N]],_=1)}while((N++=10;A/=10,p++);S(y,s+(y.e=p+f*I-1)+1,u,m)}else y.e=f,y.r=+m;return y}}(),d=function(){var t=/^(-?)0([xbo])/i,n=/^([^.]+)\.$/,r=/^\.([^.]+)$/,o=/^-?(Infinity|NaN)$/,i=/^\s*\+|^\s+|\s+$/g;return function(a,s,u,c){var l,f=u?s:s.replace(i,"");if(o.test(f))a.s=isNaN(f)?null:0>f?-1:1;else{if(!u&&(f=f.replace(t,function(t,e,n){return l="x"==(n=n.toLowerCase())?16:"b"==n?2:8,c&&c!=l?t:e}),c&&(l=c,f=f.replace(n,"$1").replace(r,"0.$1")),s!=f))return new e(f,l);J&&k(R,"not a"+(c?" base "+c:"")+" number",s),a.s=null}a.c=a.e=null,R=0}}(),C.absoluteValue=C.abs=function(){var t=new e(this);return t.s<0&&(t.s=1),t},C.ceil=function(){return S(new e(this),this.e+1,2)},C.comparedTo=C.cmp=function(t,n){return R=1,a(this,new e(t,n))},C.decimalPlaces=C.dp=function(){var t,e,n=this.c;if(!n)return null;if(t=((e=n.length-1)-o(this.e/I))*I,e=n[e])for(;e%10==0;e/=10,t--);return 0>t&&(t=0),t},C.dividedBy=C.div=function(t,n){return R=3,E(this,new e(t,n),j,U)},C.dividedToIntegerBy=C.divToInt=function(t,n){return R=4,E(this,new e(t,n),0,1)},C.equals=C.eq=function(t,n){return R=5,0===a(this,new e(t,n))},C.floor=function(){return S(new e(this),this.e+1,3)},C.greaterThan=C.gt=function(t,n){return R=6,a(this,new e(t,n))>0},C.greaterThanOrEqualTo=C.gte=function(t,n){return R=7,1===(n=a(this,new e(t,n)))||0===n},C.isFinite=function(){return!!this.c},C.isInteger=C.isInt=function(){return!!this.c&&o(this.e/I)>this.c.length-2},C.isNaN=function(){return!this.s},C.isNegative=C.isNeg=function(){return this.s<0},C.isZero=function(){return!!this.c&&0==this.c[0]},C.lessThan=C.lt=function(t,n){return R=8,a(this,new e(t,n))<0},C.lessThanOrEqualTo=C.lte=function(t,n){return R=9,-1===(n=a(this,new e(t,n)))||0===n},C.minus=C.sub=function(t,n){var r,i,a,s,u=this,c=u.s;if(R=10,t=new e(t,n),n=t.s,!c||!n)return new e(0/0);if(c!=n)return t.s=-n,u.plus(t);var l=u.e/I,f=t.e/I,p=u.c,m=t.c;if(!l||!f){if(!p||!m)return p?(t.s=-n,t):new e(m?u:0/0);if(!p[0]||!m[0])return m[0]?(t.s=-n,t):new e(p[0]?u:3==U?-0:0)}if(l=o(l),f=o(f),p=p.slice(),c=l-f){for((s=0>c)?(c=-c,a=p):(f=l,a=m),a.reverse(),n=c;n--;a.push(0));a.reverse()}else for(i=(s=(c=p.length)<(n=m.length))?c:n,c=n=0;i>n;n++)if(p[n]!=m[n]){s=p[n]0)for(;n--;p[r++]=0);for(n=x-1;i>c;){if(p[--i]0?(u=s,r=l):(a=-a,r=c),r.reverse();a--;r.push(0));r.reverse()}for(a=c.length,n=l.length,0>a-n&&(r=l,l=c,c=r,n=a),a=0;n;)a=(c[--n]=c[n]+l[n]+a)/x|0,c[n]%=x;return a&&(c.unshift(a),++u),D(t,c,u)},C.precision=C.sd=function(t){var e,n,r=this,o=r.c;if(null!=t&&t!==!!t&&1!==t&&0!==t&&(J&&k(13,"argument"+b,t),t!=!!t&&(t=null)),!o)return null;if(n=o.length-1,e=n*I+1,n=o[n]){for(;n%10==0;n/=10,e--);for(n=o[0];n>=10;n/=10,e++);}return t&&r.e+1>e&&(e=r.e+1),e},C.round=function(t,n){var r=new e(this);return(null==t||V(t,0,P,15))&&S(r,~~t+this.e+1,null!=n&&V(n,0,8,15,w)?0|n:U),r},C.shift=function(t){var n=this;return V(t,-N,N,16,"argument")?n.times("1e"+p(t)):new e(n.c&&n.c[0]&&(-N>t||t>N)?n.s*(0>t?0:1/0):n)},C.squareRoot=C.sqrt=function(){var t,n,r,a,s,u=this,c=u.c,l=u.s,f=u.e,p=j+4,m=new e("0.5");if(1!==l||!c||!c[0])return new e(!l||0>l&&(!c||c[0])?0/0:c?u:1/0);if(l=Math.sqrt(+u),0==l||l==1/0?(n=i(c),(n.length+f)%2==0&&(n+="0"),l=Math.sqrt(n),f=o((f+1)/2)-(0>f||f%2),l==1/0?n="1e"+f:(n=l.toExponential(),n=n.slice(0,n.indexOf("e")+1)+f),r=new e(n)):r=new e(l+""),r.c[0])for(f=r.e,l=f+p,3>l&&(l=0);;)if(s=r,r=m.times(s.plus(E(u,s,p,1))),i(s.c).slice(0,l)===(n=i(r.c)).slice(0,l)){if(r.el&&(g=w,w=_,_=g,a=l,l=m,m=a),a=l+m,g=[];a--;g.push(0));for(y=x,v=B,a=m;--a>=0;){for(r=0,h=_[a]%v,d=_[a]/v|0,u=l,s=a+u;s>a;)f=w[--u]%v,p=w[u]/v|0,c=d*f+p*h,f=h*f+c%v*v+g[s]+r,r=(f/y|0)+(c/v|0)+d*p,g[s--]=f%y;g[s]=r}return r?++i:g.shift(),D(t,g,i)},C.toDigits=function(t,n){var r=new e(this);return t=null!=t&&V(t,1,P,18,"precision")?0|t:null,n=null!=n&&V(n,0,8,18,w)?0|n:U,t?S(r,t,n):r},C.toExponential=function(t,e){return m(this,null!=t&&V(t,0,P,19)?~~t+1:null,e,19)},C.toFixed=function(t,e){return m(this,null!=t&&V(t,0,P,20)?~~t+this.e+1:null,e,20)},C.toFormat=function(t,e){var n=m(this,null!=t&&V(t,0,P,21)?~~t+this.e+1:null,e,21);if(this.c){var r,o=n.split("."),i=+X.groupSize,a=+X.secondaryGroupSize,s=X.groupSeparator,u=o[0],c=o[1],l=this.s<0,f=l?u.slice(1):u,p=f.length;if(a&&(r=i,i=a,a=r,p-=r),i>0&&p>0){for(r=p%i||i,u=f.substr(0,r);p>r;r+=i)u+=s+f.substr(r,i);a>0&&(u+=s+f.slice(r)),l&&(u="-"+u)}n=c?u+X.decimalSeparator+((a=+X.fractionGroupSize)?c.replace(new RegExp("\\d{"+a+"}\\B","g"),"$&"+X.fractionGroupSeparator):c):u}return n},C.toFraction=function(t){var n,r,o,a,s,u,c,l,f,p=J,m=this,h=m.c,d=new e(L),g=r=new e(L),y=c=new e(L);if(null!=t&&(J=!1,u=new e(t),J=p,(!(p=u.isInt())||u.lt(L))&&(J&&k(22,"max denominator "+(p?"out of range":"not an integer"),t),t=!p&&u.c&&S(u,u.e+1,1).gte(L)?u:null)),!h)return m.toString();for(f=i(h),a=d.e=f.length-m.e-1,d.c[0]=O[(s=a%I)<0?I+s:s],t=!t||u.cmp(d)>0?a>0?d:g:u,s=G,G=1/0,u=new e(f),c.c[0]=0;l=E(u,d,0,1),o=r.plus(l.times(y)),1!=o.cmp(t);)r=y,y=o,g=c.plus(l.times(o=g)),c=o,d=u.minus(l.times(o=d)),u=o;return o=E(t.minus(r),y,0,1),c=c.plus(o.times(g)),r=r.plus(o.times(y)),c.s=g.s=m.s,a*=2,n=E(g,y,a,U).minus(m).abs().cmp(E(c,r,a,U).minus(m).abs())<1?[g.toString(),y.toString()]:[c.toString(),r.toString()],G=s,n},C.toNumber=function(){var t=this;return+t||(t.s?0*t.s:0/0)},C.toPower=C.pow=function(t){var n,r,o=v(0>t?-t:+t),i=this;if(!V(t,-N,N,23,"exponent")&&(!isFinite(t)||o>N&&(t/=0)||parseFloat(t)!=t&&!(t=0/0)))return new e(Math.pow(+i,t));for(n=z?y(z/I+2):0,r=new e(L);;){if(o%2){if(r=r.times(i),!r.c)break;n&&r.c.length>n&&(r.c.length=n)}if(o=v(o/2),!o)break;i=i.times(i),n&&i.c&&i.c.length>n&&(i.c.length=n)}return 0>t&&(r=L.div(r)),n?S(r,z,U):r},C.toPrecision=function(t,e){return m(this,null!=t&&V(t,1,P,24,"precision")?0|t:null,e,24)},C.toString=function(t){var e,r=this,o=r.s,a=r.e;return null===a?o?(e="Infinity",0>o&&(e="-"+e)):e="NaN":(e=i(r.c),e=null!=t&&V(t,2,64,25,"base")?n(f(e,a),0|t,10,o):H>=a||a>=q?l(e,a):f(e,a),0>o&&r.c[0]&&(e="-"+e)),e},C.truncated=C.trunc=function(){return S(new e(this),this.e+1,1)},C.valueOf=C.toJSON=function(){return this.toString()},null!=t&&e.config(t),e}function o(t){var e=0|t;return t>0||t===e?e:e-1}function i(t){for(var e,n,r=1,o=t.length,i=t[0]+"";o>r;){for(e=t[r++]+"",n=I-e.length;n--;e="0"+e);i+=e}for(o=i.length;48===i.charCodeAt(--o););return i.slice(0,o+1||1)}function a(t,e){var n,r,o=t.c,i=e.c,a=t.s,s=e.s,u=t.e,c=e.e;if(!a||!s)return null;if(n=o&&!o[0],r=i&&!i[0],n||r)return n?r?0:-s:a;if(a!=s)return a;if(n=0>a,r=u==c,!o||!i)return r?0:!o^n?1:-1;if(!r)return u>c^n?1:-1;for(s=(u=o.length)<(c=i.length)?u:c,a=0;s>a;a++)if(o[a]!=i[a])return o[a]>i[a]^n?1:-1;return u==c?0:u>c^n?1:-1}function s(t,e,n){return(t=p(t))>=e&&n>=t}function u(t){return"[object Array]"==Object.prototype.toString.call(t)}function c(t,e,n){for(var r,o,i=[0],a=0,s=t.length;s>a;){for(o=i.length;o--;i[o]*=e);for(i[r=0]+=F.indexOf(t.charAt(a++));rn-1&&(null==i[r+1]&&(i[r+1]=0),i[r+1]+=i[r]/n|0,i[r]%=n)}return i.reverse()}function l(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(0>e?"e":"e+")+e}function f(t,e){var n,r;if(0>e){for(r="0.";++e;r+="0");t=r+t}else if(n=t.length,++e>n){for(r="0",e-=n;--e;r+="0");t+=r}else n>e&&(t=t.slice(0,e)+"."+t.slice(e));return t}function p(t){return t=parseFloat(t),0>t?y(t):v(t)}var m,h,d,g=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,y=Math.ceil,v=Math.floor,b=" not a boolean or binary digit",w="rounding mode",_="number type has more than 15 significant digits",F="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_",x=1e14,I=14,N=9007199254740991,O=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],B=1e7,P=1e9;if(m=r(),"function"==typeof define&&define.amd)define(function(){return m});else if("undefined"!=typeof e&&e.exports){if(e.exports=m,!h)try{h=t("crypto")}catch(T){}}else n.BigNumber=m}(this)},{crypto:28}],web3:[function(t,e,n){var r=t("./lib/web3");r.providers.HttpProvider=t("./lib/web3/httpprovider"),r.providers.QtSyncProvider=t("./lib/web3/qtsync"),r.eth.contract=t("./lib/web3/contract"),r.abi=t("./lib/solidity/abi"),"undefined"!=typeof window&&"undefined"==typeof window.web3&&(window.web3=r),e.exports=r},{"./lib/solidity/abi":1,"./lib/web3":10,"./lib/web3/contract":11,"./lib/web3/httpprovider":19,"./lib/web3/qtsync":24}]},{},["web3"]); \ No newline at end of file +require=function t(e,n,r){function o(a,s){if(!n[a]){if(!e[a]){var u="function"==typeof require&&require;if(!s&&u)return u(a,!0);if(i)return i(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var l=n[a]={exports:{}};e[a][0].call(l.exports,function(t){var n=e[a][1][t];return o(n?n:t)},l,l.exports,t,e,n,r)}return n[a].exports}for(var i="function"==typeof require&&require,a=0;ai;i+=64)n.push(this._outputFormatter(new a(t.dynamicPart().substr(i+64,64))));return n}return this._outputFormatter(t)},u.prototype.sliceParam=function(t,e,n){return"bytes"===this._mode?a.decodeBytes(t,e):s(n)?a.decodeArray(t,e):a.decodeParam(t,e)};var c=function(t){this._types=t};c.prototype._requireType=function(t){var e=this._types.filter(function(e){return e.isType(t)})[0];if(!e)throw Error("invalid solidity type!: "+t);return e},c.prototype._formatInput=function(t,e){return this._requireType(t).formatInput(e,s(t))},c.prototype.encodeParam=function(t,e){return this._formatInput(t,e).encode()},c.prototype.encodeParams=function(t,e){var n=this,r=t.map(function(t,r){return n._formatInput(t,e[r])});return a.encodeList(r)},c.prototype.decodeParam=function(t,e){return this.decodeParams([t],e)[0]},c.prototype.decodeParams=function(t,e){var n=this;return t.map(function(t,r){var o=n._requireType(t),i=o.sliceParam(e,r,t);return o.formatOutput(i,s(t))})};var l=new c([new u({name:"address",match:"strict",mode:"value",inputFormatter:i.formatInputInt,outputFormatter:i.formatOutputAddress}),new u({name:"bool",match:"strict",mode:"value",inputFormatter:i.formatInputBool,outputFormatter:i.formatOutputBool}),new u({name:"int",match:"prefix",mode:"value",inputFormatter:i.formatInputInt,outputFormatter:i.formatOutputInt}),new u({name:"uint",match:"prefix",mode:"value",inputFormatter:i.formatInputInt,outputFormatter:i.formatOutputUInt}),new u({name:"bytes",match:"strict",mode:"bytes",inputFormatter:i.formatInputDynamicBytes,outputFormatter:i.formatOutputDynamicBytes}),new u({name:"bytes",match:"prefix",mode:"value",inputFormatter:i.formatInputBytes,outputFormatter:i.formatOutputBytes}),new u({name:"real",match:"prefix",mode:"value",inputFormatter:i.formatInputReal,outputFormatter:i.formatOutputReal}),new u({name:"ureal",match:"prefix",mode:"value",inputFormatter:i.formatInputReal,outputFormatter:i.formatOutputUReal})]);e.exports=l},{"../utils/utils":6,"./formatters":2,"./param":3,"bignumber.js":"bignumber.js"}],2:[function(t,e,n){var r=t("bignumber.js"),o=t("../utils/utils"),i=t("../utils/config"),a=t("./param"),s=function(t){var e=2*i.ETH_PADDING;r.config(i.ETH_BIGNUMBER_ROUNDING_MODE);var n=o.padLeft(o.toTwosComplement(t).round().toString(16),e);return new a(n)},u=function(t){var e=o.fromAscii(t,i.ETH_PADDING).substr(2);return new a(e)},c=function(t){var e=o.fromAscii(t,i.ETH_PADDING).substr(2);return new a(s(t.length).value+e,32)},l=function(t){var e="000000000000000000000000000000000000000000000000000000000000000"+(t?"1":"0");return new a(e)},f=function(t){return s(new r(t).times(new r(2).pow(128)))},p=function(t){return"1"===new r(t.substr(0,1),16).toString(2).substr(0,1)},m=function(t){var e=t.staticPart()||"0";return p(e)?new r(e,16).minus(new r("ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff",16)).minus(1):new r(e,16)},h=function(t){var e=t.staticPart()||"0";return new r(e,16)},d=function(t){return m(t).dividedBy(new r(2).pow(128))},g=function(t){return h(t).dividedBy(new r(2).pow(128))},y=function(t){return"0000000000000000000000000000000000000000000000000000000000000001"===t.staticPart()?!0:!1},v=function(t){return o.toAscii(t.staticPart())},b=function(t){return o.toAscii(t.dynamicPart().slice(64))},w=function(t){var e=t.staticPart();return"0x"+e.slice(e.length-40,e.length)};e.exports={formatInputInt:s,formatInputBytes:u,formatInputDynamicBytes:c,formatInputBool:l,formatInputReal:f,formatOutputInt:m,formatOutputUInt:h,formatOutputReal:d,formatOutputUReal:g,formatOutputBool:y,formatOutputBytes:v,formatOutputDynamicBytes:b,formatOutputAddress:w}},{"../utils/config":5,"../utils/utils":6,"./param":3,"bignumber.js":"bignumber.js"}],3:[function(t,e,n){var r=t("../utils/utils"),o=function(t,e){this.value=t||"",this.offset=e};o.prototype.dynamicPartLength=function(){return this.dynamicPart().length/2},o.prototype.withOffset=function(t){return new o(this.value,t)},o.prototype.combine=function(t){return new o(this.value+t.value)},o.prototype.isDynamic=function(){return this.value.length>64},o.prototype.offsetAsBytes=function(){return this.isDynamic()?r.padLeft(r.toTwosComplement(this.offset).toString(16),64):""},o.prototype.staticPart=function(){return this.isDynamic()?this.offsetAsBytes():this.value},o.prototype.dynamicPart=function(){return this.isDynamic()?this.value:""},o.prototype.encode=function(){return this.staticPart()+this.dynamicPart()},o.encodeList=function(t){var e=32*t.length,n=t.map(function(t){if(!t.isDynamic())return t;var n=e;return e+=t.dynamicPartLength(),t.withOffset(n)});return n.reduce(function(t,e){return t+e.dynamicPart()},n.reduce(function(t,e){return t+e.staticPart()},""))},o.decodeParam=function(t,e){return e=e||0,new o(t.substr(64*e,64))};var i=function(t,e){return parseInt("0x"+t.substr(64*e,64))};o.decodeBytes=function(t,e){e=e||0;var n=i(t,e);return new o(t.substr(2*n,128))},o.decodeArray=function(t,e){e=e||0;var n=i(t,e),r=parseInt("0x"+t.substr(2*n,64));return new o(t.substr(2*n,64*(r+1)))},e.exports=o},{"../utils/utils":6}],4:[function(t,e,n){"use strict";n.XMLHttpRequest="undefined"==typeof XMLHttpRequest?{}:XMLHttpRequest},{}],5:[function(t,e,n){var r=t("bignumber.js"),o=["wei","Kwei","Mwei","Gwei","szabo","finney","ether","grand","Mether","Gether","Tether","Pether","Eether","Zether","Yether","Nether","Dether","Vether","Uether"];e.exports={ETH_PADDING:32,ETH_SIGNATURE_LENGTH:4,ETH_UNITS:o,ETH_BIGNUMBER_ROUNDING_MODE:{ROUNDING_MODE:r.ROUND_DOWN},ETH_POLLING_TIMEOUT:1e3,defaultBlock:"latest",defaultAccount:void 0}},{"bignumber.js":"bignumber.js"}],6:[function(t,e,n){var r=t("bignumber.js"),o={wei:"1",kwei:"1000",ada:"1000",mwei:"1000000",babbage:"1000000",gwei:"1000000000",shannon:"1000000000",szabo:"1000000000000",finney:"1000000000000000",ether:"1000000000000000000",kether:"1000000000000000000000",grand:"1000000000000000000000",einstein:"1000000000000000000000",mether:"1000000000000000000000000",gether:"1000000000000000000000000000",tether:"1000000000000000000000000000000"},i=function(t,e,n){return new Array(e-t.length+1).join(n?n:"0")+t},a=function(t){var e="",n=0,r=t.length;for("0x"===t.substring(0,2)&&(n=2);r>n;n+=2){var o=parseInt(t.substr(n,2),16);if(0===o)break;e+=String.fromCharCode(o)}return e},s=function(t){for(var e="",n=0;nthis._inputTypes.length&&i.isObject(t[t.length-1])&&(e=t[t.length-1]),e.to=this._address,e.data="0x"+this.signature()+o.encodeParams(this._inputTypes,t),e},a.prototype.signature=function(){return r.sha3(r.fromAscii(this._name)).slice(2,10)},a.prototype.unpackOutput=function(t){if(null!==t){t=t.length>=2?t.slice(2):t;var e=o.decodeParams(this._outputTypes,t);return 1===e.length?e[0]:e}},a.prototype.call=function(){var t=Array.prototype.slice.call(arguments),e=this.extractCallback(t),n=this.toPayload(t);if(!e){var o=r.eth.call(n);return this.unpackOutput(o)}var i=this;r.eth.call(n,function(t,n){e(t,i.unpackOutput(n))})},a.prototype.sendTransaction=function(){var t=Array.prototype.slice.call(arguments),e=this.extractCallback(t),n=this.toPayload(t);return e?void r.eth.sendTransaction(n,e):void r.eth.sendTransaction(n)},a.prototype.displayName=function(){return i.extractDisplayName(this._name)},a.prototype.typeName=function(){return i.extractTypeName(this._name)},a.prototype.request=function(){var t=Array.prototype.slice.call(arguments),e=this.extractCallback(t),n=this.toPayload(t),r=this.unpackOutput.bind(this);return{callback:e,payload:n,format:r}},a.prototype.execute=function(){var t=!this._constant;return t?this.sendTransaction.apply(this,Array.prototype.slice.call(arguments)):this.call.apply(this,Array.prototype.slice.call(arguments))},a.prototype.attachToContract=function(t){var e=this.execute.bind(this);e.request=this.request.bind(this),e.call=this.call.bind(this),e.sendTransaction=this.sendTransaction.bind(this);var n=this.displayName();t[n]||(t[n]=e),t[n][this.typeName()]=e},e.exports=a},{"../solidity/coder":1,"../utils/utils":6,"../web3":8}],18:[function(t,e,n){"use strict";var r=t("xmlhttprequest").XMLHttpRequest,o=t("./errors"),i=function(t){this.host=t||"http://localhost:8545"};i.prototype.send=function(t){var e=new r;e.open("POST",this.host,!1);try{e.send(JSON.stringify(t))}catch(n){throw o.InvalidConnection(this.host)}var i=e.responseText;try{i=JSON.parse(i)}catch(a){throw o.InvalidResponse(i)}return i},i.prototype.sendAsync=function(t,e){var n=new r;n.onreadystatechange=function(){if(4===n.readyState){var t=n.responseText,r=null;try{t=JSON.parse(t)}catch(i){r=o.InvalidResponse(t)}e(r,t)}},n.open("POST",this.host,!0);try{n.send(JSON.stringify(t))}catch(i){e(o.InvalidConnection(this.host))}},e.exports=i},{"./errors":12,xmlhttprequest:4}],19:[function(t,e,n){var r=function(){return arguments.callee._singletonInstance?arguments.callee._singletonInstance:(arguments.callee._singletonInstance=this,void(this.messageId=1))};r.getInstance=function(){var t=new r;return t},r.prototype.toPayload=function(t,e){return t||console.error("jsonrpc method should be specified!"),{jsonrpc:"2.0",method:t,params:e||[],id:this.messageId++}},r.prototype.isValidResponse=function(t){return!!t&&!t.error&&"2.0"===t.jsonrpc&&"number"==typeof t.id&&void 0!==t.result},r.prototype.toBatchPayload=function(t){var e=this;return t.map(function(t){return e.toPayload(t.method,t.params)})},e.exports=r},{}],20:[function(t,e,n){var r=t("./requestmanager"),o=t("../utils/utils"),i=t("./errors"),a=function(t){this.name=t.name,this.call=t.call,this.params=t.params||0,this.inputFormatter=t.inputFormatter,this.outputFormatter=t.outputFormatter};a.prototype.getCall=function(t){return o.isFunction(this.call)?this.call(t):this.call},a.prototype.extractCallback=function(t){return o.isFunction(t[t.length-1])?t.pop():void 0},a.prototype.validateArgs=function(t){if(t.length!==this.params)throw i.InvalidNumberOfParams()},a.prototype.formatInput=function(t){return this.inputFormatter?this.inputFormatter.map(function(e,n){return e?e(t[n]):t[n]}):t},a.prototype.formatOutput=function(t){return this.outputFormatter&&null!==t?this.outputFormatter(t):t},a.prototype.attachToObject=function(t){var e=this.send.bind(this);e.request=this.request.bind(this),e.call=this.call;var n=this.name.split(".");n.length>1?(t[n[0]]=t[n[0]]||{},t[n[0]][n[1]]=e):t[n[0]]=e},a.prototype.toPayload=function(t){var e=this.getCall(t),n=this.extractCallback(t),r=this.formatInput(t);return this.validateArgs(r),{method:e,params:r,callback:n}},a.prototype.request=function(){var t=this.toPayload(Array.prototype.slice.call(arguments));return t.format=this.formatOutput.bind(this),t},a.prototype.send=function(){var t=this.toPayload(Array.prototype.slice.call(arguments));if(t.callback){var e=this;return r.getInstance().sendAsync(t,function(n,r){t.callback(n,e.formatOutput(r))})}return this.formatOutput(r.getInstance().send(t))},e.exports=a},{"../utils/utils":6,"./errors":12,"./requestmanager":24}],21:[function(t,e,n){var r=t("../utils/utils"),o=t("./property"),i=[],a=[new o({name:"listening",getter:"net_listening"}),new o({name:"peerCount",getter:"net_peerCount",outputFormatter:r.toDecimal})];e.exports={methods:i,properties:a}},{"../utils/utils":6,"./property":22}],22:[function(t,e,n){var r=t("./requestmanager"),o=function(t){this.name=t.name,this.getter=t.getter,this.setter=t.setter,this.outputFormatter=t.outputFormatter,this.inputFormatter=t.inputFormatter};o.prototype.formatInput=function(t){return this.inputFormatter?this.inputFormatter(t):t},o.prototype.formatOutput=function(t){return this.outputFormatter&&null!==t?this.outputFormatter(t):t},o.prototype.attachToObject=function(t){var e={get:this.get.bind(this)},n=this.name.split("."),r=n[0];n.length>1&&(t[n[0]]=t[n[0]]||{},t=t[n[0]],r=n[1]),Object.defineProperty(t,r,e);var o=function(t,e){return t+e.charAt(0).toUpperCase()+e.slice(1)};t[o("get",r)]=this.getAsync.bind(this)},o.prototype.get=function(){return this.formatOutput(r.getInstance().send({method:this.getter}))},o.prototype.getAsync=function(t){var e=this;r.getInstance().sendAsync({method:this.getter},function(n,r){return n?t(n):void t(n,e.formatOutput(r))})},e.exports=o},{"./requestmanager":24}],23:[function(t,e,n){var r=function(){};r.prototype.send=function(t){var e=navigator.qt.callMethod(JSON.stringify(t));return JSON.parse(e)},e.exports=r},{}],24:[function(t,e,n){var r=t("./jsonrpc"),o=t("../utils/utils"),i=t("../utils/config"),a=t("./errors"),s=function(t){return arguments.callee._singletonInstance?arguments.callee._singletonInstance:(arguments.callee._singletonInstance=this,this.provider=t,this.polls=[],this.timeout=null,void this.poll())};s.getInstance=function(){var t=new s;return t},s.prototype.send=function(t){if(!this.provider)return console.error(a.InvalidProvider()),null;var e=r.getInstance().toPayload(t.method,t.params),n=this.provider.send(e);if(!r.getInstance().isValidResponse(n))throw a.InvalidResponse(n);return n.result},s.prototype.sendAsync=function(t,e){if(!this.provider)return e(a.InvalidProvider());var n=r.getInstance().toPayload(t.method,t.params);this.provider.sendAsync(n,function(t,n){return t?e(t):r.getInstance().isValidResponse(n)?void e(null,n.result):e(a.InvalidResponse(n))})},s.prototype.sendBatch=function(t,e){if(!this.provider)return e(a.InvalidProvider());var n=r.getInstance().toBatchPayload(t);this.provider.sendAsync(n,function(t,n){return t?e(t):o.isArray(n)?void e(t,n):e(a.InvalidResponse(n))})},s.prototype.setProvider=function(t){this.provider=t},s.prototype.startPolling=function(t,e,n,r){this.polls.push({data:t,id:e,callback:n,uninstall:r})},s.prototype.stopPolling=function(t){for(var e=this.polls.length;e--;){var n=this.polls[e];n.id===t&&this.polls.splice(e,1)}},s.prototype.reset=function(){this.polls.forEach(function(t){t.uninstall(t.id)}),this.polls=[],this.timeout&&(clearTimeout(this.timeout),this.timeout=null),this.poll()},s.prototype.poll=function(){if(this.timeout=setTimeout(this.poll.bind(this),i.ETH_POLLING_TIMEOUT),this.polls.length){if(!this.provider)return void console.error(a.InvalidProvider());var t=r.getInstance().toBatchPayload(this.polls.map(function(t){ +return t.data})),e=this;this.provider.sendAsync(t,function(t,n){if(!t){if(!o.isArray(n))throw a.InvalidResponse(n);n.map(function(t,n){return t.callback=e.polls[n].callback,t}).filter(function(t){var e=r.getInstance().isValidResponse(t);return e||t.callback(a.InvalidResponse(t)),e}).filter(function(t){return o.isArray(t.result)&&t.result.length>0}).forEach(function(t){t.callback(null,t.result)})}})}},e.exports=s},{"../utils/config":5,"../utils/utils":6,"./errors":12,"./jsonrpc":19}],25:[function(t,e,n){var r=t("./method"),o=t("./formatters"),i=new r({name:"post",call:"shh_post",params:1,inputFormatter:[o.inputPostFormatter]}),a=new r({name:"newIdentity",call:"shh_newIdentity",params:0}),s=new r({name:"hasIdentity",call:"shh_hasIdentity",params:1}),u=new r({name:"newGroup",call:"shh_newGroup",params:0}),c=new r({name:"addToGroup",call:"shh_addToGroup",params:0}),l=[i,a,s,u,c];e.exports={methods:l}},{"./formatters":16,"./method":20}],26:[function(t,e,n){var r=t("./method"),o=function(){var t=function(t){var e=t[0];switch(e){case"latest":return t.pop(),this.params=0,"eth_newBlockFilter";case"pending":return t.pop(),this.params=0,"eth_newPendingTransactionFilter";default:return"eth_newFilter"}},e=new r({name:"newFilter",call:t,params:1}),n=new r({name:"uninstallFilter",call:"eth_uninstallFilter",params:1}),o=new r({name:"getLogs",call:"eth_getFilterLogs",params:1}),i=new r({name:"poll",call:"eth_getFilterChanges",params:1});return[e,n,o,i]},i=function(){var t=new r({name:"newFilter",call:"shh_newFilter",params:1}),e=new r({name:"uninstallFilter",call:"shh_uninstallFilter",params:1}),n=new r({name:"getLogs",call:"shh_getMessages",params:1}),o=new r({name:"poll",call:"shh_getFilterChanges",params:1});return[t,e,n,o]};e.exports={eth:o,shh:i}},{"./method":20}],27:[function(t,e,n){},{}],"bignumber.js":[function(t,e,n){!function(n){"use strict";function r(t){function e(t,r){var o,i,a,s,u,c,l=this;if(!(l instanceof e))return W&&D(26,"constructor call without new",t),new e(t,r);if(null!=r&&J(r,2,64,R,"base")){if(r=0|r,c=t+"",10==r)return l=new e(t instanceof e?t:c),S(l,L+l.e+1,U);if((s="number"==typeof t)&&0*t!=0||!new RegExp("^-?"+(o="["+F.slice(0,r)+"]+")+"(?:\\."+o+")?$",37>r?"i":"").test(c))return d(l,c,s,r);s?(l.s=0>1/t?(c=c.slice(1),-1):1,W&&c.replace(/^0\.0*|\./,"").length>15&&D(R,_,t),s=!1):l.s=45===c.charCodeAt(0)?(c=c.slice(1),-1):1,c=n(c,10,r,l.s)}else{if(t instanceof e)return l.s=t.s,l.e=t.e,l.c=(t=t.c)?t.slice():t,void(R=0);if((s="number"==typeof t)&&0*t==0){if(l.s=0>1/t?(t=-t,-1):1,t===~~t){for(i=0,a=t;a>=10;a/=10,i++);return l.e=i,l.c=[t],void(R=0)}c=t+""}else{if(!g.test(c=t+""))return d(l,c,s);l.s=45===c.charCodeAt(0)?(c=c.slice(1),-1):1}}for((i=c.indexOf("."))>-1&&(c=c.replace(".","")),(a=c.search(/e/i))>0?(0>i&&(i=a),i+=+c.slice(a+1),c=c.substring(0,a)):0>i&&(i=c.length),a=0;48===c.charCodeAt(a);a++);for(u=c.length;48===c.charCodeAt(--u););if(c=c.slice(a,u+1))if(u=c.length,s&&W&&u>15&&D(R,_,l.s*t),i=i-a-1,i>G)l.c=l.e=null;else if(M>i)l.c=[l.e=0];else{if(l.e=i,l.c=[],a=(i+1)%I,0>i&&(a+=I),u>a){for(a&&l.c.push(+c.slice(0,a)),u-=I;u>a;)l.c.push(+c.slice(a,a+=I));c=c.slice(a),a=I-c.length}else a-=u;for(;a--;c+="0");l.c.push(+c)}else l.c=[l.e=0];R=0}function n(t,n,r,o){var a,s,u,l,p,m,h,d=t.indexOf("."),g=L,y=U;for(37>r&&(t=t.toLowerCase()),d>=0&&(u=z,z=0,t=t.replace(".",""),h=new e(r),p=h.pow(t.length-d),z=u,h.c=c(f(i(p.c),p.e),10,n),h.e=h.c.length),m=c(t,r,n),s=u=m.length;0==m[--u];m.pop());if(!m[0])return"0";if(0>d?--s:(p.c=m,p.e=s,p.s=o,p=E(p,h,g,y,n),m=p.c,l=p.r,s=p.e),a=s+g+1,d=m[a],u=n/2,l=l||0>a||null!=m[a+1],l=4>y?(null!=d||l)&&(0==y||y==(p.s<0?3:2)):d>u||d==u&&(4==y||l||6==y&&1&m[a-1]||y==(p.s<0?8:7)),1>a||!m[0])t=l?f("1",-g):"0";else{if(m.length=a,l)for(--n;++m[--a]>n;)m[a]=0,a||(++s,m.unshift(1));for(u=m.length;!m[--u];);for(d=0,t="";u>=d;t+=F.charAt(m[d++]));t=f(t,s)}return t}function m(t,n,r,o){var a,s,u,c,p;if(r=null!=r&&J(r,0,8,o,w)?0|r:U,!t.c)return t.toString();if(a=t.c[0],u=t.e,null==n)p=i(t.c),p=19==o||24==o&&j>=u?l(p,u):f(p,u);else if(t=S(new e(t),n,r),s=t.e,p=i(t.c),c=p.length,19==o||24==o&&(s>=n||j>=s)){for(;n>c;p+="0",c++);p=l(p,s)}else if(n-=u,p=f(p,s),s+1>c){if(--n>0)for(p+=".";n--;p+="0");}else if(n+=s-c,n>0)for(s+1==c&&(p+=".");n--;p+="0");return t.s<0&&a?"-"+p:p}function T(t,n){var r,o,i=0;for(u(t[0])&&(t=t[0]),r=new e(t[0]);++it||t>n||t!=p(t))&&D(r,(o||"decimal places")+(e>t||t>n?" out of range":" not an integer"),t),!0}function k(t,e,n){for(var r=1,o=e.length;!e[--o];e.pop());for(o=e[0];o>=10;o/=10,r++);return(n=r+n*I-1)>G?t.c=t.e=null:M>n?t.c=[t.e=0]:(t.e=n,t.c=e),t}function D(t,e,n){var r=new Error(["new BigNumber","cmp","config","div","divToInt","eq","gt","gte","lt","lte","minus","mod","plus","precision","random","round","shift","times","toDigits","toExponential","toFixed","toFormat","toFraction","pow","toPrecision","toString","BigNumber"][t]+"() "+e+": "+n);throw r.name="BigNumber Error",R=0,r}function S(t,e,n,r){var o,i,a,s,u,c,l,f=t.c,p=O;if(f){t:{for(o=1,s=f[0];s>=10;s/=10,o++);if(i=e-o,0>i)i+=I,a=e,u=f[c=0],l=u/p[o-a-1]%10|0;else if(c=y((i+1)/I),c>=f.length){if(!r)break t;for(;f.length<=c;f.push(0));u=l=0,o=1,i%=I,a=i-I+1}else{for(u=s=f[c],o=1;s>=10;s/=10,o++);i%=I,a=i-I+o,l=0>a?0:u/p[o-a-1]%10|0}if(r=r||0>e||null!=f[c+1]||(0>a?u:u%p[o-a-1]),r=4>n?(l||r)&&(0==n||n==(t.s<0?3:2)):l>5||5==l&&(4==n||r||6==n&&(i>0?a>0?u/p[o-a]:0:f[c-1])%10&1||n==(t.s<0?8:7)),1>e||!f[0])return f.length=0,r?(e-=t.e+1,f[0]=p[e%I],t.e=-e||0):f[0]=t.e=0,t;if(0==i?(f.length=c,s=1,c--):(f.length=c+1,s=p[I-i],f[c]=a>0?v(u/p[o-a]%p[a])*s:0),r)for(;;){if(0==c){for(i=1,a=f[0];a>=10;a/=10,i++);for(a=f[0]+=s,s=1;a>=10;a/=10,s++);i!=s&&(t.e++,f[0]==x&&(f[0]=1));break}if(f[c]+=s,f[c]!=x)break;f[c--]=0,s=1}for(i=f.length;0===f[--i];f.pop());}t.e>G?t.c=t.e=null:t.en?null!=(t=o[n++]):void 0};return a(e="DECIMAL_PLACES")&&J(t,0,P,2,e)&&(L=0|t),r[e]=L,a(e="ROUNDING_MODE")&&J(t,0,8,2,e)&&(U=0|t),r[e]=U,a(e="EXPONENTIAL_AT")&&(u(t)?J(t[0],-P,0,2,e)&&J(t[1],0,P,2,e)&&(j=0|t[0],H=0|t[1]):J(t,-P,P,2,e)&&(j=-(H=0|(0>t?-t:t)))),r[e]=[j,H],a(e="RANGE")&&(u(t)?J(t[0],-P,-1,2,e)&&J(t[1],1,P,2,e)&&(M=0|t[0],G=0|t[1]):J(t,-P,P,2,e)&&(0|t?M=-(G=0|(0>t?-t:t)):W&&D(2,e+" cannot be zero",t))),r[e]=[M,G],a(e="ERRORS")&&(t===!!t||1===t||0===t?(R=0,J=(W=!!t)?A:s):W&&D(2,e+b,t)),r[e]=W,a(e="CRYPTO")&&(t===!!t||1===t||0===t?(V=!(!t||!h||"object"!=typeof h),t&&!V&&W&&D(2,"crypto unavailable",h)):W&&D(2,e+b,t)),r[e]=V,a(e="MODULO_MODE")&&J(t,0,9,2,e)&&($=0|t),r[e]=$,a(e="POW_PRECISION")&&J(t,0,P,2,e)&&(z=0|t),r[e]=z,a(e="FORMAT")&&("object"==typeof t?X=t:W&&D(2,e+" not an object",t)),r[e]=X,r},e.max=function(){return T(arguments,C.lt)},e.min=function(){return T(arguments,C.gt)},e.random=function(){var t=9007199254740992,n=Math.random()*t&2097151?function(){return v(Math.random()*t)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)};return function(t){var r,o,i,a,s,u=0,c=[],l=new e(q);if(t=null!=t&&J(t,0,P,14)?0|t:L,a=y(t/I),V)if(h&&h.getRandomValues){for(r=h.getRandomValues(new Uint32Array(a*=2));a>u;)s=131072*r[u]+(r[u+1]>>>11),s>=9e15?(o=h.getRandomValues(new Uint32Array(2)),r[u]=o[0],r[u+1]=o[1]):(c.push(s%1e14),u+=2);u=a/2}else if(h&&h.randomBytes){for(r=h.randomBytes(a*=7);a>u;)s=281474976710656*(31&r[u])+1099511627776*r[u+1]+4294967296*r[u+2]+16777216*r[u+3]+(r[u+4]<<16)+(r[u+5]<<8)+r[u+6],s>=9e15?h.randomBytes(7).copy(r,u):(c.push(s%1e14),u+=7);u=a/7}else W&&D(14,"crypto unavailable",h);if(!u)for(;a>u;)s=n(),9e15>s&&(c[u++]=s%1e14);for(a=c[--u],t%=I,a&&t&&(s=O[I-t],c[u]=v(a/s)*s);0===c[u];c.pop(),u--);if(0>u)c=[i=0];else{for(i=-1;0===c[0];c.shift(),i-=I);for(u=1,s=c[0];s>=10;s/=10,u++);I>u&&(i-=I-u)}return l.e=i,l.c=c,l}}(),E=function(){function t(t,e,n){var r,o,i,a,s=0,u=t.length,c=e%B,l=e/B|0;for(t=t.slice();u--;)i=t[u]%B,a=t[u]/B|0,r=l*i+a*c,o=c*i+r%B*B+s,s=(o/n|0)+(r/B|0)+l*a,t[u]=o%n;return s&&t.unshift(s),t}function n(t,e,n,r){var o,i;if(n!=r)i=n>r?1:-1;else for(o=i=0;n>o;o++)if(t[o]!=e[o]){i=t[o]>e[o]?1:-1;break}return i}function r(t,e,n,r){for(var o=0;n--;)t[n]-=o,o=t[n]1;t.shift());}return function(i,a,s,u,c){var l,f,p,m,h,d,g,y,b,w,_,F,N,O,B,P,T,A=i.s==a.s?1:-1,k=i.c,D=a.c;if(!(k&&k[0]&&D&&D[0]))return new e(i.s&&a.s&&(k?!D||k[0]!=D[0]:D)?k&&0==k[0]||!D?0*A:A/0:0/0);for(y=new e(A),b=y.c=[],f=i.e-a.e,A=s+f+1,c||(c=x,f=o(i.e/I)-o(a.e/I),A=A/I|0),p=0;D[p]==(k[p]||0);p++);if(D[p]>(k[p]||0)&&f--,0>A)b.push(1),m=!0;else{for(O=k.length,P=D.length,p=0,A+=2,h=v(c/(D[0]+1)),h>1&&(D=t(D,h,c),k=t(k,h,c),P=D.length,O=k.length),N=P,w=k.slice(0,P),_=w.length;P>_;w[_++]=0);T=D.slice(),T.unshift(0),B=D[0],D[1]>=c/2&&B++;do{if(h=0,l=n(D,w,P,_),0>l){if(F=w[0],P!=_&&(F=F*c+(w[1]||0)),h=v(F/B),h>1)for(h>=c&&(h=c-1),d=t(D,h,c),g=d.length,_=w.length;1==n(d,w,g,_);)h--,r(d,g>P?T:D,g,c),g=d.length,l=1;else 0==h&&(l=h=1),d=D.slice(),g=d.length;if(_>g&&d.unshift(0),r(w,d,_,c),_=w.length,-1==l)for(;n(D,w,P,_)<1;)h++,r(w,_>P?T:D,_,c),_=w.length}else 0===l&&(h++,w=[0]);b[p++]=h,w[0]?w[_++]=k[N]||0:(w=[k[N]],_=1)}while((N++=10;A/=10,p++);S(y,s+(y.e=p+f*I-1)+1,u,m)}else y.e=f,y.r=+m;return y}}(),d=function(){var t=/^(-?)0([xbo])/i,n=/^([^.]+)\.$/,r=/^\.([^.]+)$/,o=/^-?(Infinity|NaN)$/,i=/^\s*\+|^\s+|\s+$/g;return function(a,s,u,c){var l,f=u?s:s.replace(i,"");if(o.test(f))a.s=isNaN(f)?null:0>f?-1:1;else{if(!u&&(f=f.replace(t,function(t,e,n){return l="x"==(n=n.toLowerCase())?16:"b"==n?2:8,c&&c!=l?t:e}),c&&(l=c,f=f.replace(n,"$1").replace(r,"0.$1")),s!=f))return new e(f,l);W&&D(R,"not a"+(c?" base "+c:"")+" number",s),a.s=null}a.c=a.e=null,R=0}}(),C.absoluteValue=C.abs=function(){var t=new e(this);return t.s<0&&(t.s=1),t},C.ceil=function(){return S(new e(this),this.e+1,2)},C.comparedTo=C.cmp=function(t,n){return R=1,a(this,new e(t,n))},C.decimalPlaces=C.dp=function(){var t,e,n=this.c;if(!n)return null;if(t=((e=n.length-1)-o(this.e/I))*I,e=n[e])for(;e%10==0;e/=10,t--);return 0>t&&(t=0),t},C.dividedBy=C.div=function(t,n){return R=3,E(this,new e(t,n),L,U)},C.dividedToIntegerBy=C.divToInt=function(t,n){return R=4,E(this,new e(t,n),0,1)},C.equals=C.eq=function(t,n){return R=5,0===a(this,new e(t,n))},C.floor=function(){return S(new e(this),this.e+1,3)},C.greaterThan=C.gt=function(t,n){return R=6,a(this,new e(t,n))>0},C.greaterThanOrEqualTo=C.gte=function(t,n){return R=7,1===(n=a(this,new e(t,n)))||0===n},C.isFinite=function(){return!!this.c},C.isInteger=C.isInt=function(){return!!this.c&&o(this.e/I)>this.c.length-2},C.isNaN=function(){return!this.s},C.isNegative=C.isNeg=function(){return this.s<0},C.isZero=function(){return!!this.c&&0==this.c[0]},C.lessThan=C.lt=function(t,n){return R=8,a(this,new e(t,n))<0},C.lessThanOrEqualTo=C.lte=function(t,n){return R=9,-1===(n=a(this,new e(t,n)))||0===n},C.minus=C.sub=function(t,n){var r,i,a,s,u=this,c=u.s;if(R=10,t=new e(t,n),n=t.s,!c||!n)return new e(0/0);if(c!=n)return t.s=-n,u.plus(t);var l=u.e/I,f=t.e/I,p=u.c,m=t.c;if(!l||!f){if(!p||!m)return p?(t.s=-n,t):new e(m?u:0/0);if(!p[0]||!m[0])return m[0]?(t.s=-n,t):new e(p[0]?u:3==U?-0:0)}if(l=o(l),f=o(f),p=p.slice(),c=l-f){for((s=0>c)?(c=-c,a=p):(f=l,a=m),a.reverse(),n=c;n--;a.push(0));a.reverse()}else for(i=(s=(c=p.length)<(n=m.length))?c:n,c=n=0;i>n;n++)if(p[n]!=m[n]){s=p[n]0)for(;n--;p[r++]=0);for(n=x-1;i>c;){if(p[--i]0?(u=s,r=l):(a=-a,r=c),r.reverse();a--;r.push(0));r.reverse()}for(a=c.length,n=l.length,0>a-n&&(r=l,l=c,c=r,n=a),a=0;n;)a=(c[--n]=c[n]+l[n]+a)/x|0,c[n]%=x;return a&&(c.unshift(a),++u),k(t,c,u)},C.precision=C.sd=function(t){var e,n,r=this,o=r.c;if(null!=t&&t!==!!t&&1!==t&&0!==t&&(W&&D(13,"argument"+b,t),t!=!!t&&(t=null)),!o)return null;if(n=o.length-1,e=n*I+1,n=o[n]){for(;n%10==0;n/=10,e--);for(n=o[0];n>=10;n/=10,e++);}return t&&r.e+1>e&&(e=r.e+1),e},C.round=function(t,n){var r=new e(this);return(null==t||J(t,0,P,15))&&S(r,~~t+this.e+1,null!=n&&J(n,0,8,15,w)?0|n:U),r},C.shift=function(t){var n=this;return J(t,-N,N,16,"argument")?n.times("1e"+p(t)):new e(n.c&&n.c[0]&&(-N>t||t>N)?n.s*(0>t?0:1/0):n)},C.squareRoot=C.sqrt=function(){var t,n,r,a,s,u=this,c=u.c,l=u.s,f=u.e,p=L+4,m=new e("0.5");if(1!==l||!c||!c[0])return new e(!l||0>l&&(!c||c[0])?0/0:c?u:1/0);if(l=Math.sqrt(+u),0==l||l==1/0?(n=i(c),(n.length+f)%2==0&&(n+="0"),l=Math.sqrt(n),f=o((f+1)/2)-(0>f||f%2),l==1/0?n="1e"+f:(n=l.toExponential(),n=n.slice(0,n.indexOf("e")+1)+f),r=new e(n)):r=new e(l+""),r.c[0])for(f=r.e,l=f+p,3>l&&(l=0);;)if(s=r,r=m.times(s.plus(E(u,s,p,1))),i(s.c).slice(0,l)===(n=i(r.c)).slice(0,l)){if(r.el&&(g=w,w=_,_=g,a=l,l=m,m=a),a=l+m,g=[];a--;g.push(0));for(y=x,v=B,a=m;--a>=0;){for(r=0,h=_[a]%v,d=_[a]/v|0,u=l,s=a+u;s>a;)f=w[--u]%v,p=w[u]/v|0,c=d*f+p*h,f=h*f+c%v*v+g[s]+r,r=(f/y|0)+(c/v|0)+d*p,g[s--]=f%y;g[s]=r}return r?++i:g.shift(),k(t,g,i)},C.toDigits=function(t,n){var r=new e(this);return t=null!=t&&J(t,1,P,18,"precision")?0|t:null,n=null!=n&&J(n,0,8,18,w)?0|n:U,t?S(r,t,n):r},C.toExponential=function(t,e){return m(this,null!=t&&J(t,0,P,19)?~~t+1:null,e,19)},C.toFixed=function(t,e){return m(this,null!=t&&J(t,0,P,20)?~~t+this.e+1:null,e,20)},C.toFormat=function(t,e){var n=m(this,null!=t&&J(t,0,P,21)?~~t+this.e+1:null,e,21);if(this.c){var r,o=n.split("."),i=+X.groupSize,a=+X.secondaryGroupSize,s=X.groupSeparator,u=o[0],c=o[1],l=this.s<0,f=l?u.slice(1):u,p=f.length;if(a&&(r=i,i=a,a=r,p-=r),i>0&&p>0){for(r=p%i||i,u=f.substr(0,r);p>r;r+=i)u+=s+f.substr(r,i);a>0&&(u+=s+f.slice(r)),l&&(u="-"+u)}n=c?u+X.decimalSeparator+((a=+X.fractionGroupSize)?c.replace(new RegExp("\\d{"+a+"}\\B","g"),"$&"+X.fractionGroupSeparator):c):u}return n},C.toFraction=function(t){var n,r,o,a,s,u,c,l,f,p=W,m=this,h=m.c,d=new e(q),g=r=new e(q),y=c=new e(q);if(null!=t&&(W=!1,u=new e(t),W=p,(!(p=u.isInt())||u.lt(q))&&(W&&D(22,"max denominator "+(p?"out of range":"not an integer"),t),t=!p&&u.c&&S(u,u.e+1,1).gte(q)?u:null)),!h)return m.toString();for(f=i(h),a=d.e=f.length-m.e-1,d.c[0]=O[(s=a%I)<0?I+s:s],t=!t||u.cmp(d)>0?a>0?d:g:u,s=G,G=1/0,u=new e(f),c.c[0]=0;l=E(u,d,0,1),o=r.plus(l.times(y)),1!=o.cmp(t);)r=y,y=o,g=c.plus(l.times(o=g)),c=o,d=u.minus(l.times(o=d)),u=o;return o=E(t.minus(r),y,0,1),c=c.plus(o.times(g)),r=r.plus(o.times(y)),c.s=g.s=m.s,a*=2,n=E(g,y,a,U).minus(m).abs().cmp(E(c,r,a,U).minus(m).abs())<1?[g.toString(),y.toString()]:[c.toString(),r.toString()],G=s,n},C.toNumber=function(){var t=this;return+t||(t.s?0*t.s:0/0)},C.toPower=C.pow=function(t){var n,r,o=v(0>t?-t:+t),i=this;if(!J(t,-N,N,23,"exponent")&&(!isFinite(t)||o>N&&(t/=0)||parseFloat(t)!=t&&!(t=0/0)))return new e(Math.pow(+i,t));for(n=z?y(z/I+2):0,r=new e(q);;){if(o%2){if(r=r.times(i),!r.c)break;n&&r.c.length>n&&(r.c.length=n)}if(o=v(o/2),!o)break;i=i.times(i),n&&i.c&&i.c.length>n&&(i.c.length=n)}return 0>t&&(r=q.div(r)),n?S(r,z,U):r},C.toPrecision=function(t,e){return m(this,null!=t&&J(t,1,P,24,"precision")?0|t:null,e,24)},C.toString=function(t){var e,r=this,o=r.s,a=r.e;return null===a?o?(e="Infinity",0>o&&(e="-"+e)):e="NaN":(e=i(r.c),e=null!=t&&J(t,2,64,25,"base")?n(f(e,a),0|t,10,o):j>=a||a>=H?l(e,a):f(e,a),0>o&&r.c[0]&&(e="-"+e)),e},C.truncated=C.trunc=function(){return S(new e(this),this.e+1,1)},C.valueOf=C.toJSON=function(){return this.toString()},null!=t&&e.config(t),e}function o(t){var e=0|t;return t>0||t===e?e:e-1}function i(t){for(var e,n,r=1,o=t.length,i=t[0]+"";o>r;){for(e=t[r++]+"",n=I-e.length;n--;e="0"+e);i+=e}for(o=i.length;48===i.charCodeAt(--o););return i.slice(0,o+1||1)}function a(t,e){var n,r,o=t.c,i=e.c,a=t.s,s=e.s,u=t.e,c=e.e;if(!a||!s)return null;if(n=o&&!o[0],r=i&&!i[0],n||r)return n?r?0:-s:a;if(a!=s)return a;if(n=0>a,r=u==c,!o||!i)return r?0:!o^n?1:-1;if(!r)return u>c^n?1:-1;for(s=(u=o.length)<(c=i.length)?u:c,a=0;s>a;a++)if(o[a]!=i[a])return o[a]>i[a]^n?1:-1;return u==c?0:u>c^n?1:-1}function s(t,e,n){return(t=p(t))>=e&&n>=t}function u(t){return"[object Array]"==Object.prototype.toString.call(t)}function c(t,e,n){for(var r,o,i=[0],a=0,s=t.length;s>a;){for(o=i.length;o--;i[o]*=e);for(i[r=0]+=F.indexOf(t.charAt(a++));rn-1&&(null==i[r+1]&&(i[r+1]=0),i[r+1]+=i[r]/n|0,i[r]%=n)}return i.reverse()}function l(t,e){return(t.length>1?t.charAt(0)+"."+t.slice(1):t)+(0>e?"e":"e+")+e}function f(t,e){var n,r;if(0>e){for(r="0.";++e;r+="0");t=r+t}else if(n=t.length,++e>n){for(r="0",e-=n;--e;r+="0");t+=r}else n>e&&(t=t.slice(0,e)+"."+t.slice(e));return t}function p(t){return t=parseFloat(t),0>t?y(t):v(t)}var m,h,d,g=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,y=Math.ceil,v=Math.floor,b=" not a boolean or binary digit",w="rounding mode",_="number type has more than 15 significant digits",F="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_",x=1e14,I=14,N=9007199254740991,O=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],B=1e7,P=1e9;if(m=r(),"function"==typeof define&&define.amd)define(function(){return m});else if("undefined"!=typeof e&&e.exports){if(e.exports=m,!h)try{h=t("crypto")}catch(T){}}else n.BigNumber=m}(this)},{crypto:27}],web3:[function(t,e,n){var r=t("./lib/web3");r.providers.HttpProvider=t("./lib/web3/httpprovider"),r.providers.QtSyncProvider=t("./lib/web3/qtsync"),r.eth.contract=t("./lib/web3/contract"),"undefined"!=typeof window&&"undefined"==typeof window.web3&&(window.web3=r),e.exports=r},{"./lib/web3":8,"./lib/web3/contract":10,"./lib/web3/httpprovider":18,"./lib/web3/qtsync":23}]},{},["web3"]); \ No newline at end of file diff --git a/example/contract.html b/example/contract.html index a32098536..3b83d37b1 100644 --- a/example/contract.html +++ b/example/contract.html @@ -8,14 +8,16 @@ var web3 = require('web3'); web3.setProvider(new web3.providers.HttpProvider("http://localhost:8545")); - // solidity source code - /*var source = "" +*/ - /*"contract test {\n" +*/ - /*" function multiply(uint a) constant returns(uint d) {\n" +*/ - /*" return a * 7;\n" +*/ - /*" }\n" +*/ - /*"}\n";*/ - var source = "605280600c6000396000f3006000357c010000000000000000000000000000000000000000000000000000000090048063c6888fa114602e57005b60376004356041565b8060005260206000f35b6000600782029050604d565b91905056"; + // solidity code code + var source = "" + + "contract test {\n" + + " function multiply(uint a) constant returns(uint d) {\n" + + " return a * 7;\n" + + " }\n" + + "}\n"; + + var code = web3.eth.compile.solidity(source).code; + /*var code = "605280600c6000396000f3006000357c010000000000000000000000000000000000000000000000000000000090048063c6888fa114602e57005b60376004356041565b8060005260206000f35b6000600782029050604d565b91905056";*/ // contract description, this is autogenerated using solc CLI var desc = [{ @@ -37,15 +39,30 @@ function createExampleContract() { // hide create button document.getElementById('create').style.visibility = 'hidden'; - document.getElementById('source').innerText = source; + document.getElementById('code').innerText = code; // let's assume that coinbase is our account web3.eth.defaultAccount = web3.eth.coinbase; + var watch = web3.eth.filter('latest'); + // create contract - var Contract = web3.eth.contract(desc); - myContract = new Contract({data: source}); - document.getElementById('call').style.visibility = 'visible'; + myContract = web3.eth.contract(desc).new({data: code}); + console.log('address: ' + myContract.address); + document.getElementById('status').innerText = "transaction sent, waiting for confirmation"; + watch.watch(function (err, hash) { + var block = web3.eth.getBlock(hash, true); + var contractMined = block.transactions.reduce(function (mined, th) { + // TODO: compiled code do not have 0x prefix + return mined || (th.from === web3.eth.defaultAccount && th.input.indexOf(code) !== -1); + }, false); + + if (contractMined) { + document.getElementById('status').innerText = 'Mined!'; + document.getElementById('call').style.visibility = 'visible'; + } + }); + } function callExampleContract() { @@ -61,7 +78,8 @@

contract

-
+
+
diff --git a/example/event_inc.html b/example/event_inc.html index ac12c6447..16eaa046f 100644 --- a/example/event_inc.html +++ b/example/event_inc.html @@ -6,19 +6,20 @@ var web3 = require('web3'); web3.setProvider(new web3.providers.HttpProvider('http://localhost:8545')); - /*var source = "" + */ - /*"contract Contract { " +*/ - /*" event Incremented(bool indexed odd, uint x); " +*/ - /*" function Contract() { " +*/ - /*" x = 69; " +*/ - /*" } " +*/ - /*" function inc() { " +*/ - /*" ++x; " +*/ - /*" Incremented(x % 2 == 1, x); " +*/ - /*" } " +*/ - /*" uint x; " +*/ - /*"}";*/ - var source = "5b60456000600050819055505b608c8060196000396000f3006000357c010000000000000000000000000000000000000000000000000000000090048063371303c014602e57005b6034603a565b60006000f35b6000600081815054600101919050819055506001600260006000505406147f6e61ef44ac2747ff8b84d353a908eb8bd5c3fb118334d57698c5cfc7041196ad600060006000505481526020016000a25b56"; + var source = "" + + "contract Contract { " + + " event Incremented(bool indexed odd, uint x); " + + " function Contract() { " + + " x = 70; " + + " } " + + " function inc() { " + + " ++x; " + + " Incremented(x % 2 == 1, x); " + + " } " + + " uint x; " + + "}"; + var code = web3.eth.compile.solidity(source).code; + /*var code = "5b60456000600050819055505b608c8060196000396000f3006000357c010000000000000000000000000000000000000000000000000000000090048063371303c014602e57005b6034603a565b60006000f35b6000600081815054600101919050819055506001600260006000505406147f6e61ef44ac2747ff8b84d353a908eb8bd5c3fb118334d57698c5cfc7041196ad600060006000505481526020016000a25b56";*/ var desc = [{ "constant" : false, @@ -51,13 +52,40 @@ var createContract = function () { // let's assume that we have a private key to coinbase ;) web3.eth.defaultAccount = web3.eth.coinbase; - var Contract = web3.eth.contract(desc); - contract = new Contract({data: source}); + + var watch = web3.eth.filter('latest'); + + contract = web3.eth.contract(desc).new({data: code}); + + console.log('address: ' + contract.address); + + document.getElementById('create').style.visibility = 'hidden'; + document.getElementById('status').innerText = "transaction sent, waiting for confirmation"; + watch.watch(function (err, hash) { + var block = web3.eth.getBlock(hash, true); + var contractMined = block.transactions.reduce(function (mined, th) { + // TODO: compiled code do not have 0x prefix + return mined || (th.from === web3.eth.defaultAccount && th.input.indexOf(code) !== -1); + }, false); + + if (contractMined) { + document.getElementById('status').innerText = 'Mined!'; + document.getElementById('call').style.visibility = 'visible'; + } + }); + contract.Incremented({odd: true}).watch(update); }; + var counter = 0; var callContract = function () { + counter++; + var all = 70 + counter; + document.getElementById('count').innerText = 'Transaction sent ' + counter + ' times. ' + + 'Expected x value is: ' + (all - (all % 2 ? 0 : 1)) + ' ' + + 'Waiting for the blocks to be mined...'; + contract.inc(); }; @@ -66,12 +94,14 @@ +
- +
- +
+
diff --git a/example/node-app.js b/example/node-app.js index 72b3986da..909c9d275 100644 --- a/example/node-app.js +++ b/example/node-app.js @@ -2,11 +2,11 @@ var web3 = require("../index.js"); -web3.setProvider(new web3.providers.HttpProvider('http://localhost:8080')); +web3.setProvider(new web3.providers.HttpProvider('http://localhost:8545')); var coinbase = web3.eth.coinbase; console.log(coinbase); var balance = web3.eth.getBalance(coinbase); -console.log(balance); +console.log(balance.toString(10)); diff --git a/index.js b/index.js index ae231d7d9..7a1c06902 100644 --- a/index.js +++ b/index.js @@ -2,7 +2,6 @@ var web3 = require('./lib/web3'); web3.providers.HttpProvider = require('./lib/web3/httpprovider'); web3.providers.QtSyncProvider = require('./lib/web3/qtsync'); web3.eth.contract = require('./lib/web3/contract'); -web3.abi = require('./lib/solidity/abi'); // dont override global variable if (typeof window !== 'undefined' && typeof window.web3 === 'undefined') { diff --git a/lib/solidity/abi.js b/lib/solidity/abi.js deleted file mode 100644 index feb139ed4..000000000 --- a/lib/solidity/abi.js +++ /dev/null @@ -1,44 +0,0 @@ -/* - This file is part of ethereum.js. - - ethereum.js is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - ethereum.js is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with ethereum.js. If not, see . -*/ -/** - * @file abi.js - * @author Marek Kotewicz - * @author Gav Wood - * @date 2014 - */ - -var coder = require('./coder'); -var utils = require('./utils'); - -var formatConstructorParams = function (abi, params) { - var constructor = utils.getConstructor(abi, params.length); - if (!constructor) { - if (params.length > 0) { - console.warn("didn't found matching constructor, using default one"); - } - return ''; - } - - return coder.encodeParams(constructor.inputs.map(function (input) { - return input.type; - }), params); -}; - -module.exports = { - formatConstructorParams: formatConstructorParams -}; - diff --git a/lib/solidity/utils.js b/lib/solidity/utils.js deleted file mode 100644 index 23566f74a..000000000 --- a/lib/solidity/utils.js +++ /dev/null @@ -1,45 +0,0 @@ -/* - This file is part of ethereum.js. - - ethereum.js is free software: you can redistribute it and/or modify - it under the terms of the GNU Lesser General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - ethereum.js is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with ethereum.js. If not, see . -*/ -/** - * @file utils.js - * @author Marek Kotewicz - * @date 2015 - */ - -/** - * Returns the contstructor with matching number of arguments - * - * @method getConstructor - * @param {Array} abi - * @param {Number} numberOfArgs - * @returns {Object} constructor function abi - */ -var getConstructor = function (abi, numberOfArgs) { - return abi.filter(function (f) { - return f.type === 'constructor' && f.inputs.length === numberOfArgs; - })[0]; -}; - -//var getSupremeType = function (type) { - //return type.substr(0, type.indexOf('[')) + ']'; -//}; - - -module.exports = { - getConstructor: getConstructor -}; - diff --git a/lib/utils/utils.js b/lib/utils/utils.js index baaaa7d48..91964c333 100644 --- a/lib/utils/utils.js +++ b/lib/utils/utils.js @@ -363,6 +363,7 @@ var toAddress = function (address) { return '0x' + padLeft(toHex(address).substr(2), 40); }; + /** * Returns true if object is BigNumber, otherwise false * diff --git a/lib/version.json b/lib/version.json index e5c97ebab..70753fc9d 100644 --- a/lib/version.json +++ b/lib/version.json @@ -1,3 +1,3 @@ { - "version": "0.3.6" + "version": "0.4.2" } diff --git a/lib/web3.js b/lib/web3.js index 47db94278..98460fea4 100644 --- a/lib/web3.js +++ b/lib/web3.js @@ -37,6 +37,7 @@ var RequestManager = require('./web3/requestmanager'); var c = require('./utils/config'); var Method = require('./web3/method'); var Property = require('./web3/property'); +var Batch = require('./web3/batch'); var web3Methods = [ new Method({ @@ -129,6 +130,9 @@ web3.toBigNumber = utils.toBigNumber; web3.toWei = utils.toWei; web3.fromWei = utils.fromWei; web3.isAddress = utils.isAddress; +web3.createBatch = function () { + return new Batch(); +}; // ADD defaultblock Object.defineProperty(web3.eth, 'defaultBlock', { diff --git a/lib/web3/batch.js b/lib/web3/batch.js new file mode 100644 index 000000000..ca32bf725 --- /dev/null +++ b/lib/web3/batch.js @@ -0,0 +1,61 @@ +/* + This file is part of ethereum.js. + + ethereum.js is free software: you can redistribute it and/or modify + it under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + ethereum.js is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with ethereum.js. If not, see . +*/ +/** + * @file batch.js + * @author Marek Kotewicz + * @date 2015 + */ + +var RequestManager = require('./requestmanager'); + +var Batch = function () { + this.requests = []; +}; + +/** + * Should be called to add create new request to batch request + * + * @method add + * @param {Object} jsonrpc requet object + */ +Batch.prototype.add = function (request) { + this.requests.push(request); +}; + +/** + * Should be called to execute batch request + * + * @method execute + */ +Batch.prototype.execute = function () { + var requests = this.requests; + RequestManager.getInstance().sendBatch(requests, function (err, results) { + results = results || []; + requests.map(function (request, index) { + return results[index] || {}; + }).map(function (result, index) { + return requests[index].format ? requests[index].format(result.result) : result.result; + }).forEach(function (result, index) { + if (requests[index].callback) { + requests[index].callback(err, result); + } + }); + }); +}; + +module.exports = Batch; + diff --git a/lib/web3/contract.js b/lib/web3/contract.js index 47ffae8f4..9666f9eaa 100644 --- a/lib/web3/contract.js +++ b/lib/web3/contract.js @@ -21,13 +21,39 @@ */ var web3 = require('../web3'); -var solAbi = require('../solidity/abi'); var utils = require('../utils/utils'); +var coder = require('../solidity/coder'); var SolidityEvent = require('./event'); var SolidityFunction = require('./function'); -var addFunctionsToContract = function (contract, desc) { - desc.filter(function (json) { +/** + * Should be called to encode constructor params + * + * @method encodeConstructorParams + * @param {Array} abi + * @param {Array} constructor params + */ +var encodeConstructorParams = function (abi, params) { + return abi.filter(function (json) { + return json.type === 'constructor' && json.inputs.length === params.length; + }).map(function (json) { + return json.inputs.map(function (input) { + return input.type; + }); + }).map(function (types) { + return coder.encodeParams(types, params); + })[0] || ''; +}; + +/** + * Should be called to add functions to contract object + * + * @method addFunctionsToContract + * @param {Contract} contract + * @param {Array} abi + */ +var addFunctionsToContract = function (contract, abi) { + abi.filter(function (json) { return json.type === 'function'; }).map(function (json) { return new SolidityFunction(json, contract.address); @@ -36,8 +62,15 @@ var addFunctionsToContract = function (contract, desc) { }); }; -var addEventsToContract = function (contract, desc) { - desc.filter(function (json) { +/** + * Should be called to add events to contract object + * + * @method addEventsToContract + * @param {Contract} contract + * @param {Array} abi + */ +var addEventsToContract = function (contract, abi) { + abi.filter(function (json) { return json.type === 'event'; }).map(function (json) { return new SolidityEvent(json, contract.address); @@ -47,59 +80,100 @@ var addEventsToContract = function (contract, desc) { }; /** - * This method should be called when we want to call / transact some solidity method from javascript - * it returns an object which has same methods available as solidity contract description - * usage example: - * - * var abi = [{ - * name: 'myMethod', - * inputs: [{ name: 'a', type: 'string' }], - * outputs: [{name: 'd', type: 'string' }] - * }]; // contract abi - * - * var MyContract = web3.eth.contract(abi); // creation of contract prototype - * - * var contractInstance = new MyContract('0x0123123121'); + * Should be called to create new ContractFactory * - * contractInstance.myMethod('this is test string param for call'); // myMethod call (implicit, default) - * contractInstance.call().myMethod('this is test string param for call'); // myMethod call (explicit) - * contractInstance.sendTransaction().myMethod('this is test string param for transact'); // myMethod sendTransaction - * - * @param abi - abi json description of the contract, which is being created - * @returns contract object + * @method contract + * @param {Array} abi + * @returns {ContractFactory} new contract factory */ var contract = function (abi) { + return new ContractFactory(abi); +}; - // return prototype - return Contract.bind(null, abi); +/** + * Should be called to create new ContractFactory instance + * + * @method ContractFactory + * @param {Array} abi + */ +var ContractFactory = function (abi) { + this.abi = abi; }; -var Contract = function (abi, options) { - - this.address = ''; - if (utils.isAddress(options)) { - this.address = options; - } else { // is an object! - // TODO, parse the rest of the args - options = options || {}; - var args = Array.prototype.slice.call(arguments, 2); - var bytes = solAbi.formatConstructorParams(abi, args); - options.data += bytes; - this.address = web3.eth.sendTransaction(options); +/** + * Should be called to create new contract on a blockchain + * + * @method new + * @param {Any} contract constructor param1 (optional) + * @param {Any} contract constructor param2 (optional) + * @param {Object} contract transaction object (required) + * @param {Function} callback + * @returns {Contract} returns contract if no callback was passed, + * otherwise calls callback function (err, contract) + */ +ContractFactory.prototype.new = function () { + // parse arguments + var options = {}; // required! + var callback; + + var args = Array.prototype.slice.call(arguments); + if (utils.isFunction(args[args.length - 1])) { + callback = args.pop(); } - addFunctionsToContract(this, abi); - addEventsToContract(this, abi); + var last = args[args.length - 1]; + if (utils.isObject(last) && !utils.isArray(last)) { + options = args.pop(); + } + + // throw an error if there are no options + + var bytes = encodeConstructorParams(this.abi, args); + options.data += bytes; + + if (!callback) { + var address = web3.eth.sendTransaction(options); + return this.at(address); + } + + var self = this; + web3.eth.sendTransaction(options, function (err, address) { + if (err) { + callback(err); + } + self.at(address, callback); + }); }; -Contract.prototype.call = function () { - console.error('contract.call is deprecated'); - return this; +/** + * Should be called to get access to existing contract on a blockchain + * + * @method at + * @param {Address} contract address (required) + * @param {Function} callback {optional) + * @returns {Contract} returns contract if no callback was passed, + * otherwise calls callback function (err, contract) + */ +ContractFactory.prototype.at = function (address, callback) { + // TODO: address is required + + if (callback) { + callback(null, new Contract(this.abi, address)); + } + return new Contract(this.abi, address); }; -Contract.prototype.sendTransaction = function () { - console.error('contract.sendTransact is deprecated'); - return this; +/** + * Should be called to create new contract instance + * + * @method Contract + * @param {Array} abi + * @param {Address} contract address + */ +var Contract = function (abi, address) { + this.address = address; + addFunctionsToContract(this, abi); + addEventsToContract(this, abi); }; module.exports = contract; diff --git a/lib/web3/eth.js b/lib/web3/eth.js index b955a45ac..87a2b290c 100644 --- a/lib/web3/eth.js +++ b/lib/web3/eth.js @@ -174,6 +174,14 @@ var call = new Method({ inputFormatter: [formatters.inputTransactionFormatter, formatters.inputDefaultBlockNumberFormatter] }); +var estimateGas = new Method({ + name: 'estimateGas', + call: 'eth_estimateGas', + params: 1, + inputFormatter: [formatters.inputTransactionFormatter], + outputFormatter: utils.toDecimal +}); + var compileSolidity = new Method({ name: 'compile.solidity', call: 'eth_compileSolidity', @@ -192,6 +200,18 @@ var compileSerpent = new Method({ params: 1 }); +var submitWork = new Method({ + name: 'submitWork', + call: 'eth_submitWork', + params: 3 +}); + +var getWork = new Method({ + name: 'getWork', + call: 'eth_getWork', + params: 0 +}); + var methods = [ getBalance, getStorageAt, @@ -205,10 +225,13 @@ var methods = [ getTransactionFromBlock, getTransactionCount, call, + estimateGas, sendTransaction, compileSolidity, compileLLL, compileSerpent, + submitWork, + getWork ]; /// @returns an array of objects describing web3.eth api properties diff --git a/lib/web3/function.js b/lib/web3/function.js index 2bbb68423..e9ad5d03a 100644 --- a/lib/web3/function.js +++ b/lib/web3/function.js @@ -14,7 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with ethereum.js. If not, see . */ -/** +/** * @file function.js * @author Marek Kotewicz * @date 2015 @@ -39,18 +39,23 @@ var SolidityFunction = function (json, address) { this._address = address; }; +SolidityFunction.prototype.extractCallback = function (args) { + if (utils.isFunction(args[args.length - 1])) { + return args.pop(); // modify the args array! + } +}; + /** * Should be used to create payload from arguments * * @method toPayload - * @param {...} solidity function params + * @param {Array} solidity function params * @param {Object} optional payload options */ -SolidityFunction.prototype.toPayload = function () { - var args = Array.prototype.slice.call(arguments); +SolidityFunction.prototype.toPayload = function (args) { var options = {}; if (args.length > this._inputTypes.length && utils.isObject(args[args.length -1])) { - options = args.pop(); + options = args[args.length - 1]; } options.to = this._address; options.data = '0x' + this.signature() + coder.encodeParams(this._inputTypes, args); @@ -67,19 +72,41 @@ SolidityFunction.prototype.signature = function () { return web3.sha3(web3.fromAscii(this._name)).slice(2, 10); }; + +SolidityFunction.prototype.unpackOutput = function (output) { + if (output === null) { + return; + } + + output = output.length >= 2 ? output.slice(2) : output; + var result = coder.decodeParams(this._outputTypes, output); + return result.length === 1 ? result[0] : result; +}; + /** - * Should be used to call function - * + * Calls a contract function. + * * @method call - * @param {Object} options + * @param {...Object} Contract function arguments + * @param {function} If the last argument is a function, the contract function + * call will be asynchronous, and the callback will be passed the + * error and result. * @return {String} output bytes */ SolidityFunction.prototype.call = function () { - var payload = this.toPayload.apply(this, Array.prototype.slice.call(arguments)); - var output = web3.eth.call(payload); - output = output.length >= 2 ? output.slice(2) : output; - var result = coder.decodeParams(this._outputTypes, output); - return result.length === 1 ? result[0] : result; + var args = Array.prototype.slice.call(arguments); + var callback = this.extractCallback(args); + var payload = this.toPayload(args); + + if (!callback) { + var output = web3.eth.call(payload); + return this.unpackOutput(output); + } + + var self = this; + web3.eth.call(payload, function (error, output) { + callback(error, self.unpackOutput(output)); + }); }; /** @@ -89,8 +116,16 @@ SolidityFunction.prototype.call = function () { * @param {Object} options */ SolidityFunction.prototype.sendTransaction = function () { - var payload = this.toPayload.apply(this, Array.prototype.slice.call(arguments)); - web3.eth.sendTransaction(payload); + var args = Array.prototype.slice.call(arguments); + var callback = this.extractCallback(args); + var payload = this.toPayload(args); + + if (!callback) { + web3.eth.sendTransaction(payload); + return; + } + + web3.eth.sendTransaction(payload, callback); }; /** @@ -105,7 +140,7 @@ SolidityFunction.prototype.displayName = function () { /** * Should be used to get function type name - * + * * @method typeName * @return {String} type name of the function */ @@ -113,6 +148,25 @@ SolidityFunction.prototype.typeName = function () { return utils.extractTypeName(this._name); }; +/** + * Should be called to get rpc requests from solidity function + * + * @method request + * @returns {Object} + */ +SolidityFunction.prototype.request = function () { + var args = Array.prototype.slice.call(arguments); + var callback = this.extractCallback(args); + var payload = this.toPayload(args); + var format = this.unpackOutput.bind(this); + + return { + callback: callback, + payload: payload, + format: format + }; +}; + /** * Should be called to execute function * @@ -120,7 +174,7 @@ SolidityFunction.prototype.typeName = function () { */ SolidityFunction.prototype.execute = function () { var transaction = !this._constant; - + // send transaction if (transaction) { return this.sendTransaction.apply(this, Array.prototype.slice.call(arguments)); @@ -138,6 +192,7 @@ SolidityFunction.prototype.execute = function () { */ SolidityFunction.prototype.attachToContract = function (contract) { var execute = this.execute.bind(this); + execute.request = this.request.bind(this); execute.call = this.call.bind(this); execute.sendTransaction = this.sendTransaction.bind(this); var displayName = this.displayName(); diff --git a/lib/web3/method.js b/lib/web3/method.js index 449388dd3..8f10b2dfe 100644 --- a/lib/web3/method.js +++ b/lib/web3/method.js @@ -54,7 +54,6 @@ Method.prototype.extractCallback = function (args) { if (utils.isFunction(args[args.length - 1])) { return args.pop(); // modify the args array! } - return null; }; /** @@ -107,6 +106,7 @@ Method.prototype.formatOutput = function (result) { */ Method.prototype.attachToObject = function (obj) { var func = this.send.bind(this); + func.request = this.request.bind(this); func.call = this.call; // that's ugly. filter.js uses it var name = this.name.split('.'); if (name.length > 1) { @@ -137,6 +137,19 @@ Method.prototype.toPayload = function (args) { }; }; +/** + * Should be called to create pure JSONRPC request which can be used in batch request + * + * @method request + * @param {...} params + * @return {Object} jsonrpc request + */ +Method.prototype.request = function () { + var payload = this.toPayload(Array.prototype.slice.call(arguments)); + payload.format = this.formatOutput.bind(this); + return payload; +}; + /** * Should send request to the API * @@ -149,7 +162,7 @@ Method.prototype.send = function () { if (payload.callback) { var self = this; return RequestManager.getInstance().sendAsync(payload, function (err, result) { - payload.callback(null, self.formatOutput(result)); + payload.callback(err, self.formatOutput(result)); }); } return this.formatOutput(RequestManager.getInstance().send(payload)); diff --git a/lib/web3/property.js b/lib/web3/property.js index bfcbb2d25..a2e7282e9 100644 --- a/lib/web3/property.js +++ b/lib/web3/property.js @@ -63,16 +63,23 @@ Property.prototype.formatOutput = function (result) { Property.prototype.attachToObject = function (obj) { var proto = { get: this.get.bind(this), - set: this.set.bind(this) }; - var name = this.name.split('.'); - if (name.length > 1) { - obj[name[0]] = obj[name[0]] || {}; - Object.defineProperty(obj[name[0]], name[1], proto); - } else { - Object.defineProperty(obj, name[0], proto); + var names = this.name.split('.'); + var name = names[0]; + if (names.length > 1) { + obj[names[0]] = obj[names[0]] || {}; + obj = obj[names[0]]; + name = names[1]; } + + Object.defineProperty(obj, name, proto); + + var toAsyncName = function (prefix, name) { + return prefix + name.charAt(0).toUpperCase() + name.slice(1); + }; + + obj[toAsyncName('get', name)] = this.getAsync.bind(this); }; /** @@ -88,15 +95,20 @@ Property.prototype.get = function () { }; /** - * Should be used to set value of the property + * Should be used to asynchrounously get value of property * - * @method set - * @param {Object} new value of the property + * @method getAsync + * @param {Function} */ -Property.prototype.set = function (value) { - return RequestManager.getInstance().send({ - method: this.setter, - params: [this.formatInput(value)] +Property.prototype.getAsync = function (callback) { + var self = this; + RequestManager.getInstance().sendAsync({ + method: this.getter + }, function (err, result) { + if (err) { + return callback(err); + } + callback(err, self.formatOutput(result)); }); }; diff --git a/lib/web3/requestmanager.js b/lib/web3/requestmanager.js index 87eeb8a29..73a18881a 100644 --- a/lib/web3/requestmanager.js +++ b/lib/web3/requestmanager.js @@ -105,6 +105,33 @@ RequestManager.prototype.sendAsync = function (data, callback) { }); }; +/** + * Should be called to asynchronously send batch request + * + * @method sendBatch + * @param {Array} batch data + * @param {Function} callback + */ +RequestManager.prototype.sendBatch = function (data, callback) { + if (!this.provider) { + return callback(errors.InvalidProvider()); + } + + var payload = Jsonrpc.getInstance().toBatchPayload(data); + + this.provider.sendAsync(payload, function (err, results) { + if (err) { + return callback(err); + } + + if (!utils.isArray(results)) { + return callback(errors.InvalidResponse(results)); + } + + callback(err, results); + }); +}; + /** * Should be used to set provider of request manager * diff --git a/lib/web3/watches.js b/lib/web3/watches.js index 0b2c1bd3b..8bcfe207b 100644 --- a/lib/web3/watches.js +++ b/lib/web3/watches.js @@ -25,7 +25,20 @@ var Method = require('./method'); /// @returns an array of objects describing web3.eth.filter api methods var eth = function () { var newFilterCall = function (args) { - return typeof args[0] === 'string' ? 'eth_newBlockFilter' : 'eth_newFilter'; + var type = args[0]; + + switch(type) { + case 'latest': + args.pop(); + this.params = 0; + return 'eth_newBlockFilter'; + case 'pending': + args.pop(); + this.params = 0; + return 'eth_newPendingTransactionFilter'; + default: + return 'eth_newFilter'; + } }; var newFilter = new Method({ diff --git a/package.js b/package.js index bfb8d0556..953edb4fb 100644 --- a/package.js +++ b/package.js @@ -1,7 +1,7 @@ /* jshint ignore:start */ Package.describe({ name: 'ethereum:web3', - version: '0.3.6', + version: '0.4.2', summary: 'Ethereum JavaScript API, middleware to talk to a ethreum node over RPC', git: 'https://github.com/ethereum/ethereum.js', // By default, Meteor will default to using README.md for documentation. diff --git a/package.json b/package.json index 4c7c81445..59d4f6211 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "web3", "namespace": "ethereum", - "version": "0.3.6", + "version": "0.4.2", "description": "Ethereum JavaScript API, middleware to talk to a ethereum node over RPC", "main": "./index.js", "directories": { diff --git a/test/abi.formatConstructorParams.js b/test/abi.formatConstructorParams.js deleted file mode 100644 index 9113f02c6..000000000 --- a/test/abi.formatConstructorParams.js +++ /dev/null @@ -1,106 +0,0 @@ -var chai = require('chai'); -var assert = require('assert'); -var abi = require('../lib/solidity/abi'); - -describe('lib/solidity/abi', function () { - describe('formatConstructorParams', function () { - it('should format uint256 properly', function () { - // given - var description = [{ - "name": "test", - "type": "constructor", - "inputs": [{ - "name": "a", - "type": "uint256" - } - ] - }]; - - // when - var bytes = abi.formatConstructorParams(description, [2]); - - // then - assert.equal(bytes, '0000000000000000000000000000000000000000000000000000000000000002'); - }); - - it('should not find matching constructor', function () { - // given - var description = [{ - "name": "test", - "type": "constructor", - "inputs": [{ - "name": "a", - "type": "uint256" - } - ] - }]; - - // when - var bytes = abi.formatConstructorParams(description, []); - - // then - assert.equal(bytes, ''); - }); - - it('should not find matching constructor2', function () { - // given - var description = [{ - "name": "test", - "type": "constructor", - "inputs": [{ - "name": "a", - "type": "uint256" - } - ] - }]; - - // when - var bytes = abi.formatConstructorParams(description, [1,2]); - - // then - assert.equal(bytes, ''); - }); - - it('should not find matching constructor3', function () { - // given - var description = [{ - "name": "test", - "type": "function", - "inputs": [{ - "name": "a", - "type": "uint256" - } - ] - }]; - - // when - var bytes = abi.formatConstructorParams(description, [2]); - - // then - assert.equal(bytes, ''); - }); - - it('should find matching constructor with multiple args', function () { - // given - var description = [{ - "name": "test", - "type": "constructor", - "inputs": [{ - "name": "a", - "type": "uint256" - }, { - "name": "b", - "type": "uint256" - }] - }]; - - // when - var bytes = abi.formatConstructorParams(description, ['1', '5']); - - // then - assert.equal(bytes, '00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000005'); - }); - }); -}); - - diff --git a/test/async.js b/test/async.js new file mode 100644 index 000000000..77497603c --- /dev/null +++ b/test/async.js @@ -0,0 +1,69 @@ +var chai = require('chai'); +var assert = chai.assert; +var web3 = require('../index'); +var FakeHttpProvider = require('./helpers/FakeHttpProvider'); + +// use sendTransaction as dummy +var method = 'sendTransaction'; + +var tests = [{ + result: '0xb', + formattedResult: '0xb', + call: 'eth_'+ method +}]; + +describe('async', function () { + tests.forEach(function (test, index) { + it('test: ' + index, function (done) { + + // given + var provider = new FakeHttpProvider(); + web3.setProvider(provider); + provider.injectResult(test.result); + provider.injectValidation(function (payload) { + assert.equal(payload.jsonrpc, '2.0'); + assert.equal(payload.method, test.call); + assert.deepEqual(payload.params, [{}]); + }); + + // when + web3.eth[method]({}, function(error, result){ + + // then + assert.isNull(error); + assert.strictEqual(test.formattedResult, result); + + done(); + }); + + }); + + it('error test: ' + index, function (done) { + + // given + var provider = new FakeHttpProvider(); + web3.setProvider(provider); + provider.injectError({ + message: test.result, + code: -32603 + }); + provider.injectValidation(function (payload) { + assert.equal(payload.jsonrpc, '2.0'); + assert.equal(payload.method, test.call); + assert.deepEqual(payload.params, [{}]); + }); + + // when + web3.eth[method]({}, function(error, result){ + + // then + assert.isUndefined(result); + assert.strictEqual(test.formattedResult, error.message); + + done(); + }); + + }); + }); +}); + diff --git a/test/batch.js b/test/batch.js new file mode 100644 index 000000000..69ae8fd58 --- /dev/null +++ b/test/batch.js @@ -0,0 +1,86 @@ +var chai = require('chai'); +var assert = chai.assert; +var web3 = require('../index'); +var FakeHttpProvider = require('./helpers/FakeHttpProvider'); +var bn = require('bignumber.js'); + +describe('lib/web3/batch', function () { + describe('execute', function () { + it('should execute batch request', function (done) { + + var provider = new FakeHttpProvider(); + web3.setProvider(provider); + web3.reset(); + + var result = '0x126'; + var result2 = '0x127'; + provider.injectBatchResults([result, result2]); + + var counter = 0; + var callback = function (err, r) { + counter++; + assert.deepEqual(new bn(result), r); + }; + + var callback2 = function (err, r) { + assert.equal(counter, 1); + assert.deepEqual(new bn(result2), r); + done(); + }; + + var batch = web3.createBatch(); + batch.add(web3.eth.getBalance.request('0x0000000000000000000000000000000000000000', 'latest', callback)); + batch.add(web3.eth.getBalance.request('0x0000000000000000000000000000000000000005', 'latest', callback2)); + batch.execute(); + }); + + it('should execute batch request', function (done) { + + var provider = new FakeHttpProvider(); + web3.setProvider(provider); + web3.reset(); + + var abi = [{ + "name": "balance(address)", + "type": "function", + "inputs": [{ + "name": "who", + "type": "address" + }], + "constant": true, + "outputs": [{ + "name": "value", + "type": "uint256" + }] + }]; + + + var address = '0x0000000000000000000000000000000000000000'; + var result = '0x126'; + var result2 = '0x0000000000000000000000000000000000000000000000000000000000000123'; + var signature = '0x001122334455'; + + // TODO: fix this, maybe in browser sha3? + provider.injectResult(signature); + + var counter = 0; + var callback = function (err, r) { + counter++; + assert.deepEqual(new bn(result), r); + }; + + var callback2 = function (err, r) { + assert.equal(counter, 1); + assert.deepEqual(new bn(result2), r); + done(); + }; + + var batch = web3.createBatch(); + batch.add(web3.eth.getBalance.request('0x0000000000000000000000000000000000000000', 'latest', callback)); + batch.add(web3.eth.contract(abi).at(address).balance.request(address, callback2)); + provider.injectBatchResults([result, result2]); + batch.execute(); + }); + }); +}); + diff --git a/test/contract.js b/test/contract.js index 0dcaa1003..a46a8cab3 100644 --- a/test/contract.js +++ b/test/contract.js @@ -116,8 +116,7 @@ describe('web3.eth.contract', function () { } }); - var Contract = web3.eth.contract(desc); - var contract = new Contract(address); + var contract = web3.eth.contract(desc).at(address); var res = 0; contract.Changed({from: address}).watch(function(err, result) { @@ -155,8 +154,7 @@ describe('web3.eth.contract', function () { } }); - var Contract = web3.eth.contract(desc); - var contract = new Contract(address); + var contract = web3.eth.contract(desc).at(address); contract.balance(address); }); @@ -186,8 +184,7 @@ describe('web3.eth.contract', function () { } }); - var Contract = web3.eth.contract(desc); - var contract = new Contract(address); + var contract = web3.eth.contract(desc).at(address); contract.send(address, 17); }); @@ -218,8 +215,7 @@ describe('web3.eth.contract', function () { } }); - var Contract = web3.eth.contract(desc); - var contract = new Contract(address); + var contract = web3.eth.contract(desc).at(address); contract.balance(address, {from: address, gas: 50000}); @@ -251,8 +247,7 @@ describe('web3.eth.contract', function () { } }); - var Contract = web3.eth.contract(desc); - var contract = new Contract(address); + var contract = web3.eth.contract(desc).at(address); contract.balance.call(address, {from: address, gas: 50000}); @@ -287,8 +282,7 @@ describe('web3.eth.contract', function () { } }); - var Contract = web3.eth.contract(desc); - var contract = new Contract(address); + var contract = web3.eth.contract(desc).at(address); contract.send(address, 17, {from: address, gas: 50000, gasPrice: 3000, value: 10000}); }); @@ -322,12 +316,48 @@ describe('web3.eth.contract', function () { } }); - var Contract = web3.eth.contract(desc); - var contract = new Contract(address); + var contract = web3.eth.contract(desc).at(address); contract.send.sendTransaction(address, 17, {from: address, gas: 50000, gasPrice: 3000, value: 10000}); }); + it('should explicitly sendTransaction with optional params and call callback without error', function (done) { + var provider = new FakeHttpProvider(); + web3.setProvider(provider); + web3.reset(); + var sha3 = '0x5131231231231231231231'; + var address = '0x1234567890123456789012345678901234567890'; + provider.injectResult(sha3); + var step = 0; + provider.injectValidation(function (payload) { + if (step === 0) { + step = 1; + assert.equal(payload.jsonrpc, '2.0'); + assert.equal(payload.method, 'web3_sha3'); + assert.equal(payload.params[0], web3.fromAscii('send(address,uint256)')); + } else if (step === 1) { + assert.equal(payload.method, 'eth_sendTransaction'); + assert.deepEqual(payload.params, [{ + data: sha3.slice(0, 10) + + '0000000000000000000000001234567890123456789012345678901234567890' + + '0000000000000000000000000000000000000000000000000000000000000011' , + to: address, + from: address, + gas: '0xc350', + gasPrice: '0xbb8', + value: '0x2710' + }]); + } + }); + + var contract = web3.eth.contract(desc).at(address); + + contract.send.sendTransaction(address, 17, {from: address, gas: 50000, gasPrice: 3000, value: 10000}, function (err) { + assert.equal(err, null); + done(); + }); + }); + it('should call testArr method and properly parse result', function () { var provider = new FakeHttpProvider2(); web3.setProvider(provider); @@ -356,12 +386,48 @@ describe('web3.eth.contract', function () { step++; }); - var Contract = web3.eth.contract(desc); - var contract = new Contract(address); - + var contract = web3.eth.contract(desc).at(address); var result = contract.testArr([3]); assert.deepEqual(new BigNumber(5), result); }); + + it('should call testArr method, properly parse result and return the result async', function (done) { + var provider = new FakeHttpProvider2(); + web3.setProvider(provider); + web3.reset(); + var sha3 = '0x5131231231231231231231'; + var address = '0x1234567890123456789012345678901234567890'; + provider.injectResultList([{ + result: sha3 + }, { + result: '0x0000000000000000000000000000000000000000000000000000000000000005' + }]); + var step = 0; + provider.injectValidation(function (payload) { + if (step === 1) { // getting sha3 is first + assert.equal(payload.method, 'eth_call'); + assert.deepEqual(payload.params, [{ + data: sha3.slice(0, 10) + + '0000000000000000000000000000000000000000000000000000000000000020' + + '0000000000000000000000000000000000000000000000000000000000000001' + + '0000000000000000000000000000000000000000000000000000000000000003', + to: address + }, + 'latest' + ]); + } + step++; + }); + + var contract = web3.eth.contract(desc).at(address); + + contract.testArr([3], function (err, result) { + assert.deepEqual(new BigNumber(5), result); + done(); + }); + + }); }); }); + diff --git a/test/method.request.js b/test/method.request.js new file mode 100644 index 000000000..00bf52cb7 --- /dev/null +++ b/test/method.request.js @@ -0,0 +1,23 @@ +var chai = require('chai'); +var assert = chai.assert; +var web3 = require('../index'); + +describe('lib/web3/method', function () { + describe('request', function () { + it('should create proper request', function () { + + var callback = function (err, result) {}; + var expected = { + method: 'eth_getBalance', + callback: callback, + params: ['0x0000000000000000000000000000000000000000', 'latest'], + }; + + var request = web3.eth.getBalance.request('0x0000000000000000000000000000000000000000', 'latest', callback); + + expected.format = request.format; + assert.deepEqual(request, expected); + }); + }); +}); + diff --git a/test/node/app.js b/test/node/app.js index c3fd489a0..9ec310f44 100644 --- a/test/node/app.js +++ b/test/node/app.js @@ -1,4 +1,4 @@ -var web3 = require('ethereum.js'); +var web3 = require('web3'); console.log(web3.version.api); diff --git a/test/node/package.json b/test/node/package.json index 4c56b2c10..310ad2e04 100644 --- a/test/node/package.json +++ b/test/node/package.json @@ -9,6 +9,6 @@ "author": "", "license": "ISC", "dependencies": { - "ethereum.js": "ethereum/ethereum.js#master" + "web3": "ethereum/web3.js#master" } } diff --git a/test/polling.js b/test/polling.js index ea7dd9829..8bd2b041c 100644 --- a/test/polling.js +++ b/test/polling.js @@ -6,15 +6,26 @@ var utils = require('../lib/utils/utils'); var tests = [{ protocol: 'eth', - args: ['pending'], + args: ['latest'], firstResult: 1, firstPayload: { method: "eth_newBlockFilter", - params: [ - "pending" - ] + params: [] + }, + secondResult: ['0x1234'], + secondPayload: { + method: "eth_getFilterChanges" + } +}, +{ + protocol: 'eth', + args: ['pending'], + firstResult: 1, + firstPayload: { + method: "eth_newPendingTransactionFilter", + params: [] }, - secondResult: [null], + secondResult: ['0x1234'], secondPayload: { method: "eth_getFilterChanges" } diff --git a/test/web3.eth.blockNumber.js b/test/web3.eth.blockNumber.js index dfd73f57e..dbe7f1c44 100644 --- a/test/web3.eth.blockNumber.js +++ b/test/web3.eth.blockNumber.js @@ -32,6 +32,26 @@ describe('web3.eth', function () { // then assert.strictEqual(test.formattedResult, result); }); + + it('async get property test: ' + index, function (done) { + + // given + var provider = new FakeHttpProvider(); + web3.setProvider(provider); + provider.injectResult(test.result); + provider.injectValidation(function (payload) { + assert.equal(payload.jsonrpc, '2.0'); + assert.equal(payload.method, test.call); + assert.deepEqual(payload.params, []); + }); + + // when + web3.eth.getBlockNumber(function (err, result) { + assert.strictEqual(test.formattedResult, result); + done(); + }); + + }); }); }); }); diff --git a/test/web3.eth.call.js b/test/web3.eth.call.js new file mode 100644 index 000000000..d79bd64d4 --- /dev/null +++ b/test/web3.eth.call.js @@ -0,0 +1,41 @@ +var web3 = require('../index'); +var testMethod = require('./helpers/test.method.js'); + +var method = 'call'; + +var tests = [{ + args: [{ + to: '0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b', + data: '0x23455654', + gas: 11, + gasPrice: 11 + }], + formattedArgs: [{ + to: '0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b', + data: '0x23455654', + gas: '0xb', + gasPrice: '0xb' + }, 'latest'], + result: '0x31981', + formattedResult: '0x31981', + call: 'eth_'+ method +},{ + args: [{ + to: '0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b', + data: '0x23455654', + gas: 11, + gasPrice: 11 + }, 11], + formattedArgs: [{ + to: '0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b', + data: '0x23455654', + gas: '0xb', + gasPrice: '0xb' + }, '0xb'], + result: '0x31981', + formattedResult: '0x31981', + call: 'eth_'+ method +}]; + +testMethod.runTests('eth', method, tests); + diff --git a/test/web3.eth.contract.js b/test/web3.eth.contract.js index 651810b69..b089f0243 100644 --- a/test/web3.eth.contract.js +++ b/test/web3.eth.contract.js @@ -25,8 +25,7 @@ describe('web3.eth.contract', function() { var address = '0x1234567890123456789012345678901234567890'; // when - var Con = contract(description); - var myCon = new Con(address); + var myCon = contract(description).at(address); // then assert.equal('function', typeof myCon.test); @@ -54,8 +53,7 @@ describe('web3.eth.contract', function() { var address = '0x1234567890123456789012345678901234567890'; // when - var Con = contract(description); - var myCon = new Con(address); + var myCon = contract(description).at(address); // then assert.equal('function', typeof myCon.test); @@ -97,8 +95,7 @@ describe('web3.eth.contract', function() { var address = '0x1234567890123456789012345678901234567890'; // when - var Con = contract(description); - var myCon = new Con(address); + var myCon = contract(description).at(address); // then assert.equal('function', typeof myCon.test); @@ -142,8 +139,7 @@ describe('web3.eth.contract', function() { var address = '0x1234567890123456789012345678901234567890'; // when - var Con = contract(description); - var myCon = new Con(address); + var myCon = contract(description).at(address); // then assert.equal('function', typeof myCon.test); @@ -171,8 +167,7 @@ describe('web3.eth.contract', function() { var address = '0x1234567890123456789012345678901234567890'; // when - var Con = contract(description); - var myCon = new Con(address); + var myCon = contract(description).at(address); // then assert.equal('undefined', typeof myCon.test); @@ -200,8 +195,7 @@ describe('web3.eth.contract', function() { var address = '0x1234567890123456789012345678901234567890'; // when - var Con = contract(description); - var myCon = new Con(address); + var myCon = contract(description).at(address); // then assert.equal('function', typeof myCon.test); @@ -233,8 +227,7 @@ describe('web3.eth.contract', function() { done(); }); - var Con = contract(description); - var myCon = new Con({data: code}, 2); + var myCon = contract(description).new(2, {data: code}); }); }); diff --git a/test/web3.eth.estimateGas.js b/test/web3.eth.estimateGas.js new file mode 100644 index 000000000..efa6bf310 --- /dev/null +++ b/test/web3.eth.estimateGas.js @@ -0,0 +1,25 @@ +var web3 = require('../index'); +var testMethod = require('./helpers/test.method.js'); + +var method = 'estimateGas'; + +var tests = [{ + args: [{ + to: '0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b', + data: '0x23455654', + gas: 11, + gasPrice: 11 + }], + formattedArgs: [{ + to: '0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b', + data: '0x23455654', + gas: '0xb', + gasPrice: '0xb' + }], + result: '0x31981', + formattedResult: 203137, + call: 'eth_'+ method +}]; + +testMethod.runTests('eth', method, tests); + diff --git a/test/web3.eth.filter.js b/test/web3.eth.filter.js index 7a355b50c..9f196b349 100644 --- a/test/web3.eth.filter.js +++ b/test/web3.eth.filter.js @@ -37,11 +37,17 @@ var tests = [{ formattedResult: '0xf', call: 'eth_newFilter' },{ - args: ['pending'], - formattedArgs: ['pending'], + args: ['latest'], + formattedArgs: [], result: '0xf', formattedResult: '0xf', call: 'eth_newBlockFilter' +},{ + args: ['pending'], + formattedArgs: [], + result: '0xf', + formattedResult: '0xf', + call: 'eth_newPendingTransactionFilter' }]; describe('web3.eth', function () { diff --git a/test/web3.eth.getWork.js b/test/web3.eth.getWork.js new file mode 100644 index 000000000..181c1894b --- /dev/null +++ b/test/web3.eth.getWork.js @@ -0,0 +1,16 @@ +var chai = require('chai'); +var web3 = require('../index'); +var testMethod = require('./helpers/test.method.js'); + +var method = 'getWork'; + +var tests = [{ + args: [], + formattedArgs: [], + result: true, + formattedResult: true, + call: 'eth_'+ method +}]; + +testMethod.runTests('eth', method, tests); + diff --git a/test/web3.eth.submitWork.js b/test/web3.eth.submitWork.js new file mode 100644 index 000000000..3751c8073 --- /dev/null +++ b/test/web3.eth.submitWork.js @@ -0,0 +1,17 @@ +var chai = require('chai'); +var web3 = require('../index'); +var testMethod = require('./helpers/test.method.js'); + +var method = 'submitWork'; + +var tests = [ +{ + args: ['0x567890abcdef5555', '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef', '0xcdef1234567890abcdef1234567890abcdef0x1234567890abcf1234567890ab'], + formattedArgs: ['0x567890abcdef5555', '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef', '0xcdef1234567890abcdef1234567890abcdef0x1234567890abcf1234567890ab'], + result: true, + formattedResult: true, + call: 'eth_'+ method +}]; + +testMethod.runTests('eth', method, tests); + From 2e2a59596de27988baec83222c7540c2064e22ce Mon Sep 17 00:00:00 2001 From: Marek Kotewicz Date: Thu, 14 May 2015 14:18:35 +0200 Subject: [PATCH 190/461] migration from web3.js 0.3.x -> 0.4.2 --- mix/qml/html/WebContainer.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mix/qml/html/WebContainer.html b/mix/qml/html/WebContainer.html index 9c458a4c7..cd92852a7 100644 --- a/mix/qml/html/WebContainer.html +++ b/mix/qml/html/WebContainer.html @@ -23,8 +23,7 @@ updateContracts = function(contracts) { window.contracts = {}; window.BigNumber = require('bignumber.js'); for (var c in contracts) { - var contractProto = window.web3.eth.contract(contracts[c].interface); - var contract = new contractProto(contracts[c].address); + var contract = window.web3.eth.contract(contracts[c].interface).at(contracts[c].address); window.contracts[c] = { address: contracts[c].address, interface: contracts[c].interface, From 96028db82cc15c2feabed12cc5b0b240af85287a Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Thu, 14 May 2015 16:19:16 +0300 Subject: [PATCH 191/461] More diagnostics for the BadRoot bug. --- libdevcrypto/OverlayDB.cpp | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/libdevcrypto/OverlayDB.cpp b/libdevcrypto/OverlayDB.cpp index 957c7f0e3..bde6a3644 100644 --- a/libdevcrypto/OverlayDB.cpp +++ b/libdevcrypto/OverlayDB.cpp @@ -38,6 +38,12 @@ OverlayDB::~OverlayDB() cnote << "Closing state DB"; } +class WriteBatchNoter: public ldb::WriteBatch::Handler +{ + virtual void Put(ldb::Slice const& _key, ldb::Slice const& _value) { cnote << "Put" << toHex(bytesConstRef(_key)) << "=>" << toHex(bytesConstRef(_value)); } + virtual void Delete(ldb::Slice const& _key) { cnote << "Delete" << toHex(bytesConstRef(_key)); } +}; + void OverlayDB::commit() { if (m_db) @@ -61,16 +67,27 @@ void OverlayDB::commit() } } - while (true) + for (unsigned i = 0; i < 10; ++i) { ldb::Status o = m_db->Write(m_writeOptions, &batch); if (o.ok()) break; - cwarn << "Error writing to database. Sleeping a while then retrying. If it keeps saying this, free up some space!"; - this_thread::sleep_for(chrono::milliseconds(500)); + if (i == 9) + { + cwarn << "Fail writing to state database. Bombing out."; + exit(-1); + } + cwarn << "Error writing to state database: " << o.ToString(); + WriteBatchNoter n; + batch.Iterate(&n); + cwarn << "Sleeping for" << (i + 1) << "seconds, then retrying."; + this_thread::sleep_for(chrono::seconds(i + 1)); + } + DEV_WRITE_GUARDED(x_this) + { + m_aux.clear(); + m_main.clear(); } - m_aux.clear(); - m_main.clear(); } } From ebe06b37de98d383adc3e955511c9c3e72f8a58e Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Thu, 14 May 2015 16:58:56 +0300 Subject: [PATCH 192/461] More stringent checking for ancestors in uncles. Minor fixes to AZ. Optimisations for NewBlockHashes handling. --- alethzero/MainWin.cpp | 3 ++- libethereum/BlockChain.cpp | 5 +++-- libethereum/EthereumHost.cpp | 4 ++-- libethereum/EthereumHost.h | 2 +- libethereum/EthereumPeer.cpp | 2 +- libethereum/State.cpp | 16 +++++++--------- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index 7551eaa35..7026cb7c8 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -1010,7 +1010,7 @@ void Main::refreshBalances() u256 b = ethereum()->balanceAt(i.first); QListWidgetItem* li = new QListWidgetItem(QString("%4 %2: %1 [%3]").arg(formatBalance(b).c_str()).arg(QString::fromStdString(render(i.first))).arg((unsigned)ethereum()->countAt(i.first)).arg(QString::fromStdString(i.second.first)), ui->ourAccounts); li->setData(Qt::UserRole, QByteArray((char const*)i.first.data(), Address::size)); - li->setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled); + li->setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled | Qt::ItemIsSelectable); li->setCheckState(m_beneficiary == i.first ? Qt::Checked : Qt::Unchecked); totalBalance += b; @@ -1990,6 +1990,7 @@ void Main::on_killAccount_triggered() m_keyManager.kill(h); if (m_keyManager.accounts().empty()) m_keyManager.import(Secret::random(), "Default account"); + m_beneficiary = *m_keyManager.accounts().begin(); keysChanged(); if (m_beneficiary == h) setBeneficiary(*m_keyManager.accounts().begin()); diff --git a/libethereum/BlockChain.cpp b/libethereum/BlockChain.cpp index 32a11ee53..7c03bc24f 100644 --- a/libethereum/BlockChain.cpp +++ b/libethereum/BlockChain.cpp @@ -984,11 +984,12 @@ vector BlockChain::withBlockBloom(LogBloom const& _b, unsigned _earlie h256Hash BlockChain::allUnclesFrom(h256 const& _parent) const { // Get all uncles cited given a parent (i.e. featured as uncles/main in parent, parent + 1, ... parent + 5). - h256Hash ret; h256 p = _parent; + h256Hash ret = { p }; + // p and (details(p).parent: i == 5) is likely to be overkill, but can't hurt to be cautious. for (unsigned i = 0; i < 6 && p != m_genesisHash; ++i, p = details(p).parent) { - ret.insert(p); // TODO: check: should this be details(p).parent? + ret.insert(details(p).parent); auto b = block(p); for (auto i: RLP(b)[2]) ret.insert(sha3(i.data())); diff --git a/libethereum/EthereumHost.cpp b/libethereum/EthereumHost.cpp index 72ee1854d..1ca77cd1c 100644 --- a/libethereum/EthereumHost.cpp +++ b/libethereum/EthereumHost.cpp @@ -83,7 +83,7 @@ void EthereumHost::noteNeedsSyncing(EthereumPeer* _who) _who->attemptSync(); } -void EthereumHost::changeSyncer(EthereumPeer* _syncer) +void EthereumHost::changeSyncer(EthereumPeer* _syncer, bool _needHelp) { if (_syncer) clog(NetAllDetail) << "Changing syncer to" << _syncer->session()->socketId(); @@ -93,7 +93,7 @@ void EthereumHost::changeSyncer(EthereumPeer* _syncer) m_syncer = _syncer; if (isSyncing()) { - if (_syncer->m_asking == Asking::Blocks) + if (_needHelp && _syncer->m_asking == Asking::Blocks) for (auto j: peerSessions()) { auto e = j.first->cap().get(); diff --git a/libethereum/EthereumHost.h b/libethereum/EthereumHost.h index d53c3cc79..95c7f147a 100644 --- a/libethereum/EthereumHost.h +++ b/libethereum/EthereumHost.h @@ -108,7 +108,7 @@ private: virtual void onStarting() { startWorking(); } virtual void onStopping() { stopWorking(); } - void changeSyncer(EthereumPeer* _ignore); + void changeSyncer(EthereumPeer* _ignore, bool _needHelp = true); BlockChain const& m_chain; TransactionQueue& m_tq; ///< Maintains a list of incoming transactions not yet in a block on the blockchain. diff --git a/libethereum/EthereumPeer.cpp b/libethereum/EthereumPeer.cpp index 85bdf33e9..1d0c9fa0d 100644 --- a/libethereum/EthereumPeer.cpp +++ b/libethereum/EthereumPeer.cpp @@ -600,7 +600,7 @@ bool EthereumPeer::interpret(unsigned _id, RLP const& _r) if (unknowns > 0) { host()->m_man.resetToChain(m_syncingNeededBlocks); - host()->changeSyncer(this); + host()->changeSyncer(this, false); transition(Asking::Blocks); } return true; diff --git a/libethereum/State.cpp b/libethereum/State.cpp index 167d6236e..ccc6c4512 100644 --- a/libethereum/State.cpp +++ b/libethereum/State.cpp @@ -650,25 +650,23 @@ u256 State::enact(bytesConstRef _block, BlockChain const& _bc, ImportRequirement if (rlp[2].itemCount() > 2) BOOST_THROW_EXCEPTION(TooManyUncles()); - unordered_set nonces = { m_currentBlock.nonce }; vector rewarded; - h256Hash knownUncles = _bc.allUnclesFrom(m_currentBlock.parentHash); + h256Hash excluded = _bc.allUnclesFrom(m_currentBlock.parentHash); + excluded.insert(m_currentBlock.hash()); for (auto const& i: rlp[2]) { - if (knownUncles.count(sha3(i.data()))) - BOOST_THROW_EXCEPTION(UncleInChain() << errinfo_comment("Uncle in block already mentioned") << errinfo_data(toString(knownUncles)) << errinfo_hash256(sha3(i.data())) ); - - BlockInfo uncle = BlockInfo::fromHeader(i.data()); - if (nonces.count(uncle.nonce)) - BOOST_THROW_EXCEPTION(DuplicateUncleNonce()); + auto h = sha3(i.data()); + if (excluded.count(h)) + BOOST_THROW_EXCEPTION(UncleInChain() << errinfo_comment("Uncle in block already mentioned") << errinfo_data(toString(excluded)) << errinfo_hash256(sha3(i.data()))); + excluded.insert(h); + BlockInfo uncle = BlockInfo::fromHeader(i.data(), CheckEverything, h); BlockInfo uncleParent(_bc.block(uncle.parentHash)); if ((bigint)uncleParent.number < (bigint)m_currentBlock.number - 7) BOOST_THROW_EXCEPTION(UncleTooOld()); uncle.verifyParent(uncleParent); - nonces.insert(uncle.nonce); // tdIncrease += uncle.difficulty; rewarded.push_back(uncle); } From 5b678eca8a17a1d8057a27895eb69087837eadce Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Thu, 14 May 2015 16:17:32 +0200 Subject: [PATCH 193/461] add in chain uncle test for every generation --- .../BlockTestsFiller/bcUncleTestFiller.json | 668 ++++++++++++++++++ 1 file changed, 668 insertions(+) diff --git a/test/libethereum/BlockTestsFiller/bcUncleTestFiller.json b/test/libethereum/BlockTestsFiller/bcUncleTestFiller.json index e67cfeecd..f700dc7ad 100644 --- a/test/libethereum/BlockTestsFiller/bcUncleTestFiller.json +++ b/test/libethereum/BlockTestsFiller/bcUncleTestFiller.json @@ -492,6 +492,674 @@ ] }, + + "InChainUncleFather" : { + "genesisBlockHeader" : { + "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1", + "difficulty" : "131072", + "extraData" : "0x42", + "gasLimit" : "3141592", + "gasUsed" : "0", + "number" : "0", + "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000", + "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "stateRoot" : "0xf99eb1626cfa6db435c0836235942d7ccaa935f1ae247d3f1c21e495685f903a", + "timestamp" : "0x54c98c81", + "mixHash" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "nonce" : "0x0102030405060708", + "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + }, + "expect" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "20" + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "nonce" : "2" + } + }, + "pre" : { + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "10000000000000", + "nonce" : "0", + "code" : "", + "storage": {} + } + }, + "blocks" : [ + { + "transactions" : [ + { + "data" : "", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "1", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "2", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "10" + } + ], + "uncleHeaders" : [ + { + "sameAsBlock" : "2" + } + ] + } + ] + }, + + "InChainUncleGrandPa" : { + "genesisBlockHeader" : { + "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1", + "difficulty" : "131072", + "extraData" : "0x42", + "gasLimit" : "3141592", + "gasUsed" : "0", + "number" : "0", + "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000", + "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "stateRoot" : "0xf99eb1626cfa6db435c0836235942d7ccaa935f1ae247d3f1c21e495685f903a", + "timestamp" : "0x54c98c81", + "mixHash" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "nonce" : "0x0102030405060708", + "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + }, + "expect" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "20" + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "nonce" : "2" + } + }, + "pre" : { + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "10000000000000", + "nonce" : "0", + "code" : "", + "storage": {} + } + }, + "blocks" : [ + { + "transactions" : [ + { + "data" : "", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "1", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "2", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "10" + } + ], + "uncleHeaders" : [ + { + "sameAsBlock" : "1" + } + ] + } + ] + }, + + + "InChainUncleGreatGrandPa" : { + "genesisBlockHeader" : { + "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1", + "difficulty" : "131072", + "extraData" : "0x42", + "gasLimit" : "3141592", + "gasUsed" : "0", + "number" : "0", + "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000", + "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "stateRoot" : "0xf99eb1626cfa6db435c0836235942d7ccaa935f1ae247d3f1c21e495685f903a", + "timestamp" : "0x54c98c81", + "mixHash" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "nonce" : "0x0102030405060708", + "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + }, + "expect" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "20" + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "nonce" : "2" + } + }, + "pre" : { + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "10000000000000", + "nonce" : "0", + "code" : "", + "storage": {} + } + }, + "blocks" : [ + { + "transactions" : [ + { + "data" : "", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "1", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "2", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "3", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "10" + } + ], + "uncleHeaders" : [ + { + "sameAsBlock" : "1" + } + ] + } + ] + }, + + "InChainUncleGreatGreatGrandPa" : { + "genesisBlockHeader" : { + "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1", + "difficulty" : "131072", + "extraData" : "0x42", + "gasLimit" : "3141592", + "gasUsed" : "0", + "number" : "0", + "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000", + "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "stateRoot" : "0xf99eb1626cfa6db435c0836235942d7ccaa935f1ae247d3f1c21e495685f903a", + "timestamp" : "0x54c98c81", + "mixHash" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "nonce" : "0x0102030405060708", + "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + }, + "expect" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "20" + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "nonce" : "2" + } + }, + "pre" : { + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "10000000000000", + "nonce" : "0", + "code" : "", + "storage": {} + } + }, + "blocks" : [ + { + "transactions" : [ + { + "data" : "", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "1", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "2", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "3", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "4", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "10" + } + ], + "uncleHeaders" : [ + { + "sameAsBlock" : "1" + } + ] + } + ] + }, + + "InChainUncleGreatGreatGreatGrandPa" : { + "genesisBlockHeader" : { + "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1", + "difficulty" : "131072", + "extraData" : "0x42", + "gasLimit" : "3141592", + "gasUsed" : "0", + "number" : "0", + "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000", + "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "stateRoot" : "0xf99eb1626cfa6db435c0836235942d7ccaa935f1ae247d3f1c21e495685f903a", + "timestamp" : "0x54c98c81", + "mixHash" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "nonce" : "0x0102030405060708", + "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + }, + "expect" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "20" + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "nonce" : "2" + } + }, + "pre" : { + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "10000000000000", + "nonce" : "0", + "code" : "", + "storage": {} + } + }, + "blocks" : [ + { + "transactions" : [ + { + "data" : "", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "1", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "2", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "3", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "4", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "5", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "10" + } + ], + "uncleHeaders" : [ + { + "sameAsBlock" : "1" + } + ] + } + ] + }, + + "InChainUncleGreatGreatGreatGreatGrandPa" : { + "genesisBlockHeader" : { + "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1", + "difficulty" : "131072", + "extraData" : "0x42", + "gasLimit" : "3141592", + "gasUsed" : "0", + "number" : "0", + "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000", + "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "stateRoot" : "0xf99eb1626cfa6db435c0836235942d7ccaa935f1ae247d3f1c21e495685f903a", + "timestamp" : "0x54c98c81", + "mixHash" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "nonce" : "0x0102030405060708", + "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + }, + "expect" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "20" + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "nonce" : "2" + } + }, + "pre" : { + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "10000000000000", + "nonce" : "0", + "code" : "", + "storage": {} + } + }, + "blocks" : [ + { + "transactions" : [ + { + "data" : "", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "1", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "2", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "3", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "4", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "5", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "6", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "10" + } + ], + "uncleHeaders" : [ + { + "sameAsBlock" : "1" + } + ] + } + ] + }, + "twoEqualUncle" : { "genesisBlockHeader" : { "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", From 3802e4110e2a707c98f81868acab6024568964f7 Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Thu, 14 May 2015 16:20:42 +0200 Subject: [PATCH 194/461] correct expext value for in chain uncle tests --- .../BlockTestsFiller/bcUncleTestFiller.json | 54 +++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/test/libethereum/BlockTestsFiller/bcUncleTestFiller.json b/test/libethereum/BlockTestsFiller/bcUncleTestFiller.json index f700dc7ad..aeb372f67 100644 --- a/test/libethereum/BlockTestsFiller/bcUncleTestFiller.json +++ b/test/libethereum/BlockTestsFiller/bcUncleTestFiller.json @@ -103,7 +103,7 @@ "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" }, - "expect" : { + "expect" : { "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { "balance" : "30" }, @@ -204,7 +204,7 @@ "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" }, - "expect" : { + "expect" : { "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { "balance" : "30" }, @@ -305,7 +305,7 @@ "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" }, - "expect" : { + "expect" : { "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { "balance" : "20" }, @@ -406,7 +406,7 @@ "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" }, - "expect" : { + "expect" : { "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { "balance" : "20" }, @@ -511,7 +511,7 @@ "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" }, - "expect" : { + "expect" : { "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { "balance" : "20" }, @@ -597,7 +597,7 @@ "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" }, - "expect" : { + "expect" : { "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { "balance" : "20" }, @@ -684,12 +684,12 @@ "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" }, - "expect" : { + "expect" : { "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { - "balance" : "20" + "balance" : "30" }, "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { - "nonce" : "2" + "nonce" : "3" } }, "pre" : { @@ -785,12 +785,12 @@ "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" }, - "expect" : { + "expect" : { "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { - "balance" : "20" + "balance" : "40" }, "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { - "nonce" : "2" + "nonce" : "4" } }, "pre" : { @@ -901,12 +901,12 @@ "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" }, - "expect" : { + "expect" : { "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { - "balance" : "20" + "balance" : "50" }, "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { - "nonce" : "2" + "nonce" : "5" } }, "pre" : { @@ -1032,12 +1032,12 @@ "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" }, - "expect" : { + "expect" : { "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { - "balance" : "20" + "balance" : "60" }, "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { - "nonce" : "2" + "nonce" : "6" } }, "pre" : { @@ -1178,7 +1178,7 @@ "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" }, - "expect" : { + "expect" : { "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { "balance" : "20" }, @@ -1282,7 +1282,7 @@ "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" }, - "expect" : { + "expect" : { "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { "balance" : "30" }, @@ -1407,7 +1407,7 @@ "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" }, - "expect" : { + "expect" : { "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { "balance" : "20" }, @@ -1544,7 +1544,7 @@ "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" }, - "expect" : { + "expect" : { "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { "balance" : "40" }, @@ -1663,7 +1663,7 @@ "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" }, - "expect" : { + "expect" : { "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { "balance" : "50" }, @@ -1797,7 +1797,7 @@ "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" }, - "expect" : { + "expect" : { "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { "balance" : "60" }, @@ -1946,7 +1946,7 @@ "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" }, - "expect" : { + "expect" : { "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { "balance" : "70" }, @@ -2110,7 +2110,7 @@ "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" }, - "expect" : { + "expect" : { "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { "balance" : "80" }, @@ -2289,7 +2289,7 @@ "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" }, - "expect" : { + "expect" : { "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { "balance" : "80" }, From 4409bc5d7d437f5354218dc3e2061027eadffccd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Thu, 14 May 2015 16:39:40 +0200 Subject: [PATCH 195/461] Tests: SMOD edge case test. --- .../VMTestsFiller/vmArithmeticTestFiller.json | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/test/libevm/VMTestsFiller/vmArithmeticTestFiller.json b/test/libevm/VMTestsFiller/vmArithmeticTestFiller.json index 76771982e..72c90e912 100644 --- a/test/libevm/VMTestsFiller/vmArithmeticTestFiller.json +++ b/test/libevm/VMTestsFiller/vmArithmeticTestFiller.json @@ -2031,6 +2031,76 @@ } }, + "smod_i256min1": { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "1000000", + "currentDifficulty" : "256", + "currentTimestamp" : "1", + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "expect" : { + "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "storage" : { + "0x" : "0x8000000000000000000000000000000000000000000000000000000000000000" + } + } + }, + "pre" : { + "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "1000000000000000000", + "nonce" : "0", + "code" : "{ [[ 0 ]] (SMOD (- 0 57896044618658097711785492504343953926634992332820282019728792003956564819968) (- 0 1) ) }", + "storage": {} + } + }, + "exec" : { + "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681", + "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681", + "value" : "1000000000000000000", + "data" : "", + "gasPrice" : "100000000000000", + "gas" : "100000" + } + }, + + "smod_i256min2": { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "1000000", + "currentDifficulty" : "256", + "currentTimestamp" : "1", + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "expect" : { + "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "storage" : { + "0x" : "0x8000000000000000000000000000000000000000000000000000000000000000" + } + } + }, + "pre" : { + "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "1000000000000000000", + "nonce" : "0", + "code" : "{ [[ 0 ]] (- (SMOD (- 0 57896044618658097711785492504343953926634992332820282019728792003956564819968) (- 0 1) ) 1) }", + "storage": {} + } + }, + "exec" : { + "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "origin" : "cd1722f2947def4cf144679da39c4c32bdc35681", + "caller" : "cd1722f2947def4cf144679da39c4c32bdc35681", + "value" : "1000000000000000000", + "data" : "", + "gasPrice" : "100000000000000", + "gas" : "100000" + } + }, + "addmod0": { "env" : { "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", From 9cd64dcfe570975acfe5e49d7dec71b95a225b98 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Thu, 14 May 2015 17:14:21 +0200 Subject: [PATCH 196/461] Probably fix for BadRoot bug. --- libethereum/State.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/libethereum/State.cpp b/libethereum/State.cpp index ccc6c4512..f5739aadb 100644 --- a/libethereum/State.cpp +++ b/libethereum/State.cpp @@ -62,6 +62,7 @@ OverlayDB State::openDB(std::string _path, WithExisting _we) boost::filesystem::remove_all(_path + "/state"); ldb::Options o; + o.max_open_files = 256; o.create_if_missing = true; ldb::DB* db = nullptr; ldb::DB::Open(o, _path + "/state", &db); From 802024ba0e5ad2693c901301f3db2cf9a708addc Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Thu, 14 May 2015 17:14:40 +0200 Subject: [PATCH 197/461] Bump. --- libdevcore/Common.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libdevcore/Common.cpp b/libdevcore/Common.cpp index 28b537be5..1ffa66f14 100644 --- a/libdevcore/Common.cpp +++ b/libdevcore/Common.cpp @@ -28,7 +28,7 @@ using namespace dev; namespace dev { -char const* Version = "0.9.20"; +char const* Version = "0.9.21"; const u256 UndefinedU256 = ~(u256)0; From eb8dc43e8a9c83313bbd9a8e898437ce12a5cef6 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Thu, 14 May 2015 17:52:53 +0200 Subject: [PATCH 198/461] Make terms more clear for uncle exclusion API. --- libethereum/BlockChain.cpp | 4 ++-- libethereum/BlockChain.h | 6 +++--- libethereum/State.cpp | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/libethereum/BlockChain.cpp b/libethereum/BlockChain.cpp index 7c03bc24f..68eccddf5 100644 --- a/libethereum/BlockChain.cpp +++ b/libethereum/BlockChain.cpp @@ -981,13 +981,13 @@ vector BlockChain::withBlockBloom(LogBloom const& _b, unsigned _earlie return ret; } -h256Hash BlockChain::allUnclesFrom(h256 const& _parent) const +h256Hash BlockChain::allKinFrom(h256 const& _parent, unsigned _generations) const { // Get all uncles cited given a parent (i.e. featured as uncles/main in parent, parent + 1, ... parent + 5). h256 p = _parent; h256Hash ret = { p }; // p and (details(p).parent: i == 5) is likely to be overkill, but can't hurt to be cautious. - for (unsigned i = 0; i < 6 && p != m_genesisHash; ++i, p = details(p).parent) + for (unsigned i = 0; i < _generations && p != m_genesisHash; ++i, p = details(p).parent) { ret.insert(details(p).parent); auto b = block(p); diff --git a/libethereum/BlockChain.h b/libethereum/BlockChain.h index e77369534..02f3f618a 100644 --- a/libethereum/BlockChain.h +++ b/libethereum/BlockChain.h @@ -203,10 +203,10 @@ public: /// Get the hash of the genesis block. Thread-safe. h256 genesisHash() const { return m_genesisHash; } - /// Get all blocks not allowed as uncles given a parent (i.e. featured as uncles/main in parent, parent + 1, ... parent + 5). - /// @returns set including the header-hash of every parent (including @a _parent) up to and including generation +5 + /// Get all blocks not allowed as uncles given a parent (i.e. featured as uncles/main in parent, parent + 1, ... parent + @a _generations). + /// @returns set including the header-hash of every parent (including @a _parent) up to and including generation + @a _generations /// togther with all their quoted uncles. - h256Hash allUnclesFrom(h256 const& _parent) const; + h256Hash allKinFrom(h256 const& _parent, unsigned _generations) const; /// Run through database and verify all blocks by reevaluating. /// Will call _progress with the progress in this operation first param done, second total. diff --git a/libethereum/State.cpp b/libethereum/State.cpp index f5739aadb..67fa5395b 100644 --- a/libethereum/State.cpp +++ b/libethereum/State.cpp @@ -652,7 +652,7 @@ u256 State::enact(bytesConstRef _block, BlockChain const& _bc, ImportRequirement BOOST_THROW_EXCEPTION(TooManyUncles()); vector rewarded; - h256Hash excluded = _bc.allUnclesFrom(m_currentBlock.parentHash); + h256Hash excluded = _bc.allKinFrom(m_currentBlock.parentHash, 6); excluded.insert(m_currentBlock.hash()); for (auto const& i: rlp[2]) @@ -816,7 +816,7 @@ void State::commitToMine(BlockChain const& _bc) { // Find great-uncles (or second-cousins or whatever they are) - children of great-grandparents, great-great-grandparents... that were not already uncles in previous generations. // cout << "Checking " << m_previousBlock.hash << ", parent=" << m_previousBlock.parentHash << endl; - h256Hash knownUncles = _bc.allUnclesFrom(m_currentBlock.parentHash); + h256Hash knownUncles = _bc.allKinFrom(m_currentBlock.parentHash); auto p = m_previousBlock.parentHash; for (unsigned gen = 0; gen < 6 && p != _bc.genesisHash() && unclesCount < 2; ++gen, p = _bc.details(p).parent) { From b50d44b8ac8229bbebe58e7d21b84c720e961d6a Mon Sep 17 00:00:00 2001 From: arkpar Date: Thu, 14 May 2015 19:48:01 +0200 Subject: [PATCH 199/461] Trie optimizations --- libdevcrypto/OverlayDB.cpp | 2 +- libdevcrypto/TrieDB.h | 93 ++++++++++++++++++++++++-------------- libethcore/Common.cpp | 3 +- test/libdevcrypto/trie.cpp | 61 +++++++++++++++++++++++-- 4 files changed, 119 insertions(+), 40 deletions(-) diff --git a/libdevcrypto/OverlayDB.cpp b/libdevcrypto/OverlayDB.cpp index bde6a3644..80c901635 100644 --- a/libdevcrypto/OverlayDB.cpp +++ b/libdevcrypto/OverlayDB.cpp @@ -94,7 +94,7 @@ void OverlayDB::commit() bytes OverlayDB::lookupAux(h256 const& _h) const { bytes ret = MemoryDB::lookupAux(_h); - if (!ret.empty()) + if (!ret.empty() || !m_db) return move(ret); std::string v; bytes b = _h.asBytes(); diff --git a/libdevcrypto/TrieDB.h b/libdevcrypto/TrieDB.h index 29b412bab..cf85148d2 100644 --- a/libdevcrypto/TrieDB.h +++ b/libdevcrypto/TrieDB.h @@ -220,6 +220,7 @@ public: bool operator!=(Node const& _c) const { return !operator==(_c); } }; + protected: std::vector m_trail; GenericTrieDB const* m_that; }; @@ -239,6 +240,7 @@ private: void mergeAtAux(RLPStream& _out, RLP const& _replace, NibbleSlice _key, bytesConstRef _value); bytes mergeAt(RLP const& _replace, NibbleSlice _k, bytesConstRef _v, bool _inLine = false); + bytes mergeAt(RLP const& _replace, h256 const& _replaceHash, NibbleSlice _k, bytesConstRef _v, bool _inLine = false); bool deleteAtAux(RLPStream& _out, RLP const& _replace, NibbleSlice _key); bytes deleteAt(RLP const& _replace, NibbleSlice _k); @@ -295,6 +297,7 @@ private: // for the special case of the root (which is always looked up via a hash). In that case, // use forceKillNode(). void killNode(RLP const& _d) { if (_d.data().size() >= 32) forceKillNode(sha3(_d.data())); } + void killNode(RLP const& _d, h256 const& _h) { if (_d.data().size() >= 32) forceKillNode(_h); } h256 m_root; DB* m_db = nullptr; @@ -409,46 +412,59 @@ public: iterator lower_bound(bytesConstRef) const { return iterator(); } }; -// Hashed & Basic -template -class FatGenericTrieDB: public GenericTrieDB +// Hashed & Hash-key mapping +template +class FatGenericTrieDB: private SpecificTrieDB, h256> { - using Super = GenericTrieDB; + using Super = SpecificTrieDB, h256>; public: - FatGenericTrieDB(DB* _db): Super(_db), m_secure(_db) {} - FatGenericTrieDB(DB* _db, h256 _root, Verification _v = Verification::Normal) { open(_db, _root, _v); } - - void open(DB* _db, h256 _root, Verification _v = Verification::Normal) { Super::open(_db); m_secure.open(_db); setRoot(_root, _v); } + using DB = _DB; + FatGenericTrieDB(DB* _db = nullptr): Super(_db) {} + FatGenericTrieDB(DB* _db, h256 _root, Verification _v = Verification::Normal): Super(_db, _root, _v) {} - void init() { Super::init(); m_secure.init(); syncRoot(); } + using Super::init; + using Super::isNull; + using Super::isEmpty; + using Super::root; + using Super::leftOvers; + using Super::check; + using Super::open; + using Super::setRoot; - void setRoot(h256 _root, Verification _v = Verification::Normal) + std::string at(bytesConstRef _key) const { return Super::at(sha3(_key)); } + bool contains(bytesConstRef _key) { return Super::contains(sha3(_key)); } + void insert(bytesConstRef _key, bytesConstRef _value) { - if (!m_secure.isNull()) - Super::db()->removeAux(m_secure.root()); - m_secure.setRoot(_root, _v); - auto rb = Super::db()->lookupAux(m_secure.root()); - auto r = h256(rb); - Super::setRoot(r, _v); + h256 hash = sha3(_key); + Super::insert(hash, _value); + Super::db()->insertAux(hash, _key); } - h256 root() const { return m_secure.root(); } - - void insert(bytesConstRef _key, bytesConstRef _value) { Super::insert(_key, _value); m_secure.insert(_key, _value); syncRoot(); } - void remove(bytesConstRef _key) { Super::remove(_key); m_secure.remove(_key); syncRoot(); } + void remove(bytesConstRef _key) { Super::remove(sha3(_key)); } - h256Hash leftOvers(std::ostream* = nullptr) const { return h256Hash{}; } - bool check(bool) const { return m_secure.check(false) && Super::check(false); } + //friend class iterator; -private: - void syncRoot() + class iterator : public GenericTrieDB<_DB>::iterator { - // Root changed. Need to record the mapping so we can determine on setRoot. - Super::db()->insertAux(m_secure.root(), Super::root().ref()); - } + public: + using Super = typename GenericTrieDB<_DB>::iterator; - HashedGenericTrieDB m_secure; + iterator() { } + iterator(FatGenericTrieDB const* _trie): Super(_trie) { } + + typename Super::value_type at() const + { + auto hashed = Super::at(); + m_key = static_cast(Super::m_that)->db()->lookupAux(h256(hashed.first)); + return std::make_pair(&m_key, std::move(hashed.second)); + } + + private: + mutable bytes m_key; + }; + iterator begin() const { return iterator(); } + iterator end() const { return iterator(); } }; template using TrieDB = SpecificTrieDB, KeyType>; @@ -745,7 +761,7 @@ template void GenericTrieDB::insert(bytesConstRef _key, bytesCons std::string rv = node(m_root); assert(rv.size()); - bytes b = mergeAt(RLP(rv), NibbleSlice(_key), _value); + bytes b = mergeAt(RLP(rv), m_root, NibbleSlice(_key), _value); // mergeAt won't attempt to delete the node if it's less than 32 bytes // However, we know it's the root node and thus always hashed. @@ -765,8 +781,9 @@ template std::string GenericTrieDB::atAux(RLP const& _here, Nibbl if (_here.isEmpty() || _here.isNull()) // not found. return std::string(); - assert(_here.isList() && (_here.itemCount() == 2 || _here.itemCount() == 17)); - if (_here.itemCount() == 2) + unsigned itemCount = _here.itemCount(); + assert(_here.isList() && (itemCount == 2 || itemCount == 17)); + if (itemCount == 2) { auto k = keyOf(_here); if (_key == k && isLeaf(_here)) @@ -792,6 +809,11 @@ template std::string GenericTrieDB::atAux(RLP const& _here, Nibbl } template bytes GenericTrieDB::mergeAt(RLP const& _orig, NibbleSlice _k, bytesConstRef _v, bool _inLine) +{ + return mergeAt(_orig, sha3(_orig.data()), _k, _v, _inLine); +} + +template bytes GenericTrieDB::mergeAt(RLP const& _orig, h256 const& _origHash, NibbleSlice _k, bytesConstRef _v, bool _inLine) { #if ETH_PARANOIA tdebug << "mergeAt " << _orig << _k << sha3(_orig.data()); @@ -805,8 +827,9 @@ template bytes GenericTrieDB::mergeAt(RLP const& _orig, NibbleSli if (_orig.isEmpty()) return place(_orig, _k, _v); - assert(_orig.isList() && (_orig.itemCount() == 2 || _orig.itemCount() == 17)); - if (_orig.itemCount() == 2) + unsigned itemCount = _orig.itemCount(); + assert(_orig.isList() && (itemCount == 2 || itemCount == 17)); + if (itemCount == 2) { // pair... NibbleSlice k = keyOf(_orig); @@ -819,7 +842,7 @@ template bytes GenericTrieDB::mergeAt(RLP const& _orig, NibbleSli if (_k.contains(k) && !isLeaf(_orig)) { if (!_inLine) - killNode(_orig); + killNode(_orig, _origHash); RLPStream s(2); s.append(_orig[0]); mergeAtAux(s, _orig[1], _k.mid(k.size()), _v); @@ -851,7 +874,7 @@ template bytes GenericTrieDB::mergeAt(RLP const& _orig, NibbleSli // Kill the node. if (!_inLine) - killNode(_orig); + killNode(_orig, _origHash); // not exactly our node - delve to next level at the correct index. byte n = _k[0]; diff --git a/libethcore/Common.cpp b/libethcore/Common.cpp index 2c7601dbc..0b36ca5fa 100644 --- a/libethcore/Common.cpp +++ b/libethcore/Common.cpp @@ -37,10 +37,11 @@ namespace eth const unsigned c_protocolVersion = 60; const unsigned c_minorProtocolVersion = 2; -const unsigned c_databaseBaseVersion = 9; #if ETH_FATDB +const unsigned c_databaseBaseVersion = 10; const unsigned c_databaseVersionModifier = 1; #else +const unsigned c_databaseBaseVersion = 9; const unsigned c_databaseVersionModifier = 0; #endif diff --git a/test/libdevcrypto/trie.cpp b/test/libdevcrypto/trie.cpp index d41739a01..da90b7403 100644 --- a/test/libdevcrypto/trie.cpp +++ b/test/libdevcrypto/trie.cpp @@ -124,7 +124,9 @@ BOOST_AUTO_TEST_CASE(hex_encoded_securetrie_test) BOOST_REQUIRE(t.check(true)); BOOST_REQUIRE(ht.check(true)); BOOST_REQUIRE(ft.check(true)); - for (auto i = ft.begin(), j = t.begin(); i != ft.end() && j != t.end(); ++i, ++j) + auto i = ft.begin(); + auto j = t.begin(); + for (; i != ft.end() && j != t.end(); ++i, ++j) { BOOST_CHECK_EQUAL(i == ft.end(), j == t.end()); BOOST_REQUIRE((*i).first.toBytes() == (*j).first.toBytes()); @@ -189,7 +191,9 @@ BOOST_AUTO_TEST_CASE(trie_test_anyorder) BOOST_REQUIRE(t.check(true)); BOOST_REQUIRE(ht.check(true)); BOOST_REQUIRE(ft.check(true)); - for (auto i = ft.begin(), j = t.begin(); i != ft.end() && j != t.end(); ++i, ++j) + auto i = ft.begin(); + auto j = t.begin(); + for (; i != ft.end() && j != t.end(); ++i, ++j) { BOOST_CHECK_EQUAL(i == ft.end(), j == t.end()); BOOST_REQUIRE((*i).first.toBytes() == (*j).first.toBytes()); @@ -274,7 +278,9 @@ BOOST_AUTO_TEST_CASE(trie_tests_ordered) BOOST_REQUIRE(t.check(true)); BOOST_REQUIRE(ht.check(true)); BOOST_REQUIRE(ft.check(true)); - for (auto i = ft.begin(), j = t.begin(); i != ft.end() && j != t.end(); ++i, ++j) + auto i = ft.begin(); + auto j = t.begin(); + for (; i != ft.end() && j != t.end(); ++i, ++j) { BOOST_CHECK_EQUAL(i == ft.end(), j == t.end()); BOOST_REQUIRE((*i).first.toBytes() == (*j).first.toBytes()); @@ -558,6 +564,55 @@ BOOST_AUTO_TEST_CASE(trieStess) } } +template void perfTestTrie(char const* _name) +{ + for (size_t p = 1000; p != 1000000; p*=10) + { + MemoryDB dm; + Trie d(&dm); + d.init(); + cnote << "TriePerf " << _name << p; + std::vector keys(1000); + boost::timer t; + size_t ki = 0; + for (size_t i = 0; i < p; ++i) + { + auto k = h256::random(); + auto v = toString(i); + d.insert(k, v); + + if (i % (p / 1000) == 0) + keys[ki++] = k; + } + cnote << "Insert " << p << "values: " << t.elapsed(); + t.restart(); + for (auto k: keys) + d.at(k); + cnote << "Query 1000 values: " << t.elapsed(); + t.restart(); + size_t i = 0; + for (auto it = d.begin(); i < 1000 && it != d.end(); ++it, ++i) + *it; + cnote << "Iterate 1000 values: " << t.elapsed(); + t.restart(); + for (auto k: keys) + d.remove(k); + cnote << "Remove 1000 values:" << t.elapsed() << "\n"; + } +} + + +BOOST_AUTO_TEST_CASE(triePerf) +{ + if (test::Options::get().performance) + { + perfTestTrie, h256>>("GenericTrieDB"); + perfTestTrie, h256>>("HashedGenericTrieDB"); + perfTestTrie, h256>>("FatGenericTrieDB"); + } +} + + BOOST_AUTO_TEST_SUITE_END() From a4efee3f05b0651c25dc56baffaa83e1623b58d1 Mon Sep 17 00:00:00 2001 From: arkpar Date: Thu, 14 May 2015 19:50:30 +0200 Subject: [PATCH 200/461] style --- test/libdevcrypto/trie.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/libdevcrypto/trie.cpp b/test/libdevcrypto/trie.cpp index da90b7403..810876d5f 100644 --- a/test/libdevcrypto/trie.cpp +++ b/test/libdevcrypto/trie.cpp @@ -601,7 +601,6 @@ template void perfTestTrie(char const* _name) } } - BOOST_AUTO_TEST_CASE(triePerf) { if (test::Options::get().performance) @@ -612,7 +611,6 @@ BOOST_AUTO_TEST_CASE(triePerf) } } - BOOST_AUTO_TEST_SUITE_END() From 19f3a5802194f8a891ef1aa44f03a7b1573881ef Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Thu, 14 May 2015 20:08:28 +0200 Subject: [PATCH 201/461] Reduce p2p net verbosity. --- libethash-cl/ethash_cl_miner.cpp | 5 +++++ libethash-cl/ethash_cl_miner.h | 1 + libethereum/State.cpp | 4 ++-- libp2p/Common.cpp | 6 ++++++ libp2p/Common.h | 7 +++++-- libp2p/Host.cpp | 12 ++++++------ libp2p/RLPxHandshake.cpp | 28 ++++++++++++++-------------- 7 files changed, 39 insertions(+), 24 deletions(-) diff --git a/libethash-cl/ethash_cl_miner.cpp b/libethash-cl/ethash_cl_miner.cpp index 79efbcb97..3891f2ef6 100644 --- a/libethash-cl/ethash_cl_miner.cpp +++ b/libethash-cl/ethash_cl_miner.cpp @@ -61,6 +61,11 @@ ethash_cl_miner::ethash_cl_miner() { } +ethash_cl_miner::~ethash_cl_miner() +{ + finish(); +} + std::string ethash_cl_miner::platform_info(unsigned _platformId, unsigned _deviceId) { std::vector platforms; diff --git a/libethash-cl/ethash_cl_miner.h b/libethash-cl/ethash_cl_miner.h index 2fb192c3f..43bfa2336 100644 --- a/libethash-cl/ethash_cl_miner.h +++ b/libethash-cl/ethash_cl_miner.h @@ -30,6 +30,7 @@ public: public: ethash_cl_miner(); + ~ethash_cl_miner(); static unsigned get_num_platforms(); static unsigned get_num_devices(unsigned _platformId = 0); diff --git a/libethereum/State.cpp b/libethereum/State.cpp index 67fa5395b..8438d3847 100644 --- a/libethereum/State.cpp +++ b/libethereum/State.cpp @@ -816,14 +816,14 @@ void State::commitToMine(BlockChain const& _bc) { // Find great-uncles (or second-cousins or whatever they are) - children of great-grandparents, great-great-grandparents... that were not already uncles in previous generations. // cout << "Checking " << m_previousBlock.hash << ", parent=" << m_previousBlock.parentHash << endl; - h256Hash knownUncles = _bc.allKinFrom(m_currentBlock.parentHash); + h256Hash excluded = _bc.allKinFrom(m_currentBlock.parentHash, 6); auto p = m_previousBlock.parentHash; for (unsigned gen = 0; gen < 6 && p != _bc.genesisHash() && unclesCount < 2; ++gen, p = _bc.details(p).parent) { auto us = _bc.details(p).children; assert(us.size() >= 1); // must be at least 1 child of our grandparent - it's our own parent! for (auto const& u: us) - if (!knownUncles.count(u)) // ignore any uncles/mainline blocks that we know about. + if (!excluded.count(u)) // ignore any uncles/mainline blocks that we know about. { BlockInfo ubi(_bc.block(u)); ubi.streamRLP(unclesData, WithNonce); diff --git a/libp2p/Common.cpp b/libp2p/Common.cpp index ed84f014c..ad04ca4ba 100644 --- a/libp2p/Common.cpp +++ b/libp2p/Common.cpp @@ -47,6 +47,9 @@ const char* NetTriviaDetail::name() { return EthYellow "N" EthCoal " 0"; } const char* NetAllDetail::name() { return EthYellow "N" EthCoal " A"; } const char* NetRight::name() { return EthYellow "N" EthGreen "->"; } const char* NetLeft::name() { return EthYellow "N" EthNavy "<-"; } +const char* NetP2PWarn::name() { return EthYellow "N" EthRed " X"; } +const char* NetP2PNote::name() { return EthYellow "N" EthBlue " i"; } +const char* NetP2PConnect::name() { return EthYellow "N" EthYellow " C"; } #else const char* NetWarn::name() { return EthYellow "⧎" EthRed " ✘"; } const char* NetImpolite::name() { return EthYellow "⧎" EthRed " !"; } @@ -59,6 +62,9 @@ const char* NetTriviaDetail::name() { return EthYellow "⧎" EthCoal " ◍"; } const char* NetAllDetail::name() { return EthYellow "⧎" EthCoal " ●"; } const char* NetRight::name() { return EthYellow "⧎" EthGreen "▬▶"; } const char* NetLeft::name() { return EthYellow "⧎" EthNavy "◀▬"; } +const char* NetP2PWarn::name() { return EthYellow "⧎" EthRed " ✘"; } +const char* NetP2PNote::name() { return EthYellow "⧎" EthBlue " ℹ"; } +const char* NetP2PConnect::name() { return EthYellow "⧎" EthYellow " ▢"; } #endif bool p2p::isPublicAddress(std::string const& _addressToCheck) diff --git a/libp2p/Common.h b/libp2p/Common.h index 3029bf18a..8fd330580 100644 --- a/libp2p/Common.h +++ b/libp2p/Common.h @@ -78,8 +78,8 @@ struct InvalidHostIPAddress: virtual dev::Exception {}; struct NetWarn: public LogChannel { static const char* name(); static const int verbosity = 0; }; struct NetNote: public LogChannel { static const char* name(); static const int verbosity = 1; }; -struct NetImpolite: public LogChannel { static const char* name(); static const int verbosity = 1; }; -struct NetMessageSummary: public LogChannel { static const char* name(); static const int verbosity = 2; }; +struct NetImpolite: public LogChannel { static const char* name(); static const int verbosity = 2; }; +struct NetMessageSummary: public LogChannel { static const char* name(); static const int verbosity = 3; }; struct NetConnect: public LogChannel { static const char* name(); static const int verbosity = 10; }; struct NetMessageDetail: public LogChannel { static const char* name(); static const int verbosity = 5; }; struct NetTriviaSummary: public LogChannel { static const char* name(); static const int verbosity = 10; }; @@ -87,6 +87,9 @@ struct NetTriviaDetail: public LogChannel { static const char* name(); static co struct NetAllDetail: public LogChannel { static const char* name(); static const int verbosity = 13; }; struct NetRight: public LogChannel { static const char* name(); static const int verbosity = 14; }; struct NetLeft: public LogChannel { static const char* name(); static const int verbosity = 15; }; +struct NetP2PWarn: public LogChannel { static const char* name(); static const int verbosity = 2; }; +struct NetP2PNote: public LogChannel { static const char* name(); static const int verbosity = 6; }; +struct NetP2PConnect: public LogChannel { static const char* name(); static const int verbosity = 10; }; enum PacketType { diff --git a/libp2p/Host.cpp b/libp2p/Host.cpp index 9b5a6dca7..2f139fd3d 100644 --- a/libp2p/Host.cpp +++ b/libp2p/Host.cpp @@ -244,7 +244,7 @@ void Host::startPeerSession(Public const& _id, RLP const& _rlp, RLPXFrameIO* _io m_sessions[_id] = ps; } - clog(NetNote) << "p2p.host.peer.register" << _id; + clog(NetP2PNote) << "p2p.host.peer.register" << _id; StructuredLogger::p2pConnected(_id.abridged(), ps->m_peer->endpoint, ps->m_peer->m_lastConnected, clientVersion, peerCount()); } @@ -252,7 +252,7 @@ void Host::onNodeTableEvent(NodeId const& _n, NodeTableEventType const& _e) { if (_e == NodeEntryAdded) { - clog(NetNote) << "p2p.host.nodeTable.events.nodeEntryAdded " << _n; + clog(NetP2PNote) << "p2p.host.nodeTable.events.nodeEntryAdded " << _n; // only add iff node is in node table if (Node n = m_nodeTable->node(_n)) { @@ -268,7 +268,7 @@ void Host::onNodeTableEvent(NodeId const& _n, NodeTableEventType const& _e) { p.reset(new Peer(n)); m_peers[_n] = p; - clog(NetNote) << "p2p.host.peers.events.peerAdded " << _n << p->endpoint; + clog(NetP2PNote) << "p2p.host.peers.events.peerAdded " << _n << p->endpoint; } } if (peerSlotsAvailable(Egress)) @@ -277,7 +277,7 @@ void Host::onNodeTableEvent(NodeId const& _n, NodeTableEventType const& _e) } else if (_e == NodeEntryDropped) { - clog(NetNote) << "p2p.host.nodeTable.events.NodeEntryDropped " << _n; + clog(NetP2PNote) << "p2p.host.nodeTable.events.NodeEntryDropped " << _n; RecursiveGuard l(x_sessions); m_peers.erase(_n); } @@ -647,14 +647,14 @@ void Host::startedWorking() runAcceptor(); } else - clog(NetNote) << "p2p.start.notice id:" << id() << "TCP Listen port is invalid or unavailable."; + clog(NetP2PNote) << "p2p.start.notice id:" << id() << "TCP Listen port is invalid or unavailable."; shared_ptr nodeTable(new NodeTable(m_ioService, m_alias, NodeIPEndpoint(bi::address::from_string(listenAddress()), listenPort(), listenPort()))); nodeTable->setEventHandler(new HostNodeTableHandler(*this)); m_nodeTable = nodeTable; restoreNetwork(&m_restoreNetwork); - clog(NetNote) << "p2p.started id:" << id(); + clog(NetP2PNote) << "p2p.started id:" << id(); run(boost::system::error_code()); } diff --git a/libp2p/RLPxHandshake.cpp b/libp2p/RLPxHandshake.cpp index 8566b4f50..65116cd58 100644 --- a/libp2p/RLPxHandshake.cpp +++ b/libp2p/RLPxHandshake.cpp @@ -30,7 +30,7 @@ using namespace CryptoPP; void RLPXHandshake::writeAuth() { - clog(NetConnect) << "p2p.connect.egress sending auth to " << m_socket->remoteEndpoint(); + clog(NetP2PConnect) << "p2p.connect.egress sending auth to " << m_socket->remoteEndpoint(); m_auth.resize(Signature::size + h256::size + Public::size + h256::size + 1); bytesRef sig(&m_auth[0], Signature::size); bytesRef hepubk(&m_auth[Signature::size], h256::size); @@ -56,7 +56,7 @@ void RLPXHandshake::writeAuth() void RLPXHandshake::writeAck() { - clog(NetConnect) << "p2p.connect.ingress sending ack to " << m_socket->remoteEndpoint(); + clog(NetP2PConnect) << "p2p.connect.ingress sending ack to " << m_socket->remoteEndpoint(); m_ack.resize(Public::size + h256::size + 1); bytesRef epubk(&m_ack[0], Public::size); bytesRef nonce(&m_ack[Public::size], h256::size); @@ -74,7 +74,7 @@ void RLPXHandshake::writeAck() void RLPXHandshake::readAuth() { - clog(NetConnect) << "p2p.connect.ingress recving auth from " << m_socket->remoteEndpoint(); + clog(NetP2PConnect) << "p2p.connect.ingress recving auth from " << m_socket->remoteEndpoint(); m_authCipher.resize(307); auto self(shared_from_this()); ba::async_read(m_socket->ref(), ba::buffer(m_authCipher, 307), [this, self](boost::system::error_code ec, std::size_t) @@ -95,13 +95,13 @@ void RLPXHandshake::readAuth() m_remoteEphemeral = recover(*(Signature*)sig.data(), sharedSecret ^ m_remoteNonce); if (sha3(m_remoteEphemeral) != *(h256*)hepubk.data()) - clog(NetConnect) << "p2p.connect.ingress auth failed (invalid: hash mismatch) for" << m_socket->remoteEndpoint(); + clog(NetP2PConnect) << "p2p.connect.ingress auth failed (invalid: hash mismatch) for" << m_socket->remoteEndpoint(); transition(); } else { - clog(NetConnect) << "p2p.connect.ingress recving auth decrypt failed for" << m_socket->remoteEndpoint(); + clog(NetP2PConnect) << "p2p.connect.ingress recving auth decrypt failed for" << m_socket->remoteEndpoint(); m_nextState = Error; transition(); } @@ -110,7 +110,7 @@ void RLPXHandshake::readAuth() void RLPXHandshake::readAck() { - clog(NetConnect) << "p2p.connect.egress recving ack from " << m_socket->remoteEndpoint(); + clog(NetP2PConnect) << "p2p.connect.egress recving ack from " << m_socket->remoteEndpoint(); m_ackCipher.resize(210); auto self(shared_from_this()); ba::async_read(m_socket->ref(), ba::buffer(m_ackCipher, 210), [this, self](boost::system::error_code ec, std::size_t) @@ -125,7 +125,7 @@ void RLPXHandshake::readAck() } else { - clog(NetConnect) << "p2p.connect.egress recving ack decrypt failed for " << m_socket->remoteEndpoint(); + clog(NetP2PConnect) << "p2p.connect.egress recving ack decrypt failed for " << m_socket->remoteEndpoint(); m_nextState = Error; transition(); } @@ -138,9 +138,9 @@ void RLPXHandshake::error() auto connected = m_socket->isConnected(); if (connected && !m_socket->remoteEndpoint().address().is_unspecified()) - clog(NetConnect) << "Disconnecting " << m_socket->remoteEndpoint() << " (Handshake Failed)"; + clog(NetP2PConnect) << "Disconnecting " << m_socket->remoteEndpoint() << " (Handshake Failed)"; else - clog(NetConnect) << "Handshake Failed (Connection reset by peer)"; + clog(NetP2PConnect) << "Handshake Failed (Connection reset by peer)"; m_socket->close(); if (m_io != nullptr) @@ -151,7 +151,7 @@ void RLPXHandshake::transition(boost::system::error_code _ech) { if (_ech || m_nextState == Error || m_cancel) { - clog(NetConnect) << "Handshake Failed (I/O Error:" << _ech.message() << ")"; + clog(NetP2PConnect) << "Handshake Failed (I/O Error:" << _ech.message() << ")"; return error(); } @@ -175,7 +175,7 @@ void RLPXHandshake::transition(boost::system::error_code _ech) else if (m_nextState == WriteHello) { m_nextState = ReadHello; - clog(NetConnect) << (m_originated ? "p2p.connect.egress" : "p2p.connect.ingress") << "sending capabilities handshake"; + clog(NetP2PConnect) << (m_originated ? "p2p.connect.egress" : "p2p.connect.ingress") << "sending capabilities handshake"; /// This pointer will be freed if there is an error otherwise /// it will be passed to Host which will take ownership. @@ -220,7 +220,7 @@ void RLPXHandshake::transition(boost::system::error_code _ech) return; } - clog(NetNote) << (m_originated ? "p2p.connect.egress" : "p2p.connect.ingress") << "recvd hello header"; + clog(NetP2PNote) << (m_originated ? "p2p.connect.egress" : "p2p.connect.ingress") << "recvd hello header"; /// check frame size bytes& header = m_handshakeInBuffer; @@ -228,7 +228,7 @@ void RLPXHandshake::transition(boost::system::error_code _ech) if (frameSize > 1024) { // all future frames: 16777216 - clog(NetWarn) << (m_originated ? "p2p.connect.egress" : "p2p.connect.ingress") << "hello frame is too large" << frameSize; + clog(NetP2PWarn) << (m_originated ? "p2p.connect.egress" : "p2p.connect.ingress") << "hello frame is too large" << frameSize; m_nextState = Error; transition(); return; @@ -279,7 +279,7 @@ void RLPXHandshake::transition(boost::system::error_code _ech) if (!_ec) { if (!m_socket->remoteEndpoint().address().is_unspecified()) - clog(NetConnect) << "Disconnecting " << m_socket->remoteEndpoint() << " (Handshake Timeout)"; + clog(NetP2PConnect) << "Disconnecting " << m_socket->remoteEndpoint() << " (Handshake Timeout)"; cancel(); } }); From b7683a8c65225b6bd2af00e924e2cfe1bf0ff927 Mon Sep 17 00:00:00 2001 From: arkpar Date: Thu, 14 May 2015 20:11:56 +0200 Subject: [PATCH 202/461] fixed m_pubkDiscoverPings guard --- libp2p/NodeTable.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libp2p/NodeTable.cpp b/libp2p/NodeTable.cpp index b51ba8211..bf056c52f 100644 --- a/libp2p/NodeTable.cpp +++ b/libp2p/NodeTable.cpp @@ -95,7 +95,7 @@ shared_ptr NodeTable::addNode(Node const& _node, NodeRelation _relati { DEV_GUARDED(x_nodes) clog(NodeTableConnect) << "Sending public key discovery Ping to" << (bi::udp::endpoint)_node.endpoint << "(Advertising:" << (bi::udp::endpoint)m_node.endpoint << ")"; - DEV_GUARDED(x_pubkDiscoverPings); + DEV_GUARDED(x_pubkDiscoverPings) m_pubkDiscoverPings[_node.endpoint.address] = std::chrono::steady_clock::now(); ping(_node.endpoint); return move(shared_ptr()); From 1958a7a46942f9543589467a863fcb50277f8a49 Mon Sep 17 00:00:00 2001 From: arkpar Date: Thu, 14 May 2015 20:55:57 +0200 Subject: [PATCH 203/461] Skip second nonce check on import --- libethereum/BlockChain.cpp | 2 +- libethereum/State.cpp | 8 ++++---- libethereum/State.h | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/libethereum/BlockChain.cpp b/libethereum/BlockChain.cpp index 7c03bc24f..712a1e1ba 100644 --- a/libethereum/BlockChain.cpp +++ b/libethereum/BlockChain.cpp @@ -639,7 +639,7 @@ ImportRoute BlockChain::import(bytes const& _block, OverlayDB const& _db, Import } try { - State canary(_db, *this, bi.hash()); + State canary(_db, *this, bi.hash(), ImportRequirements::DontHave); } catch (...) { diff --git a/libethereum/State.cpp b/libethereum/State.cpp index f5739aadb..1a73177d5 100644 --- a/libethereum/State.cpp +++ b/libethereum/State.cpp @@ -114,7 +114,7 @@ State::State(OverlayDB const& _db, BaseState _bs, Address _coinbaseAddress): paranoia("end of normal construction.", true); } -State::State(OverlayDB const& _db, BlockChain const& _bc, h256 _h): +State::State(OverlayDB const& _db, BlockChain const& _bc, h256 _h, ImportRequirements::value _ir): m_db(_db), m_state(&m_db), m_blockReward(c_blockReward) @@ -136,18 +136,18 @@ State::State(OverlayDB const& _db, BlockChain const& _bc, h256 _h): // 1. Start at parent's end state (state root). BlockInfo bip; bip.populate(_bc.block(bi.parentHash)); - sync(_bc, bi.parentHash, bip); + sync(_bc, bi.parentHash, bip, _ir); // 2. Enact the block's transactions onto this state. m_ourAddress = bi.coinbaseAddress; - enact(&b, _bc); + enact(&b, _bc, _ir); } else { // Genesis required: // We know there are no transactions, so just populate directly. m_state.init(); - sync(_bc, _h, bi); + sync(_bc, _h, bi, _ir); } } diff --git a/libethereum/State.h b/libethereum/State.h index a11812c6f..d9fc9d2b5 100644 --- a/libethereum/State.h +++ b/libethereum/State.h @@ -118,7 +118,7 @@ public: explicit State(OverlayDB const& _db, BaseState _bs = BaseState::PreExisting, Address _coinbaseAddress = Address()); /// Construct state object from arbitrary point in blockchain. - State(OverlayDB const& _db, BlockChain const& _bc, h256 _hash); + State(OverlayDB const& _db, BlockChain const& _bc, h256 _hash, ImportRequirements::value _ir = ImportRequirements::Default); /// Copy state object. State(State const& _s); From 648a83f0fc9b700096498f862395bd9b9671b8e6 Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Thu, 14 May 2015 21:53:59 +0200 Subject: [PATCH 204/461] Stricter interface for EthashAux::light() --- eth/main.cpp | 2 +- ethminer/main.cpp | 2 +- libethcore/EthashAux.cpp | 5 ----- libethcore/EthashAux.h | 1 - test/libethcore/dagger.cpp | 8 ++++---- 5 files changed, 6 insertions(+), 12 deletions(-) diff --git a/eth/main.cpp b/eth/main.cpp index e352cd53a..dc130e296 100644 --- a/eth/main.cpp +++ b/eth/main.cpp @@ -866,7 +866,7 @@ int main(int argc, char** argv) cout << " with seed as " << seedHash << endl; if (valid) cout << "(mixHash = " << r.mixHash << ")" << endl; - cout << "SHA3( light(seed) ) = " << sha3(EthashAux::light(bi)->data()) << endl; + cout << "SHA3( light(seed) ) = " << sha3(EthashAux::light(bi.seedHash())->data()) << endl; exit(0); } catch (...) diff --git a/ethminer/main.cpp b/ethminer/main.cpp index 33c2e7c80..732d49dee 100644 --- a/ethminer/main.cpp +++ b/ethminer/main.cpp @@ -441,7 +441,7 @@ int main(int argc, char** argv) cout << " with seed as " << seedHash << endl; if (valid) cout << "(mixHash = " << r.mixHash << ")" << endl; - cout << "SHA3( light(seed) ) = " << sha3(EthashAux::light(bi)->data()) << endl; + cout << "SHA3( light(seed) ) = " << sha3(EthashAux::light(bi.seedHash())->data()) << endl; exit(0); } catch (...) diff --git a/libethcore/EthashAux.cpp b/libethcore/EthashAux.cpp index 4f29a6516..aeacf325a 100644 --- a/libethcore/EthashAux.cpp +++ b/libethcore/EthashAux.cpp @@ -105,11 +105,6 @@ void EthashAux::killCache(h256 const& _s) m_lights.erase(_s); } -EthashAux::LightType EthashAux::light(BlockInfo const& _header) -{ - return light(_header.seedHash()); -} - EthashAux::LightType EthashAux::light(h256 const& _seedHash) { RecursiveGuard l(get()->x_lights); diff --git a/libethcore/EthashAux.h b/libethcore/EthashAux.h index 2a4060e78..64501e37b 100644 --- a/libethcore/EthashAux.h +++ b/libethcore/EthashAux.h @@ -65,7 +65,6 @@ public: static uint64_t number(h256 const& _seedHash); static uint64_t cacheSize(BlockInfo const& _header); - static LightType light(BlockInfo const& _header); static LightType light(h256 const& _seedHash); static const uint64_t NotGenerating = (uint64_t)-1; diff --git a/test/libethcore/dagger.cpp b/test/libethcore/dagger.cpp index 4faf0a283..59770373d 100644 --- a/test/libethcore/dagger.cpp +++ b/test/libethcore/dagger.cpp @@ -63,14 +63,14 @@ BOOST_AUTO_TEST_CASE(basic_test) unsigned cacheSize(o["cache_size"].get_int()); h256 cacheHash(o["cache_hash"].get_str()); - BOOST_REQUIRE_EQUAL(EthashAux::get()->light(header)->size, cacheSize); - BOOST_REQUIRE_EQUAL(sha3(EthashAux::get()->light(header)->data()), cacheHash); + BOOST_REQUIRE_EQUAL(EthashAux::get()->light(header.seedHash())->size, cacheSize); + BOOST_REQUIRE_EQUAL(sha3(EthashAux::get()->light(header.seedHash())->data()), cacheHash); #if TEST_FULL unsigned fullSize(o["full_size"].get_int()); h256 fullHash(o["full_hash"].get_str()); - BOOST_REQUIRE_EQUAL(EthashAux::get()->full(header)->size(), fullSize); - BOOST_REQUIRE_EQUAL(sha3(EthashAux::get()->full(header)->data()), fullHash); + BOOST_REQUIRE_EQUAL(EthashAux::get()->full(header.seedHash())->size(), fullSize); + BOOST_REQUIRE_EQUAL(sha3(EthashAux::get()->full(header.seedHash())->data()), fullHash); #endif h256 result(o["result"].get_str()); From 38bf18de816a6d62fcfae5c656b72633eeaa66cb Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Thu, 14 May 2015 21:59:36 +0200 Subject: [PATCH 205/461] fix in chain uncle tests --- test/libethereum/blockchain.cpp | 35 ++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/test/libethereum/blockchain.cpp b/test/libethereum/blockchain.cpp index 824eafe26..191b94cc3 100644 --- a/test/libethereum/blockchain.cpp +++ b/test/libethereum/blockchain.cpp @@ -204,6 +204,20 @@ void doBlockchainTests(json_spirit::mValue& _v, bool _fillin) blObj["transactions"] = writeTransactionsToJson(txList); BlockInfo current_BlockHeader = state.info(); + + RLPStream uncleStream; + uncleStream.appendList(vBiUncles.size()); + for (unsigned i = 0; i < vBiUncles.size(); ++i) + { + RLPStream uncleRlp; + vBiUncles[i].streamRLP(uncleRlp, WithNonce); + uncleStream.appendRaw(uncleRlp.out()); + } + + // update unclehash in case of invalid uncles + current_BlockHeader.sha3Uncles = sha3(uncleStream.out()); + updatePoW(current_BlockHeader); + if (blObj.count("blockHeader")) overwriteBlockHeader(current_BlockHeader, blObj); @@ -223,15 +237,6 @@ void doBlockchainTests(json_spirit::mValue& _v, bool _fillin) txStream.appendRaw(txrlp.out()); } - RLPStream uncleStream; - uncleStream.appendList(vBiUncles.size()); - for (unsigned i = 0; i < vBiUncles.size(); ++i) - { - RLPStream uncleRlp; - vBiUncles[i].streamRLP(uncleRlp, WithNonce); - uncleStream.appendRaw(uncleRlp.out()); - } - RLPStream block2 = createFullBlockFromHeader(current_BlockHeader, txStream.out(), uncleStream.out()); blObj["rlp"] = toHex(block2.out(), 2, HexPrefix::Add); @@ -497,14 +502,20 @@ mArray importUncles(mObject const& blObj, vector& vBiUncles, vector Date: Thu, 14 May 2015 22:56:19 +0200 Subject: [PATCH 206/461] update gas Pricer tests --- test/libethereum/gaspricer.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/libethereum/gaspricer.cpp b/test/libethereum/gaspricer.cpp index 577d217e8..68a55ab42 100644 --- a/test/libethereum/gaspricer.cpp +++ b/test/libethereum/gaspricer.cpp @@ -115,26 +115,26 @@ BOOST_AUTO_TEST_CASE(basicGasPricer_notxs) BOOST_AUTO_TEST_CASE(basicGasPricer_highGasUsage_LowestPrio) { - dev::test::executeGasPricerTest("highGasUsage", 30.679, 15.0, "/BlockTests/bcGasPricerTest.json", TransactionPriority::Lowest, 15731292650, 10000000000000); + dev::test::executeGasPricerTest("highGasUsage", 30.679, 15.0, "/BlockTests/bcGasPricerTest.json", TransactionPriority::Lowest, 15731282021, 10000000000000); } BOOST_AUTO_TEST_CASE(basicGasPricer_highGasUsage_LowPrio) { - dev::test::executeGasPricerTest("highGasUsage", 30.679, 15.0, "/BlockTests/bcGasPricerTest.json", TransactionPriority::Low, 15731292650, 15734152261884); + dev::test::executeGasPricerTest("highGasUsage", 30.679, 15.0, "/BlockTests/bcGasPricerTest.json", TransactionPriority::Low, 15731282021, 15734152261884); } BOOST_AUTO_TEST_CASE(basicGasPricer_highGasUsage_MediumPrio) { - dev::test::executeGasPricerTest("highGasUsage", 30.679, 15.0, "/BlockTests/bcGasPricerTest.json", TransactionPriority::Medium, 15731292650, 20000000000000); + dev::test::executeGasPricerTest("highGasUsage", 30.679, 15.0, "/BlockTests/bcGasPricerTest.json", TransactionPriority::Medium, 15731282021, 20000000000000); } BOOST_AUTO_TEST_CASE(basicGasPricer_highGasUsage_HighPrio) { - dev::test::executeGasPricerTest("highGasUsage", 30.679, 15.0, "/BlockTests/bcGasPricerTest.json", TransactionPriority::High, 15731292650, 24265847738115); + dev::test::executeGasPricerTest("highGasUsage", 30.679, 15.0, "/BlockTests/bcGasPricerTest.json", TransactionPriority::High, 15731282021, 24265847738115); } BOOST_AUTO_TEST_CASE(basicGasPricer_highGasUsage_HighestPrio) { - dev::test::executeGasPricerTest("highGasUsage", 30.679, 15.0, "/BlockTests/bcGasPricerTest.json", TransactionPriority::Highest, 15731292650, 30000000000000); + dev::test::executeGasPricerTest("highGasUsage", 30.679, 15.0, "/BlockTests/bcGasPricerTest.json", TransactionPriority::Highest, 15731282021, 30000000000000); } BOOST_AUTO_TEST_SUITE_END() From 3881b160d64938d840c9a3cdcbba31aee9f15985 Mon Sep 17 00:00:00 2001 From: yann300 Date: Fri, 15 May 2015 11:26:19 +0200 Subject: [PATCH 207/461] Display gas estimation as annotation --- mix/CodeModel.cpp | 8 ++-- mix/CodeModel.h | 6 ++- mix/qml/Application.qml | 15 ++++++ mix/qml/CodeEditorView.qml | 9 +++- mix/qml/WebCodeEditor.qml | 10 ++-- mix/qml/html/cm/solarized.css | 6 ++- mix/qml/html/codeeditor.js | 87 +++++++++++++++++++++++++++++++---- 7 files changed, 117 insertions(+), 24 deletions(-) diff --git a/mix/CodeModel.cpp b/mix/CodeModel.cpp index ecdb46be3..d9262586b 100644 --- a/mix/CodeModel.cpp +++ b/mix/CodeModel.cpp @@ -189,7 +189,6 @@ CodeModel::CodeModel(): qRegisterMetaType("QContractDefinition*"); qRegisterMetaType("QFunctionDefinition*"); qRegisterMetaType("QVariableDeclaration*"); - //qRegisterMetaType("GasMap"); qmlRegisterType("org.ethereum.qml", 1, 0, "QFunctionDefinition"); qmlRegisterType("org.ethereum.qml", 1, 0, "QVariableDeclaration"); } @@ -325,7 +324,6 @@ void CodeModel::gasEstimation(solidity::CompilerStack const& _cs) m_gasCostsMaps.clear(); for (std::string n: _cs.getContractNames()) { - ContractDefinition const& contractDefinition = _cs.getContractDefinition(n); QString sourceName = QString::fromStdString(*contractDefinition.getLocation().sourceName); @@ -344,7 +342,9 @@ void CodeModel::gasEstimation(solidity::CompilerStack const& _cs) { SourceLocation location = gasIte->first->getLocation(); GasMeter::GasConsumption cost = gasIte->second; - GasMap* gas = new GasMap(location.start, location.end, (new QBigInt(cost.value))->value()); + std::stringstream v; + v << cost.value; + GasMap* gas = new GasMap(location.start, location.end, QString::fromStdString(v.str()), gasIte->second.isInfinite); m_gasCostsMaps.find(sourceName).value().push_back(QVariant::fromValue(gas)); } } @@ -355,8 +355,6 @@ QVariantList CodeModel::gasCostByDocumentId(QString const& _documentId) const if (m_gasCostsMaps.contains(_documentId)) { auto sourceMapIter = m_gasCostsMaps.find(_documentId); - int gg = sourceMapIter.value().size(); - Q_UNUSED(gg); return sourceMapIter.value(); } else diff --git a/mix/CodeModel.h b/mix/CodeModel.h index a1a2c29ec..b28c5f6c6 100644 --- a/mix/CodeModel.h +++ b/mix/CodeModel.h @@ -134,17 +134,19 @@ class GasMap: public QObject Q_PROPERTY(int start MEMBER m_start CONSTANT) Q_PROPERTY(int end MEMBER m_end CONSTANT) Q_PROPERTY(QString gas MEMBER m_gas CONSTANT) + Q_PROPERTY(bool isInfinite MEMBER m_isInfinite CONSTANT) public: - GasMap(int _start, int _end, QString _gas): m_start(_start), m_end(_end), m_gas(_gas) {} + GasMap(int _start, int _end, QString _gas, bool _isInfinite): m_start(_start), m_end(_end), m_gas(_gas), m_isInfinite(_isInfinite) {} int m_start; int m_end; QString m_gas; + bool m_isInfinite; }; using SourceMaps = QMap; //by source id -using GasCostsMaps = QMap*/>; //gas cost by contract name +using GasCostsMaps = QMap; //gas cost by contract name /// Code compilation model. Compiles contracts in background an provides compiled contract data class CodeModel: public QObject diff --git a/mix/qml/Application.qml b/mix/qml/Application.qml index fe62efe12..161f7141a 100644 --- a/mix/qml/Application.qml +++ b/mix/qml/Application.qml @@ -116,6 +116,10 @@ ApplicationWindow { MenuSeparator {} MenuItem { action: toggleAssemblyDebuggingAction } } + Menu { + title: qsTr("Tools") + MenuItem { action: gasEstimationAction } + } Menu { title: qsTr("Windows") MenuItem { action: openNextDocumentAction } @@ -409,4 +413,15 @@ ApplicationWindow { mainContent.codeEditor.goToCompilationError(); } } + + Action { + id: gasEstimationAction + text: qsTr("Display gas estimation") + shortcut: "Ctrl+G" + checkable: true + onTriggered: + { + mainContent.codeEditor.displayGasEstimation(checked); + } + } } diff --git a/mix/qml/CodeEditorView.qml b/mix/qml/CodeEditorView.qml index 08bb072f5..08610a8e1 100644 --- a/mix/qml/CodeEditorView.qml +++ b/mix/qml/CodeEditorView.qml @@ -168,6 +168,13 @@ Item { editors.itemAt(i).item.setFontSize(size); } + function displayGasEstimation(checked) + { + var editor = getEditor(currentDocumentId); + if (editor) + editor.displayGasEstimation(checked); + } + Component.onCompleted: projectModel.codeEditor = codeEditorView; Connections { @@ -180,7 +187,7 @@ Item { var gasCosts = codeModel.gasCostByDocumentId(currentDocumentId); var editor = getEditor(currentDocumentId); if (editor) - editor.displayGasCosts(gasCosts); + editor.setGasCosts(gasCosts); } } diff --git a/mix/qml/WebCodeEditor.qml b/mix/qml/WebCodeEditor.qml index a2602304a..0d681d79c 100644 --- a/mix/qml/WebCodeEditor.qml +++ b/mix/qml/WebCodeEditor.qml @@ -83,12 +83,14 @@ Item { editorBrowser.runJavaScript("setFontSize(" + size + ")", function(result) {}); } - function displayGasCosts(gasCosts) { + function setGasCosts(gasCosts) { + if (initialized && editorBrowser) + editorBrowser.runJavaScript("setGasCosts('" + JSON.stringify(gasCosts) + "')", function(result) {}); + } - //console.log(gasCosts); - //console.log(JSON.stringify(gasCosts)); + function displayGasEstimation(show) { if (initialized && editorBrowser) - editorBrowser.runJavaScript("displayGasCosts('" + JSON.stringify(gasCosts) + "')", function(result) {}); + editorBrowser.runJavaScript("displayGasEstimation('" + show + "')", function(result) {}); } Clipboard diff --git a/mix/qml/html/cm/solarized.css b/mix/qml/html/cm/solarized.css index 046042450..1d298b990 100644 --- a/mix/qml/html/cm/solarized.css +++ b/mix/qml/html/cm/solarized.css @@ -190,6 +190,8 @@ view-port span.CodeMirror-selectedtext { color: #586e75 !important; } -.gasCost { - background: #b58900 !important; +/* Gas Costs */ +.CodeMirror-gasCosts { + border-bottom: double 1px #2aa198; } + diff --git a/mix/qml/html/codeeditor.js b/mix/qml/html/codeeditor.js index cc5e9a28c..3e1a54958 100644 --- a/mix/qml/html/codeeditor.js +++ b/mix/qml/html/codeeditor.js @@ -3,7 +3,7 @@ var editor = CodeMirror(document.body, { //styleActiveLine: true, matchBrackets: true, autofocus: true, - gutters: ["CodeMirror-linenumbers", "breakpoints", "gasCost"], + gutters: ["CodeMirror-linenumbers", "breakpoints"], autoCloseBrackets: true, styleSelectedText: true }); @@ -207,22 +207,89 @@ makeGasCostMarker = function(value) { var marker = document.createElement("div"); marker.style.color = "#822"; marker.innerHTML = value; + marker.className = "CodeMirror-errorannotation-context"; return marker; }; -displayGasCosts = function(gasCosts) +var gasCosts = null; +setGasCosts = function(_gasCosts) { - gasCosts = JSON.parse(gasCosts); - for (var i in gasCosts) + gasCosts = JSON.parse(_gasCosts); + + if (showGasEstimation) + { + displayGasEstimation(false); + displayGasEstimation(true); + } +} + +var showGasEstimation = false; +var gasMarkText = []; +var gasMarkRef = {}; +displayGasEstimation = function(show) +{ + show = JSON.parse(show); + showGasEstimation = show; + if (show) + { + var maxGas = 20000; + var step = colorGradient.length / maxGas; // 20000 max gas + gasMarkRef = []; + gasMarkRef = {}; + for (var i in gasCosts) + { + if (gasCosts[i].gas !== "0") + { + var color; + var colorIndex = Math.round(step * gasCosts[i].gas); + if (gasCosts[i].isInfinite || colorIndex > colorGradient.length) + color = colorGradient[colorGradient.length - 1]; + else + color = colorGradient[colorIndex]; + var className = "CodeMirror-gasCosts" + i; + var line = editor.posFromIndex(gasCosts[i].start) + gasMarkText.push(editor.markText(line, editor.posFromIndex(gasCosts[i].end), { inclusiveLeft: true, inclusiveRight: true, handleMouseEvents: true, className: className, css: "background-color:" + color })); + gasMarkRef[className] = { line: line.line, value: gasCosts[i] }; + } + } + CodeMirror.on(editor.getWrapperElement(), "mouseover", listenMouseOver); + } + else { - var line = editor.posFromIndex(gasCosts[i].start); - console.log("___________") - console.log(line.line); - console.log(gasCosts[i].start); - //editor.setGutterMarker(line.line, "gasCost", makeGasCostMarker(gasCosts[i].gas)); - editor.markText(editor.posFromIndex(gasCosts[i].start), editor.posFromIndex(gasCosts[i].end), { className: "gasCost" }); + CodeMirror.off(editor.getWrapperElement(), "mouseover", listenMouseOver); + for (var k in gasMarkText) + gasMarkText[k].clear(); + if (gasAnnotation) + { + gasAnnotation.clear(); + gasAnnotation = null; + } + } +} + +var gasAnnotation; +function listenMouseOver(e) +{ + var node = e.target || e.srcElement; + if (node) { + if (!gasAnnotation && node.className && node.className.indexOf("CodeMirror-gasCosts") !== -1) + { + if (gasAnnotation) + gasAnnotation.clear(); + var cl = node.className.split(" ")[1]; + var gasTitle = gasMarkRef[cl].value.isInfinite ? "infinite" : gasMarkRef[cl].value.gas; + gasTitle = gasTitle + " gas"; + gasAnnotation = editor.addLineWidget(gasMarkRef[cl].line + 1, makeGasCostMarker(gasTitle), { coverGutter: false, above: true }); + } + else if (gasAnnotation) + { + gasAnnotation.clear(); + gasAnnotation = null; + } } } +// blue => red ["#1515ED", "#1714EA", "#1914E8", "#1B14E6", "#1D14E4", "#1F14E2", "#2214E0", "#2414DE", "#2614DC", "#2813DA", "#2A13D8", "#2D13D6", "#2F13D4", "#3113D2", "#3313D0", "#3513CE", "#3713CC", "#3A12CA", "#3C12C8", "#3E12C6", "#4012C4", "#4212C2", "#4512C0", "#4712BE", "#4912BC", "#4B11BA", "#4D11B8", "#4F11B6", "#5211B4", "#5411B2", "#5611B0", "#5811AE", "#5A11AC", "#5D11AA", "#5F10A7", "#6110A5", "#6310A3", "#6510A1", "#67109F", "#6A109D", "#6C109B", "#6E1099", "#700F97", "#720F95", "#750F93", "#770F91", "#790F8F", "#7B0F8D", "#7D0F8B", "#7F0F89", "#820E87", "#840E85", "#860E83", "#880E81", "#8A0E7F", "#8D0E7D", "#8F0E7B", "#910E79", "#930D77", "#950D75", "#970D73", "#9A0D71", "#9C0D6F", "#9E0D6D", "#A00D6B", "#A20D69", "#A50D67", "#A70C64", "#A90C62", "#AB0C60", "#AD0C5E", "#AF0C5C", "#B20C5A", "#B40C58", "#B60C56", "#B80B54", "#BA0B52", "#BD0B50", "#BF0B4E", "#C10B4C", "#C30B4A", "#C50B48", "#C70B46", "#CA0A44", "#CC0A42", "#CE0A40", "#D00A3E", "#D20A3C", "#D50A3A", "#D70A38", "#D90A36", "#DB0934", "#DD0932", "#DF0930", "#E2092E", "#E4092C", "#E6092A", "#E80928", "#EA0926", "#ED0924"] +/* green => red */ var colorGradient = ["#429C27", "#439A26", "#449926", "#469726", "#479626", "#489525", "#4A9325", "#4B9225", "#4D9025", "#4E8F25", "#4F8E24", "#518C24", "#528B24", "#548924", "#558824", "#568723", "#588523", "#598423", "#5B8223", "#5C8122", "#5D8022", "#5F7E22", "#607D22", "#627B22", "#637A21", "#647921", "#667721", "#677621", "#697421", "#6A7320", "#6B7220", "#6D7020", "#6E6F20", "#706E20", "#716C1F", "#726B1F", "#74691F", "#75681F", "#76671E", "#78651E", "#79641E", "#7B621E", "#7C611E", "#7D601D", "#7F5E1D", "#805D1D", "#825B1D", "#835A1D", "#84591C", "#86571C", "#87561C", "#89541C", "#8A531B", "#8B521B", "#8D501B", "#8E4F1B", "#904D1B", "#914C1A", "#924B1A", "#94491A", "#95481A", "#97461A", "#984519", "#994419", "#9B4219", "#9C4119", "#9E4019", "#9F3E18", "#A03D18", "#A23B18", "#A33A18", "#A43917", "#A63717", "#A73617", "#A93417", "#AA3317", "#AB3216", "#AD3016", "#AE2F16", "#B02D16", "#B12C16", "#B22B15", "#B42915", "#B52815", "#B72615", "#B82514", "#B92414", "#BB2214", "#BC2114", "#BE1F14", "#BF1E13", "#C01D13", "#C21B13", "#C31A13", "#C51813", "#C61712", "#C71612", "#C91412", "#CA1312", "#CC1212"] editor.setOption("extraKeys", extraKeys); From 32f57c6c25911022bbeced63d0a51047f9042099 Mon Sep 17 00:00:00 2001 From: chriseth Date: Fri, 15 May 2015 11:46:32 +0200 Subject: [PATCH 208/461] Disable test. --- test/libsolidity/SolidityOptimizer.cpp | 27 ++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/test/libsolidity/SolidityOptimizer.cpp b/test/libsolidity/SolidityOptimizer.cpp index ce43887e1..e8cc2d5b5 100644 --- a/test/libsolidity/SolidityOptimizer.cpp +++ b/test/libsolidity/SolidityOptimizer.cpp @@ -884,18 +884,21 @@ BOOST_AUTO_TEST_CASE(cse_sha3_twice_same_content_noninterfering_store_in_between BOOST_CHECK_EQUAL(1, count(output.begin(), output.end(), AssemblyItem(Instruction::SHA3))); } -BOOST_AUTO_TEST_CASE(cse_with_initially_known_stack) -{ - eth::KnownState state = createInitialState(AssemblyItems{ - u256(0x12), - u256(0x20), - Instruction::ADD - }); - AssemblyItems input{ - u256(0x12 + 0x20) - }; - checkCSE(input, AssemblyItems{Instruction::DUP1}, state); -} +// ****************************** +// DISABLED DUE TO FAILURE ON OSX +// ****************************** +//BOOST_AUTO_TEST_CASE(cse_with_initially_known_stack) +//{ +// eth::KnownState state = createInitialState(AssemblyItems{ +// u256(0x12), +// u256(0x20), +// Instruction::ADD +// }); +// AssemblyItems input{ +// u256(0x12 + 0x20) +// }; +// checkCSE(input, AssemblyItems{Instruction::DUP1}, state); +//} BOOST_AUTO_TEST_CASE(cse_equality_on_initially_known_stack) { From 9357e47a8392fc227cde74ba9c95e3c058c869eb Mon Sep 17 00:00:00 2001 From: subtly Date: Fri, 15 May 2015 11:50:21 +0200 Subject: [PATCH 209/461] Update gas limit modulation. --- libethcore/BlockInfo.cpp | 5 ++++- libwhisper/WhisperPeer.cpp | 3 +-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/libethcore/BlockInfo.cpp b/libethcore/BlockInfo.cpp index eb64593af..e70b16753 100644 --- a/libethcore/BlockInfo.cpp +++ b/libethcore/BlockInfo.cpp @@ -228,7 +228,10 @@ u256 BlockInfo::selectGasLimit(BlockInfo const& _parent) const return c_genesisGasLimit; else // target minimum of 3141592 - return max(max(c_minGasLimit, 3141592), _parent.gasLimit - _parent.gasLimit / c_gasLimitBoundDivisor + 1 + (_parent.gasUsed * 6 / 5) / c_gasLimitBoundDivisor); + if (_parent.gasLimit < c_genesisGasLimit) + return min(c_genesisGasLimit, _parent.gasLimit + _parent.gasLimit / c_gasLimitBoundDivisor - 1); + else + return max(c_genesisGasLimit, _parent.gasLimit - _parent.gasLimit / c_gasLimitBoundDivisor + 1 + (_parent.gasUsed * 6 / 5) / c_gasLimitBoundDivisor); } u256 BlockInfo::calculateDifficulty(BlockInfo const& _parent) const diff --git a/libwhisper/WhisperPeer.cpp b/libwhisper/WhisperPeer.cpp index 9bef25140..5ac538171 100644 --- a/libwhisper/WhisperPeer.cpp +++ b/libwhisper/WhisperPeer.cpp @@ -68,8 +68,7 @@ bool WhisperPeer::interpret(unsigned _id, RLP const& _r) { unsigned n = 0; for (auto i: _r) - if (n++) - host()->inject(Envelope(i), this); + host()->inject(Envelope(i), this); break; } default: From dc054d7b53ef74274216257d86cd68e33d906cdf Mon Sep 17 00:00:00 2001 From: yann300 Date: Fri, 15 May 2015 12:01:20 +0200 Subject: [PATCH 210/461] bug fix --- mix/CodeModel.cpp | 1 - mix/qml/CodeEditorView.qml | 1 + mix/qml/WebCodeEditor.qml | 5 +++++ mix/qml/html/codeeditor.js | 19 +++++++++++++------ 4 files changed, 19 insertions(+), 7 deletions(-) diff --git a/mix/CodeModel.cpp b/mix/CodeModel.cpp index d9262586b..71a2f0eba 100644 --- a/mix/CodeModel.cpp +++ b/mix/CodeModel.cpp @@ -43,7 +43,6 @@ #include "CodeHighlighter.h" #include "FileIo.h" #include "CodeModel.h" -#include "QBigInt.h" using namespace dev::mix; diff --git a/mix/qml/CodeEditorView.qml b/mix/qml/CodeEditorView.qml index 08610a8e1..a5f8cd233 100644 --- a/mix/qml/CodeEditorView.qml +++ b/mix/qml/CodeEditorView.qml @@ -288,6 +288,7 @@ Item { messageDialog.doc = editorListModel.get(index); messageDialog.open(); } + loader.item.displayGasEstimation(gasEstimationAction.checked); } } Component.onCompleted: { diff --git a/mix/qml/WebCodeEditor.qml b/mix/qml/WebCodeEditor.qml index 0d681d79c..562c9716b 100644 --- a/mix/qml/WebCodeEditor.qml +++ b/mix/qml/WebCodeEditor.qml @@ -144,7 +144,12 @@ Item { function compilationComplete() { if (editorBrowser) + { editorBrowser.runJavaScript("compilationComplete()", function(result) { }); + parent.displayGasEstimation(gasEstimationAction.checked); + } + + } function compilationError(error, sourceName) diff --git a/mix/qml/html/codeeditor.js b/mix/qml/html/codeeditor.js index 3e1a54958..7d68f4032 100644 --- a/mix/qml/html/codeeditor.js +++ b/mix/qml/html/codeeditor.js @@ -216,25 +216,26 @@ setGasCosts = function(_gasCosts) { gasCosts = JSON.parse(_gasCosts); - if (showGasEstimation) + if (showingGasEstimation) { displayGasEstimation(false); displayGasEstimation(true); } } -var showGasEstimation = false; +var showingGasEstimation = false; var gasMarkText = []; var gasMarkRef = {}; displayGasEstimation = function(show) { show = JSON.parse(show); - showGasEstimation = show; + showingGasEstimation = show; if (show) { var maxGas = 20000; var step = colorGradient.length / maxGas; // 20000 max gas - gasMarkRef = []; + clearGasMark(); + gasMarkText = []; gasMarkRef = {}; for (var i in gasCosts) { @@ -257,8 +258,7 @@ displayGasEstimation = function(show) else { CodeMirror.off(editor.getWrapperElement(), "mouseover", listenMouseOver); - for (var k in gasMarkText) - gasMarkText[k].clear(); + clearGasMark(); if (gasAnnotation) { gasAnnotation.clear(); @@ -267,6 +267,13 @@ displayGasEstimation = function(show) } } +function clearGasMark() +{ + if (gasMarkText) + for (var k in gasMarkText) + gasMarkText[k].clear(); +} + var gasAnnotation; function listenMouseOver(e) { From bc7e909eabdf5a860bf19b5b5633be6ac5d50dcb Mon Sep 17 00:00:00 2001 From: subtly Date: Fri, 15 May 2015 12:15:55 +0200 Subject: [PATCH 211/461] reverse unrelated code --- libwhisper/WhisperPeer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libwhisper/WhisperPeer.cpp b/libwhisper/WhisperPeer.cpp index 5ac538171..9bef25140 100644 --- a/libwhisper/WhisperPeer.cpp +++ b/libwhisper/WhisperPeer.cpp @@ -68,7 +68,8 @@ bool WhisperPeer::interpret(unsigned _id, RLP const& _r) { unsigned n = 0; for (auto i: _r) - host()->inject(Envelope(i), this); + if (n++) + host()->inject(Envelope(i), this); break; } default: From ca7df0afa3b3a4869bfec1839dbf947ee241fe46 Mon Sep 17 00:00:00 2001 From: chriseth Date: Fri, 15 May 2015 13:25:44 +0200 Subject: [PATCH 212/461] Store copied assembly items in test. Fixes OSX issues. --- test/libsolidity/SolidityOptimizer.cpp | 29 ++++++++++++-------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/test/libsolidity/SolidityOptimizer.cpp b/test/libsolidity/SolidityOptimizer.cpp index e8cc2d5b5..744fc48ae 100644 --- a/test/libsolidity/SolidityOptimizer.cpp +++ b/test/libsolidity/SolidityOptimizer.cpp @@ -97,7 +97,7 @@ public: { eth::KnownState state; for (auto const& item: addDummyLocations(_input)) - state.feedItem(item); + state.feedItem(item, true); return state; } @@ -884,21 +884,18 @@ BOOST_AUTO_TEST_CASE(cse_sha3_twice_same_content_noninterfering_store_in_between BOOST_CHECK_EQUAL(1, count(output.begin(), output.end(), AssemblyItem(Instruction::SHA3))); } -// ****************************** -// DISABLED DUE TO FAILURE ON OSX -// ****************************** -//BOOST_AUTO_TEST_CASE(cse_with_initially_known_stack) -//{ -// eth::KnownState state = createInitialState(AssemblyItems{ -// u256(0x12), -// u256(0x20), -// Instruction::ADD -// }); -// AssemblyItems input{ -// u256(0x12 + 0x20) -// }; -// checkCSE(input, AssemblyItems{Instruction::DUP1}, state); -//} +BOOST_AUTO_TEST_CASE(cse_with_initially_known_stack) +{ + eth::KnownState state = createInitialState(AssemblyItems{ + u256(0x12), + u256(0x20), + Instruction::ADD + }); + AssemblyItems input{ + u256(0x12 + 0x20) + }; + checkCSE(input, AssemblyItems{Instruction::DUP1}, state); +} BOOST_AUTO_TEST_CASE(cse_equality_on_initially_known_stack) { From 177e99c29b62e7765b7c3dacaa7d556b8af4aa04 Mon Sep 17 00:00:00 2001 From: yann300 Date: Fri, 15 May 2015 15:12:34 +0200 Subject: [PATCH 213/461] bug fix --- mix/CodeModel.cpp | 5 +++-- mix/CodeModel.h | 2 +- mix/qml/html/codeeditor.js | 20 ++++++++++++++++---- 3 files changed, 20 insertions(+), 7 deletions(-) diff --git a/mix/CodeModel.cpp b/mix/CodeModel.cpp index 15d5a7679..7a0325b7a 100644 --- a/mix/CodeModel.cpp +++ b/mix/CodeModel.cpp @@ -352,7 +352,7 @@ void CodeModel::gasEstimation(solidity::CompilerStack const& _cs) for (auto gasIte = gasCosts.begin(); gasIte != gasCosts.end(); ++gasIte) { - SourceLocation location = gasIte->first->getLocation(); + SourceLocation const& location = gasIte->first->getLocation(); GasMeter::GasConsumption cost = gasIte->second; std::stringstream v; v << cost.value; @@ -364,7 +364,8 @@ void CodeModel::gasEstimation(solidity::CompilerStack const& _cs) QVariantList CodeModel::gasCostByDocumentId(QString const& _documentId) const { - if (m_gasCostsMaps.contains(_documentId)) + auto ite = m_gasCostsMaps.find(_documentId); + if (ite != m_gasCostsMaps.end()) { auto sourceMapIter = m_gasCostsMaps.find(_documentId); return sourceMapIter.value(); diff --git a/mix/CodeModel.h b/mix/CodeModel.h index f5a170da6..7cc9d3477 100644 --- a/mix/CodeModel.h +++ b/mix/CodeModel.h @@ -137,7 +137,7 @@ class GasMap: public QObject Q_PROPERTY(bool isInfinite MEMBER m_isInfinite CONSTANT) public: - GasMap(int _start, int _end, QString _gas, bool _isInfinite): m_start(_start), m_end(_end), m_gas(_gas), m_isInfinite(_isInfinite) {} + GasMap(int _start, int _end, QString _gas, bool _isInfinite): m_start(_start), m_end(_end), m_gas(_gas), m_isInfinite(_isInfinite) { QQmlEngine::setObjectOwnership(this, QQmlEngine::JavaScriptOwnership); } int m_start; int m_end; diff --git a/mix/qml/html/codeeditor.js b/mix/qml/html/codeeditor.js index 7d68f4032..d1ecf0380 100644 --- a/mix/qml/html/codeeditor.js +++ b/mix/qml/html/codeeditor.js @@ -215,7 +215,6 @@ var gasCosts = null; setGasCosts = function(_gasCosts) { gasCosts = JSON.parse(_gasCosts); - if (showingGasEstimation) { displayGasEstimation(false); @@ -278,12 +277,13 @@ var gasAnnotation; function listenMouseOver(e) { var node = e.target || e.srcElement; - if (node) { - if (!gasAnnotation && node.className && node.className.indexOf("CodeMirror-gasCosts") !== -1) + if (node) + { + if (node.className && node.className.indexOf("CodeMirror-gasCosts") !== -1) { if (gasAnnotation) gasAnnotation.clear(); - var cl = node.className.split(" ")[1]; + var cl = getClass(node); var gasTitle = gasMarkRef[cl].value.isInfinite ? "infinite" : gasMarkRef[cl].value.gas; gasTitle = gasTitle + " gas"; gasAnnotation = editor.addLineWidget(gasMarkRef[cl].line + 1, makeGasCostMarker(gasTitle), { coverGutter: false, above: true }); @@ -296,7 +296,19 @@ function listenMouseOver(e) } } +function getClass(node) +{ + var classes = node.className.split(" "); + for (var k in classes) + { + if (classes[k].indexOf("CodeMirror-gasCosts") !== -1) + return classes[k]; + } + return ""; +} + // blue => red ["#1515ED", "#1714EA", "#1914E8", "#1B14E6", "#1D14E4", "#1F14E2", "#2214E0", "#2414DE", "#2614DC", "#2813DA", "#2A13D8", "#2D13D6", "#2F13D4", "#3113D2", "#3313D0", "#3513CE", "#3713CC", "#3A12CA", "#3C12C8", "#3E12C6", "#4012C4", "#4212C2", "#4512C0", "#4712BE", "#4912BC", "#4B11BA", "#4D11B8", "#4F11B6", "#5211B4", "#5411B2", "#5611B0", "#5811AE", "#5A11AC", "#5D11AA", "#5F10A7", "#6110A5", "#6310A3", "#6510A1", "#67109F", "#6A109D", "#6C109B", "#6E1099", "#700F97", "#720F95", "#750F93", "#770F91", "#790F8F", "#7B0F8D", "#7D0F8B", "#7F0F89", "#820E87", "#840E85", "#860E83", "#880E81", "#8A0E7F", "#8D0E7D", "#8F0E7B", "#910E79", "#930D77", "#950D75", "#970D73", "#9A0D71", "#9C0D6F", "#9E0D6D", "#A00D6B", "#A20D69", "#A50D67", "#A70C64", "#A90C62", "#AB0C60", "#AD0C5E", "#AF0C5C", "#B20C5A", "#B40C58", "#B60C56", "#B80B54", "#BA0B52", "#BD0B50", "#BF0B4E", "#C10B4C", "#C30B4A", "#C50B48", "#C70B46", "#CA0A44", "#CC0A42", "#CE0A40", "#D00A3E", "#D20A3C", "#D50A3A", "#D70A38", "#D90A36", "#DB0934", "#DD0932", "#DF0930", "#E2092E", "#E4092C", "#E6092A", "#E80928", "#EA0926", "#ED0924"] /* green => red */ var colorGradient = ["#429C27", "#439A26", "#449926", "#469726", "#479626", "#489525", "#4A9325", "#4B9225", "#4D9025", "#4E8F25", "#4F8E24", "#518C24", "#528B24", "#548924", "#558824", "#568723", "#588523", "#598423", "#5B8223", "#5C8122", "#5D8022", "#5F7E22", "#607D22", "#627B22", "#637A21", "#647921", "#667721", "#677621", "#697421", "#6A7320", "#6B7220", "#6D7020", "#6E6F20", "#706E20", "#716C1F", "#726B1F", "#74691F", "#75681F", "#76671E", "#78651E", "#79641E", "#7B621E", "#7C611E", "#7D601D", "#7F5E1D", "#805D1D", "#825B1D", "#835A1D", "#84591C", "#86571C", "#87561C", "#89541C", "#8A531B", "#8B521B", "#8D501B", "#8E4F1B", "#904D1B", "#914C1A", "#924B1A", "#94491A", "#95481A", "#97461A", "#984519", "#994419", "#9B4219", "#9C4119", "#9E4019", "#9F3E18", "#A03D18", "#A23B18", "#A33A18", "#A43917", "#A63717", "#A73617", "#A93417", "#AA3317", "#AB3216", "#AD3016", "#AE2F16", "#B02D16", "#B12C16", "#B22B15", "#B42915", "#B52815", "#B72615", "#B82514", "#B92414", "#BB2214", "#BC2114", "#BE1F14", "#BF1E13", "#C01D13", "#C21B13", "#C31A13", "#C51813", "#C61712", "#C71612", "#C91412", "#CA1312", "#CC1212"] + editor.setOption("extraKeys", extraKeys); From eca68b12587f9f6c2b2203c191b929b05b289ba9 Mon Sep 17 00:00:00 2001 From: yann300 Date: Fri, 15 May 2015 15:14:23 +0200 Subject: [PATCH 214/461] small change --- mix/qml/html/codeeditor.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mix/qml/html/codeeditor.js b/mix/qml/html/codeeditor.js index d1ecf0380..6499922ae 100644 --- a/mix/qml/html/codeeditor.js +++ b/mix/qml/html/codeeditor.js @@ -283,7 +283,7 @@ function listenMouseOver(e) { if (gasAnnotation) gasAnnotation.clear(); - var cl = getClass(node); + var cl = getGasCostClass(node); var gasTitle = gasMarkRef[cl].value.isInfinite ? "infinite" : gasMarkRef[cl].value.gas; gasTitle = gasTitle + " gas"; gasAnnotation = editor.addLineWidget(gasMarkRef[cl].line + 1, makeGasCostMarker(gasTitle), { coverGutter: false, above: true }); @@ -296,7 +296,7 @@ function listenMouseOver(e) } } -function getClass(node) +function getGasCostClass(node) { var classes = node.className.split(" "); for (var k in classes) From b4912db1c6263e53e0fdc5614740f03ba5e2a099 Mon Sep 17 00:00:00 2001 From: chriseth Date: Fri, 15 May 2015 15:27:31 +0200 Subject: [PATCH 215/461] Succint interfaces. --- libsolidity/InterfaceHandler.cpp | 6 +++--- libsolidity/InterfaceHandler.h | 2 -- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/libsolidity/InterfaceHandler.cpp b/libsolidity/InterfaceHandler.cpp index a49c4dc3f..85026ac12 100644 --- a/libsolidity/InterfaceHandler.cpp +++ b/libsolidity/InterfaceHandler.cpp @@ -101,7 +101,7 @@ std::unique_ptr InterfaceHandler::getABIInterface(ContractDefinitio event["inputs"] = params; abi.append(event); } - return std::unique_ptr(new std::string(m_writer.write(abi))); + return std::unique_ptr(new std::string(Json::FastWriter().write(abi))); } unique_ptr InterfaceHandler::getABISolidityInterface(ContractDefinition const& _contractDef) @@ -153,7 +153,7 @@ std::unique_ptr InterfaceHandler::getUserDocumentation(ContractDefi } doc["methods"] = methods; - return std::unique_ptr(new std::string(m_writer.write(doc))); + return std::unique_ptr(new std::string(Json::FastWriter().write(doc))); } std::unique_ptr InterfaceHandler::getDevDocumentation(ContractDefinition const& _contractDef) @@ -217,7 +217,7 @@ std::unique_ptr InterfaceHandler::getDevDocumentation(ContractDefin } doc["methods"] = methods; - return std::unique_ptr(new std::string(m_writer.write(doc))); + return std::unique_ptr(new std::string(Json::FastWriter().write(doc))); } /* -- private -- */ diff --git a/libsolidity/InterfaceHandler.h b/libsolidity/InterfaceHandler.h index 6aa3f72d6..405181890 100644 --- a/libsolidity/InterfaceHandler.h +++ b/libsolidity/InterfaceHandler.h @@ -108,8 +108,6 @@ private: std::string const& _tag, CommentOwner _owner); - Json::StyledWriter m_writer; - // internal state DocTagType m_lastTag; std::string m_notice; From eeceeea3d440fd07a0c5a7f1fc4b1124ef9401df Mon Sep 17 00:00:00 2001 From: chriseth Date: Fri, 15 May 2015 15:36:14 +0200 Subject: [PATCH 216/461] Hex/decimal cleanup for assembly output. --- libevmasm/Assembly.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/libevmasm/Assembly.cpp b/libevmasm/Assembly.cpp index 1011392b9..6f38b0f42 100644 --- a/libevmasm/Assembly.cpp +++ b/libevmasm/Assembly.cpp @@ -121,13 +121,13 @@ ostream& Assembly::streamAsm(ostream& _out, string const& _prefix, StringMap con _out << " " << instructionInfo(i.instruction()).name << "\t" << i.getJumpTypeAsString(); break; case Push: - _out << " PUSH " << i.data(); + _out << " PUSH " << hex << i.data(); break; case PushString: _out << " PUSH \"" << m_strings.at((h256)i.data()) << "\""; break; case PushTag: - _out << " PUSH [tag" << i.data() << "]"; + _out << " PUSH [tag" << dec << i.data() << "]"; break; case PushSub: _out << " PUSH [$" << h256(i.data()).abridged() << "]"; @@ -139,7 +139,7 @@ ostream& Assembly::streamAsm(ostream& _out, string const& _prefix, StringMap con _out << " PUSHSIZE"; break; case Tag: - _out << "tag" << i.data() << ": " << endl << _prefix << " JUMPDEST"; + _out << "tag" << dec << i.data() << ": " << endl << _prefix << " JUMPDEST"; break; case PushData: _out << " PUSH [" << hex << (unsigned)i.data() << "]"; @@ -208,7 +208,7 @@ Json::Value Assembly::streamAsmJson(ostream& _out, StringMap const& _sourceCodes break; case PushTag: collection.append( - createJsonValue("PUSH [tag]", i.getLocation().start, i.getLocation().end, toStringInHex(i.data()))); + createJsonValue("PUSH [tag]", i.getLocation().start, i.getLocation().end, string(i.data()))); break; case PushSub: collection.append( @@ -223,19 +223,13 @@ Json::Value Assembly::streamAsmJson(ostream& _out, StringMap const& _sourceCodes createJsonValue("PUSHSIZE", i.getLocation().start, i.getLocation().end)); break; case Tag: - { collection.append( createJsonValue("tag", i.getLocation().start, i.getLocation().end, string(i.data()))); collection.append( createJsonValue("JUMDEST", i.getLocation().start, i.getLocation().end)); - } break; case PushData: - { - Json::Value pushData; - pushData["name"] = "PUSH hex"; - collection.append(createJsonValue("PUSH hex", i.getLocation().start, i.getLocation().end, toStringInHex(i.data()))); - } + collection.append(createJsonValue("PUSH data", i.getLocation().start, i.getLocation().end, toStringInHex(i.data()))); break; default: BOOST_THROW_EXCEPTION(InvalidOpcode()); From 51ddf29763bb61cdd60d96589129647bfbe27290 Mon Sep 17 00:00:00 2001 From: yann300 Date: Fri, 15 May 2015 15:42:23 +0200 Subject: [PATCH 217/461] small changes --- mix/CodeModel.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/mix/CodeModel.cpp b/mix/CodeModel.cpp index 7a0325b7a..137188e40 100644 --- a/mix/CodeModel.cpp +++ b/mix/CodeModel.cpp @@ -350,13 +350,13 @@ void CodeModel::gasEstimation(solidity::CompilerStack const& _cs) StructuralGasEstimator estimator; std::map gasCosts = estimator.breakToStatementLevel(estimator.performEstimation(*items, std::vector({&sourceUnit})), {&sourceUnit}); - for (auto gasIte = gasCosts.begin(); gasIte != gasCosts.end(); ++gasIte) + for (auto gasItem = gasCosts.begin(); gasItem != gasCosts.end(); ++gasItem) { - SourceLocation const& location = gasIte->first->getLocation(); - GasMeter::GasConsumption cost = gasIte->second; + SourceLocation const& location = gasItem->first->getLocation(); + GasMeter::GasConsumption cost = gasItem->second; std::stringstream v; v << cost.value; - GasMap* gas = new GasMap(location.start, location.end, QString::fromStdString(v.str()), gasIte->second.isInfinite); + GasMap* gas = new GasMap(location.start, location.end, QString::fromStdString(v.str()), cost.isInfinite); m_gasCostsMaps.find(sourceName).value().push_back(QVariant::fromValue(gas)); } } @@ -364,12 +364,9 @@ void CodeModel::gasEstimation(solidity::CompilerStack const& _cs) QVariantList CodeModel::gasCostByDocumentId(QString const& _documentId) const { - auto ite = m_gasCostsMaps.find(_documentId); - if (ite != m_gasCostsMaps.end()) - { - auto sourceMapIter = m_gasCostsMaps.find(_documentId); - return sourceMapIter.value(); - } + auto gasIter = m_gasCostsMaps.find(_documentId); + if (gasIter != m_gasCostsMaps.end()) + return gasIter.value(); else return QVariantList(); } From b9133db9fb84a4c4f0c6d066cbefcefd5e369814 Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Fri, 15 May 2015 16:46:02 +0200 Subject: [PATCH 218/461] printf logging for ethash_full_new() errors --- internal.c | 12 +++++++++++- io.c | 18 ++++++++++++++++-- io.h | 13 +++++++++++++ 3 files changed, 40 insertions(+), 3 deletions(-) diff --git a/internal.c b/internal.c index e881e0c7b..ec2275f32 100644 --- a/internal.c +++ b/internal.c @@ -400,38 +400,48 @@ ethash_full_t ethash_full_new_internal( ret->file_size = (size_t)full_size; switch (ethash_io_prepare(dirname, seed_hash, &f, (size_t)full_size, false)) { case ETHASH_IO_FAIL: + // ethash_io_prepare will do all ETHASH_CRITICAL() logging in fail case goto fail_free_full; case ETHASH_IO_MEMO_MATCH: if (!ethash_mmap(ret, f)) { + ETHASH_CRITICAL("mmap failure()"); goto fail_close_file; } return ret; case ETHASH_IO_MEMO_SIZE_MISMATCH: // if a DAG of same filename but unexpected size is found, silently force new file creation if (ethash_io_prepare(dirname, seed_hash, &f, (size_t)full_size, true) != ETHASH_IO_MEMO_MISMATCH) { + ETHASH_CRITICAL("Could not recreate DAG file after finding existing DAG with unexpected size."); goto fail_free_full; } // fallthrough to the mismatch case here, DO NOT go through match case ETHASH_IO_MEMO_MISMATCH: if (!ethash_mmap(ret, f)) { + ETHASH_CRITICAL("mmap failure()"); goto fail_close_file; } break; } if (!ethash_compute_full_data(ret->data, full_size, light, callback)) { + ETHASH_CRITICAL("Failure at computing DAG data."); goto fail_free_full_data; } // after the DAG has been filled then we finalize it by writting the magic number at the beginning if (fseek(f, 0, SEEK_SET) != 0) { + ETHASH_CRITICAL("Could not seek to DAG file start to write magic number."); goto fail_free_full_data; } uint64_t const magic_num = ETHASH_DAG_MAGIC_NUM; if (fwrite(&magic_num, ETHASH_DAG_MAGIC_NUM_SIZE, 1, f) != 1) { + ETHASH_CRITICAL("Could not write magic number to DAG's beginning."); + goto fail_free_full_data; + } + if (fflush(f) != 0) {// make sure the magic number IS there + ETHASH_CRITICAL("Could not flush memory mapped data to DAG file. Insufficient space?"); goto fail_free_full_data; } - fflush(f); // make sure the magic number IS there return ret; fail_free_full_data: diff --git a/io.c b/io.c index 5b4e7da2b..f53827ee0 100644 --- a/io.c +++ b/io.c @@ -35,12 +35,14 @@ enum ethash_io_rc ethash_io_prepare( // assert directory exists if (!ethash_mkdir(dirname)) { + ETHASH_CRITICAL("Could not create the ethash directory"); goto end; } ethash_io_mutable_name(ETHASH_REVISION, &seedhash, mutable_name); char* tmpfile = ethash_io_create_filename(dirname, mutable_name, strlen(mutable_name)); if (!tmpfile) { + ETHASH_CRITICAL("Could not create the full DAG pathname"); goto end; } @@ -52,6 +54,7 @@ enum ethash_io_rc ethash_io_prepare( size_t found_size; if (!ethash_file_size(f, &found_size)) { fclose(f); + ETHASH_CRITICAL("Could not query size of DAG file: \"%s\"", tmpfile); goto free_memo; } if (file_size != found_size - ETHASH_DAG_MAGIC_NUM_SIZE) { @@ -64,6 +67,7 @@ enum ethash_io_rc ethash_io_prepare( if (fread(&magic_num, ETHASH_DAG_MAGIC_NUM_SIZE, 1, f) != 1) { // I/O error fclose(f); + ETHASH_CRITICAL("Could not read from DAG file: \"%s\"", tmpfile); ret = ETHASH_IO_MEMO_SIZE_MISMATCH; goto free_memo; } @@ -80,15 +84,25 @@ enum ethash_io_rc ethash_io_prepare( // file does not exist, will need to be created f = ethash_fopen(tmpfile, "wb+"); if (!f) { + ETHASH_CRITICAL("Could not create DAG file: \"%s\"", tmpfile); goto free_memo; } // make sure it's of the proper size if (fseek(f, (long int)(file_size + ETHASH_DAG_MAGIC_NUM_SIZE - 1), SEEK_SET) != 0) { fclose(f); + ETHASH_CRITICAL("Could not seek to the end of DAG file: \"%s\". Insufficient space?", tmpfile); + goto free_memo; + } + if (fputc('\n', f) == EOF) { + fclose(f); + ETHASH_CRITICAL("Could not write in the end of DAG file: \"%s\". Insufficient space?", tmpfile); + goto free_memo; + } + if (fflush(f) != 0) { + fclose(f); + ETHASH_CRITICAL("Could not flush at end of DAG file: \"%s\". Insufficient space?", tmpfile); goto free_memo; } - fputc('\n', f); - fflush(f); ret = ETHASH_IO_MEMO_MISMATCH; goto set_file; diff --git a/io.h b/io.h index 05aa5ed37..58ec90a9e 100644 --- a/io.h +++ b/io.h @@ -54,6 +54,19 @@ enum ethash_io_rc { #define snprintf(...) sprintf_s(__VA_ARGS__) #endif +/** + * Logs a critical error in important parts of ethash. Should mostly help + * figure out what kind of problem (I/O, memory e.t.c.) causes a NULL + * ethash_full_t + */ +#define ETHASH_CRITICAL(...) \ + do \ + { \ + printf("ETHASH CRITICAL ERROR: "__VA_ARGS__); \ + printf("\n"); \ + fflush(stdout); \ + } while (0) + /** * Prepares io for ethash * From 65bcb451d4e186274d566e391d4a91da097bd315 Mon Sep 17 00:00:00 2001 From: chriseth Date: Fri, 15 May 2015 17:00:08 +0200 Subject: [PATCH 219/461] Function hashes for JSON compiler. --- solc/jsonCompiler.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/solc/jsonCompiler.cpp b/solc/jsonCompiler.cpp index 6f3834af4..d47903fca 100644 --- a/solc/jsonCompiler.cpp +++ b/solc/jsonCompiler.cpp @@ -50,6 +50,14 @@ string formatError(Exception const& _exception, string const& _name, CompilerSta return Json::FastWriter().write(output); } +Json::Value functionHashes(ContractDefinition const& _contract) +{ + Json::Value functionHashes(Json::objectValue); + for (auto const& it: _contract.getInterfaceFunctions()) + functionHashes[it.second->externalSignature()] = toHex(it.first.ref()); + return functionHashes; +} + string compile(string _input, bool _optimize) { StringMap sources; @@ -100,6 +108,7 @@ string compile(string _input, bool _optimize) contractData["interface"] = compiler.getInterface(contractName); contractData["bytecode"] = toHex(compiler.getBytecode(contractName)); contractData["opcodes"] = eth::disassemble(compiler.getBytecode(contractName)); + contractData["functionHashes"] = functionHashes(compiler.getContractDefinition(contractName)); ostringstream unused; contractData["assembly"] = compiler.streamAssembly(unused, contractName, sources, true); output["contracts"][contractName] = contractData; From 74c2179c55afd7a5a9ac0993fa2dbe122e02abb7 Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Fri, 15 May 2015 17:28:34 +0200 Subject: [PATCH 220/461] Don't echo written password under win32 --- libdevcore/CommonIO.cpp | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/libdevcore/CommonIO.cpp b/libdevcore/CommonIO.cpp index d37f74db2..9538ca55f 100644 --- a/libdevcore/CommonIO.cpp +++ b/libdevcore/CommonIO.cpp @@ -24,7 +24,10 @@ #include #include #include "Exceptions.h" -#ifndef _WIN32 +#include +#ifdef _WIN32 +#include +#else #include #endif using namespace std; @@ -125,8 +128,22 @@ std::string dev::getPassword(std::string const& _prompt) { #if WIN32 cout << _prompt << flush; + // Get current Console input flags + HANDLE hStdin; + DWORD fdwSaveOldMode; + if ((hStdin = GetStdHandle(STD_INPUT_HANDLE)) == INVALID_HANDLE_VALUE) + BOOST_THROW_EXCEPTION(ExternalFunctionFailure("GetStdHandle")); + if (!GetConsoleMode(hStdin, &fdwSaveOldMode)) + BOOST_THROW_EXCEPTION(ExternalFunctionFailure("GetConsoleMode")); + // Set console flags to no echo + if (!SetConsoleMode(hStdin, fdwSaveOldMode & (~ENABLE_ECHO_INPUT))) + BOOST_THROW_EXCEPTION(ExternalFunctionFailure("SetConsoleMode")); + // Read the string std::string ret; std::getline(cin, ret); + // Restore old input mode + if (!SetConsoleMode(hStdin, fdwSaveOldMode)) + BOOST_THROW_EXCEPTION(ExternalFunctionFailure("SetConsoleMode")); return ret; #else struct termios oflags; From 01aced01890f0e5ba29c0ebe6d9f3069cd2a173f Mon Sep 17 00:00:00 2001 From: arkpar Date: Fri, 15 May 2015 17:36:20 +0200 Subject: [PATCH 221/461] fixed gas calculation --- mix/MixClient.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mix/MixClient.cpp b/mix/MixClient.cpp index cac208ba4..e3ed2eead 100644 --- a/mix/MixClient.cpp +++ b/mix/MixClient.cpp @@ -220,7 +220,7 @@ void MixClient::executeTransaction(Transaction const& _t, State& _state, bool _c d.address = _t.receiveAddress(); d.sender = _t.sender(); d.value = _t.value(); - d.gasUsed = er.gasUsed + er.gasRefunded; + d.gasUsed = er.gasUsed + er.gasRefunded + c_callStipend; if (_t.isCreation()) d.contractAddress = right160(sha3(rlpList(_t.sender(), _t.nonce()))); if (!_call) @@ -234,7 +234,7 @@ void MixClient::executeTransaction(Transaction const& _t, State& _state, bool _c er =_state.execute(lastHashes, t); if (t.isCreation() && _state.code(d.contractAddress).empty()) BOOST_THROW_EXCEPTION(OutOfGas() << errinfo_comment("Not enough gas for contract deployment")); - d.gasUsed = er.gasUsed + er.gasRefunded + er.gasForDeposit; + d.gasUsed = er.gasUsed + er.gasRefunded + er.gasForDeposit + c_callStipend; // collect watches h256Set changed; Guard l(x_filtersWatches); From 135513f18a1851bc18a2d4f01ecf76d376abc2e9 Mon Sep 17 00:00:00 2001 From: arkpar Date: Fri, 15 May 2015 17:56:44 +0200 Subject: [PATCH 222/461] globalreg address --- mix/qml/DeploymentDialog.qml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mix/qml/DeploymentDialog.qml b/mix/qml/DeploymentDialog.qml index 1fbde3ac9..81092ec76 100644 --- a/mix/qml/DeploymentDialog.qml +++ b/mix/qml/DeploymentDialog.qml @@ -15,7 +15,7 @@ Dialog { id: modalDeploymentDialog modality: Qt.ApplicationModal width: 735 - height: 400 + height: 450 visible: false property int ownedRegistrarDeployGas: 1179075 // TODO: Use sol library to calculate gas requirement for each tr. property int ownedRegistrarSetSubRegistrarGas: 50000 @@ -293,15 +293,15 @@ Dialog { DefaultLabel { text: qsTr("Root Registrar address:") - visible: false //still use it for now in dev env. + visible: true //still use it for now in dev env. } DefaultTextField { Layout.preferredWidth: 350 id: registrarAddr - text: "ab69f864e49fc4294d18355c4bafb0b91b5e629b" - visible: false + text: "c6d9d2cd449a754c494264e1809c50e34d64562b" + visible: true } DefaultLabel From 47b6e38df9d56866af2093516c364e1921acd506 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Fri, 15 May 2015 17:58:31 +0200 Subject: [PATCH 223/461] Fixes for transact gas usage. --- alethzero/Transact.cpp | 2 +- libethcore/Ethash.cpp | 2 +- libethcore/EthashAux.cpp | 6 ++++-- libethcore/EthashAux.h | 7 +++++-- libethereum/Executive.h | 2 +- libethereum/TransactionQueue.cpp | 11 ++++++++--- mix/qml/DeploymentDialog.qml | 4 ++-- 7 files changed, 22 insertions(+), 12 deletions(-) diff --git a/alethzero/Transact.cpp b/alethzero/Transact.cpp index f2a8ef0d5..1336c3f05 100644 --- a/alethzero/Transact.cpp +++ b/alethzero/Transact.cpp @@ -361,7 +361,7 @@ void Transact::rejigData() to = m_context->fromString(ui->destination->currentText().toStdString()).first; er = ethereum()->call(s, value(), to, m_data, gasNeeded, gasPrice()); } - gasNeeded = (qint64)(er.gasUsed + er.gasRefunded); + gasNeeded = (qint64)(er.gasUsed + er.gasRefunded + c_callStipend); htmlInfo = QString("
INFO Gas required: %1 total = %2 base, %3 exec [%4 refunded later]
").arg(gasNeeded).arg(baseGas).arg(gasNeeded - baseGas).arg((qint64)er.gasRefunded) + htmlInfo; if (er.excepted != TransactionException::None) diff --git a/libethcore/Ethash.cpp b/libethcore/Ethash.cpp index 80550886c..fedf23826 100644 --- a/libethcore/Ethash.cpp +++ b/libethcore/Ethash.cpp @@ -317,7 +317,7 @@ void Ethash::GPUMiner::workLoop() } if (shouldStop()) return; - EthashAux::FullType dag = EthashAux::full(EthashAux::number(w.seedHash)); + EthashAux::FullType dag = EthashAux::full(EthashAux::number(w.seedHash)); // todo , , false bytesConstRef dagData = dag->data(); m_miner->init(dagData.data(), dagData.size(), 32, s_platformId, device); } diff --git a/libethcore/EthashAux.cpp b/libethcore/EthashAux.cpp index 9287bcbfc..2f369c458 100644 --- a/libethcore/EthashAux.cpp +++ b/libethcore/EthashAux.cpp @@ -156,8 +156,10 @@ static int dagCallbackShim(unsigned _p) return s_dagCallback ? s_dagCallback(_p) : 0; } -EthashAux::FullType EthashAux::full(uint64_t _blockNumber, function const& _f) +EthashAux::FullType EthashAux::full(uint64_t _blockNumber, function const& _f, bool _createIfMissing) { + (void)_createIfMissing; + // TODO: implement auto l = light(_blockNumber); h256 seedHash = EthashAux::seedHash(_blockNumber); FullType ret; @@ -195,7 +197,7 @@ unsigned EthashAux::computeFull(uint64_t _blockNumber) get()->m_generatingFullNumber = _blockNumber / ETHASH_EPOCH_LENGTH * ETHASH_EPOCH_LENGTH; get()->m_fullGenerator = unique_ptr(new thread([=](){ cnote << "Loading full DAG of" << _blockNumber; - get()->full(_blockNumber, [](unsigned p){ get()->m_fullProgress = p; return 0; }); + get()->full(_blockNumber, [](unsigned p){ get()->m_fullProgress = p; return 0; }), true; cnote << "Full DAG loaded"; get()->m_fullProgress = 0; get()->m_generatingFullNumber = NotGenerating; diff --git a/libethcore/EthashAux.h b/libethcore/EthashAux.h index f57f7a4d3..bc87f9dff 100644 --- a/libethcore/EthashAux.h +++ b/libethcore/EthashAux.h @@ -73,8 +73,9 @@ public: static unsigned computeFull(uint64_t _blockNumber); /// Information on the generation progress. static std::pair fullGeneratingProgress() { return std::make_pair(get()->m_generatingFullNumber, get()->m_fullProgress); } - /// Kicks off generation of DAG for @a _blocknumber and blocks until ready; @returns result. - static FullType full(uint64_t _blockNumber, std::function const& _f = std::function()); + + /// Kicks off generation of DAG for @a _blocknumber and blocks until ready; @returns result or empty pointer if not existing. + static FullType full(uint64_t _blockNumber, std::function const& _f = std::function(), bool _createIfMissing = false); static Ethash::Result eval(BlockInfo const& _header) { return eval(_header, _header.nonce); } static Ethash::Result eval(BlockInfo const& _header, Nonce const& _nonce); @@ -83,6 +84,8 @@ public: private: EthashAux() {} + /// Kicks off generation of DAG for @a _blocknumber and blocks until ready; @returns result. + void killCache(h256 const& _s); static EthashAux* s_this; diff --git a/libethereum/Executive.h b/libethereum/Executive.h index 8903fd464..3806221be 100644 --- a/libethereum/Executive.h +++ b/libethereum/Executive.h @@ -137,7 +137,7 @@ private: Transaction m_t; ///< The original transaction. Set by setup(). LogEntries m_logs; ///< The log entries created by this transaction. Set by finalize(). - bigint m_gasRequired; + bigint m_gasRequired; ///< Gas required during execution of the transaction. bigint m_gasCost; bigint m_totalCost; }; diff --git a/libethereum/TransactionQueue.cpp b/libethereum/TransactionQueue.cpp index 5aca67a29..11104705c 100644 --- a/libethereum/TransactionQueue.cpp +++ b/libethereum/TransactionQueue.cpp @@ -41,9 +41,14 @@ ImportResult TransactionQueue::import(bytesConstRef _transactionRLP, ImportCallb if (ir != ImportResult::Success) return ir; - Transaction t(_transactionRLP, CheckTransaction::Everything); - UpgradeGuard ul(l); - return manageImport_WITH_LOCK(h, t, _cb); + try { + Transaction t(_transactionRLP, CheckTransaction::Everything); + UpgradeGuard ul(l); + return manageImport_WITH_LOCK(h, t, _cb); + } + catch (...) { + return ImportResult::Malformed; + } } ImportResult TransactionQueue::check_WITH_LOCK(h256 const& _h, IfDropped _ik) diff --git a/mix/qml/DeploymentDialog.qml b/mix/qml/DeploymentDialog.qml index 1fbde3ac9..e2d15d487 100644 --- a/mix/qml/DeploymentDialog.qml +++ b/mix/qml/DeploymentDialog.qml @@ -300,8 +300,8 @@ Dialog { { Layout.preferredWidth: 350 id: registrarAddr - text: "ab69f864e49fc4294d18355c4bafb0b91b5e629b" - visible: false + text: "c6d9d2cd449a754c494264e1809c50e34d64562b" + } DefaultLabel From 4c69ecf16bc5f0a978d10d215a1aa76a52d8db38 Mon Sep 17 00:00:00 2001 From: chriseth Date: Fri, 15 May 2015 18:02:09 +0200 Subject: [PATCH 224/461] Bare callcode for addresses and contracts. --- libsolidity/ExpressionCompiler.cpp | 37 ++++++++++++++--------- libsolidity/ExpressionCompiler.h | 6 ++-- libsolidity/Types.cpp | 23 ++++++++++++-- libsolidity/Types.h | 37 +++++++++++++++++------ test/libsolidity/SolidityEndToEndTest.cpp | 31 +++++++++++++++++++ 5 files changed, 106 insertions(+), 28 deletions(-) diff --git a/libsolidity/ExpressionCompiler.cpp b/libsolidity/ExpressionCompiler.cpp index 76d05bd0a..838ee264e 100644 --- a/libsolidity/ExpressionCompiler.cpp +++ b/libsolidity/ExpressionCompiler.cpp @@ -458,9 +458,11 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall) break; } case Location::External: + case Location::CallCode: case Location::Bare: + case Location::BareCallCode: _functionCall.getExpression().accept(*this); - appendExternalFunctionCall(function, arguments, function.getLocation() == Location::Bare); + appendExternalFunctionCall(function, arguments); break; case Location::Creation: { @@ -527,13 +529,12 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall) TypePointers{}, strings(), strings(), - Location::External, + Location::Bare, false, true, true ), - {}, - true + {} ); break; case Location::Suicide: @@ -622,7 +623,7 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall) m_context << contractAddresses.find(function.getLocation())->second; for (unsigned i = function.getSizeOnStack(); i > 0; --i) m_context << eth::swapInstruction(i); - appendExternalFunctionCall(function, arguments, true); + appendExternalFunctionCall(function, arguments); break; } default: @@ -685,7 +686,7 @@ void ExpressionCompiler::endVisit(MemberAccess const& _memberAccess) IntegerType(0, IntegerType::Modifier::Address), true); m_context << eth::Instruction::BALANCE; } - else if (member == "send" || member.substr(0, min(member.size(), 4)) == "call") + else if ((set{"send", "call", "callcode"}).count(member)) appendTypeConversion(*_memberAccess.getExpression().getType(), IntegerType(0, IntegerType::Modifier::Address), true); else @@ -1031,9 +1032,10 @@ void ExpressionCompiler::appendHighBitsCleanup(IntegerType const& _typeOnStack) m_context << ((u256(1) << _typeOnStack.getNumBits()) - 1) << eth::Instruction::AND; } -void ExpressionCompiler::appendExternalFunctionCall(FunctionType const& _functionType, - vector> const& _arguments, - bool bare) +void ExpressionCompiler::appendExternalFunctionCall( + FunctionType const& _functionType, + vector> const& _arguments +) { solAssert(_functionType.takesArbitraryParameters() || _arguments.size() == _functionType.getParameterTypes().size(), ""); @@ -1047,7 +1049,7 @@ void ExpressionCompiler::appendExternalFunctionCall(FunctionType const& _functio unsigned gasValueSize = (_functionType.gasSet() ? 1 : 0) + (_functionType.valueSet() ? 1 : 0); - unsigned contractStackPos = m_context.currentToBaseStackOffset(1 + gasValueSize + (bare ? 0 : 1)); + unsigned contractStackPos = m_context.currentToBaseStackOffset(1 + gasValueSize + (_functionType.isBareCall() ? 0 : 1)); unsigned gasStackPos = m_context.currentToBaseStackOffset(gasValueSize); unsigned valueStackPos = m_context.currentToBaseStackOffset(1); @@ -1057,7 +1059,7 @@ void ExpressionCompiler::appendExternalFunctionCall(FunctionType const& _functio unsigned retSize = firstType ? firstType->getCalldataEncodedSize() : 0; m_context << u256(retSize) << u256(0); - if (bare) + if (_functionType.isBareCall()) m_context << u256(0); else { @@ -1074,7 +1076,8 @@ void ExpressionCompiler::appendExternalFunctionCall(FunctionType const& _functio _arguments, _functionType.getParameterTypes(), _functionType.padArguments(), - bare, + _functionType.getLocation() == FunctionType::Location::Bare || + _functionType.getLocation() == FunctionType::Location::BareCallCode, _functionType.takesArbitraryParameters() ); @@ -1093,14 +1096,20 @@ void ExpressionCompiler::appendExternalFunctionCall(FunctionType const& _functio // send all gas except the amount needed to execute "SUB" and "CALL" // @todo this retains too much gas for now, needs to be fine-tuned. m_context << u256(50 + (_functionType.valueSet() ? 9000 : 0) + 25000) << eth::Instruction::GAS << eth::Instruction::SUB; - m_context << eth::Instruction::CALL; + if ( + _functionType.getLocation() == FunctionType::Location::CallCode || + _functionType.getLocation() == FunctionType::Location::BareCallCode + ) + m_context << eth::Instruction::CALLCODE; + else + m_context << eth::Instruction::CALL; auto tag = m_context.appendConditionalJump(); m_context << eth::Instruction::STOP << tag; // STOP if CALL leaves 0. if (_functionType.valueSet()) m_context << eth::Instruction::POP; if (_functionType.gasSet()) m_context << eth::Instruction::POP; - if (!bare) + if (!_functionType.isBareCall()) m_context << eth::Instruction::POP; m_context << eth::Instruction::POP; // pop contract address diff --git a/libsolidity/ExpressionCompiler.h b/libsolidity/ExpressionCompiler.h index 45a2311ef..954e32c84 100644 --- a/libsolidity/ExpressionCompiler.h +++ b/libsolidity/ExpressionCompiler.h @@ -98,8 +98,10 @@ private: void appendHighBitsCleanup(IntegerType const& _typeOnStack); /// Appends code to call a function of the given type with the given arguments. - void appendExternalFunctionCall(FunctionType const& _functionType, std::vector> const& _arguments, - bool bare = false); + void appendExternalFunctionCall( + FunctionType const& _functionType, + std::vector> const& _arguments + ); /// Appends code that evaluates the given arguments and moves the result to memory encoded as /// specified by the ABI. The memory offset is expected to be on the stack and is updated by /// this call. If @a _padToWordBoundaries is set to false, all values are concatenated without diff --git a/libsolidity/Types.cpp b/libsolidity/Types.cpp index 7a5b309d9..d1f51decf 100644 --- a/libsolidity/Types.cpp +++ b/libsolidity/Types.cpp @@ -316,6 +316,7 @@ TypePointer IntegerType::binaryOperatorResult(Token::Value _operator, TypePointe const MemberList IntegerType::AddressMemberList({ {"balance", make_shared(256)}, {"call", make_shared(strings(), strings(), FunctionType::Location::Bare, true)}, + {"callcode", make_shared(strings(), strings(), FunctionType::Location::BareCallCode, true)}, {"send", make_shared(strings{"uint"}, strings{}, FunctionType::Location::Send)} }); @@ -1115,9 +1116,11 @@ unsigned FunctionType::getSizeOnStack() const } unsigned size = 0; - if (location == Location::External) + if (location == Location::External || location == Location::CallCode) size = 2; - else if (location == Location::Internal || location == Location::Bare) + else if (location == Location::Bare || location == Location::BareCallCode) + size = 1; + else if (location == Location::Internal) size = 1; if (m_gasSet) size++; @@ -1156,6 +1159,7 @@ MemberList const& FunctionType::getMembers() const case Location::SHA256: case Location::RIPEMD160: case Location::Bare: + case Location::BareCallCode: if (!m_members) { MemberList::MemberMap members{ @@ -1228,6 +1232,21 @@ bool FunctionType::hasEqualArgumentTypes(FunctionType const& _other) const ); } +bool FunctionType::isBareCall() const +{ + switch (m_location) + { + case Location::Bare: + case Location::BareCallCode: + case Location::ECRecover: + case Location::SHA256: + case Location::RIPEMD160: + return true; + default: + return false; + } +} + string FunctionType::externalSignature(std::string const& _name) const { std::string funcName = _name; diff --git a/libsolidity/Types.h b/libsolidity/Types.h index da2fcdb89..a69df964c 100644 --- a/libsolidity/Types.h +++ b/libsolidity/Types.h @@ -540,17 +540,32 @@ private: class FunctionType: public Type { public: - /// The meaning of the value(s) on the stack referencing the function: - /// INTERNAL: jump tag, EXTERNAL: contract address + function identifier, - /// BARE: contract address (non-abi contract call) - /// OTHERS: special virtual function, nothing on the stack + /// How this function is invoked on the EVM. /// @todo This documentation is outdated, and Location should rather be named "Type" - enum class Location { Internal, External, Creation, Send, - SHA3, Suicide, - ECRecover, SHA256, RIPEMD160, - Log0, Log1, Log2, Log3, Log4, Event, - SetGas, SetValue, BlockHash, - Bare }; + enum class Location + { + Internal, ///< stack-call using plain JUMP + External, ///< external call using CALL + CallCode, ///< extercnal call using CALLCODE, i.e. not exchanging the storage + Bare, ///< CALL without function hash + BareCallCode, ///< CALLCODE without function hash + Creation, ///< external call using CREATE + Send, ///< CALL, but without data and gas + SHA3, ///< SHA3 + Suicide, ///< SUICIDE + ECRecover, ///< CALL to special contract for ecrecover + SHA256, ///< CALL to special contract for sha256 + RIPEMD160, ///< CALL to special contract for ripemd160 + Log0, + Log1, + Log2, + Log3, + Log4, + Event, ///< syntactic sugar for LOG* + SetGas, ///< modify the default gas value for the function call + SetValue, ///< modify the default value transfer for the function call + BlockHash ///< BLOCKHASH + }; virtual Category getCategory() const override { return Category::Function; } @@ -620,6 +635,8 @@ public: /// @returns true if the types of parameters are equal (does't check return parameter types) bool hasEqualArgumentTypes(FunctionType const& _other) const; + /// @returns true if the ABI is used for this call (only meaningful for external calls) + bool isBareCall() const; Location const& getLocation() const { return m_location; } /// @returns the external signature of this function type given the function name /// If @a _name is not provided (empty string) then the @c m_declaration member of the diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index ed5f1acdf..6713382fa 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -2558,6 +2558,37 @@ BOOST_AUTO_TEST_CASE(generic_call) BOOST_CHECK_EQUAL(m_state.balance(m_contractAddress), 50 - 2); } +BOOST_AUTO_TEST_CASE(generic_callcode) +{ + char const* sourceCode = R"**( + contract receiver { + uint public received; + function receive(uint256 x) { received = x; } + } + contract sender { + uint public received; + function doSend(address rec) returns (uint d) + { + bytes4 signature = bytes4(bytes32(sha3("receive(uint256)"))); + rec.callcode.value(2)(signature, 23); + return receiver(rec).received(); + } + } + )**"; + compileAndRun(sourceCode, 0, "receiver"); + u160 const c_receiverAddress = m_contractAddress; + compileAndRun(sourceCode, 50, "sender"); + u160 const c_senderAddress = m_contractAddress; + BOOST_CHECK(callContractFunction("doSend(address)", c_receiverAddress) == encodeArgs(0)); + BOOST_CHECK(callContractFunction("received()") == encodeArgs(23)); + m_contractAddress = c_receiverAddress; + BOOST_CHECK(callContractFunction("received()") == encodeArgs(0)); + BOOST_CHECK(m_state.storage(c_receiverAddress).empty()); + BOOST_CHECK(!m_state.storage(c_senderAddress).empty()); + BOOST_CHECK_EQUAL(m_state.balance(c_receiverAddress), 0); + BOOST_CHECK_EQUAL(m_state.balance(c_senderAddress), 50); +} + BOOST_AUTO_TEST_CASE(store_bytes) { // this test just checks that the copy loop does not mess up the stack From 3145b5aa7d6bdcaf2aa14d2ed6e627af95e5458b Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Fri, 15 May 2015 09:48:58 +0200 Subject: [PATCH 225/461] Throw if ethash_XXX_new() fails --- libethcore/EthashAux.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libethcore/EthashAux.cpp b/libethcore/EthashAux.cpp index 9bb2c4aa9..59155610f 100644 --- a/libethcore/EthashAux.cpp +++ b/libethcore/EthashAux.cpp @@ -116,6 +116,8 @@ EthashAux::LightAllocation::LightAllocation(h256 const& _seedHash) { uint64_t blockNumber = EthashAux::number(_seedHash); light = ethash_light_new(blockNumber); + if (!light) + BOOST_THROW_EXCEPTION(ExternalFunctionFailure("ethash_light_new()")); size = ethash_get_cachesize(blockNumber); } @@ -132,6 +134,8 @@ bytesConstRef EthashAux::LightAllocation::data() const EthashAux::FullAllocation::FullAllocation(ethash_light_t _light, ethash_callback_t _cb) { full = ethash_full_new(_light, _cb); + if (!full) + BOOST_THROW_EXCEPTION(ExternalFunctionFailure("ethash_full_new()")); } EthashAux::FullAllocation::~FullAllocation() From ed83256798a760486cf0003b11894b078f122891 Mon Sep 17 00:00:00 2001 From: Lars Pensjo Date: Sat, 16 May 2015 23:13:45 +0200 Subject: [PATCH 226/461] Enable -G without --opencl-device Otherwise, -G doesn't work. --- eth/main.cpp | 3 +++ ethminer/main.cpp | 3 +++ 2 files changed, 6 insertions(+) diff --git a/eth/main.cpp b/eth/main.cpp index 1eed535cd..26305f4da 100644 --- a/eth/main.cpp +++ b/eth/main.cpp @@ -787,11 +787,14 @@ int main(int argc, char** argv) else if (arg == "-C" || arg == "--cpu") minerType = MinerType::CPU; else if (arg == "-G" || arg == "--opencl") + { minerType = MinerType::GPU; + miningThreads = 1; /*<< " -s,--import-secret Import a secret key into the key store and use as the default." << endl << " -S,--import-session-secret Import a secret key into the key store and use as the default for this session only." << endl << " --sign-key
Sign all transactions with the key of the given address." << endl << " --session-sign-key
Sign all transactions with the key of the given address for this session only." << endl*/ + } else if ((arg == "-s" || arg == "--import-secret") && i + 1 < argc) { Secret s(fromHex(argv[++i])); diff --git a/ethminer/main.cpp b/ethminer/main.cpp index 80895c975..c53fca481 100644 --- a/ethminer/main.cpp +++ b/ethminer/main.cpp @@ -398,7 +398,10 @@ int main(int argc, char** argv) else if (arg == "-C" || arg == "--cpu") minerType = MinerType::CPU; else if (arg == "-G" || arg == "--opencl") + { minerType = MinerType::GPU; + miningThreads = 1; + } else if ((arg == "-D" || arg == "--create-dag") && i + 1 < argc) { string m = boost::to_lower_copy(string(argv[++i])); From 462fa598435639777c6f099746d5b92956cf1d20 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Sun, 17 May 2015 13:00:48 +0200 Subject: [PATCH 227/461] Fix CPU mining. --- libethcore/Ethash.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libethcore/Ethash.cpp b/libethcore/Ethash.cpp index 64ffa9549..ff7fe47e7 100644 --- a/libethcore/Ethash.cpp +++ b/libethcore/Ethash.cpp @@ -134,7 +134,10 @@ void Ethash::CPUMiner::workLoop() WorkPackage w = work(); - auto dag = EthashAux::full(w.seedHash); + EthashAux::FullType dag; + while (!shouldStop() && !(dag = EthashAux::full(w.seedHash))) + this_thread::sleep_for(chrono::milliseconds(500)); + h256 boundary = w.boundary; unsigned hashCount = 1; for (; !shouldStop(); tryNonce++, hashCount++) From 51cb83bd084deaab038e6f328ff2af56a3a0bd16 Mon Sep 17 00:00:00 2001 From: subtly Date: Sun, 17 May 2015 14:38:09 +0200 Subject: [PATCH 228/461] GetFolderPathW needs wchar_t and can otherwise fail (returning an invalid path) and use AppData path instead of users home directory. Use Local AppData instead of roaming to users on domain networks aren't uploading DAG files to servers. --- libethash/io_win32.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libethash/io_win32.c b/libethash/io_win32.c index 2e6c8deb8..34f1aaa77 100644 --- a/libethash/io_win32.c +++ b/libethash/io_win32.c @@ -87,9 +87,9 @@ bool ethash_file_size(FILE* f, size_t* ret_size) bool ethash_get_default_dirname(char* strbuf, size_t buffsize) { - static const char dir_suffix[] = "Appdata\\Ethash\\"; + static const char dir_suffix[] = "Ethash\\"; strbuf[0] = '\0'; - if (!SUCCEEDED(SHGetFolderPathW(NULL, CSIDL_PROFILE, NULL, 0, (WCHAR*)strbuf))) { + if (!SUCCEEDED(SHGetFolderPathA(NULL, CSIDL_LOCAL_APPDATA, NULL, 0, (CHAR*)strbuf))) { return false; } if (!ethash_strncat(strbuf, buffsize, "\\", 1)) { From d4a4b6e2850a1df8247939119f3812477e1659b3 Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Sun, 17 May 2015 17:29:38 +0200 Subject: [PATCH 229/461] Using errno to detect ethash_io failures - Printf debug output is still printed by ethash itself unless one compiles with -DETHASH_NO_CRITICAL_OUTPUT. --- internal.c | 1 + io.c | 3 +++ io.h | 4 ++++ 3 files changed, 8 insertions(+) diff --git a/internal.c b/internal.c index ec2275f32..b28a59e43 100644 --- a/internal.c +++ b/internal.c @@ -364,6 +364,7 @@ static bool ethash_mmap(struct ethash_full* ret, FILE* f) { int fd; char* mmapped_data; + errno = 0; ret->file = f; if ((fd = ethash_fileno(ret->file)) == -1) { return false; diff --git a/io.c b/io.c index f53827ee0..f4db477c2 100644 --- a/io.c +++ b/io.c @@ -21,6 +21,7 @@ #include "io.h" #include #include +#include enum ethash_io_rc ethash_io_prepare( char const* dirname, @@ -32,6 +33,8 @@ enum ethash_io_rc ethash_io_prepare( { char mutable_name[DAG_MUTABLE_NAME_MAX_SIZE]; enum ethash_io_rc ret = ETHASH_IO_FAIL; + // reset errno before io calls + errno = 0; // assert directory exists if (!ethash_mkdir(dirname)) { diff --git a/io.h b/io.h index 58ec90a9e..da35eacba 100644 --- a/io.h +++ b/io.h @@ -59,6 +59,7 @@ enum ethash_io_rc { * figure out what kind of problem (I/O, memory e.t.c.) causes a NULL * ethash_full_t */ +#ifndef ETHASH_NO_CRITICAL_OUTPUT #define ETHASH_CRITICAL(...) \ do \ { \ @@ -66,6 +67,9 @@ enum ethash_io_rc { printf("\n"); \ fflush(stdout); \ } while (0) +#else +#define ETHASH_CRITICAL(...) +#endif /** * Prepares io for ethash From e7a0b94786f1493fa1176bf47551eec832990cac Mon Sep 17 00:00:00 2001 From: subtly Date: Sun, 17 May 2015 19:00:58 +0200 Subject: [PATCH 230/461] Trigger dag creation prior to mining until threading on windows is sorted. Delete miner when returning early from gpu miner doWork so that in the event that abort is called prior to miner initializing, miner is still initialized. --- ethminer/main.cpp | 5 +++-- libethcore/Ethash.cpp | 3 +++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ethminer/main.cpp b/ethminer/main.cpp index 97e125e65..bcb33915f 100644 --- a/ethminer/main.cpp +++ b/ethminer/main.cpp @@ -250,10 +250,11 @@ void doFarm(MinerType _m, string const& _remote, unsigned _recheckPeriod) cnote << "Getting work package..."; Json::Value v = rpc.eth_getWork(); h256 hh(v[0].asString()); - if (hh != current.headerHash) + h256 newSeedHash(v[1].asString()); + if (hh != current.headerHash && !!EthashAux::full(newSeedHash, true)) { current.headerHash = hh; - current.seedHash = h256(v[1].asString()); + current.seedHash = newSeedHash; current.boundary = h256(fromHex(v[2].asString()), h256::AlignRight); cnote << "Got work package:"; cnote << " Header-hash:" << current.headerHash.hex(); diff --git a/libethcore/Ethash.cpp b/libethcore/Ethash.cpp index ff7fe47e7..72c340f70 100644 --- a/libethcore/Ethash.cpp +++ b/libethcore/Ethash.cpp @@ -319,7 +319,10 @@ void Ethash::GPUMiner::workLoop() if ((dag = EthashAux::full(w.seedHash, false))) break; if (shouldStop()) + { + delete m_miner; return; + } cnote << "Awaiting DAG"; this_thread::sleep_for(chrono::milliseconds(500)); } From ac60b992c6838d795bf1eaa0f77caf4ba12663d0 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Sun, 17 May 2015 19:21:33 +0200 Subject: [PATCH 231/461] Parallelised BlockQueue. Setup for using TrieRoot. --- alethzero/Main.ui | 12 ++ alethzero/MainWin.cpp | 9 +- alethzero/MainWin.h | 1 + alethzero/OurWebThreeStubServer.cpp | 3 + .../TrieHash.cpp | 33 +++- .../libdevcrypto => libdevcrypto}/TrieHash.h | 15 ++ libethcore/BlockInfo.cpp | 34 +++- libethereum/BlockChain.cpp | 129 ++++++++------- libethereum/BlockChain.h | 3 +- libethereum/BlockQueue.cpp | 156 +++++++++++++++--- libethereum/BlockQueue.h | 34 +++- libethereum/ClientBase.cpp | 2 +- libethereum/State.cpp | 38 +++-- libethereum/TransactionQueue.cpp | 125 +++++++++----- libethereum/TransactionQueue.h | 11 +- test/libdevcrypto/trie.cpp | 2 +- 16 files changed, 443 insertions(+), 164 deletions(-) rename {test/libdevcrypto => libdevcrypto}/TrieHash.cpp (89%) rename {test/libdevcrypto => libdevcrypto}/TrieHash.h (66%) diff --git a/alethzero/Main.ui b/alethzero/Main.ui index e0852142a..b5e22409d 100644 --- a/alethzero/Main.ui +++ b/alethzero/Main.ui @@ -185,6 +185,7 @@ + @@ -1733,6 +1734,17 @@ font-size: 14pt Prepare Next &DAG + + + true + + + true + + + Co&nfirm Transactions + + diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index 9f630f37d..191db6eb4 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -212,7 +212,7 @@ Main::Main(QWidget *parent) : m_server->setIdentities(keysAsVector(owned())); m_server->StartListening(); - WebPage* webPage= new WebPage(this); + WebPage* webPage = new WebPage(this); m_webPage = webPage; connect(webPage, &WebPage::consoleMessage, [this](QString const& _msg) { Main::addConsoleMessage(_msg, QString()); }); ui->webView->setPage(m_webPage); @@ -368,6 +368,11 @@ Address Main::getCurrencies() const return abiOut
(ethereum()->call(c_newConfig, abiIn("lookup(uint256)", (u256)3)).output); } +bool Main::doConfirm() +{ + return ui->confirm->isChecked(); +} + void Main::installNameRegWatch() { uninstallWatch(m_nameRegFilter); @@ -1151,7 +1156,7 @@ void Main::refreshBlockCount() { auto d = ethereum()->blockChain().details(); BlockQueueStatus b = ethereum()->blockQueueStatus(); - ui->chainStatus->setText(QString("%3 ready %4 future %5 unknown %6 bad %1 #%2").arg(m_privateChain.size() ? "[" + m_privateChain + "] " : "testnet").arg(d.number).arg(b.ready).arg(b.future).arg(b.unknown).arg(b.bad)); + ui->chainStatus->setText(QString("%3 ready %4 verifying %5 unverified %6 future %7 unknown %8 bad %1 #%2").arg(m_privateChain.size() ? "[" + m_privateChain + "] " : "testnet").arg(d.number).arg(b.verified).arg(b.verifying).arg(b.unverified).arg(b.future).arg(b.unknown).arg(b.bad)); } void Main::on_turboMining_triggered() diff --git a/alethzero/MainWin.h b/alethzero/MainWin.h index d9075d178..9f2082dd0 100644 --- a/alethzero/MainWin.h +++ b/alethzero/MainWin.h @@ -94,6 +94,7 @@ public: dev::u256 gasPrice() const { return 10 * dev::eth::szabo; } dev::eth::KeyManager& keyManager() override { return m_keyManager; } + bool doConfirm(); dev::Secret retrieveSecret(dev::Address const& _a) const override; diff --git a/alethzero/OurWebThreeStubServer.cpp b/alethzero/OurWebThreeStubServer.cpp index d3ee4f41b..7e9836818 100644 --- a/alethzero/OurWebThreeStubServer.cpp +++ b/alethzero/OurWebThreeStubServer.cpp @@ -146,6 +146,9 @@ AddressHash OurAccountHolder::realAccounts() const bool OurAccountHolder::validateTransaction(TransactionSkeleton const& _t, bool _toProxy) { + if (!m_main->doConfirm()) + return true; + if (_t.creation) { // show notice concerning the creation code. TODO: this needs entering into natspec. diff --git a/test/libdevcrypto/TrieHash.cpp b/libdevcrypto/TrieHash.cpp similarity index 89% rename from test/libdevcrypto/TrieHash.cpp rename to libdevcrypto/TrieHash.cpp index ccf12c162..0b02ce77f 100644 --- a/test/libdevcrypto/TrieHash.cpp +++ b/libdevcrypto/TrieHash.cpp @@ -20,8 +20,8 @@ */ #include "TrieHash.h" - #include +#include // @TODO replace ASAP! #include #include using namespace std; @@ -197,4 +197,35 @@ h256 hash256(u256Map const& _s) return sha3(s.out()); } +/*h256 orderedTrieRoot(std::vector const& _data) +{ + StringMap m; + unsigned j = 0; + for (auto i: _data) + m[asString(rlp(j++))] = asString(i); + return hash256(m); +}*/ + +h256 orderedTrieRoot(std::vector const& _data) +{ + MemoryDB db; + GenericTrieDB t(&db); + t.init(); + unsigned j = 0; + for (auto i: _data) + t.insert(rlp(j++), i.toBytes()); + return t.root(); +} + +h256 orderedTrieRoot(std::vector const& _data) +{ + MemoryDB db; + GenericTrieDB t(&db); + t.init(); + unsigned j = 0; + for (auto i: _data) + t.insert(rlp(j++), i); + return t.root(); +} + } diff --git a/test/libdevcrypto/TrieHash.h b/libdevcrypto/TrieHash.h similarity index 66% rename from test/libdevcrypto/TrieHash.h rename to libdevcrypto/TrieHash.h index be1d84480..b0588fc38 100644 --- a/test/libdevcrypto/TrieHash.h +++ b/libdevcrypto/TrieHash.h @@ -31,4 +31,19 @@ bytes rlp256(StringMap const& _s); h256 hash256(StringMap const& _s); h256 hash256(u256Map const& _s); +/*h256 orderedTrieRoot(std::vector const& _data); + +template inline h256 trieRootOver(unsigned _itemCount, T const& _getKey, U const& _getValue) +{ + StringMap m; + for (unsigned i = 0; i < _itemCount; ++i) + m[asString(_getKey(i))] = asString(_getValue(i)); + return hash256(m); +}*/ + +using bytesMap = std::unordered_map; + +h256 orderedTrieRoot(std::vector const& _data); +h256 orderedTrieRoot(std::vector const& _data); + } diff --git a/libethcore/BlockInfo.cpp b/libethcore/BlockInfo.cpp index e70b16753..00a5108c4 100644 --- a/libethcore/BlockInfo.cpp +++ b/libethcore/BlockInfo.cpp @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include "EthashAux.h" @@ -173,6 +174,9 @@ void BlockInfo::populateFromHeader(RLP const& _header, Strictness _s, h256 const void BlockInfo::populate(bytesConstRef _block, Strictness _s, h256 const& _h) { RLP root(_block); + if (!root.isList()) + BOOST_THROW_EXCEPTION(InvalidBlockFormat() << errinfo_comment("block needs to be a list") << BadFieldError(0, _block.toString())); + RLP header = root[0]; if (!header.isList()) @@ -185,6 +189,8 @@ void BlockInfo::populate(bytesConstRef _block, Strictness _s, h256 const& _h) BOOST_THROW_EXCEPTION(InvalidBlockFormat() << errinfo_comment("block uncles need to be a list") << BadFieldError(2, root[2].data().toString())); } +struct BlockInfoDiagnosticsChannel: public LogChannel { static const char* name() { return EthBlue "▧" EthWhite " ◌"; } static const int verbosity = 9; }; + template h256 trieRootOver(unsigned _itemCount, T const& _getKey, U const& _getValue) { MemoryDB db; @@ -195,17 +201,41 @@ template h256 trieRootOver(unsigned _itemCount, T const& _get return t.root(); } -struct BlockInfoDiagnosticsChannel: public LogChannel { static const char* name() { return EthBlue "▧" EthWhite " ◌"; } static const int verbosity = 9; }; - void BlockInfo::verifyInternals(bytesConstRef _block) const { RLP root(_block); auto txList = root[1]; auto expectedRoot = trieRootOver(txList.itemCount(), [&](unsigned i){ return rlp(i); }, [&](unsigned i){ return txList[i].data(); }); + clog(BlockInfoDiagnosticsChannel) << "Expected trie root:" << toString(expectedRoot); if (transactionsRoot != expectedRoot) + { + MemoryDB tm; + GenericTrieDB transactionsTrie(&tm); + transactionsTrie.init(); + + vector txs; + + for (unsigned i = 0; i < txList.itemCount(); ++i) + { + RLPStream k; + k << i; + + transactionsTrie.insert(&k.out(), txList[i].data()); + + txs.push_back(txList[i].data()); + cdebug << toHex(k.out()) << toHex(txList[i].data()); + } + cdebug << "trieRootOver" << expectedRoot; + cdebug << "orderedTrieRoot" << orderedTrieRoot(txs); + cdebug << "TrieDB" << transactionsTrie.root(); + cdebug << "Contents:"; + for (auto const& t: txs) + cdebug << toHex(t); + BOOST_THROW_EXCEPTION(InvalidTransactionsHash() << HashMismatchError(expectedRoot, transactionsRoot)); + } clog(BlockInfoDiagnosticsChannel) << "Expected uncle hash:" << toString(sha3(root[2].data())); if (sha3Uncles != sha3(root[2].data())) BOOST_THROW_EXCEPTION(InvalidUnclesHash()); diff --git a/libethereum/BlockChain.cpp b/libethereum/BlockChain.cpp index da0e56247..cbde3f14e 100644 --- a/libethereum/BlockChain.cpp +++ b/libethereum/BlockChain.cpp @@ -199,7 +199,7 @@ void BlockChain::close() #define IGNORE_EXCEPTIONS(X) try { X; } catch (...) {} -void BlockChain::rebuild(std::string const& _path, std::function const& _progress) +void BlockChain::rebuild(std::string const& _path, std::function const& _progress, bool _prepPoW) { std::string path = _path.empty() ? Defaults::get()->m_dbPath : _path; @@ -252,7 +252,8 @@ void BlockChain::rebuild(std::string const& _path, std::function(h256(u256(d)), m_blockHashes, x_blockHashes, NullBlockHash, oldExtrasDB).value); BlockInfo bi(b); - ProofOfWork::prep(bi); + if (_prepPoW) + ProofOfWork::prep(bi); if (bi.parentHash != lastHash) { @@ -306,7 +307,7 @@ tuple BlockChain::sync(BlockQueue& _bq, OverlayDB const& _st { // _bq.tick(*this); - vector blocks; + vector> blocks; _bq.drain(blocks, _max); h256s fresh; @@ -316,7 +317,7 @@ tuple BlockChain::sync(BlockQueue& _bq, OverlayDB const& _st { try { - auto r = import(block, _stateDB); + auto r = import(block.first, block.second, _stateDB); fresh += r.first; dead += r.second; } @@ -325,14 +326,14 @@ tuple BlockChain::sync(BlockQueue& _bq, OverlayDB const& _st cwarn << "ODD: Import queue contains block with unknown parent." << LogTag::Error << boost::current_exception_diagnostic_information(); // NOTE: don't reimport since the queue should guarantee everything in the right order. // Can't continue - chain bad. - badBlocks.push_back(BlockInfo::headerHash(block)); + badBlocks.push_back(block.first.hash()); } catch (Exception const& _e) { cnote << "Exception while importing block. Someone (Jeff? That you?) seems to be giving us dodgy blocks!" << LogTag::Error << diagnostic_information(_e); // NOTE: don't reimport since the queue should guarantee everything in the right order. // Can't continue - chain bad. - badBlocks.push_back(BlockInfo::headerHash(block)); + badBlocks.push_back(block.first.hash()); } } return make_tuple(fresh, dead, _bq.doneDrain(badBlocks)); @@ -364,18 +365,6 @@ pair BlockChain::attemptImport(bytes const& _block, O ImportRoute BlockChain::import(bytes const& _block, OverlayDB const& _db, ImportRequirements::value _ir) { - //@tidy This is a behemoth of a method - could do to be split into a few smaller ones. - -#if ETH_TIMED_IMPORTS - boost::timer total; - double preliminaryChecks; - double enactment; - double collation; - double writing; - double checkBest; - boost::timer t; -#endif - // VERIFY: populates from the block and checks the block is internally coherent. BlockInfo bi; @@ -383,11 +372,6 @@ ImportRoute BlockChain::import(bytes const& _block, OverlayDB const& _db, Import try #endif { - RLP blockRLP(_block); - - if (!blockRLP.isList()) - BOOST_THROW_EXCEPTION(InvalidBlockFormat() << errinfo_comment("block header needs to be a list") << BadFieldError(0, blockRLP.data().toString())); - bi.populate(&_block); bi.verifyInternals(&_block); } @@ -400,29 +384,46 @@ ImportRoute BlockChain::import(bytes const& _block, OverlayDB const& _db, Import } #endif + return import(bi, _block, _db, _ir); +} + +ImportRoute BlockChain::import(BlockInfo const& _bi, bytes const& _block, OverlayDB const& _db, ImportRequirements::value _ir) +{ + //@tidy This is a behemoth of a method - could do to be split into a few smaller ones. + +#if ETH_TIMED_IMPORTS + boost::timer total; + double preliminaryChecks; + double enactment; + double collation; + double writing; + double checkBest; + boost::timer t; +#endif + // Check block doesn't already exist first! - if (isKnown(bi.hash()) && (_ir & ImportRequirements::DontHave)) + if (isKnown(_bi.hash()) && (_ir & ImportRequirements::DontHave)) { - clog(BlockChainNote) << bi.hash() << ": Not new."; + clog(BlockChainNote) << _bi.hash() << ": Not new."; BOOST_THROW_EXCEPTION(AlreadyHaveBlock()); } // Work out its number as the parent's number + 1 - if (!isKnown(bi.parentHash)) + if (!isKnown(_bi.parentHash)) { - clog(BlockChainNote) << bi.hash() << ": Unknown parent " << bi.parentHash; + clog(BlockChainNote) << _bi.hash() << ": Unknown parent " << _bi.parentHash; // We don't know the parent (yet) - discard for now. It'll get resent to us if we find out about its ancestry later on. BOOST_THROW_EXCEPTION(UnknownParent()); } - auto pd = details(bi.parentHash); + auto pd = details(_bi.parentHash); if (!pd) { auto pdata = pd.rlp(); clog(BlockChainDebug) << "Details is returning false despite block known:" << RLP(pdata); - auto parentBlock = block(bi.parentHash); - clog(BlockChainDebug) << "isKnown:" << isKnown(bi.parentHash); - clog(BlockChainDebug) << "last/number:" << m_lastBlockNumber << m_lastBlockHash << bi.number; + auto parentBlock = block(_bi.parentHash); + clog(BlockChainDebug) << "isKnown:" << isKnown(_bi.parentHash); + clog(BlockChainDebug) << "last/number:" << m_lastBlockNumber << m_lastBlockHash << _bi.number; clog(BlockChainDebug) << "Block:" << BlockInfo(parentBlock); clog(BlockChainDebug) << "RLP:" << RLP(parentBlock); clog(BlockChainDebug) << "DATABASE CORRUPTION: CRITICAL FAILURE"; @@ -430,14 +431,14 @@ ImportRoute BlockChain::import(bytes const& _block, OverlayDB const& _db, Import } // Check it's not crazy - if (bi.timestamp > (u256)time(0)) + if (_bi.timestamp > (u256)time(0)) { - clog(BlockChainChat) << bi.hash() << ": Future time " << bi.timestamp << " (now at " << time(0) << ")"; + clog(BlockChainChat) << _bi.hash() << ": Future time " << _bi.timestamp << " (now at " << time(0) << ")"; // Block has a timestamp in the future. This is no good. BOOST_THROW_EXCEPTION(FutureTime()); } - clog(BlockChainChat) << "Attempting import of " << bi.hash() << "..."; + clog(BlockChainChat) << "Attempting import of " << _bi.hash() << "..."; #if ETH_TIMED_IMPORTS preliminaryChecks = t.elapsed(); @@ -457,7 +458,7 @@ ImportRoute BlockChain::import(bytes const& _block, OverlayDB const& _db, Import // Check transactions are valid and that they result in a state equivalent to our state_root. // Get total difficulty increase and update state, checking it. State s(_db); - auto tdIncrease = s.enactOn(&_block, bi, *this, _ir); + auto tdIncrease = s.enactOn(&_block, _bi, *this, _ir); BlockLogBlooms blb; BlockReceipts br; @@ -493,22 +494,22 @@ ImportRoute BlockChain::import(bytes const& _block, OverlayDB const& _db, Import // together with an "ensureCachedWithUpdatableLock(l)" method. // This is safe in practice since the caches don't get flushed nearly often enough to be // done here. - details(bi.parentHash); + details(_bi.parentHash); DEV_WRITE_GUARDED(x_details) - m_details[bi.parentHash].children.push_back(bi.hash()); + m_details[_bi.parentHash].children.push_back(_bi.hash()); #if ETH_TIMED_IMPORTS || !ETH_TRUE collation = t.elapsed(); t.restart(); #endif - blocksBatch.Put(toSlice(bi.hash()), (ldb::Slice)ref(_block)); + blocksBatch.Put(toSlice(_bi.hash()), (ldb::Slice)ref(_block)); DEV_READ_GUARDED(x_details) - extrasBatch.Put(toSlice(bi.parentHash, ExtraDetails), (ldb::Slice)dev::ref(m_details[bi.parentHash].rlp())); + extrasBatch.Put(toSlice(_bi.parentHash, ExtraDetails), (ldb::Slice)dev::ref(m_details[_bi.parentHash].rlp())); - extrasBatch.Put(toSlice(bi.hash(), ExtraDetails), (ldb::Slice)dev::ref(BlockDetails((unsigned)pd.number + 1, td, bi.parentHash, {}).rlp())); - extrasBatch.Put(toSlice(bi.hash(), ExtraLogBlooms), (ldb::Slice)dev::ref(blb.rlp())); - extrasBatch.Put(toSlice(bi.hash(), ExtraReceipts), (ldb::Slice)dev::ref(br.rlp())); + extrasBatch.Put(toSlice(_bi.hash(), ExtraDetails), (ldb::Slice)dev::ref(BlockDetails((unsigned)pd.number + 1, td, _bi.parentHash, {}).rlp())); + extrasBatch.Put(toSlice(_bi.hash(), ExtraLogBlooms), (ldb::Slice)dev::ref(blb.rlp())); + extrasBatch.Put(toSlice(_bi.hash(), ExtraReceipts), (ldb::Slice)dev::ref(br.rlp())); #if ETH_TIMED_IMPORTS || !ETH_TRUE writing = t.elapsed(); @@ -526,20 +527,20 @@ ImportRoute BlockChain::import(bytes const& _block, OverlayDB const& _db, Import { clog(BlockChainWarn) << " Malformed block: " << diagnostic_information(_e); _e << errinfo_comment("Malformed block "); - clog(BlockChainWarn) << "Block: " << bi.hash(); - clog(BlockChainWarn) << bi; - clog(BlockChainWarn) << "Block parent: " << bi.parentHash; - clog(BlockChainWarn) << BlockInfo(block(bi.parentHash)); + clog(BlockChainWarn) << "Block: " << _bi.hash(); + clog(BlockChainWarn) << _bi; + clog(BlockChainWarn) << "Block parent: " << _bi.parentHash; + clog(BlockChainWarn) << BlockInfo(block(_bi.parentHash)); throw; } #endif StructuredLogger::chainReceivedNewBlock( - bi.headerHash(WithoutNonce).abridged(), - bi.nonce.abridged(), + _bi.headerHash(WithoutNonce).abridged(), + _bi.nonce.abridged(), currentHash().abridged(), "", // TODO: remote id ?? - bi.parentHash.abridged() + _bi.parentHash.abridged() ); // cnote << "Parent " << bi.parentHash << " has " << details(bi.parentHash).children.size() << " children."; @@ -552,8 +553,8 @@ ImportRoute BlockChain::import(bytes const& _block, OverlayDB const& _db, Import // don't include bi.hash() in treeRoute, since it's not yet in details DB... // just tack it on afterwards. unsigned commonIndex; - tie(route, common, commonIndex) = treeRoute(last, bi.parentHash); - route.push_back(bi.hash()); + tie(route, common, commonIndex) = treeRoute(last, _bi.parentHash); + route.push_back(_bi.hash()); // Most of the time these two will be equal - only when we're doing a chain revert will they not be if (common != last) @@ -565,8 +566,8 @@ ImportRoute BlockChain::import(bytes const& _block, OverlayDB const& _db, Import for (auto i = route.rbegin(); i != route.rend() && *i != common; ++i) { BlockInfo tbi; - if (*i == bi.hash()) - tbi = bi; + if (*i == _bi.hash()) + tbi = _bi; else tbi = BlockInfo(block(*i)); @@ -593,7 +594,7 @@ ImportRoute BlockChain::import(bytes const& _block, OverlayDB const& _db, Import h256s newTransactionAddresses; { bytes blockBytes; - RLP blockRLP(*i == bi.hash() ? _block : (blockBytes = block(*i))); + RLP blockRLP(*i == _bi.hash() ? _block : (blockBytes = block(*i))); TransactionAddress ta; ta.blockHash = tbi.hash(); for (ta.index = 0; ta.index < blockRLP[1].itemCount(); ++ta.index) @@ -609,17 +610,17 @@ ImportRoute BlockChain::import(bytes const& _block, OverlayDB const& _db, Import // FINALLY! change our best hash. { - newLastBlockHash = bi.hash(); - newLastBlockNumber = (unsigned)bi.number; + newLastBlockHash = _bi.hash(); + newLastBlockNumber = (unsigned)_bi.number; } - clog(BlockChainNote) << " Imported and best" << td << " (#" << bi.number << "). Has" << (details(bi.parentHash).children.size() - 1) << "siblings. Route:" << route; + clog(BlockChainNote) << " Imported and best" << td << " (#" << _bi.number << "). Has" << (details(_bi.parentHash).children.size() - 1) << "siblings. Route:" << route; StructuredLogger::chainNewHead( - bi.headerHash(WithoutNonce).abridged(), - bi.nonce.abridged(), + _bi.headerHash(WithoutNonce).abridged(), + _bi.nonce.abridged(), currentHash().abridged(), - bi.parentHash.abridged() + _bi.parentHash.abridged() ); } else @@ -630,21 +631,21 @@ ImportRoute BlockChain::import(bytes const& _block, OverlayDB const& _db, Import m_blocksDB->Write(m_writeOptions, &blocksBatch); m_extrasDB->Write(m_writeOptions, &extrasBatch); - if (isKnown(bi.hash()) && !details(bi.hash())) + if (isKnown(_bi.hash()) && !details(_bi.hash())) { clog(BlockChainDebug) << "Known block just inserted has no details."; - clog(BlockChainDebug) << "Block:" << bi; + clog(BlockChainDebug) << "Block:" << _bi; clog(BlockChainDebug) << "DATABASE CORRUPTION: CRITICAL FAILURE"; exit(-1); } try { - State canary(_db, *this, bi.hash(), ImportRequirements::DontHave); + State canary(_db, *this, _bi.hash(), ImportRequirements::DontHave); } catch (...) { clog(BlockChainDebug) << "Failed to initialise State object form imported block."; - clog(BlockChainDebug) << "Block:" << bi; + clog(BlockChainDebug) << "Block:" << _bi; clog(BlockChainDebug) << "DATABASE CORRUPTION: CRITICAL FAILURE"; exit(-1); } diff --git a/libethereum/BlockChain.h b/libethereum/BlockChain.h index 02f3f618a..a67ec9a9c 100644 --- a/libethereum/BlockChain.h +++ b/libethereum/BlockChain.h @@ -120,6 +120,7 @@ public: /// Import block into disk-backed DB /// @returns the block hashes of any blocks that came into/went out of the canonical block chain. ImportRoute import(bytes const& _block, OverlayDB const& _stateDB, ImportRequirements::value _ir = ImportRequirements::Default); + ImportRoute import(BlockInfo const& _bi, bytes const& _block, OverlayDB const& _stateDB, ImportRequirements::value _ir = ImportRequirements::Default); /// Returns true if the given block is known (though not necessarily a part of the canon chain). bool isKnown(h256 const& _hash) const; @@ -210,7 +211,7 @@ public: /// Run through database and verify all blocks by reevaluating. /// Will call _progress with the progress in this operation first param done, second total. - void rebuild(std::string const& _path, ProgressCallback const& _progress = std::function()); + void rebuild(std::string const& _path, ProgressCallback const& _progress = std::function(), bool _prepPoW = false); /** @returns a tuple of: * - an vector of hashes of all blocks between @a _from and @a _to, all blocks are ordered first by a number of diff --git a/libethereum/BlockQueue.cpp b/libethereum/BlockQueue.cpp index 43d2b4cb8..1632b2fa3 100644 --- a/libethereum/BlockQueue.cpp +++ b/libethereum/BlockQueue.cpp @@ -20,7 +20,7 @@ */ #include "BlockQueue.h" - +#include #include #include #include @@ -35,6 +35,106 @@ const char* BlockQueueChannel::name() { return EthOrange "[]>"; } const char* BlockQueueChannel::name() { return EthOrange "▣┅▶"; } #endif + +BlockQueue::BlockQueue() +{ + for (unsigned i = 0; i < thread::hardware_concurrency(); ++i) + m_verifiers.emplace_back([=](){ + setThreadName("verifier" + toString(i)); + this->verifierBody(); + }); +} + +BlockQueue::~BlockQueue() +{ + m_deleting = true; + m_moreToVerify.notify_all(); + for (auto& i: m_verifiers) + i.join(); +} + +void BlockQueue::verifierBody() +{ + while (!m_deleting) + { + std::pair work; + + { + unique_lock l(m_verification); + m_moreToVerify.wait(l, [&](){ return !m_unverified.empty() || m_deleting; }); + swap(work, m_unverified.front()); + m_unverified.pop_front(); + BlockInfo bi; + bi.mixHash = work.first; + m_verifying.push_back(make_pair(bi, bytes())); + cdebug << "Verifying" << bi.mixHash; + } + + std::pair res; + swap(work.second, res.second); + try { + res.first.populate(res.second, CheckEverything, work.first); + res.first.verifyInternals(&res.second); + } + catch (...) + { + // bad block. + { + // has to be this order as that's how invariants() assumes. + WriteGuard l2(m_lock); + unique_lock l(m_verification); + m_readySet.erase(work.first); + m_knownBad.insert(work.first); + } + + unique_lock l(m_verification); + for (auto it = m_verifying.begin(); it != m_verifying.end(); ++it) + if (it->first.mixHash == work.first) + { + cdebug << "Cancel verifying" << work.first; + m_verifying.erase(it); + goto OK1; + } + cwarn << "GAA BlockQueue corrupt: job cancelled but cannot be found in m_verifying queue."; + OK1:; + continue; + } + + bool ready = false; + { + unique_lock l(m_verification); + if (m_verifying.front().first.mixHash == work.first) + { + // we're next! + cdebug << "Verifyied" << work.first; + m_verifying.pop_front(); + m_verified.push_back(move(res)); + while (m_verifying.size() && !m_verifying.front().second.empty()) + { + cdebug << "Pre-verified" << m_verifying.front().first.hash(); + m_verified.push_back(move(m_verifying.front())); + m_verifying.pop_front(); + } + ready = true; + } + else + { + for (auto& i: m_verifying) + if (i.first.mixHash == work.first) + { + cdebug << "Delay-verified" << work.first << " (replacing with " << res << ")"; + i = move(res); + goto OK; + } + cwarn << "GAA BlockQueue corrupt: job finished but cannot be found in m_verifying queue."; + OK:; + } + } + if (ready) + m_onReady(); + } +} + ImportResult BlockQueue::import(bytesConstRef _block, BlockChain const& _bc, bool _isOurs) { // Check if we already know this block. @@ -110,11 +210,13 @@ ImportResult BlockQueue::import(bytesConstRef _block, BlockChain const& _bc, boo { // If valid, append to blocks. cblockq << "OK - ready for chain insertion."; - m_ready.push_back(make_pair(h, _block.toBytes())); + DEV_GUARDED(m_verification) + m_unverified.push_back(make_pair(h, _block.toBytes())); + m_moreToVerify.notify_one(); m_readySet.insert(h); noteReady_WITH_LOCK(h); - m_onReady(); + return ImportResult::Success; } } @@ -127,18 +229,19 @@ bool BlockQueue::doneDrain(h256s const& _bad) m_drainingSet.clear(); if (_bad.size()) { - vector> old; - swap(m_ready, old); + vector> old; + DEV_GUARDED(m_verification) + swap(m_verified, old); for (auto& b: old) { - BlockInfo bi(b.second); - if (m_knownBad.count(bi.parentHash)) + if (m_knownBad.count(b.first.parentHash)) { - m_knownBad.insert(b.first); - m_readySet.erase(b.first); + m_knownBad.insert(b.first.hash()); + m_readySet.erase(b.first.hash()); } else - m_ready.push_back(std::move(b)); + DEV_GUARDED(m_verification) + m_verified.push_back(std::move(b)); } } m_knownBad += _bad; @@ -197,62 +300,73 @@ QueueStatus BlockQueue::blockStatus(h256 const& _h) const QueueStatus::Unknown; } -void BlockQueue::drain(std::vector& o_out, unsigned _max) +void BlockQueue::drain(std::vector>& o_out, unsigned _max) { WriteGuard l(m_lock); DEV_INVARIANT_CHECK; if (m_drainingSet.empty()) { - o_out.resize(min(_max, m_ready.size())); - for (unsigned i = 0; i < o_out.size(); ++i) - swap(o_out[i], m_ready[i].second); - m_ready.erase(m_ready.begin(), advanced(m_ready.begin(), o_out.size())); + DEV_GUARDED(m_verification) + { + o_out.resize(min(_max, m_verified.size())); + for (unsigned i = 0; i < o_out.size(); ++i) + swap(o_out[i], m_verified[i]); + m_verified.erase(m_verified.begin(), advanced(m_verified.begin(), o_out.size())); + } for (auto const& bs: o_out) { // TODO: @optimise use map rather than vector & set. - auto h = BlockInfo::headerHash(bs); + auto h = bs.first.hash(); m_drainingSet.insert(h); m_readySet.erase(h); } -// swap(o_out, m_ready); -// swap(m_drainingSet, m_readySet); } } bool BlockQueue::invariants() const { - return m_readySet.size() == m_ready.size(); + Guard l(m_verification); + return m_readySet.size() == m_verified.size() + m_unverified.size() + m_verifying.size(); } void BlockQueue::noteReady_WITH_LOCK(h256 const& _good) { DEV_INVARIANT_CHECK; list goodQueue(1, _good); + bool notify = false; while (!goodQueue.empty()) { auto r = m_unknown.equal_range(goodQueue.front()); goodQueue.pop_front(); for (auto it = r.first; it != r.second; ++it) { - m_ready.push_back(it->second); + DEV_GUARDED(m_verification) + m_unverified.push_back(it->second); auto newReady = it->second.first; m_unknownSet.erase(newReady); m_readySet.insert(newReady); goodQueue.push_back(newReady); + notify = true; } m_unknown.erase(r.first, r.second); } + if (notify) + m_moreToVerify.notify_all(); } void BlockQueue::retryAllUnknown() { + WriteGuard l(m_lock); DEV_INVARIANT_CHECK; for (auto it = m_unknown.begin(); it != m_unknown.end(); ++it) { - m_ready.push_back(it->second); + DEV_GUARDED(m_verification) + m_unverified.push_back(it->second); auto newReady = it->second.first; m_unknownSet.erase(newReady); m_readySet.insert(newReady); + m_moreToVerify.notify_one(); } m_unknown.clear(); + m_moreToVerify.notify_all(); } diff --git a/libethereum/BlockQueue.h b/libethereum/BlockQueue.h index a4e44b390..ba515b409 100644 --- a/libethereum/BlockQueue.h +++ b/libethereum/BlockQueue.h @@ -21,12 +21,15 @@ #pragma once +#include +#include #include #include #include #include #include #include +#include namespace dev { @@ -41,7 +44,9 @@ struct BlockQueueChannel: public LogChannel { static const char* name(); static struct BlockQueueStatus { - size_t ready; + size_t verified; + size_t verifying; + size_t unverified; size_t future; size_t unknown; size_t bad; @@ -64,6 +69,9 @@ enum class QueueStatus class BlockQueue: HasInvariants { public: + BlockQueue(); + ~BlockQueue(); + /// Import a block into the queue. ImportResult import(bytesConstRef _tx, BlockChain const& _bc, bool _isOurs = false); @@ -72,7 +80,7 @@ public: /// Grabs at most @a _max of the blocks that are ready, giving them in the correct order for insertion into the chain. /// Don't forget to call doneDrain() once you're done importing. - void drain(std::vector& o_out, unsigned _max); + void drain(std::vector>& o_out, unsigned _max); /// Must be called after a drain() call. Notes that the drained blocks have been imported into the blockchain, so we can forget about them. /// @returns true iff there are additional blocks ready to be processed. @@ -85,16 +93,16 @@ public: void retryAllUnknown(); /// Get information on the items queued. - std::pair items() const { ReadGuard l(m_lock); return std::make_pair(m_ready.size(), m_unknown.size()); } + std::pair items() const { ReadGuard l(m_lock); return std::make_pair(m_verified.size(), m_unknown.size()); } /// Clear everything. - void clear() { WriteGuard l(m_lock); DEV_INVARIANT_CHECK; m_readySet.clear(); m_drainingSet.clear(); m_ready.clear(); m_unknownSet.clear(); m_unknown.clear(); m_future.clear(); } + void clear() { WriteGuard l(m_lock); DEV_INVARIANT_CHECK; Guard l2(m_verification); m_readySet.clear(); m_drainingSet.clear(); m_verified.clear(); m_unverified.clear(); m_unknownSet.clear(); m_unknown.clear(); m_future.clear(); } /// Return first block with an unknown parent. h256 firstUnknown() const { ReadGuard l(m_lock); return m_unknownSet.size() ? *m_unknownSet.begin() : h256(); } /// Get some infomration on the current status. - BlockQueueStatus status() const { ReadGuard l(m_lock); return BlockQueueStatus{m_ready.size(), m_future.size(), m_unknown.size(), m_knownBad.size()}; } + BlockQueueStatus status() const { ReadGuard l(m_lock); Guard l2(m_verification); return BlockQueueStatus{m_verified.size(), m_verifying.size(), m_unverified.size(), m_future.size(), m_unknown.size(), m_knownBad.size()}; } /// Get some infomration on the given block's status regarding us. QueueStatus blockStatus(h256 const& _h) const; @@ -106,15 +114,25 @@ private: bool invariants() const override; - mutable boost::shared_mutex m_lock; ///< General lock. + void verifierBody(); + + mutable boost::shared_mutex m_lock; ///< General lock for the sets, m_future and m_unknown. h256Hash m_drainingSet; ///< All blocks being imported. - h256Hash m_readySet; ///< All blocks ready for chain-import. - std::vector> m_ready; ///< List of blocks, in correct order, ready for chain-import. + h256Hash m_readySet; ///< All blocks ready for chain import. h256Hash m_unknownSet; ///< Set of all blocks whose parents are not ready/in-chain. std::unordered_multimap> m_unknown; ///< For blocks that have an unknown parent; we map their parent hash to the block stuff, and insert once the block appears. h256Hash m_knownBad; ///< Set of blocks that we know will never be valid. std::multimap> m_future; ///< Set of blocks that are not yet valid. Ordered by timestamp Signal m_onReady; ///< Called when a subsequent call to import blocks will return a non-empty container. Be nice and exit fast. + + mutable Mutex m_verification; ///< Mutex that allows writing to m_verified, m_verifying and m_unverified. + std::condition_variable m_moreToVerify; ///< Signaled when m_unverified has a new entry. + std::vector> m_verified; ///< List of blocks, in correct order, verified and ready for chain-import. + std::deque> m_verifying; ///< List of blocks being verified; as long as the second component (bytes) is empty, it's not finished. + std::deque> m_unverified; ///< List of blocks, in correct order, ready for verification. + + std::vector m_verifiers; ///< Threads who only verify. + bool m_deleting = false; ///< Exit condition for verifiers. }; } diff --git a/libethereum/ClientBase.cpp b/libethereum/ClientBase.cpp index cfa271cf6..8dc666bb5 100644 --- a/libethereum/ClientBase.cpp +++ b/libethereum/ClientBase.cpp @@ -57,7 +57,7 @@ void ClientBase::submitTransaction(Secret _secret, u256 _value, Address _dest, b m_tq.import(t.rlp()); StructuredLogger::transactionReceived(t.sha3().abridged(), t.sender().abridged()); - cnote << "New transaction " << t; + cnote << "New transaction " << t << "(maxNonce for sender" << a << "is" << m_tq.maxNonce(a) << ")"; } Address ClientBase::submitTransaction(Secret _secret, u256 _endowment, bytes const& _init, u256 _gas, u256 _gasPrice) diff --git a/libethereum/State.cpp b/libethereum/State.cpp index 654dca8d7..b9e548ea3 100644 --- a/libethereum/State.cpp +++ b/libethereum/State.cpp @@ -29,6 +29,7 @@ #include #include #include +#include #include #include #include @@ -516,10 +517,10 @@ pair State::sync(BlockChain const& _bc, TransactionQu cnote << i.first << "Dropping old transaction (nonce too low)"; _tq.drop(i.first); } - else if (got > req + 25) + else if (got > req + _tq.waiting(i.second.sender())) { // too new - cnote << i.first << "Dropping new transaction (> 25 nonces ahead)"; + cnote << i.first << "Dropping new transaction (too many nonces ahead)"; _tq.drop(i.first); } else @@ -534,7 +535,12 @@ pair State::sync(BlockChain const& _bc, TransactionQu _tq.drop(i.first); } else - _tq.setFuture(i); + { + // Temporarily no gas left in current block. + // OPTIMISE: could note this and then we don't evaluate until a block that does have the gas left. + // for now, just leave alone. +// _tq.setFuture(i); + } } catch (Exception const& _e) { @@ -592,34 +598,33 @@ u256 State::enact(bytesConstRef _block, BlockChain const& _bc, ImportRequirement LastHashes lh = _bc.lastHashes((unsigned)m_previousBlock.number); RLP rlp(_block); + vector receipts; + // All ok with the block generally. Play back the transactions now... unsigned i = 0; for (auto const& tr: rlp[1]) { - RLPStream k; - k << i; - - transactionsTrie.insert(&k.out(), tr.data()); execute(lh, Transaction(tr.data(), CheckTransaction::Everything)); - - RLPStream receiptrlp; - m_receipts.back().streamRLP(receiptrlp); - receiptsTrie.insert(&k.out(), &receiptrlp.out()); + RLPStream receiptRLP; + m_receipts.back().streamRLP(receiptRLP); + receipts.push_back(receiptRLP.out()); ++i; } - if (receiptsTrie.root() != m_currentBlock.receiptsRoot) + auto receiptsRoot = orderedTrieRoot(receipts); + + if (receiptsRoot != m_currentBlock.receiptsRoot) { cwarn << "Bad receipts state root."; - cwarn << "Expected: " << toString(receiptsTrie.root()) << " received: " << toString(m_currentBlock.receiptsRoot); + cwarn << "Expected: " << toString(receiptsRoot) << " received: " << toString(m_currentBlock.receiptsRoot); cwarn << "Block:" << toHex(_block); cwarn << "Block RLP:" << rlp; - cwarn << "Calculated: " << receiptsTrie.root(); + cwarn << "Calculated: " << receiptsRoot; for (unsigned j = 0; j < i; ++j) { RLPStream k; k << j; - auto b = asBytes(receiptsTrie.at(&k.out())); + auto b = receipts[j]; cwarn << j << ": "; cwarn << "RLP: " << RLP(b); cwarn << "Hex: " << toHex(b); @@ -835,6 +840,9 @@ void State::commitToMine(BlockChain const& _bc) } } + // TODO: move over to using TrieHash + + MemoryDB tm; GenericTrieDB transactionsTrie(&tm); transactionsTrie.init(); diff --git a/libethereum/TransactionQueue.cpp b/libethereum/TransactionQueue.cpp index 11104705c..76c486d50 100644 --- a/libethereum/TransactionQueue.cpp +++ b/libethereum/TransactionQueue.cpp @@ -35,20 +35,26 @@ ImportResult TransactionQueue::import(bytesConstRef _transactionRLP, ImportCallb // Check if we already know this transaction. h256 h = sha3(_transactionRLP); + Transaction t; + ImportResult ir; + { UpgradableGuard l(m_lock); - auto ir = check_WITH_LOCK(h, _ik); + ir = check_WITH_LOCK(h, _ik); if (ir != ImportResult::Success) return ir; try { - Transaction t(_transactionRLP, CheckTransaction::Everything); + t = Transaction(_transactionRLP, CheckTransaction::Everything); UpgradeGuard ul(l); - return manageImport_WITH_LOCK(h, t, _cb); + ir = manageImport_WITH_LOCK(h, t, _cb); } catch (...) { return ImportResult::Malformed; } + } +// cdebug << "import-END: Nonce of" << t.sender() << "now" << maxNonce(t.sender()); + return ir; } ImportResult TransactionQueue::check_WITH_LOCK(h256 const& _h, IfDropped _ik) @@ -67,15 +73,23 @@ ImportResult TransactionQueue::import(Transaction const& _transaction, ImportCal // Check if we already know this transaction. h256 h = _transaction.sha3(WithSignature); - UpgradableGuard l(m_lock); - // TODO: keep old transactions around and check in State for nonce validity +// cdebug << "import-BEGIN: Nonce of sender" << maxNonce(_transaction.sender()); + ImportResult ret; + { + UpgradableGuard l(m_lock); + // TODO: keep old transactions around and check in State for nonce validity - auto ir = check_WITH_LOCK(h, _ik); - if (ir != ImportResult::Success) - return ir; + auto ir = check_WITH_LOCK(h, _ik); + if (ir != ImportResult::Success) + return ir; - UpgradeGuard ul(l); - return manageImport_WITH_LOCK(h, _transaction, _cb); + { + UpgradeGuard ul(l); + ret = manageImport_WITH_LOCK(h, _transaction, _cb); + } + } +// cdebug << "import-END: Nonce of" << _transaction.sender() << "now" << maxNonce(_transaction.sender()); + return ret; } ImportResult TransactionQueue::manageImport_WITH_LOCK(h256 const& _h, Transaction const& _transaction, ImportCallback const& _cb) @@ -110,62 +124,95 @@ ImportResult TransactionQueue::manageImport_WITH_LOCK(h256 const& _h, Transactio u256 TransactionQueue::maxNonce(Address const& _a) const { - cdebug << "txQ::maxNonce" << _a; +// cdebug << "txQ::maxNonce" << _a; ReadGuard l(m_lock); u256 ret = 0; auto r = m_senders.equal_range(_a); for (auto it = r.first; it != r.second; ++it) - { - cdebug << it->first << "1+" << m_current.at(it->second).nonce(); - DEV_IGNORE_EXCEPTIONS(ret = max(ret, m_current.at(it->second).nonce() + 1)); - } + if (m_current.count(it->second)) + { +// cdebug << it->first << "1+" << m_current.at(it->second).nonce(); + ret = max(ret, m_current.at(it->second).nonce() + 1); + } + else if (m_future.count(it->second)) + { +// cdebug << it->first << "1+" << m_future.at(it->second).nonce(); + ret = max(ret, m_future.at(it->second).nonce() + 1); + } + else + { + cwarn << "ERRROR!!!!! m_senders references non-current transaction"; + cwarn << "Sender" << it->first << "has transaction" << it->second; + cwarn << "Count of m_current for" << it->second << "is" << m_current.count(it->second); + } return ret; } void TransactionQueue::insertCurrent_WITH_LOCK(std::pair const& _p) { - cdebug << "txQ::insertCurrent" << _p.first << _p.second.sender() << _p.second.nonce(); +// cdebug << "txQ::insertCurrent" << _p.first << _p.second.sender() << _p.second.nonce(); m_senders.insert(make_pair(_p.second.sender(), _p.first)); + if (m_current.count(_p.first)) + cwarn << "Transaction hash" << _p.first << "already in current?!"; m_current.insert(_p); } -bool TransactionQueue::removeCurrent_WITH_LOCK(h256 const& _txHash) +bool TransactionQueue::remove_WITH_LOCK(h256 const& _txHash) { - cdebug << "txQ::removeCurrent" << _txHash; - if (m_current.count(_txHash)) +// cdebug << "txQ::remove" << _txHash; + for (std::unordered_map* pool: { &m_current, &m_future }) { - auto r = m_senders.equal_range(m_current[_txHash].sender()); - for (auto it = r.first; it != r.second; ++it) - if (it->second == _txHash) - { - cdebug << "=> sender" << it->first; - m_senders.erase(it); - break; - } - cdebug << "=> nonce" << m_current[_txHash].nonce(); - m_current.erase(_txHash); - return true; + auto pit = pool->find(_txHash); + if (pit != pool->end()) + { + auto r = m_senders.equal_range(pit->second.sender()); + for (auto i = r.first; i != r.second; ++i) + if (i->second == _txHash) + { + m_senders.erase(i); + break; + } + cdebug << "=> nonce" << pit->second.nonce(); + pool->erase(pit); + return true; + } } return false; } +unsigned TransactionQueue::waiting(Address const& _a) const +{ + auto it = m_senders.equal_range(_a); + unsigned ret = 0; + for (auto i = it.first; i != it.second; ++i, ++ret) {} + return ret; +} + void TransactionQueue::setFuture(std::pair const& _t) { +// cdebug << "txQ::setFuture" << _t.first; WriteGuard l(m_lock); if (m_current.count(_t.first)) { - m_unknown.insert(make_pair(_t.second.sender(), _t)); + m_future.insert(_t); m_current.erase(_t.first); } } void TransactionQueue::noteGood(std::pair const& _t) { +// cdebug << "txQ::noteGood" << _t.first; WriteGuard l(m_lock); - auto r = m_unknown.equal_range(_t.second.sender()); + auto r = m_senders.equal_range(_t.second.sender()); for (auto it = r.first; it != r.second; ++it) - m_current.insert(it->second); - m_unknown.erase(r.first, r.second); + { + auto fit = m_future.find(it->second); + if (fit != m_future.end()) + { + m_current.insert(*fit); + m_future.erase(fit); + } + } } void TransactionQueue::drop(h256 const& _txHash) @@ -179,13 +226,5 @@ void TransactionQueue::drop(h256 const& _txHash) m_dropped.insert(_txHash); m_known.erase(_txHash); - if (!removeCurrent_WITH_LOCK(_txHash)) - { - for (auto i = m_unknown.begin(); i != m_unknown.end(); ++i) - if (i->second.first == _txHash) - { - m_unknown.erase(i); - break; - } - } + remove_WITH_LOCK(_txHash); } diff --git a/libethereum/TransactionQueue.h b/libethereum/TransactionQueue.h index 50fcea574..e91a12360 100644 --- a/libethereum/TransactionQueue.h +++ b/libethereum/TransactionQueue.h @@ -55,14 +55,15 @@ public: void drop(h256 const& _txHash); + unsigned waiting(Address const& _a) const; std::unordered_map transactions() const { ReadGuard l(m_lock); return m_current; } - std::pair items() const { ReadGuard l(m_lock); return std::make_pair(m_current.size(), m_unknown.size()); } + std::pair items() const { ReadGuard l(m_lock); return std::make_pair(m_current.size(), m_future.size()); } u256 maxNonce(Address const& _a) const; void setFuture(std::pair const& _t); void noteGood(std::pair const& _t); - void clear() { WriteGuard l(m_lock); m_known.clear(); m_current.clear(); m_unknown.clear(); } + void clear() { WriteGuard l(m_lock); m_senders.clear(); m_known.clear(); m_current.clear(); m_future.clear(); } template Handler onReady(T const& _t) { return m_onReady.add(_t); } private: @@ -70,15 +71,15 @@ private: ImportResult manageImport_WITH_LOCK(h256 const& _h, Transaction const& _transaction, ImportCallback const& _cb); void insertCurrent_WITH_LOCK(std::pair const& _p); - bool removeCurrent_WITH_LOCK(h256 const& _txHash); + bool remove_WITH_LOCK(h256 const& _txHash); mutable SharedMutex m_lock; ///< General lock. h256Hash m_known; ///< Hashes of transactions in both sets. + std::unordered_multimap m_senders; ///< Mapping from the sender address to the transaction hash; useful for determining the nonce of a given sender. std::unordered_map m_current; ///< Map of SHA3(tx) to tx. - std::unordered_multimap> m_unknown; ///< For transactions that have a future nonce; we map their sender address to the tx stuff, and insert once the sender has a valid TX. + std::unordered_map m_future; ///< For transactions that have a future nonce; we re-insert into current once the sender has a valid TX. std::unordered_map> m_callbacks; ///< Called once. h256Hash m_dropped; ///< Transactions that have previously been dropped. - std::multimap m_senders; ///< Mapping from the sender address to the transaction hash; useful for determining the nonce of a given sender. Signal m_onReady; ///< Called when a subsequent call to import transactions will return a non-empty container. Be nice and exit fast. }; diff --git a/test/libdevcrypto/trie.cpp b/test/libdevcrypto/trie.cpp index d41739a01..c53617772 100644 --- a/test/libdevcrypto/trie.cpp +++ b/test/libdevcrypto/trie.cpp @@ -28,7 +28,7 @@ #include "../JsonSpiritHeaders.h" #include #include -#include "TrieHash.h" +#include #include "MemTrie.h" #include "../TestHelper.h" From b0dba6b5599214550ec553aeaf11bf0ce6121772 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Sun, 17 May 2015 21:23:31 +0200 Subject: [PATCH 232/461] Version bump push all valid "ready" transactions to the network asap. --- libdevcore/Common.cpp | 2 +- libethereum/BlockQueue.cpp | 7 ++----- libethereum/TransactionQueue.cpp | 10 ++++++++++ libethereum/TransactionQueue.h | 2 +- 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/libdevcore/Common.cpp b/libdevcore/Common.cpp index 1ffa66f14..7171c4a2b 100644 --- a/libdevcore/Common.cpp +++ b/libdevcore/Common.cpp @@ -28,7 +28,7 @@ using namespace dev; namespace dev { -char const* Version = "0.9.21"; +char const* Version = "0.9.22"; const u256 UndefinedU256 = ~(u256)0; diff --git a/libethereum/BlockQueue.cpp b/libethereum/BlockQueue.cpp index 1632b2fa3..43a3d1caf 100644 --- a/libethereum/BlockQueue.cpp +++ b/libethereum/BlockQueue.cpp @@ -62,12 +62,13 @@ void BlockQueue::verifierBody() { unique_lock l(m_verification); m_moreToVerify.wait(l, [&](){ return !m_unverified.empty() || m_deleting; }); + if (m_deleting) + return; swap(work, m_unverified.front()); m_unverified.pop_front(); BlockInfo bi; bi.mixHash = work.first; m_verifying.push_back(make_pair(bi, bytes())); - cdebug << "Verifying" << bi.mixHash; } std::pair res; @@ -91,7 +92,6 @@ void BlockQueue::verifierBody() for (auto it = m_verifying.begin(); it != m_verifying.end(); ++it) if (it->first.mixHash == work.first) { - cdebug << "Cancel verifying" << work.first; m_verifying.erase(it); goto OK1; } @@ -106,12 +106,10 @@ void BlockQueue::verifierBody() if (m_verifying.front().first.mixHash == work.first) { // we're next! - cdebug << "Verifyied" << work.first; m_verifying.pop_front(); m_verified.push_back(move(res)); while (m_verifying.size() && !m_verifying.front().second.empty()) { - cdebug << "Pre-verified" << m_verifying.front().first.hash(); m_verified.push_back(move(m_verifying.front())); m_verifying.pop_front(); } @@ -122,7 +120,6 @@ void BlockQueue::verifierBody() for (auto& i: m_verifying) if (i.first.mixHash == work.first) { - cdebug << "Delay-verified" << work.first << " (replacing with " << res << ")"; i = move(res); goto OK; } diff --git a/libethereum/TransactionQueue.cpp b/libethereum/TransactionQueue.cpp index 76c486d50..40a149ebf 100644 --- a/libethereum/TransactionQueue.cpp +++ b/libethereum/TransactionQueue.cpp @@ -92,6 +92,16 @@ ImportResult TransactionQueue::import(Transaction const& _transaction, ImportCal return ret; } +std::unordered_map TransactionQueue::transactions() const +{ + ReadGuard l(m_lock); + auto ret = m_current; + for (auto const& i: m_future) + if (i.second.nonce() < maxNonce(i.second.sender())) + ret.insert(i); + return ret; +} + ImportResult TransactionQueue::manageImport_WITH_LOCK(h256 const& _h, Transaction const& _transaction, ImportCallback const& _cb) { try diff --git a/libethereum/TransactionQueue.h b/libethereum/TransactionQueue.h index e91a12360..6036caa83 100644 --- a/libethereum/TransactionQueue.h +++ b/libethereum/TransactionQueue.h @@ -56,7 +56,7 @@ public: void drop(h256 const& _txHash); unsigned waiting(Address const& _a) const; - std::unordered_map transactions() const { ReadGuard l(m_lock); return m_current; } + std::unordered_map transactions() const; std::pair items() const { ReadGuard l(m_lock); return std::make_pair(m_current.size(), m_future.size()); } u256 maxNonce(Address const& _a) const; From 3c410cf00883b38efe188e38af9bbc783197951a Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Sun, 17 May 2015 21:45:51 +0200 Subject: [PATCH 233/461] Lockup fix. --- libethereum/TransactionQueue.cpp | 7 ++++++- libethereum/TransactionQueue.h | 1 + libp2p/Host.cpp | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/libethereum/TransactionQueue.cpp b/libethereum/TransactionQueue.cpp index 40a149ebf..785e16c2d 100644 --- a/libethereum/TransactionQueue.cpp +++ b/libethereum/TransactionQueue.cpp @@ -97,7 +97,7 @@ std::unordered_map TransactionQueue::transactions() const ReadGuard l(m_lock); auto ret = m_current; for (auto const& i: m_future) - if (i.second.nonce() < maxNonce(i.second.sender())) + if (i.second.nonce() < maxNonce_WITH_LOCK(i.second.sender())) ret.insert(i); return ret; } @@ -136,6 +136,11 @@ u256 TransactionQueue::maxNonce(Address const& _a) const { // cdebug << "txQ::maxNonce" << _a; ReadGuard l(m_lock); + return maxNonce_WITH_LOCK(_a); +} + +u256 TransactionQueue::maxNonce_WITH_LOCK(Address const& _a) const +{ u256 ret = 0; auto r = m_senders.equal_range(_a); for (auto it = r.first; it != r.second; ++it) diff --git a/libethereum/TransactionQueue.h b/libethereum/TransactionQueue.h index 6036caa83..a07efb848 100644 --- a/libethereum/TransactionQueue.h +++ b/libethereum/TransactionQueue.h @@ -72,6 +72,7 @@ private: void insertCurrent_WITH_LOCK(std::pair const& _p); bool remove_WITH_LOCK(h256 const& _txHash); + u256 maxNonce_WITH_LOCK(Address const& _a) const; mutable SharedMutex m_lock; ///< General lock. h256Hash m_known; ///< Hashes of transactions in both sets. diff --git a/libp2p/Host.cpp b/libp2p/Host.cpp index 2f139fd3d..9c3e629d4 100644 --- a/libp2p/Host.cpp +++ b/libp2p/Host.cpp @@ -392,7 +392,7 @@ string Host::pocHost() std::unordered_map const& Host::pocHosts() { static const std::unordered_map c_ret = { -// { Public(""), "poc-9.ethdev.com:30303" }, + { Public("487611428e6c99a11a9795a6abe7b529e81315ca6aad66e2a2fc76e3adf263faba0d35466c2f8f68d561dbefa8878d4df5f1f2ddb1fbeab7f42ffb8cd328bd4a"), "poc-9.ethdev.com:30303" }, { Public("a979fb575495b8d6db44f750317d0f4622bf4c2aa3365d6af7c284339968eef29b69ad0dce72a4d8db5ebb4968de0e3bec910127f134779fbcb0cb6d3331163c"), "52.16.188.185:30303" }, { Public("7f25d3eab333a6b98a8b5ed68d962bb22c876ffcd5561fca54e3c2ef27f754df6f7fd7c9b74cc919067abac154fb8e1f8385505954f161ae440abc355855e034"), "54.207.93.166:30303" } }; From 83a0b937971d22f0cb828f793a95919735c8fe2d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Sun, 17 May 2015 23:03:39 +0200 Subject: [PATCH 234/461] Little improved base64 implementation. Global variable type changed from dynamic constructed std::string to constant char array. Truncating conversion eliminated (no MSVC warning). Unit tests added. --- libdevcore/Base64.cpp | 23 +++++++++++++---------- libdevcore/Base64.h | 1 - test/libdevcrypto/hexPrefix.cpp | 27 +++++++++++++++++++++++++++ 3 files changed, 40 insertions(+), 11 deletions(-) diff --git a/libdevcore/Base64.cpp b/libdevcore/Base64.cpp index 684556cd5..cb6e873df 100644 --- a/libdevcore/Base64.cpp +++ b/libdevcore/Base64.cpp @@ -27,11 +27,9 @@ /// Originally by René Nyffenegger, modified by some other guy and then devified by Gav Wood. #include "Base64.h" -#include -using namespace std; using namespace dev; -static const std::string base64_chars = +static const char base64_chars[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ" "abcdefghijklmnopqrstuvwxyz" "0123456789+/"; @@ -40,6 +38,11 @@ static inline bool is_base64(byte c) { return (isalnum(c) || (c == '+') || (c == '/')); } +static inline byte find_base64_char_index(byte c) { + auto it = std::find(base64_chars, base64_chars + sizeof(base64_chars), c); + return static_cast(it - base64_chars); +} + std::string dev::toBase64(bytesConstRef _in) { std::string ret; int i = 0; @@ -85,7 +88,7 @@ std::string dev::toBase64(bytesConstRef _in) { } bytes dev::fromBase64(std::string const& encoded_string) { - int in_len = encoded_string.size(); + auto in_len = encoded_string.size(); int i = 0; int j = 0; int in_ = 0; @@ -94,9 +97,9 @@ bytes dev::fromBase64(std::string const& encoded_string) { while (in_len-- && ( encoded_string[in_] != '=') && is_base64(encoded_string[in_])) { char_array_4[i++] = encoded_string[in_]; in_++; - if (i ==4) { - for (i = 0; i <4; i++) - char_array_4[i] = base64_chars.find(char_array_4[i]); + if (i == 4) { + for (i = 0; i < 4; i++) + char_array_4[i] = find_base64_char_index(char_array_4[i]); char_array_3[0] = (char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4); char_array_3[1] = ((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2); @@ -109,11 +112,11 @@ bytes dev::fromBase64(std::string const& encoded_string) { } if (i) { - for (j = i; j <4; j++) + for (j = i; j < 4; j++) char_array_4[j] = 0; - for (j = 0; j <4; j++) - char_array_4[j] = base64_chars.find(char_array_4[j]); + for (j = 0; j < 4; j++) + char_array_4[j] = find_base64_char_index(char_array_4[j]); char_array_3[0] = (char_array_4[0] << 2) + ((char_array_4[1] & 0x30) >> 4); char_array_3[1] = ((char_array_4[1] & 0xf) << 4) + ((char_array_4[2] & 0x3c) >> 2); diff --git a/libdevcore/Base64.h b/libdevcore/Base64.h index 8ff10cff0..d99a29767 100644 --- a/libdevcore/Base64.h +++ b/libdevcore/Base64.h @@ -28,7 +28,6 @@ /// DEVified by Gav Wood. #pragma once -#include #include #include "Common.h" #include "FixedHash.h" diff --git a/test/libdevcrypto/hexPrefix.cpp b/test/libdevcrypto/hexPrefix.cpp index c72f24535..c8eff797b 100644 --- a/test/libdevcrypto/hexPrefix.cpp +++ b/test/libdevcrypto/hexPrefix.cpp @@ -27,6 +27,7 @@ #include "../JsonSpiritHeaders.h" #include #include +#include #include #include "../TestHelper.h" @@ -60,4 +61,30 @@ BOOST_AUTO_TEST_CASE(hexPrefix_test) } } +BOOST_AUTO_TEST_CASE(base64) +{ + static char const* const s_tests[][2] = { + {"", ""}, + {"f", "Zg=="}, + {"fo", "Zm8="}, + {"foo", "Zm9v"}, + {"foob", "Zm9vYg=="}, + {"fooba", "Zm9vYmE="}, + {"foobar", "Zm9vYmFy"} + }; + static const auto c_numTests = sizeof(s_tests) / sizeof(s_tests[0]); + + for (size_t i = 0; i < c_numTests; ++i) + { + auto expectedDecoded = std::string{s_tests[i][0]}; + auto expectedEncoded = std::string{s_tests[i][1]}; + + auto encoded = toBase64(expectedDecoded); + BOOST_CHECK_EQUAL(expectedEncoded, encoded); + auto decodedBytes = fromBase64(expectedEncoded); + auto decoded = bytesConstRef{decodedBytes.data(), decodedBytes.size()}.toString(); + BOOST_CHECK_EQUAL(decoded, expectedDecoded); + } +} + BOOST_AUTO_TEST_SUITE_END() From 68099a7c8ea16052d5cb14326345e2f89676a366 Mon Sep 17 00:00:00 2001 From: subtly Date: Sun, 17 May 2015 23:10:50 +0200 Subject: [PATCH 235/461] Normalize ethash filepath for macos to be same as others. --- ethminer/main.cpp | 5 ++++- libethash/io_posix.c | 17 +++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/ethminer/main.cpp b/ethminer/main.cpp index bcb33915f..c5fa968a7 100644 --- a/ethminer/main.cpp +++ b/ethminer/main.cpp @@ -251,7 +251,10 @@ void doFarm(MinerType _m, string const& _remote, unsigned _recheckPeriod) Json::Value v = rpc.eth_getWork(); h256 hh(v[0].asString()); h256 newSeedHash(v[1].asString()); - if (hh != current.headerHash && !!EthashAux::full(newSeedHash, true)) + if (!EthashAux::full(newSeedHash, true)) + BOOST_THROW_EXCEPTION(DAGCreationFailure()); + + if (hh != current.headerHash) { current.headerHash = hh; current.seedHash = newSeedHash; diff --git a/libethash/io_posix.c b/libethash/io_posix.c index 7f03d5482..b030748a9 100644 --- a/libethash/io_posix.c +++ b/libethash/io_posix.c @@ -26,6 +26,10 @@ #include #include #include +#if defined(__APPLE__) +#include +#include +#endif FILE* ethash_fopen(char const* file_name, char const* mode) { @@ -86,9 +90,22 @@ bool ethash_file_size(FILE* f, size_t* ret_size) bool ethash_get_default_dirname(char* strbuf, size_t buffsize) { +#if defined(__APPLE__) + static const char dir_suffix[] = "Ethash/"; + strbuf[0] = '\0'; + char* home_dir = getenv("HOME"); + if (!home_dir || strlen(home_dir) == 0) + { + struct passwd* pwd = getpwuid(getuid()); + if (pwd) + home_dir = pwd->pw_dir; + } +#else static const char dir_suffix[] = ".ethash/"; strbuf[0] = '\0'; char* home_dir = getenv("HOME"); +#endif + size_t len = strlen(home_dir); if (!ethash_strncat(strbuf, buffsize, home_dir, len)) { return false; From 6bce6400ff82b019e5033e64add48c0ca13c46a9 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Sun, 17 May 2015 23:11:43 +0200 Subject: [PATCH 236/461] Fix lockup. --- libethcore/Common.cpp | 5 +++-- libethereum/Client.cpp | 16 ++++++++-------- libethereum/TransactionQueue.cpp | 2 +- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/libethcore/Common.cpp b/libethcore/Common.cpp index 0b36ca5fa..c74aeba5e 100644 --- a/libethcore/Common.cpp +++ b/libethcore/Common.cpp @@ -36,11 +36,12 @@ namespace eth { const unsigned c_protocolVersion = 60; -const unsigned c_minorProtocolVersion = 2; #if ETH_FATDB -const unsigned c_databaseBaseVersion = 10; +const unsigned c_minorProtocolVersion = 3; +const unsigned c_databaseBaseVersion = 9; const unsigned c_databaseVersionModifier = 1; #else +const unsigned c_minorProtocolVersion = 2; const unsigned c_databaseBaseVersion = 9; const unsigned c_databaseVersionModifier = 0; #endif diff --git a/libethereum/Client.cpp b/libethereum/Client.cpp index 6d934f3ad..6d5e39e39 100644 --- a/libethereum/Client.cpp +++ b/libethereum/Client.cpp @@ -461,13 +461,13 @@ ProofOfWork::WorkPackage Client::getWork() bool Client::submitWork(ProofOfWork::Solution const& _solution) { bytes newBlock; - DEV_TIMED(working) DEV_WRITE_GUARDED(x_working) + DEV_WRITE_GUARDED(x_working) if (!m_working.completeMine(_solution)) return false; DEV_READ_GUARDED(x_working) { - DEV_TIMED(post) DEV_WRITE_GUARDED(x_postMine) + DEV_WRITE_GUARDED(x_postMine) m_postMine = m_working; newBlock = m_working.blockData(); } @@ -499,14 +499,14 @@ void Client::syncTransactionQueue() h256Hash changeds; TransactionReceipts newPendingReceipts; - DEV_TIMED(working) DEV_WRITE_GUARDED(x_working) + DEV_WRITE_GUARDED(x_working) tie(newPendingReceipts, m_syncTransactionQueue) = m_working.sync(m_bc, m_tq, *m_gp); if (newPendingReceipts.empty()) return; DEV_READ_GUARDED(x_working) - DEV_TIMED(post) DEV_WRITE_GUARDED(x_postMine) + DEV_WRITE_GUARDED(x_postMine) m_postMine = m_working; DEV_READ_GUARDED(x_postMine) @@ -574,7 +574,7 @@ void Client::onChainChanged(ImportRoute const& _ir) DEV_WRITE_GUARDED(x_preMine) m_preMine = newPreMine; - DEV_TIMED(working) DEV_WRITE_GUARDED(x_working) + DEV_WRITE_GUARDED(x_working) m_working = newPreMine; DEV_READ_GUARDED(x_postMine) for (auto const& t: m_postMine.pending()) @@ -584,7 +584,7 @@ void Client::onChainChanged(ImportRoute const& _ir) if (ir != ImportResult::Success) onTransactionQueueReady(); } - DEV_READ_GUARDED(x_working) DEV_TIMED(post) DEV_WRITE_GUARDED(x_postMine) + DEV_READ_GUARDED(x_working) DEV_WRITE_GUARDED(x_postMine) m_postMine = m_working; changeds.insert(PendingChangedFilter); @@ -609,11 +609,11 @@ void Client::onPostStateChanged() cnote << "Post state changed: Restarting mining..."; if (isMining() || remoteActive()) { - DEV_TIMED(working) DEV_WRITE_GUARDED(x_working) + DEV_WRITE_GUARDED(x_working) m_working.commitToMine(m_bc); DEV_READ_GUARDED(x_working) { - DEV_TIMED(post) DEV_WRITE_GUARDED(x_postMine) + DEV_WRITE_GUARDED(x_postMine) m_postMine = m_working; m_miningInfo = m_postMine.info(); } diff --git a/libethereum/TransactionQueue.cpp b/libethereum/TransactionQueue.cpp index 785e16c2d..e488805d9 100644 --- a/libethereum/TransactionQueue.cpp +++ b/libethereum/TransactionQueue.cpp @@ -187,7 +187,7 @@ bool TransactionQueue::remove_WITH_LOCK(h256 const& _txHash) m_senders.erase(i); break; } - cdebug << "=> nonce" << pit->second.nonce(); +// cdebug << "=> nonce" << pit->second.nonce(); pool->erase(pit); return true; } From cbb5e640ef6646abf8244570c9a6f803fe9f1891 Mon Sep 17 00:00:00 2001 From: arkpar Date: Mon, 18 May 2015 00:26:09 +0200 Subject: [PATCH 237/461] more blockchain import optimizations --- libethcore/EthashAux.cpp | 4 ++-- libethcore/EthashAux.h | 2 +- libethereum/BlockChain.cpp | 2 +- libethereum/BlockQueue.cpp | 3 ++- 4 files changed, 6 insertions(+), 5 deletions(-) diff --git a/libethcore/EthashAux.cpp b/libethcore/EthashAux.cpp index 9bb2c4aa9..e01372452 100644 --- a/libethcore/EthashAux.cpp +++ b/libethcore/EthashAux.cpp @@ -101,13 +101,13 @@ uint64_t EthashAux::number(h256 const& _seedHash) void EthashAux::killCache(h256 const& _s) { - RecursiveGuard l(x_lights); + WriteGuard l(x_lights); m_lights.erase(_s); } EthashAux::LightType EthashAux::light(h256 const& _seedHash) { - RecursiveGuard l(get()->x_lights); + ReadGuard l(get()->x_lights); LightType ret = get()->m_lights[_seedHash]; return ret ? ret : (get()->m_lights[_seedHash] = make_shared(_seedHash)); } diff --git a/libethcore/EthashAux.h b/libethcore/EthashAux.h index 92ca52097..3f876f442 100644 --- a/libethcore/EthashAux.h +++ b/libethcore/EthashAux.h @@ -88,7 +88,7 @@ private: static EthashAux* s_this; - RecursiveMutex x_lights; + SharedMutex x_lights; std::unordered_map> m_lights; Mutex x_fulls; diff --git a/libethereum/BlockChain.cpp b/libethereum/BlockChain.cpp index cbde3f14e..7838e432d 100644 --- a/libethereum/BlockChain.cpp +++ b/libethereum/BlockChain.cpp @@ -317,7 +317,7 @@ tuple BlockChain::sync(BlockQueue& _bq, OverlayDB const& _st { try { - auto r = import(block.first, block.second, _stateDB); + auto r = import(block.first, block.second, _stateDB, ImportRequirements::Default & ~ImportRequirements::ValidNonce); fresh += r.first; dead += r.second; } diff --git a/libethereum/BlockQueue.cpp b/libethereum/BlockQueue.cpp index 43a3d1caf..8fa7b6cca 100644 --- a/libethereum/BlockQueue.cpp +++ b/libethereum/BlockQueue.cpp @@ -38,7 +38,8 @@ const char* BlockQueueChannel::name() { return EthOrange "▣┅▶"; } BlockQueue::BlockQueue() { - for (unsigned i = 0; i < thread::hardware_concurrency(); ++i) + unsigned verifierThreads = std::max(thread::hardware_concurrency(), 3U) - 2U; + for (unsigned i = 0; i < verifierThreads; ++i) m_verifiers.emplace_back([=](){ setThreadName("verifier" + toString(i)); this->verifierBody(); From 3f979d856f986abaac32fde3ed501931d97b596b Mon Sep 17 00:00:00 2001 From: subtly Date: Mon, 18 May 2015 02:56:58 +0200 Subject: [PATCH 238/461] Add deque for windows to compile. --- libethereum/BlockQueue.h | 1 + libwhisper/WhisperPeer.cpp | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/libethereum/BlockQueue.h b/libethereum/BlockQueue.h index ba515b409..c865bac32 100644 --- a/libethereum/BlockQueue.h +++ b/libethereum/BlockQueue.h @@ -23,6 +23,7 @@ #include #include +#include #include #include #include diff --git a/libwhisper/WhisperPeer.cpp b/libwhisper/WhisperPeer.cpp index 9bef25140..7bcdfe8aa 100644 --- a/libwhisper/WhisperPeer.cpp +++ b/libwhisper/WhisperPeer.cpp @@ -66,10 +66,8 @@ bool WhisperPeer::interpret(unsigned _id, RLP const& _r) } case MessagesPacket: { - unsigned n = 0; for (auto i: _r) - if (n++) - host()->inject(Envelope(i), this); + host()->inject(Envelope(i), this); break; } default: From 953be7886b5681f0fa8ecde94b1fdb8c25afbfd4 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Mon, 18 May 2015 08:57:00 +0200 Subject: [PATCH 239/461] Move Farm to ethcore and rejig build to allow ethminer-only build. --- CMakeLists.txt | 66 ++++++++++++++++++++++-------- ethminer/CMakeLists.txt | 7 +--- ethminer/main.cpp | 12 ++---- exp/main.cpp | 2 +- libethcore/CMakeLists.txt | 2 +- {libethereum => libethcore}/Farm.h | 0 libethereum/Client.h | 2 +- libethereum/Farm.cpp | 0 8 files changed, 57 insertions(+), 34 deletions(-) rename {libethereum => libethcore}/Farm.h (100%) delete mode 100644 libethereum/Farm.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 289cecad8..aafdad099 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,6 +32,7 @@ option(USENPM "Use npm to recompile ethereum.js if it was changed" OFF) option(PROFILING "Build in support for profiling" OFF) set(BUNDLE "none" CACHE STRING "Predefined bundle of software to build (none, full, user, tests, minimal).") +option(MINER "Build the miner component" ON) option(SOLIDITY "Build the Solidity language components" ON) option(SERPENT "Build the Serpent language components" ON) option(TOOLS "Build the tools components" ON) @@ -187,6 +188,7 @@ eth_format_option(VMTRACE) eth_format_option(EVMJIT) eth_format_option(FATDB) eth_format_option(JSONRPC) +eth_format_option(MINER) eth_format_option(USENPM) eth_format_option(PROFILING) eth_format_option(SOLIDITY) @@ -249,6 +251,16 @@ elseif (BUNDLE STREQUAL "user") set(NCURSES ${DECENT_PLATFORM}) set(TOOLS ON) set(TESTS OFF) +elseif (BUNDLE STREQUAL "miner") + set(SERPENT OFF) + set(SOLIDITY OFF) + set(USENPM OFF) + set(GUI OFF) + set(NCURSES OFF) + set(TOOLS OFF) + set(TESTS OFF) + set(MINER ON) + set(ETHASHCL ON) endif () # Default CMAKE_BUILD_TYPE to "Release". @@ -283,6 +295,7 @@ message("-- FATDB Full database exploring ${FATDB}") message("-- JSONRPC JSON-RPC support ${JSONRPC}") message("-- USENPM Javascript source building ${USENPM}") message("------------------------------------------------------------- components") +message("-- MINER Build miner ${MINER}") message("-- TOOLS Build basic tools ${TOOLS}") message("-- SOLIDITY Build Solidity language components ${SOLIDITY}") message("-- SERPENT Build Serpent language components ${SERPENT}") @@ -310,10 +323,20 @@ if (EVMJIT) add_subdirectory(evmjit) endif() +if (TOOLS OR GUI OR SOLIDITY OR NCURSES OR TESTS) + set(GENERAL 1) +else () + set(GENERAL 0) +endif () + +message("GENERAL ${GENERAL}") + add_subdirectory(libdevcore) -add_subdirectory(libevmcore) -add_subdirectory(libevmasm) -add_subdirectory(liblll) +if (GENERAL) + add_subdirectory(libevmcore) + add_subdirectory(libevmasm) + add_subdirectory(liblll) +endif () if (SERPENT) add_subdirectory(libserpent) @@ -329,31 +352,43 @@ if (TOOLS) if (SOLIDITY) add_subdirectory(solc) endif () -endif() +endif () -if (JSONRPC) +if (JSONRPC AND GENERAL) add_subdirectory(libweb3jsonrpc) -endif() +endif () if (JSCONSOLE) add_subdirectory(libjsengine) add_subdirectory(libjsconsole) -endif() +endif () add_subdirectory(secp256k1) -add_subdirectory(libp2p) add_subdirectory(libdevcrypto) -add_subdirectory(libwhisper) -add_subdirectory(libethash) -if (ETHASHCL) - add_subdirectory(libethash-cl) +if (GENERAL) + add_subdirectory(libp2p) + add_subdirectory(libwhisper) +endif () + +if (GENERAL OR MINER) + add_subdirectory(libethash) + if (ETHASHCL) + add_subdirectory(libethash-cl) + endif () endif () add_subdirectory(libethcore) -add_subdirectory(libevm) -add_subdirectory(libethereum) -add_subdirectory(libwebthree) + +if (GENERAL) + add_subdirectory(libevm) + add_subdirectory(libethereum) + add_subdirectory(libwebthree) +endif () + +if (MINER) + add_subdirectory(ethminer) +endif () if (TESTS) add_subdirectory(libtestutils) @@ -367,7 +402,6 @@ if (TOOLS) add_subdirectory(rlp) add_subdirectory(abi) - add_subdirectory(ethminer) add_subdirectory(eth) if("x${CMAKE_BUILD_TYPE}" STREQUAL "xDebug") diff --git a/ethminer/CMakeLists.txt b/ethminer/CMakeLists.txt index af38c0c84..d364f6ed1 100644 --- a/ethminer/CMakeLists.txt +++ b/ethminer/CMakeLists.txt @@ -17,12 +17,7 @@ add_dependencies(${EXECUTABLE} BuildInfo.h) target_link_libraries(${EXECUTABLE} ${Boost_REGEX_LIBRARIES}) -if (READLINE_FOUND) - target_link_libraries(${EXECUTABLE} ${READLINE_LIBRARIES}) -endif() - if (JSONRPC) - target_link_libraries(${EXECUTABLE} web3jsonrpc) target_link_libraries(${EXECUTABLE} ${JSON_RPC_CPP_CLIENT_LIBRARIES}) target_link_libraries(${EXECUTABLE} ${CURL_LIBRARIES}) if (DEFINED WIN32 AND NOT DEFINED CMAKE_COMPILER_IS_MINGW) @@ -30,7 +25,7 @@ if (JSONRPC) endif() endif() -target_link_libraries(${EXECUTABLE} webthree) +target_link_libraries(${EXECUTABLE} ethcore) target_link_libraries(${EXECUTABLE} ethash) if (DEFINED WIN32 AND NOT DEFINED CMAKE_COMPILER_IS_MINGW) diff --git a/ethminer/main.cpp b/ethminer/main.cpp index 10d8436f0..a19934ba0 100644 --- a/ethminer/main.cpp +++ b/ethminer/main.cpp @@ -32,12 +32,10 @@ #include #include #include +#include #include #include -#include -#include -#include -#include +#include #if ETH_JSONRPC || !ETH_TRUE #include #include @@ -50,7 +48,6 @@ #endif using namespace std; using namespace dev; -using namespace dev::p2p; using namespace dev::eth; using namespace boost::algorithm; using dev::eth::Instruction; @@ -143,7 +140,7 @@ enum class MinerType void doBenchmark(MinerType _m, bool _phoneHome, unsigned _warmupDuration = 15, unsigned _trialDuration = 3, unsigned _trials = 5) { - BlockInfo genesis = CanonBlockChain::genesis(); + BlockInfo genesis; genesis.difficulty = 1 << 18; cdebug << genesis.boundary(); @@ -294,9 +291,6 @@ void doFarm(MinerType _m, string const& _remote, unsigned _recheckPeriod) int main(int argc, char** argv) { - // Init defaults - Defaults::get(); - /// Operating mode. OperationMode mode = OperationMode::Farm; diff --git a/exp/main.cpp b/exp/main.cpp index 2bd0a741e..138ae76a4 100644 --- a/exp/main.cpp +++ b/exp/main.cpp @@ -45,10 +45,10 @@ #include #include #include +#include #include #include #include -#include #include #include #include diff --git a/libethcore/CMakeLists.txt b/libethcore/CMakeLists.txt index 4dd626642..a527ad1f4 100644 --- a/libethcore/CMakeLists.txt +++ b/libethcore/CMakeLists.txt @@ -28,7 +28,7 @@ add_library(${EXECUTABLE} ${SRC_LIST} ${HEADERS}) target_link_libraries(${EXECUTABLE} ethash) target_link_libraries(${EXECUTABLE} devcrypto) -target_link_libraries(${EXECUTABLE} evmcore) +#target_link_libraries(${EXECUTABLE} evmcore) if (ETHASHCL) target_link_libraries(${EXECUTABLE} ethash-cl) diff --git a/libethereum/Farm.h b/libethcore/Farm.h similarity index 100% rename from libethereum/Farm.h rename to libethcore/Farm.h diff --git a/libethereum/Client.h b/libethereum/Client.h index 674556a6e..7eeb7fb2d 100644 --- a/libethereum/Client.h +++ b/libethereum/Client.h @@ -37,12 +37,12 @@ #include #include #include +#include #include #include "CanonBlockChain.h" #include "TransactionQueue.h" #include "State.h" #include "CommonNet.h" -#include "Farm.h" #include "ClientBase.h" namespace dev diff --git a/libethereum/Farm.cpp b/libethereum/Farm.cpp deleted file mode 100644 index e69de29bb..000000000 From 4d2c292c7c0b73de3279772576538101de281df1 Mon Sep 17 00:00:00 2001 From: Martin Holst Swende Date: Mon, 18 May 2015 07:35:02 +0000 Subject: [PATCH 240/461] Fixed error introduced in 953be7886b5681f0fa8ecde94b1fdb8c25afbfd4 --- test/libethereum/stateOriginal.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/libethereum/stateOriginal.cpp b/test/libethereum/stateOriginal.cpp index 82d6288d6..e7a078182 100644 --- a/test/libethereum/stateOriginal.cpp +++ b/test/libethereum/stateOriginal.cpp @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include "../TestHelper.h" using namespace std; From 16ce50dded9a63296dc502b3edd938f81e3ad301 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 18 May 2015 10:49:10 +0200 Subject: [PATCH 241/461] add GasMapWrapper --- mix/CodeModel.cpp | 44 ++++++++++++++++++++++++++++++++------------ mix/CodeModel.h | 27 ++++++++++++++++++++++----- 2 files changed, 54 insertions(+), 17 deletions(-) diff --git a/mix/CodeModel.cpp b/mix/CodeModel.cpp index 137188e40..e622d7973 100644 --- a/mix/CodeModel.cpp +++ b/mix/CodeModel.cpp @@ -333,42 +333,36 @@ void CodeModel::runCompilationJob(int _jobId) void CodeModel::gasEstimation(solidity::CompilerStack const& _cs) { - m_gasCostsMaps.clear(); + m_gasCostsMaps->deleteLater(); + m_gasCostsMaps = new GasMapWrapper(this); for (std::string n: _cs.getContractNames()) { ContractDefinition const& contractDefinition = _cs.getContractDefinition(n); QString sourceName = QString::fromStdString(*contractDefinition.getLocation().sourceName); - if (!m_gasCostsMaps.contains(sourceName)) - m_gasCostsMaps.insert(sourceName, QVariantList()); + if (!m_gasCostsMaps->contains(sourceName)) + m_gasCostsMaps->insert(sourceName, QVariantList()); if (!contractDefinition.isFullyImplemented()) continue; dev::solidity::SourceUnit const& sourceUnit = _cs.getAST(*contractDefinition.getLocation().sourceName); AssemblyItems const* items = _cs.getRuntimeAssemblyItems(n); - StructuralGasEstimator estimator; std::map gasCosts = estimator.breakToStatementLevel(estimator.performEstimation(*items, std::vector({&sourceUnit})), {&sourceUnit}); - for (auto gasItem = gasCosts.begin(); gasItem != gasCosts.end(); ++gasItem) { SourceLocation const& location = gasItem->first->getLocation(); GasMeter::GasConsumption cost = gasItem->second; std::stringstream v; v << cost.value; - GasMap* gas = new GasMap(location.start, location.end, QString::fromStdString(v.str()), cost.isInfinite); - m_gasCostsMaps.find(sourceName).value().push_back(QVariant::fromValue(gas)); + m_gasCostsMaps->push(sourceName, location.start, location.end, QString::fromStdString(v.str()), cost.isInfinite); } } } QVariantList CodeModel::gasCostByDocumentId(QString const& _documentId) const { - auto gasIter = m_gasCostsMaps.find(_documentId); - if (gasIter != m_gasCostsMaps.end()) - return gasIter.value(); - else - return QVariantList(); + return m_gasCostsMaps->gasCostsByDocId(_documentId); } void CodeModel::collectContracts(dev::solidity::CompilerStack const& _cs, std::vector const& _sourceNames) @@ -560,3 +554,29 @@ QString CodeModel::resolveFunctionName(dev::SourceLocation const& _location) } return QString(); } + +void GasMapWrapper::push(QString _source, int _start, int _end, QString _value, bool _isInfinite) +{ + GasMap* gas = new GasMap(_start, _end, _value, _isInfinite, this); + m_gasMaps.find(_source).value().push_back(QVariant::fromValue(gas)); +} + +bool GasMapWrapper::contains(QString _key) +{ + return m_gasMaps.contains(_key); +} + +void GasMapWrapper::insert(QString _source, QVariantList _variantList) +{ + m_gasMaps.insert(_source, _variantList); +} + +QVariantList GasMapWrapper::gasCostsByDocId(QString _source) +{ + auto gasIter = m_gasMaps.find(_source); + if (gasIter != m_gasMaps.end()) + return gasIter.value(); + else + return QVariantList(); +} + diff --git a/mix/CodeModel.h b/mix/CodeModel.h index 7cc9d3477..ca9658786 100644 --- a/mix/CodeModel.h +++ b/mix/CodeModel.h @@ -127,6 +127,26 @@ struct SourceMap LocationMap functions; }; +using SourceMaps = QMap; //by source id +using GasCostsMaps = QMap; //gas cost by contract name + +class GasMapWrapper: public QObject +{ + Q_OBJECT + + Q_PROPERTY(GasCostsMaps gasMaps MEMBER m_gasMaps CONSTANT) + +public: + GasMapWrapper(QObject* _parent): QObject(_parent){} + void push(QString _source, int _start, int _end, QString _value, bool _isInfinite); + bool contains(QString _key); + void insert(QString _source, QVariantList _variantList); + QVariantList gasCostsByDocId(QString _source); + +private: + GasCostsMaps m_gasMaps; +}; + class GasMap: public QObject { Q_OBJECT @@ -137,7 +157,7 @@ class GasMap: public QObject Q_PROPERTY(bool isInfinite MEMBER m_isInfinite CONSTANT) public: - GasMap(int _start, int _end, QString _gas, bool _isInfinite): m_start(_start), m_end(_end), m_gas(_gas), m_isInfinite(_isInfinite) { QQmlEngine::setObjectOwnership(this, QQmlEngine::JavaScriptOwnership); } + GasMap(int _start, int _end, QString _gas, bool _isInfinite, QObject _parent): QObject(_parent), m_start(_start), m_end(_end), m_gas(_gas), m_isInfinite(_isInfinite) { QQmlEngine::setObjectOwnership(this, QQmlEngine::JavaScriptOwnership); } int m_start; int m_end; @@ -145,9 +165,6 @@ public: bool m_isInfinite; }; -using SourceMaps = QMap; //by source id -using GasCostsMaps = QMap; //gas cost by contract name - /// Code compilation model. Compiles contracts in background an provides compiled contract data class CodeModel: public QObject { @@ -227,7 +244,7 @@ private: mutable dev::Mutex x_contractMap; ContractMap m_contractMap; SourceMaps m_sourceMaps; - GasCostsMaps m_gasCostsMaps; + GasMapWrapper* m_gasCostsMaps; std::unique_ptr m_codeHighlighterSettings; QThread m_backgroundThread; BackgroundWorker m_backgroundWorker; From 2c665ea0f9de2f8b4c4438d787b21b6f6e39be97 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 18 May 2015 11:06:34 +0200 Subject: [PATCH 242/461] small changes --- mix/CodeModel.cpp | 3 ++- mix/CodeModel.h | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/mix/CodeModel.cpp b/mix/CodeModel.cpp index e622d7973..03ae828e0 100644 --- a/mix/CodeModel.cpp +++ b/mix/CodeModel.cpp @@ -333,7 +333,8 @@ void CodeModel::runCompilationJob(int _jobId) void CodeModel::gasEstimation(solidity::CompilerStack const& _cs) { - m_gasCostsMaps->deleteLater(); + if (m_gasCostsMaps) + m_gasCostsMaps->deleteLater(); m_gasCostsMaps = new GasMapWrapper(this); for (std::string n: _cs.getContractNames()) { diff --git a/mix/CodeModel.h b/mix/CodeModel.h index ca9658786..9295c38f0 100644 --- a/mix/CodeModel.h +++ b/mix/CodeModel.h @@ -244,7 +244,7 @@ private: mutable dev::Mutex x_contractMap; ContractMap m_contractMap; SourceMaps m_sourceMaps; - GasMapWrapper* m_gasCostsMaps; + GasMapWrapper* m_gasCostsMaps = 0; std::unique_ptr m_codeHighlighterSettings; QThread m_backgroundThread; BackgroundWorker m_backgroundWorker; From 9111b31ca7721feaa029c2398741a6f34a2c1361 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 18 May 2015 11:18:01 +0200 Subject: [PATCH 243/461] small changes --- mix/CodeModel.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mix/CodeModel.cpp b/mix/CodeModel.cpp index 03ae828e0..b0edb20f9 100644 --- a/mix/CodeModel.cpp +++ b/mix/CodeModel.cpp @@ -363,7 +363,10 @@ void CodeModel::gasEstimation(solidity::CompilerStack const& _cs) QVariantList CodeModel::gasCostByDocumentId(QString const& _documentId) const { - return m_gasCostsMaps->gasCostsByDocId(_documentId); + if (m_gasCostsMaps) + return m_gasCostsMaps->gasCostsByDocId(_documentId); + else + return QVariantList(); } void CodeModel::collectContracts(dev::solidity::CompilerStack const& _cs, std::vector const& _sourceNames) From 8f9f7d9a6f96aef61bd7fdaf2ec027be906f97f1 Mon Sep 17 00:00:00 2001 From: arkpar Date: Mon, 18 May 2015 11:34:11 +0200 Subject: [PATCH 244/461] comments --- libethereum/BlockChain.cpp | 1 + libethereum/BlockQueue.cpp | 1 + 2 files changed, 2 insertions(+) diff --git a/libethereum/BlockChain.cpp b/libethereum/BlockChain.cpp index 7838e432d..f4a1dcec2 100644 --- a/libethereum/BlockChain.cpp +++ b/libethereum/BlockChain.cpp @@ -317,6 +317,7 @@ tuple BlockChain::sync(BlockQueue& _bq, OverlayDB const& _st { try { + // Nonce is already verified thread at this point. auto r = import(block.first, block.second, _stateDB, ImportRequirements::Default & ~ImportRequirements::ValidNonce); fresh += r.first; dead += r.second; diff --git a/libethereum/BlockQueue.cpp b/libethereum/BlockQueue.cpp index 8fa7b6cca..df134b246 100644 --- a/libethereum/BlockQueue.cpp +++ b/libethereum/BlockQueue.cpp @@ -38,6 +38,7 @@ const char* BlockQueueChannel::name() { return EthOrange "▣┅▶"; } BlockQueue::BlockQueue() { + // Allow some room for other activity unsigned verifierThreads = std::max(thread::hardware_concurrency(), 3U) - 2U; for (unsigned i = 0; i < verifierThreads; ++i) m_verifiers.emplace_back([=](){ From fff1a1379e29557907051a0f1a779bb5ab052623 Mon Sep 17 00:00:00 2001 From: chriseth Date: Mon, 18 May 2015 11:34:16 +0200 Subject: [PATCH 245/461] Fixed error message about explicit type conversion. --- libsolidity/AST.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libsolidity/AST.cpp b/libsolidity/AST.cpp index 2f98ce4f6..9842901e7 100644 --- a/libsolidity/AST.cpp +++ b/libsolidity/AST.cpp @@ -746,7 +746,7 @@ void FunctionCall::checkTypeRequirements(TypePointers const*) //@todo for structs, we have to check the number of arguments to be equal to the // number of non-mapping members if (m_arguments.size() != 1) - BOOST_THROW_EXCEPTION(createTypeError("More than one argument for explicit type conversion.")); + BOOST_THROW_EXCEPTION(createTypeError("Exactly one argument expected for explicit type conversion.")); if (!isPositionalCall) BOOST_THROW_EXCEPTION(createTypeError("Type conversion cannot allow named arguments.")); if (!m_arguments.front()->getType()->isExplicitlyConvertibleTo(*type.getActualType())) From c11326c22189c3a72af90820cf97d58ef2b7780c Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Mon, 18 May 2015 11:37:31 +0200 Subject: [PATCH 246/461] Ethash critical output should be disabled by default - If the user needs it simply compile with -DETHASH_PRINT_CRITICAL_OUTPUT --- io.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/io.h b/io.h index da35eacba..7a27089c7 100644 --- a/io.h +++ b/io.h @@ -59,7 +59,7 @@ enum ethash_io_rc { * figure out what kind of problem (I/O, memory e.t.c.) causes a NULL * ethash_full_t */ -#ifndef ETHASH_NO_CRITICAL_OUTPUT +#ifdef ETHASH_PRINT_CRITICAL_OUTPUT #define ETHASH_CRITICAL(...) \ do \ { \ From 670b4e1e7245625cc296d37d1ad328deb0158f44 Mon Sep 17 00:00:00 2001 From: winsvega Date: Wed, 6 May 2015 19:06:56 +0300 Subject: [PATCH 247/461] New Tests validBlockTestFix Solidity Contract Inheritance singletest for blockchain --- .../bcValidBlockTestFiller.json | 85 ++++++++++++++++++- .../stSolidityTestFiller.json | 6 +- 2 files changed, 84 insertions(+), 7 deletions(-) diff --git a/test/libethereum/BlockTestsFiller/bcValidBlockTestFiller.json b/test/libethereum/BlockTestsFiller/bcValidBlockTestFiller.json index dc18fb2ca..2d1bb9cfd 100644 --- a/test/libethereum/BlockTestsFiller/bcValidBlockTestFiller.json +++ b/test/libethereum/BlockTestsFiller/bcValidBlockTestFiller.json @@ -122,8 +122,8 @@ "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" }, "expect" : { - "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { - "balance" : "100" + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "10000000000" } }, "pre" : { @@ -139,8 +139,8 @@ "transactions" : [ { "data" : "", - "gasLimit" : "100001", - "gasPrice" : "0", + "gasLimit" : "10000001", + "gasPrice" : "1", "nonce" : "0", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", @@ -153,6 +153,83 @@ ] }, + "gasLimitTooHigh2" : { + "genesisBlockHeader" : { + "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1", + "difficulty" : "131072", + "extraData" : "0x42", + "gasLimit" : "3141592", + "gasUsed" : "0", + "mixHash" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "nonce" : "0x0102030405060708", + "number" : "0", + "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000", + "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "stateRoot" : "0xf99eb1626cfa6db435c0836235942d7ccaa935f1ae247d3f1c21e495685f903a", + "timestamp" : "0x54c98c81", + "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + }, + "expect" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "30" + } + }, + "pre" : { + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "10000000000", + "nonce" : "0", + "code" : "", + "storage": {} + } + }, + "blocks" : [ + { + "transactions" : [ + { + "data" : "", + "gasLimit" : "21000", + "gasPrice" : "1", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "10" + }, + { + "data" : "", + "gasLimit" : "21000", + "gasPrice" : "1", + "nonce" : "1", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "10" + }, + { + "data" : "", + "gasLimit" : "21000", + "gasPrice" : "1", + "nonce" : "2", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "10" + }, + { + "data" : "", + "gasLimit" : "21000", + "gasPrice" : "1", + "nonce" : "3", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + } + ] + }, + "SimpleTx" : { "genesisBlockHeader" : { "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", diff --git a/test/libethereum/StateTestsFiller/stSolidityTestFiller.json b/test/libethereum/StateTestsFiller/stSolidityTestFiller.json index a4243c8dd..7ee5db0c3 100644 --- a/test/libethereum/StateTestsFiller/stSolidityTestFiller.json +++ b/test/libethereum/StateTestsFiller/stSolidityTestFiller.json @@ -47,16 +47,16 @@ "//" : " function testInheretance() returns (bool res) ", "//" : " { ", "//" : " res = true; ", - "//" : " base contract1; ", + "//" : " base contract1 = new base(); ", "//" : " if (contract1.methodA() != 1) ", "//" : " return false; ", "//" : " ", - "//" : " frombase contract2; ", + "//" : " frombase contract2 = new frombase(); ", "//" : " if (contract2.methodA() != 2) ", "//" : " return false; ", "//" : " } ", "//" : "} ", - "code" : "0x6000357c0100000000000000000000000000000000000000000000000000000000900480633e0bca3b1461003a578063c04062261461004c57005b610042610099565b8060005260206000f35b61005461005e565b8060005260206000f35b6000610068610099565b600060006101000a81548160ff02191690830217905550600060009054906101000a900460ff169050610096565b90565b60006000600060019250825060018273ffffffffffffffffffffffffffffffffffffffff166381bda09b60206000827c010000000000000000000000000000000000000000000000000000000002600052600460006000866161da5a03f16100fd57005b505060005163ffffffff1614156101135761011c565b60009250610194565b60028173ffffffffffffffffffffffffffffffffffffffff166381bda09b60206000827c010000000000000000000000000000000000000000000000000000000002600052600460006000866161da5a03f161017457005b505060005163ffffffff16141561018a57610193565b60009250610194565b5b50509056", + "code" : "0x7c010000000000000000000000000000000000000000000000000000000060003504633e0bca3b8114610039578063c0406226146100a857005b6100b55b600160008060456101ec8339604560006000f091508173ffffffffffffffffffffffffffffffffffffffff166381bda09b60206000827c010000000000000000000000000000000000000000000000000000000002600052600460006000866161da5a03f161011957005b6100bf60006100c961003d565b8060005260206000f35b8060005260206000f35b600080547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016919091179081905560ff16919050565b505060005163ffffffff166002141561019d575b5b505090565b505060005163ffffffff1660011415610194575b60456101a7600039604560006000f090508073ffffffffffffffffffffffffffffffffffffffff166381bda09b60206000827c010000000000000000000000000000000000000000000000000000000002600052600460006000866161da5a03f16100ff57005b60009250610114565b600092506101145600603980600c6000396000f3007c0100000000000000000000000000000000000000000000000000000000600035046381bda09b8114602d57005b60026000818152602090f3603980600c6000396000f3007c0100000000000000000000000000000000000000000000000000000000600035046381bda09b8114602d57005b60016000818152602090f3", "nonce" : "0", "storage" : { } From 55186b689a94d771ae75b3a5ba6cfd4c9e8cb3a4 Mon Sep 17 00:00:00 2001 From: winsvega Date: Mon, 18 May 2015 13:32:26 +0300 Subject: [PATCH 248/461] Blocktests: SimpleTx3 --- .../bcValidBlockTestFiller.json | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) diff --git a/test/libethereum/BlockTestsFiller/bcValidBlockTestFiller.json b/test/libethereum/BlockTestsFiller/bcValidBlockTestFiller.json index 2d1bb9cfd..2dbbb5032 100644 --- a/test/libethereum/BlockTestsFiller/bcValidBlockTestFiller.json +++ b/test/libethereum/BlockTestsFiller/bcValidBlockTestFiller.json @@ -280,6 +280,96 @@ ] }, + "SimpleTx3" : { + "genesisBlockHeader" : { + "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1", + "difficulty" : "131072", + "extraData" : "0x42", + "gasLimit" : "3141592", + "gasUsed" : "0", + "mixHash" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "nonce" : "0x0102030405060708", + "number" : "0", + "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000", + "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "stateRoot" : "0xf99eb1626cfa6db435c0836235942d7ccaa935f1ae247d3f1c21e495685f903a", + "timestamp" : "0x54c98c81", + "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + }, + "expect" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "10" + }, + "000000000000000000000000000b9331677e6ebf" : { + "balance" : "10" + }, + "b94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "10" + } + }, + "pre" : { + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "10000000000", + "nonce" : "0", + "code" : "", + "storage": {} + }, + "31bb58672e8bf7684108feeacf424ab62b873824" : { + "balance" : "10000000000", + "nonce" : "0", + "code" : "", + "storage": {} + }, + "fa7f04899691becd07dd3081d0a2f3ee7640af52" : { + "balance" : "10000000000", + "nonce" : "3", + "code" : "", + "storage": {} + } + }, + "blocks" : [ + { + "transactions" : [ + { + "data" : "", + "gasLimit" : "50000", + "gasPrice" : "10", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "10" + }, + { + "data" : "", + "gasLimit" : "0x5208", + "gasPrice" : "0x01", + "nonce" : "0x00", + "r" : "0x98ff921201554726367d2be8c804a7ff89ccf285ebc57dff8ae4c44b9c19ac4a", + "s" : "0x8887321be575c8095f789dd4c743dfe42c1820f9231f98a962b210e3ac2452a3", + "to" : "000000000000000000000000000b9331677e6ebf", + "v" : "0x1c", + "value" : "0x0a" + }, + { + "data" : "0x", + "gasLimit" : "0x5208", + "gasPrice" : "0x01", + "nonce" : "0x03", + "r" : "0x98ff921201554726367d2be8c804a7ff89ccf285ebc57dff8ae4c44b9c19ac4a", + "s" : "0x8887321be575c8095f789dd4c743dfe42c1820f9231f98a962b210e3ac2452a3", + "to" : "b94f5374fce5edbc8e2a8697c15331677e6ebf0b", + "v" : "0x1c", + "value" : "0x0a" + } + ], + "uncleHeaders" : [ + ] + } + ] + }, + "txOrder" : { "genesisBlockHeader" : { "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", From a6f80e6f973f249f61d565e3c3c0a37918bb7cfb Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Mon, 18 May 2015 12:42:21 +0200 Subject: [PATCH 249/461] Use straight homedirectory rather than Application Support. --- libethcore/EthashAux.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/libethcore/EthashAux.cpp b/libethcore/EthashAux.cpp index 59155610f..2c96c3ff0 100644 --- a/libethcore/EthashAux.cpp +++ b/libethcore/EthashAux.cpp @@ -181,10 +181,18 @@ EthashAux::FullType EthashAux::full(h256 const& _seedHash, bool _createIfMissing return ret; } +#define DEV_IF_THROWS(X) try { X; } catch (...) + unsigned EthashAux::computeFull(h256 const& _seedHash) { Guard l(get()->x_fulls); - uint64_t blockNumber = EthashAux::number(_seedHash); + uint64_t blockNumber; + + DEV_IF_THROWS(blockNumber = EthashAux::number(_seedHash)) + { + return 0; + } + if (FullType ret = get()->m_fulls[_seedHash].lock()) { get()->m_lastUsedFull = ret; @@ -232,5 +240,8 @@ Ethash::Result EthashAux::eval(h256 const& _seedHash, h256 const& _headerHash, N { if (FullType dag = get()->m_fulls[_seedHash].lock()) return dag->compute(_headerHash, _nonce); - return EthashAux::get()->light(_seedHash)->compute(_headerHash, _nonce); + DEV_IF_THROWS(return EthashAux::get()->light(_seedHash)->compute(_headerHash, _nonce)) + { + return Ethash::Result(~h256(), h256()); + } } From fea144622a5e017446ab1660f426dead40647452 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Mon, 18 May 2015 13:16:46 +0200 Subject: [PATCH 250/461] Bump and build fix. --- libdevcore/Common.cpp | 2 +- libdevcrypto/FileSystem.cpp | 5 ----- libethcore/Ethash.h | 1 - libethcore/EthashAux.cpp | 2 +- 4 files changed, 2 insertions(+), 8 deletions(-) diff --git a/libdevcore/Common.cpp b/libdevcore/Common.cpp index 7171c4a2b..cb9b94de8 100644 --- a/libdevcore/Common.cpp +++ b/libdevcore/Common.cpp @@ -28,7 +28,7 @@ using namespace dev; namespace dev { -char const* Version = "0.9.22"; +char const* Version = "0.9.23"; const u256 UndefinedU256 = ~(u256)0; diff --git a/libdevcrypto/FileSystem.cpp b/libdevcrypto/FileSystem.cpp index e3b8c6e3f..adf3a2946 100644 --- a/libdevcrypto/FileSystem.cpp +++ b/libdevcrypto/FileSystem.cpp @@ -70,11 +70,6 @@ std::string dev::getDataDir(std::string _prefix) else dataDirPath = boost::filesystem::path(homeDir); -#if defined(__APPLE__) && defined(__MACH__) - // This eventually needs to be put in proper wrapper (to support sandboxing) - return (dataDirPath / "Library/Application Support/Ethereum").string(); -#else return (dataDirPath / ("." + _prefix)).string(); #endif -#endif } diff --git a/libethcore/Ethash.h b/libethcore/Ethash.h index 0fd2e4cd0..81f842e4f 100644 --- a/libethcore/Ethash.h +++ b/libethcore/Ethash.h @@ -79,7 +79,6 @@ public: static WorkPackage package(BlockInfo const& _header); static void assignResult(Solution const& _r, BlockInfo& _header) { _header.nonce = _r.nonce; _header.mixHash = _r.mixHash; } - class CPUMiner: public Miner, Worker { public: diff --git a/libethcore/EthashAux.cpp b/libethcore/EthashAux.cpp index 2c96c3ff0..805585b4f 100644 --- a/libethcore/EthashAux.cpp +++ b/libethcore/EthashAux.cpp @@ -242,6 +242,6 @@ Ethash::Result EthashAux::eval(h256 const& _seedHash, h256 const& _headerHash, N return dag->compute(_headerHash, _nonce); DEV_IF_THROWS(return EthashAux::get()->light(_seedHash)->compute(_headerHash, _nonce)) { - return Ethash::Result(~h256(), h256()); + return Ethash::Result{ ~h256(), h256() }; } } From 09f13ce1a6a50cc8929212e194434789f7f1768a Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 18 May 2015 14:39:07 +0200 Subject: [PATCH 251/461] small change --- mix/CodeModel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mix/CodeModel.h b/mix/CodeModel.h index 9295c38f0..95c44febe 100644 --- a/mix/CodeModel.h +++ b/mix/CodeModel.h @@ -157,7 +157,7 @@ class GasMap: public QObject Q_PROPERTY(bool isInfinite MEMBER m_isInfinite CONSTANT) public: - GasMap(int _start, int _end, QString _gas, bool _isInfinite, QObject _parent): QObject(_parent), m_start(_start), m_end(_end), m_gas(_gas), m_isInfinite(_isInfinite) { QQmlEngine::setObjectOwnership(this, QQmlEngine::JavaScriptOwnership); } + GasMap(int _start, int _end, QString _gas, bool _isInfinite, QObject* _parent): QObject(_parent), m_start(_start), m_end(_end), m_gas(_gas), m_isInfinite(_isInfinite) { QQmlEngine::setObjectOwnership(this, QQmlEngine::JavaScriptOwnership); } int m_start; int m_end; From 5d759f549b770455d8c1668b03c82b145897d65b Mon Sep 17 00:00:00 2001 From: arkpar Date: Mon, 18 May 2015 15:14:48 +0200 Subject: [PATCH 252/461] mix bugfixes --- mix/ClientModel.cpp | 151 ++++++++++++------------------- mix/qml.qrc | 1 - mix/qml/ContractLibrary.qml | 27 ------ mix/qml/StateListModel.qml | 29 +----- mix/qml/TransactionDialog.qml | 2 + mix/qml/html/cm/codemirror.css | 4 + mix/qml/html/cm/solidityToken.js | 2 +- 7 files changed, 68 insertions(+), 148 deletions(-) delete mode 100644 mix/qml/ContractLibrary.qml diff --git a/mix/ClientModel.cpp b/mix/ClientModel.cpp index 7638db635..54d5db2b5 100644 --- a/mix/ClientModel.cpp +++ b/mix/ClientModel.cpp @@ -256,32 +256,17 @@ void ClientModel::setupState(QVariantMap _state) u256 value = (qvariant_cast(transaction.value("value")))->toU256Wei(); u256 gasPrice = (qvariant_cast(transaction.value("gasPrice")))->toU256Wei(); QString sender = transaction.value("sender").toString(); - bool isStdContract = transaction.value("stdContract").toBool(); bool isContractCreation = transaction.value("isContractCreation").toBool(); bool isFunctionCall = transaction.value("isFunctionCall").toBool(); - if (isStdContract) - { - if (contractId.isEmpty()) //TODO: This is to support old project files, remove later - contractId = functionId; - TransactionSettings transactionSettings(contractId, transaction.value("url").toString()); - transactionSettings.gasPrice = 10000000000000; - transactionSettings.gasAuto = true; - transactionSettings.value = 0; - transactionSettings.sender = Secret(sender.toStdString()); - transactionSequence.push_back(transactionSettings); - } - else - { - if (contractId.isEmpty() && m_codeModel->hasContract()) //TODO: This is to support old project files, remove later - contractId = m_codeModel->contracts().keys()[0]; - TransactionSettings transactionSettings(contractId, functionId, value, gas, gasAuto, gasPrice, Secret(sender.toStdString()), isContractCreation, isFunctionCall); - transactionSettings.parameterValues = transaction.value("parameters").toMap(); + if (contractId.isEmpty() && m_codeModel->hasContract()) //TODO: This is to support old project files, remove later + contractId = m_codeModel->contracts().keys()[0]; + TransactionSettings transactionSettings(contractId, functionId, value, gas, gasAuto, gasPrice, Secret(sender.toStdString()), isContractCreation, isFunctionCall); + transactionSettings.parameterValues = transaction.value("parameters").toMap(); - if (contractId == functionId || functionId == "Constructor") - transactionSettings.functionId.clear(); + if (contractId == functionId || functionId == "Constructor") + transactionSettings.functionId.clear(); - transactionSequence.push_back(transactionSettings); - } + transactionSequence.push_back(transactionSettings); } m_ethAccounts->setAccounts(userAccounts); executeSequence(transactionSequence, accounts, Secret(_state.value("miner").toMap().value("secret").toString().toStdString())); @@ -319,79 +304,66 @@ void ClientModel::executeSequence(vector const& _sequence, continue; } ContractCallDataEncoder encoder; - if (!transaction.stdContractUrl.isEmpty()) + //encode data + CompiledContract const& compilerRes = m_codeModel->contract(ctrInstance.first); + QFunctionDefinition const* f = nullptr; + bytes contractCode = compilerRes.bytes(); + shared_ptr contractDef = compilerRes.sharedContract(); + if (transaction.functionId.isEmpty()) + f = contractDef->constructor(); + else + for (QFunctionDefinition const* tf: contractDef->functionsList()) + if (tf->name() == transaction.functionId) + { + f = tf; + break; + } + if (!f) { - //std contract - bytes const& stdContractCode = m_codeModel->getStdContractCode(transaction.contractId, transaction.stdContractUrl); - TransactionSettings stdTransaction = transaction; - stdTransaction.gasAuto = true; - Address address = deployContract(stdContractCode, stdTransaction); - m_stdContractAddresses[stdTransaction.contractId] = address; - m_stdContractNames[address] = stdTransaction.contractId; + emit runFailed("Function '" + transaction.functionId + tr("' not found. Please check transactions or the contract code.")); + m_running = false; + emit runStateChanged(); + return; + } + if (!transaction.functionId.isEmpty()) + encoder.encode(f); + for (QVariableDeclaration const* p: f->parametersList()) + { + QSolidityType const* type = p->type(); + QVariant value = transaction.parameterValues.value(p->name()); + if (type->type().type == SolidityType::Type::Address) + { + std::pair ctrParamInstance = resolvePair(value.toString()); + value = QVariant(resolveToken(ctrParamInstance, deployedContracts)); + } + encoder.encode(value, type->type()); + } + + if (transaction.functionId.isEmpty() || transaction.functionId == ctrInstance.first) + { + bytes param = encoder.encodedData(); + contractCode.insert(contractCode.end(), param.begin(), param.end()); + Address newAddress = deployContract(contractCode, transaction); + deployedContracts.push_back(newAddress); + std::pair contractToken = retrieveToken(transaction.contractId, deployedContracts); + m_contractAddresses[contractToken] = newAddress; + m_contractNames[newAddress] = contractToken.first; + contractAddressesChanged(); + gasCostsChanged(); } else { - //encode data - CompiledContract const& compilerRes = m_codeModel->contract(ctrInstance.first); - QFunctionDefinition const* f = nullptr; - bytes contractCode = compilerRes.bytes(); - shared_ptr contractDef = compilerRes.sharedContract(); - if (transaction.functionId.isEmpty()) - f = contractDef->constructor(); - else - for (QFunctionDefinition const* tf: contractDef->functionsList()) - if (tf->name() == transaction.functionId) - { - f = tf; - break; - } - if (!f) + auto contractAddressIter = m_contractAddresses.find(ctrInstance); + if (contractAddressIter == m_contractAddresses.end()) { - emit runFailed("Function '" + transaction.functionId + tr("' not found. Please check transactions or the contract code.")); + emit runFailed("Contract '" + transaction.contractId + tr(" not deployed.") + "' " + tr(" Cannot call ") + transaction.functionId); m_running = false; emit runStateChanged(); return; } - if (!transaction.functionId.isEmpty()) - encoder.encode(f); - for (QVariableDeclaration const* p: f->parametersList()) - { - QSolidityType const* type = p->type(); - QVariant value = transaction.parameterValues.value(p->name()); - if (type->type().type == SolidityType::Type::Address) - { - std::pair ctrParamInstance = resolvePair(value.toString()); - value = QVariant(resolveToken(ctrParamInstance, deployedContracts)); - } - encoder.encode(value, type->type()); - } - - if (transaction.functionId.isEmpty() || transaction.functionId == ctrInstance.first) - { - bytes param = encoder.encodedData(); - contractCode.insert(contractCode.end(), param.begin(), param.end()); - Address newAddress = deployContract(contractCode, transaction); - deployedContracts.push_back(newAddress); - std::pair contractToken = retrieveToken(transaction.contractId, deployedContracts); - m_contractAddresses[contractToken] = newAddress; - m_contractNames[newAddress] = contractToken.first; - contractAddressesChanged(); - gasCostsChanged(); - } - else - { - auto contractAddressIter = m_contractAddresses.find(ctrInstance); - if (contractAddressIter == m_contractAddresses.end()) - { - emit runFailed("Contract '" + transaction.contractId + tr(" not deployed.") + "' " + tr(" Cannot call ") + transaction.functionId); - m_running = false; - emit runStateChanged(); - return; - } - callAddress(contractAddressIter->second, encoder.encodedData(), transaction); - } - m_gasCosts.append(m_client->lastExecution().gasUsed); + callAddress(contractAddressIter->second, encoder.encodedData(), transaction); } + m_gasCosts.append(m_client->lastExecution().gasUsed); onNewTransaction(); } m_running = false; @@ -697,14 +669,7 @@ void ClientModel::onNewTransaction() if (creation) { //contract creation - auto const stdContractName = m_stdContractNames.find(tr.contractAddress); - if (stdContractName != m_stdContractNames.end()) - { - function = stdContractName->second; - contract = function; - } - else - function = QObject::tr("Constructor"); + function = QObject::tr("Constructor"); address = QObject::tr("(Create contract)"); } else diff --git a/mix/qml.qrc b/mix/qml.qrc index 6cbc97a78..c47a7254f 100644 --- a/mix/qml.qrc +++ b/mix/qml.qrc @@ -8,7 +8,6 @@ qml/CodeEditorStyle.qml qml/CodeEditorView.qml qml/CommonSeparator.qml - qml/ContractLibrary.qml qml/DebugBasicInfo.qml qml/DebugInfoList.qml qml/Debugger.qml diff --git a/mix/qml/ContractLibrary.qml b/mix/qml/ContractLibrary.qml deleted file mode 100644 index 4f3afafc6..000000000 --- a/mix/qml/ContractLibrary.qml +++ /dev/null @@ -1,27 +0,0 @@ -import QtQuick 2.2 - -Item { - id: contractLibrary - property alias model: contractListModel; - - Connections { - target: mainApplication - onLoaded: { - - //TODO: load a list, dependencies, ets, from external files - contractListModel.append({ - name: "Config", - url: "qrc:///stdc/std.sol", - }); - contractListModel.append({ - name: "NameReg", - url: "qrc:///stdc/std.sol", - }); - } - } - - ListModel { - id: contractListModel - } -} - diff --git a/mix/qml/StateListModel.qml b/mix/qml/StateListModel.qml index b4d9b6bc6..f21c93199 100644 --- a/mix/qml/StateListModel.qml +++ b/mix/qml/StateListModel.qml @@ -22,7 +22,7 @@ Item { s.contracts = []; return { title: s.title, - transactions: s.transactions.map(fromPlainTransactionItem), + transactions: s.transactions.filter(function(t) { return !t.stdContract; }).map(fromPlainTransactionItem), //support old projects by filtering std contracts accounts: s.accounts.map(fromPlainAccountItem), contracts: s.contracts.map(fromPlainAccountItem), miner: s.miner @@ -54,7 +54,6 @@ Item { gas: QEtherHelper.createBigInt(t.gas.value), gasPrice: QEtherHelper.createEther(t.gasPrice.value, t.gasPrice.unit), gasAuto: t.gasAuto, - stdContract: t.stdContract ? true : false, parameters: {}, sender: t.sender, isContractCreation: t.isContractCreation, @@ -122,7 +121,6 @@ Item { gas: { value: t.gas.value() }, gasAuto: t.gasAuto, gasPrice: { value: t.gasPrice.value, unit: t.gasPrice.unit }, - stdContract: t.stdContract, sender: t.sender, parameters: {}, isContractCreation: t.isContractCreation, @@ -189,10 +187,6 @@ Item { } } - ContractLibrary { - id: contractLibrary; - } - ListModel { id: stateListModel property int defaultStateIndex: 0 @@ -226,18 +220,6 @@ Item { item.accounts.push(account); item.miner = account; - //add all stdc contracts - for (var i = 0; i < contractLibrary.model.count; i++) { - var contractTransaction = defaultTransactionItem(); - var contractItem = contractLibrary.model.get(i); - contractTransaction.url = contractItem.url; - contractTransaction.contractId = contractItem.name; - contractTransaction.functionId = contractItem.name; - contractTransaction.stdContract = true; - contractTransaction.sender = item.accounts[0].secret; // default account is used to deploy std contract. - item.transactions.push(contractTransaction); - }; - //add constructors, //TODO: order by dependencies for(var c in codeModel.contracts) { var ctorTr = defaultTransactionItem(); @@ -273,17 +255,12 @@ Item { } function addNewContracts() { - //add new contracts for all states + //add new contracts to empty states var changed = false; for (var c in codeModel.contracts) { for (var s = 0; s < stateListModel.count; s++) { var state = stateList[s]; - for (var t = 0; t < state.transactions.length; t++) { - var transaction = state.transactions[t]; - if (transaction.functionId === c && transaction.contractId === c) - break; - } - if (t === state.transactions.length) { + if (state.transactions.length === 0) { //append this contract var ctorTr = defaultTransactionItem(); ctorTr.functionId = c; diff --git a/mix/qml/TransactionDialog.qml b/mix/qml/TransactionDialog.qml index fe4bfc82e..1437c2562 100644 --- a/mix/qml/TransactionDialog.qml +++ b/mix/qml/TransactionDialog.qml @@ -210,6 +210,8 @@ Dialog { } item.isContractCreation = trType.checked; + if (item.isContractCreation) + item.functionId = item.contractId; item.isFunctionCall = item.functionId !== " - "; if (!item.isContractCreation) diff --git a/mix/qml/html/cm/codemirror.css b/mix/qml/html/cm/codemirror.css index 625baa942..c25a3ddad 100644 --- a/mix/qml/html/cm/codemirror.css +++ b/mix/qml/html/cm/codemirror.css @@ -8,6 +8,10 @@ font-size:12px } +.CodeMirror-search-field { + height:200%; +} + /* BREAKPOINTS */ .breakpoints {width: .8em;} .breakpoint { color: #822; } diff --git a/mix/qml/html/cm/solidityToken.js b/mix/qml/html/cm/solidityToken.js index d8e588a10..1c12278e1 100644 --- a/mix/qml/html/cm/solidityToken.js +++ b/mix/qml/html/cm/solidityToken.js @@ -5,7 +5,7 @@ function solCurrency() function solKeywords() { - return { "break": true, "case": true, "constant": true, "continue": true, "contract": true, "default": true, "do": true, "else": true, "event": true, "external": true, "is": true, "indexed": true, "for": true, "function": true, "if": true, "import": true, "mapping": true, "modifier": true, "new": true, "public": true, "private": true, "internal": true, "return": true, "returns": true, "struct": true, "switch": true, "var": true, "while": true, "enum": true }; + return { "break": true, "case": true, "constant": true, "continue": true, "contract": true, "default": true, "delete": true, "do": true, "else": true, "event": true, "external": true, "is": true, "indexed": true, "for": true, "function": true, "if": true, "import": true, "mapping": true, "modifier": true, "new": true, "public": true, "private": true, "internal": true, "return": true, "returns": true, "struct": true, "switch": true, "var": true, "while": true, "enum": true }; } function solStdContract() From db12fc1d83c534e68c83daceb5ee46f236b0594e Mon Sep 17 00:00:00 2001 From: subtly Date: Mon, 18 May 2015 15:28:19 +0200 Subject: [PATCH 253/461] Don't abort connecting to required peer when it's not in node table. --- libp2p/Host.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libp2p/Host.cpp b/libp2p/Host.cpp index 9c3e629d4..e2599c1d5 100644 --- a/libp2p/Host.cpp +++ b/libp2p/Host.cpp @@ -475,9 +475,11 @@ void Host::connect(std::shared_ptr const& _p) if (!!m_nodeTable && !m_nodeTable->haveNode(_p->id)) { - clog(NetWarn) << "Aborted connect. Node not in node table."; + // connect was attempted, so try again by adding to node table m_nodeTable->addNode(*_p.get()); - return; + // abort unless peer is required + if (!_p->required) + return; } // prevent concurrently connecting to a node From 66c2e4b4598a3160f95d9dc09a4b14faa2a2bf4a Mon Sep 17 00:00:00 2001 From: subtly Date: Mon, 18 May 2015 15:56:45 +0200 Subject: [PATCH 254/461] normalize path for osx --- libethash/io_posix.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/libethash/io_posix.c b/libethash/io_posix.c index b030748a9..1fe82973f 100644 --- a/libethash/io_posix.c +++ b/libethash/io_posix.c @@ -90,20 +90,16 @@ bool ethash_file_size(FILE* f, size_t* ret_size) bool ethash_get_default_dirname(char* strbuf, size_t buffsize) { -#if defined(__APPLE__) - static const char dir_suffix[] = "Ethash/"; + static const char dir_suffix[] = ".ethash/"; strbuf[0] = '\0'; char* home_dir = getenv("HOME"); +#if defined(__APPLE__) if (!home_dir || strlen(home_dir) == 0) { struct passwd* pwd = getpwuid(getuid()); if (pwd) home_dir = pwd->pw_dir; } -#else - static const char dir_suffix[] = ".ethash/"; - strbuf[0] = '\0'; - char* home_dir = getenv("HOME"); #endif size_t len = strlen(home_dir); From 4e4f899745e190d5b8507488c0e7a2491ad8e6d9 Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Mon, 18 May 2015 16:29:26 +0200 Subject: [PATCH 255/461] add create retrun value tests --- .../stCallCreateCallCodeTestFiller.json | 238 ++++++++++++++++++ .../stRecursiveCreateFiller.json | 36 ++- 2 files changed, 273 insertions(+), 1 deletion(-) diff --git a/test/libethereum/StateTestsFiller/stCallCreateCallCodeTestFiller.json b/test/libethereum/StateTestsFiller/stCallCreateCallCodeTestFiller.json index d75439f78..682b0cb3e 100644 --- a/test/libethereum/StateTestsFiller/stCallCreateCallCodeTestFiller.json +++ b/test/libethereum/StateTestsFiller/stCallCreateCallCodeTestFiller.json @@ -787,5 +787,243 @@ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", "data" : "0x60406103ca600439600451602451336000819055506000600481905550816001819055508060028190555042600581905550336003819055505050610381806100496000396000f30060003560e060020a9004806343d726d61461004257806391b7f5ed14610050578063d686f9ee14610061578063f5bade661461006f578063fcfff16f1461008057005b61004a6101de565b60006000f35b61005b6004356100bf565b60006000f35b610069610304565b60006000f35b61007a60043561008e565b60006000f35b6100886100f0565b60006000f35b600054600160a060020a031633600160a060020a031614156100af576100b4565b6100bc565b806001819055505b50565b600054600160a060020a031633600160a060020a031614156100e0576100e5565b6100ed565b806002819055505b50565b600054600160a060020a031633600160a060020a031614806101255750600354600160a060020a031633600160a060020a0316145b61012e57610161565b60016004819055507f59ebeb90bc63057b6515673c3ecf9438e5058bca0f92585014eced636878c9a560006000a16101dc565b60045460011480610173575060015434105b6101b85760016004819055507f59ebeb90bc63057b6515673c3ecf9438e5058bca0f92585014eced636878c9a560006000a142600581905550336003819055506101db565b33600160a060020a03166000346000600060006000848787f16101d757005b5050505b5b565b60006004546000146101ef576101f4565b610301565b600054600160a060020a031633600160a060020a031614801561022c5750600054600160a060020a0316600354600160a060020a0316145b61023557610242565b6000600481905550610301565b600354600160a060020a031633600160a060020a03161461026257610300565b600554420360025402905060015481116102c757600354600160a060020a0316600082600154036000600060006000848787f161029b57005b505050600054600160a060020a03166000826000600060006000848787f16102bf57005b5050506102ee565b600054600160a060020a031660006001546000600060006000848787f16102ea57005b5050505b60006004819055506000546003819055505b5b50565b6000600054600160a060020a031633600160a060020a031614156103275761032c565b61037e565b600554420360025402905060015481116103455761037d565b600054600160a060020a031660006001546000600060006000848787f161036857005b50505060006004819055506000546003819055505b5b505600000000000000000000000000000000000000000000000000000000000000420000000000000000000000000000000000000000000000000000000000000023" } + }, + + "createInitFailStackUnderflow": { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "100000000", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000000", + "nonce" : "0", + "code" : "{(MSTORE8 0 0x01 ) (SUICIDE (CREATE 1 0 1)) }", + "storage": {} + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1000000000000000000", + "nonce" : "0", + "code" : "", + "storage": {} + } + }, + "transaction" : { + "nonce" : "0", + "gasPrice" : "1", + "gasLimit" : "100000000", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "100000", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "data" : "" + } + }, + + "createInitFailUndefinedInstruction": { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "100000000", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000000", + "nonce" : "0", + "code" : "{(MSTORE8 0 0xf4 ) (SUICIDE (CREATE 1 0 1)) }", + "storage": {} + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1000000000000000000", + "nonce" : "0", + "code" : "", + "storage": {} + } + }, + "transaction" : { + "nonce" : "0", + "gasPrice" : "1", + "gasLimit" : "100000000", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "100000", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "data" : "" + } + }, + + "createInitFailBadJumpDestination": { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "100000000", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000000", + "nonce" : "0", + "code" : "{(MSTORE8 0 0x56 ) (SUICIDE (CREATE 1 0 1)) }", + "storage": {} + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1000000000000000000", + "nonce" : "0", + "code" : "", + "storage": {} + } + }, + "transaction" : { + "nonce" : "0", + "gasPrice" : "1", + "gasLimit" : "100000000", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "100000", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "data" : "" + } + }, + + "createInitFail_OOGduringInit": { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "100000000", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000000", + "nonce" : "0", + "code" : "{(MSTORE8 0 0x5a ) (SUICIDE (CREATE 1 0 1)) }", + "storage": {} + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1000000000000000000", + "nonce" : "0", + "code" : "", + "storage": {} + } + }, + "transaction" : { + "nonce" : "0", + "gasPrice" : "1", + "gasLimit" : "53021", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "100000", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "data" : "" + } + }, + + "createInitFailStackSizeLargerThan1024": { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "100000000", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000000", + "nonce" : "0", + "code" : "{(MSTORE 0 0x6103ff6000525b7f0102030405060708090a0102030405060708090a01020304) (MSTORE 32 0x05060708090a0102600160005103600052600051600657000000000000000000 ) (SUICIDE (CREATE 1 0 64)) }", + "storage": {} + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1000000000000000000", + "nonce" : "0", + "code" : "", + "storage": {} + } + }, + "transaction" : { + "nonce" : "0", + "gasPrice" : "1", + "gasLimit" : "100000000", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "100000", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "data" : "" + } + }, + + "createFailBalanceTooLow": { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "100000000", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000000", + "nonce" : "0", + "code" : "{(MSTORE8 0 0x5a ) (SUICIDE (CREATE 1000000000000000024 0 1)) }", + "storage": {} + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1000000000000000000", + "nonce" : "0", + "code" : "", + "storage": {} + } + }, + "transaction" : { + "nonce" : "0", + "gasPrice" : "1", + "gasLimit" : "53021", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "23", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "data" : "" + } + }, + + "createInitOOGforCREATE": { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "100000000", + "currentDifficulty" : "256", + "currentTimestamp" : 1, + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000000", + "nonce" : "0", + "code" : "{(MSTORE8 0 0x5a ) (SUICIDE (CREATE 1 0 1)) }", + "storage": {} + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1000000000000000000", + "nonce" : "0", + "code" : "", + "storage": {} + } + }, + "transaction" : { + "nonce" : "0", + "gasPrice" : "1", + "gasLimit" : "53020", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "100000", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "data" : "" + } } } diff --git a/test/libethereum/StateTestsFiller/stRecursiveCreateFiller.json b/test/libethereum/StateTestsFiller/stRecursiveCreateFiller.json index 25a909d9c..acaccbeb2 100644 --- a/test/libethereum/StateTestsFiller/stRecursiveCreateFiller.json +++ b/test/libethereum/StateTestsFiller/stRecursiveCreateFiller.json @@ -31,5 +31,39 @@ "secretKey": "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", "data": "" } - } + }, + + "recursiveCreateReturnValue": { + "env": { + "previousHash": "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber": "0", + "currentGasLimit": "10000000000", + "currentDifficulty": "256", + "currentTimestamp": 1, + "currentCoinbase": "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "pre": { + "095e7baea6a6c7c4c2dfeb977efac326af552d87": { + "balance": "20000000", + "nonce" : "0", + "code": "{(CODECOPY 0 0 32) [[ 0 ]] (ADD (CREATE 0 0 32) 1) }", + "storage": {} + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b": { + "balance": "1000000000000000000", + "nonce" : "0", + "code": "", + "storage": {} + } + }, + "transaction": { + "nonce": "0", + "gasPrice": "1", + "gasLimit": "1000000000", + "to": "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value": "100000", + "secretKey": "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "data": "" + } + } } From 6879c04393658f382ecd441947831c3a08e0830d Mon Sep 17 00:00:00 2001 From: subtly Date: Mon, 18 May 2015 16:54:32 +0200 Subject: [PATCH 256/461] Update paths so macos is consistent with linux and windows isn't using wchar. --- io_posix.c | 13 +++++++++++++ io_win32.c | 4 ++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/io_posix.c b/io_posix.c index 7f03d5482..1fe82973f 100644 --- a/io_posix.c +++ b/io_posix.c @@ -26,6 +26,10 @@ #include #include #include +#if defined(__APPLE__) +#include +#include +#endif FILE* ethash_fopen(char const* file_name, char const* mode) { @@ -89,6 +93,15 @@ bool ethash_get_default_dirname(char* strbuf, size_t buffsize) static const char dir_suffix[] = ".ethash/"; strbuf[0] = '\0'; char* home_dir = getenv("HOME"); +#if defined(__APPLE__) + if (!home_dir || strlen(home_dir) == 0) + { + struct passwd* pwd = getpwuid(getuid()); + if (pwd) + home_dir = pwd->pw_dir; + } +#endif + size_t len = strlen(home_dir); if (!ethash_strncat(strbuf, buffsize, home_dir, len)) { return false; diff --git a/io_win32.c b/io_win32.c index 2e6c8deb8..34f1aaa77 100644 --- a/io_win32.c +++ b/io_win32.c @@ -87,9 +87,9 @@ bool ethash_file_size(FILE* f, size_t* ret_size) bool ethash_get_default_dirname(char* strbuf, size_t buffsize) { - static const char dir_suffix[] = "Appdata\\Ethash\\"; + static const char dir_suffix[] = "Ethash\\"; strbuf[0] = '\0'; - if (!SUCCEEDED(SHGetFolderPathW(NULL, CSIDL_PROFILE, NULL, 0, (WCHAR*)strbuf))) { + if (!SUCCEEDED(SHGetFolderPathA(NULL, CSIDL_LOCAL_APPDATA, NULL, 0, (CHAR*)strbuf))) { return false; } if (!ethash_strncat(strbuf, buffsize, "\\", 1)) { From aa43d7261d5433a231f9d36abea074ce95f8c811 Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Mon, 18 May 2015 16:59:35 +0200 Subject: [PATCH 257/461] fix Create return value for exceptional haltings --- libethereum/Executive.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libethereum/Executive.cpp b/libethereum/Executive.cpp index 2d8dbdc16..a1eee9440 100644 --- a/libethereum/Executive.cpp +++ b/libethereum/Executive.cpp @@ -246,6 +246,9 @@ bool Executive::go(OnOpFunc const& _onOp) m_endGas = 0; m_excepted = toTransactionException(_e); m_ext->revert(); + + if (m_isCreation) + m_newAddress = Address(); } catch (Exception const& _e) { From 798012bfc89cf0e5806824b6253065e63ee3dfb1 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 18 May 2015 17:02:54 +0200 Subject: [PATCH 258/461] second error location --- mix/CodeModel.cpp | 35 ++++++++++++++++-------- mix/CodeModel.h | 3 ++- mix/qml/CodeEditorView.qml | 2 +- mix/qml/WebCodeEditor.qml | 21 +++++++++++---- mix/qml/html/cm/errorannotation.js | 26 +++++++++--------- mix/qml/html/cm/solidityToken.js | 2 +- mix/qml/html/codeeditor.js | 43 ++++++++++++++++++++++-------- 7 files changed, 89 insertions(+), 43 deletions(-) diff --git a/mix/CodeModel.cpp b/mix/CodeModel.cpp index 5c6ec07c0..82f9291df 100644 --- a/mix/CodeModel.cpp +++ b/mix/CodeModel.cpp @@ -309,24 +309,37 @@ void CodeModel::runCompilationJob(int _jobId) } catch (dev::Exception const& _exception) { - std::ostringstream error; + std::stringstream error; solidity::SourceReferenceFormatter::printExceptionInformation(error, _exception, "Error", cs); QString message = QString::fromStdString(error.str()); - QString sourceName; - if (SourceLocation const* location = boost::get_error_info(_exception)) - { - if (location->sourceName) - sourceName = QString::fromStdString(*location->sourceName); - if (!sourceName.isEmpty()) - if (CompiledContract* contract = contractByDocumentId(sourceName)) - message = message.replace(sourceName, contract->contract()->name()); //substitute the location to match our contract names - } - compilationError(message, sourceName); + QVariantMap firstLocation; + QVariantMap secondLocation; + if (SourceLocation const* first = boost::get_error_info(_exception)) + firstLocation = resolveCompilationErrorLocation(cs, *first); + if (SecondarySourceLocation const* second = boost::get_error_info(_exception)) + secondLocation = resolveCompilationErrorLocation(cs, second->infos.front().second); + compilationError(message, firstLocation, secondLocation); } m_compiling = false; emit stateChanged(); } +QVariantMap CodeModel::resolveCompilationErrorLocation(CompilerStack const& _compiler, SourceLocation const& _location) +{ + std::tuple pos = _compiler.positionFromSourceLocation(_location); + QVariantMap startError; + startError.insert("line", std::get<0>(pos) - 1); + startError.insert("column", std::get<1>(pos) - 1); + QVariantMap endError; + endError.insert("line", std::get<2>(pos) - 1); + endError.insert("column", std::get<3>(pos) - 1); + QVariantMap error; + error.insert("start", startError); + error.insert("end", endError); + error.insert("source", QString::fromStdString(*_location.sourceName)); + return error; +} + void CodeModel::collectContracts(dev::solidity::CompilerStack const& _cs, std::vector const& _sourceNames) { Guard pl(x_pendingContracts); diff --git a/mix/CodeModel.h b/mix/CodeModel.h index a0b03951f..05d013f9a 100644 --- a/mix/CodeModel.h +++ b/mix/CodeModel.h @@ -175,7 +175,7 @@ signals: /// Emitted on compilation complete void compilationComplete(); /// Emitted on compilation error - void compilationError(QString _error, QString _sourceName); + void compilationError(QString _error, QVariantMap _firstErrorLoc, QVariantMap _secondErrorLoc); /// Internal signal used to transfer compilation job to background thread void scheduleCompilationJob(int _jobId); /// Emitted if there are any changes in the code model @@ -198,6 +198,7 @@ private: void stop(); void releaseContracts(); void collectContracts(dev::solidity::CompilerStack const& _cs, std::vector const& _sourceNames); + QVariantMap resolveCompilationErrorLocation(dev::solidity::CompilerStack const& _cs, dev::SourceLocation const& _location); std::atomic m_compiling; mutable dev::Mutex x_contractMap; diff --git a/mix/qml/CodeEditorView.qml b/mix/qml/CodeEditorView.qml index bb7e203bf..8ebb7319f 100644 --- a/mix/qml/CodeEditorView.qml +++ b/mix/qml/CodeEditorView.qml @@ -173,7 +173,7 @@ Item { Connections { target: codeModel onCompilationError: { - sourceInError = _sourceName; + sourceInError = _firstErrorLoc.source; } onCompilationComplete: { sourceInError = ""; diff --git a/mix/qml/WebCodeEditor.qml b/mix/qml/WebCodeEditor.qml index 38f2327b1..49a0576cc 100644 --- a/mix/qml/WebCodeEditor.qml +++ b/mix/qml/WebCodeEditor.qml @@ -137,17 +137,28 @@ Item { editorBrowser.runJavaScript("compilationComplete()", function(result) { }); } - function compilationError(error, sourceName) + function compilationError(error, firstLocation, secondLocation) { - if (sourceName !== parent.sourceName) + console.log("current " + parent.sourceName); + console.log("source " + firstLocation.source); + if (firstLocation.source !== parent.sourceName && secondLocation.source !== parent.sourceName) return; if (!editorBrowser || !error) return; - var errorInfo = ErrorLocationFormater.extractErrorInfo(error, false); - if (errorInfo.line && errorInfo.column) - editorBrowser.runJavaScript("compilationError('" + errorInfo.line + "', '" + errorInfo.column + "', '" + errorInfo.errorDetail + "')", function(result) { }); + if (firstLocation.start.line) + { + var detail = error.split('\n')[0]; + var reg = detail.match(/:\d+:\d+:/g); + if (reg !== null) + detail = detail.replace(reg[0], ""); + editorBrowser.runJavaScript("compilationError('" + JSON.stringify(firstLocation) + "', '" + JSON.stringify(secondLocation) + "', '" + detail + "')", function(result){}); + } else + { + console.log("e d qml"); editorBrowser.runJavaScript("compilationComplete()", function(result) { }); + } + } Timer diff --git a/mix/qml/html/cm/errorannotation.js b/mix/qml/html/cm/errorannotation.js index 071f0e0d8..f5266d4dc 100644 --- a/mix/qml/html/cm/errorannotation.js +++ b/mix/qml/html/cm/errorannotation.js @@ -1,42 +1,39 @@ -function ErrorAnnotation(editor, line, column, content) +function ErrorAnnotation(editor, location, content) { + this.location = JSON.parse(location); this.opened = false; - this.line = line; - this.column = column; + this.rawContent = content; this.content = content.replace("Contract Error:", ""); this.editor = editor; this.errorMark = null; this.lineWidget = null; this.init(); - this.open(); + if (this.content) + this.open(); } ErrorAnnotation.prototype.init = function() { - var separators = [';', ',', '\\\(', '\\\{', '\\\}', '\\\)', ':']; - var errorPart = editor.getLine(this.line).substring(this.column); - var incrMark = this.column + errorPart.split(new RegExp(separators.join('|'), 'g'))[0].length; - if (incrMark === this.column) - incrMark = this.column + 1; - this.errorMark = editor.markText({ line: this.line, ch: this.column }, { line: this.line, ch: incrMark }, { className: "CodeMirror-errorannotation", inclusiveRight: true }); + this.errorMark = editor.markText({ line: this.location.start.line, ch: this.location.start.column }, { line: this.location.end.line, ch: this.location.end.column }, { className: "CodeMirror-errorannotation", inclusiveRight: true }); } ErrorAnnotation.prototype.open = function() { - if (this.line) + if (this.location.start.line) { var node = document.createElement("div"); node.id = "annotation" node.innerHTML = this.content; node.className = "CodeMirror-errorannotation-context"; - this.lineWidget = this.editor.addLineWidget(this.line, node, { coverGutter: false }); + this.lineWidget = this.editor.addLineWidget(this.location.start.line, node, { coverGutter: false }); this.opened = true; } } ErrorAnnotation.prototype.close = function() { - this.lineWidget.clear(); + if (this.lineWidget) + this.lineWidget.clear(); this.opened = false; } @@ -47,3 +44,6 @@ ErrorAnnotation.prototype.destroy = function() if (this.errorMark) this.errorMark.clear(); } + + + diff --git a/mix/qml/html/cm/solidityToken.js b/mix/qml/html/cm/solidityToken.js index d8e588a10..d803697cb 100644 --- a/mix/qml/html/cm/solidityToken.js +++ b/mix/qml/html/cm/solidityToken.js @@ -5,7 +5,7 @@ function solCurrency() function solKeywords() { - return { "break": true, "case": true, "constant": true, "continue": true, "contract": true, "default": true, "do": true, "else": true, "event": true, "external": true, "is": true, "indexed": true, "for": true, "function": true, "if": true, "import": true, "mapping": true, "modifier": true, "new": true, "public": true, "private": true, "internal": true, "return": true, "returns": true, "struct": true, "switch": true, "var": true, "while": true, "enum": true }; + return { "delete": true, "break": true, "case": true, "constant": true, "continue": true, "contract": true, "default": true, "do": true, "else": true, "event": true, "external": true, "is": true, "indexed": true, "for": true, "function": true, "if": true, "import": true, "mapping": true, "modifier": true, "new": true, "public": true, "private": true, "internal": true, "return": true, "returns": true, "struct": true, "switch": true, "var": true, "while": true, "enum": true }; } function solStdContract() diff --git a/mix/qml/html/codeeditor.js b/mix/qml/html/codeeditor.js index d25fbd091..4c8af5888 100644 --- a/mix/qml/html/codeeditor.js +++ b/mix/qml/html/codeeditor.js @@ -158,30 +158,43 @@ showWarning = function(content) } var annotation = null; +var secondaryAnnotation = null; var compilationCompleteBool = true; -compilationError = function(line, column, content) +compilationError = function(location, secondLocation, error) { compilationCompleteBool = false; window.setTimeout(function(){ if (compilationCompleteBool) return; - line = parseInt(line); - column = parseInt(column); - if (line > 0) - line = line - 1; - if (column > 0) - column = column - 1; + var loc = JSON.parse(location); if (annotation == null) - annotation = new ErrorAnnotation(editor, line, column, content); - else if (annotation.line !== line || annotation.column !== column || annotation.content !== content) + { + annotation = new ErrorAnnotation(editor, location, error); + if (secondLocation.start) + secondaryAnnotation = new ErrorAnnotation(editor, secondLocation, ""); + } + else if (annotation.location.start.line !== loc.start.line || annotation.location.start.column !== loc.start.column || annotation.rawContent !== error) { annotation.destroy(); - annotation = new ErrorAnnotation(editor, line, column, content); + annotation = new ErrorAnnotation(editor, location, error); + if (secondaryAnnotation) + secondaryAnnotation.destroy(); + secondaryAnnotation = new ErrorAnnotation(editor, secondLocation, ""); } }, 500) } +formatSource = function(line, column) +{ + line = parseInt(line); + column = parseInt(column); + if (line > 0) + line = line - 1; + if (column > 0) + column = column - 1; +} + compilationComplete = function() { if (annotation !== null) @@ -189,12 +202,20 @@ compilationComplete = function() annotation.destroy(); annotation = null; } + + if (secondaryAnnotation !== null) + { + secondaryAnnotation.destroy(); + secondaryAnnotation = null; + } + compilationCompleteBool = true; + console.log("end"); } goToCompilationError = function() { - editor.setCursor(annotation.line, annotation.column) + editor.setCursor(annotation.start.line, annotation.start.column) } setFontSize = function(size) From 53d63f80c3eb42eab38e3a0e9d58b7dd304efea1 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Mon, 18 May 2015 17:15:30 +0200 Subject: [PATCH 259/461] Pull out shared code into Aux file. --- alethzero/MainWin.cpp | 3 + eth/main.cpp | 549 ++++------------------------------------- ethminer/MinerAux.h | 483 ++++++++++++++++++++++++++++++++++++ ethminer/main.cpp | 429 +------------------------------- libethcore/Ethash.cpp | 4 +- libethcore/EthashAux.h | 2 + 6 files changed, 550 insertions(+), 920 deletions(-) create mode 100644 ethminer/MinerAux.h diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index 191db6eb4..9486f9f01 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -1166,6 +1166,9 @@ void Main::on_turboMining_triggered() void Main::refreshBlockChain() { + if (!ui->blocks->isVisible()) + return; + DEV_TIMED_FUNCTION; cwatch << "refreshBlockChain()"; diff --git a/eth/main.cpp b/eth/main.cpp index 5f2349ae4..1cf918346 100644 --- a/eth/main.cpp +++ b/eth/main.cpp @@ -57,6 +57,7 @@ #include "PhoneHome.h" #include "Farm.h" #endif +#include using namespace std; using namespace dev; using namespace dev::p2p; @@ -64,18 +65,6 @@ using namespace dev::eth; using namespace boost::algorithm; using dev::eth::Instruction; -#undef RETURN - -bool isTrue(std::string const& _m) -{ - return _m == "on" || _m == "yes" || _m == "true" || _m == "1"; -} - -bool isFalse(std::string const& _m) -{ - return _m == "off" || _m == "no" || _m == "false" || _m == "0"; -} - void interactiveHelp() { cout @@ -159,33 +148,13 @@ void help() << " --port Connect to remote port (default: 30303)." << endl << " --network-id Only connect to other hosts with this network id (default:0)." << endl << " --upnp Use UPnP for NAT (default: on)." << endl - << endl + << endl; + MinerCLI::streamHelp(cout); + cout << "Client structured logging:" << endl << " --structured-logging Enable structured logging (default output to stdout)." << endl << " --structured-logging-format Set the structured logging time format." << endl << " --structured-logging-url Set the structured logging destination (currently only file:// supported)." << endl -#if ETH_JSONRPC || !ETH_TRUE - << endl - << "Work farming mode:" << endl - << " -F,--farm Put into mining farm mode with the work server at URL. Use with -G/--opencl." << endl - << " --farm-recheck Leave n ms between checks for changed work (default: 500)." << endl -#endif - << endl - << "Ethash verify mode:" << endl - << " -w,--check-pow Check PoW credentials for validity." << endl - << endl - << "Benchmarking mode:" << endl - << " -M,--benchmark Benchmark for mining and exit; use with --cpu and --opencl." << endl - << " --benchmark-warmup Set the duration of warmup for the benchmark tests (default: 3)." << endl - << " --benchmark-trial Set the duration for each trial for the benchmark tests (default: 3)." << endl - << " --benchmark-trials Set the duration of warmup for the benchmark tests (default: 5)." << endl -#if ETH_JSONRPC || !ETH_TRUE - << " --phone-home When benchmarking, publish results (default: on)" << endl -#endif - << endl - << "DAG creation mode:" << endl - << " -D,--create-dag Create the DAG in preparation for mining on given block and exit." << endl - << endl << "Import/export modes:" << endl << " -I,--import Import file as a concatenated series of blocks and exit." << endl << " -E,--export Export file as a concatenated series of blocks and exit." << endl @@ -208,20 +177,13 @@ void help() exit(0); } -string credits(bool _interactive = false) +string ethCredits(bool _interactive = false) { std::ostringstream cout; - cout - << "Ethereum (++) " << dev::Version << endl - << " Code by Gav Wood et al, (c) 2013, 2014, 2015." << endl - << " Based on a design by Vitalik Buterin." << endl << endl; - if (_interactive) cout - << "Type 'netstart 30303' to start networking" << endl - << "Type 'connect " << Host::pocHost() << " 30303' to connect" << endl << "Type 'exit' to quit" << endl << endl; - return cout.str(); + return credits() + cout.str(); } void version() @@ -263,23 +225,11 @@ enum class NodeMode Full }; -void doInitDAG(unsigned _n) -{ - BlockInfo bi; - bi.number = _n; - cout << "Initializing DAG for epoch beginning #" << (bi.number / 30000 * 30000) << " (seedhash " << bi.seedHash().abridged() << "). This will take a while." << endl; - Ethash::prep(bi); - exit(0); -} - enum class OperationMode { Node, Import, - Export, - DAGInit, - Benchmark, - Farm + Export }; enum class Format @@ -289,148 +239,6 @@ enum class Format Human }; -enum class MinerType -{ - CPU, - GPU -}; - -void doBenchmark(MinerType _m, bool _phoneHome, unsigned _warmupDuration = 15, unsigned _trialDuration = 3, unsigned _trials = 5) -{ - BlockInfo genesis = CanonBlockChain::genesis(); - genesis.difficulty = 1 << 18; - cdebug << genesis.boundary(); - - GenericFarm f; - f.onSolutionFound([&](ProofOfWork::Solution) { return false; }); - - string platformInfo = _m == MinerType::CPU ? ProofOfWork::CPUMiner::platformInfo() : _m == MinerType::GPU ? ProofOfWork::GPUMiner::platformInfo() : ""; - cout << "Benchmarking on platform: " << platformInfo << endl; - - cout << "Preparing DAG..." << endl; - Ethash::prep(genesis); - - genesis.difficulty = u256(1) << 63; - genesis.noteDirty(); - f.setWork(genesis); - if (_m == MinerType::CPU) - f.startCPU(); - else if (_m == MinerType::GPU) - f.startGPU(); - - map results; - uint64_t mean = 0; - uint64_t innerMean = 0; - for (unsigned i = 0; i <= _trials; ++i) - { - if (!i) - cout << "Warming up..." << endl; - else - cout << "Trial " << i << "... " << flush; - this_thread::sleep_for(chrono::seconds(i ? _trialDuration : _warmupDuration)); - - auto mp = f.miningProgress(); - f.resetMiningProgress(); - if (!i) - continue; - auto rate = mp.rate(); - - cout << rate << endl; - results[rate] = mp; - mean += rate; - if (i > 1 && i < 5) - innerMean += rate; - } - f.stop(); - innerMean /= (_trials - 2); - cout << "min/mean/max: " << results.begin()->second.rate() << "/" << (mean / _trials) << "/" << results.rbegin()->second.rate() << " H/s" << endl; - cout << "inner mean: " << innerMean << " H/s" << endl; - - (void)_phoneHome; -#if ETH_JSONRPC || !ETH_TRUE - if (_phoneHome) - { - cout << "Phoning home to find world ranking..." << endl; - jsonrpc::HttpClient client("http://gav.ethdev.com:3000/benchmark"); - PhoneHome rpc(client); - try - { - unsigned ranking = rpc.report_benchmark(platformInfo, innerMean); - cout << "Ranked: " << ranking << " of all benchmarks." << endl; - } - catch (...) - { - cout << "Error phoning home. ET is sad." << endl; - } - } -#endif - exit(0); -} - -struct HappyChannel: public LogChannel { static const char* name() { return ":-D"; } static const int verbosity = 1; }; -struct SadChannel: public LogChannel { static const char* name() { return ":-("; } static const int verbosity = 1; }; - -void doFarm(MinerType _m, string const& _remote, unsigned _recheckPeriod) -{ - (void)_m; - (void)_remote; - (void)_recheckPeriod; -#if ETH_JSONRPC || !ETH_TRUE - jsonrpc::HttpClient client(_remote); - Farm rpc(client); - GenericFarm f; - if (_m == MinerType::CPU) - f.startCPU(); - else if (_m == MinerType::GPU) - f.startGPU(); - - ProofOfWork::WorkPackage current; - while (true) - try - { - bool completed = false; - ProofOfWork::Solution solution; - f.onSolutionFound([&](ProofOfWork::Solution sol) - { - solution = sol; - return completed = true; - }); - for (unsigned i = 0; !completed; ++i) - { - if (current) - cnote << "Mining on PoWhash" << current.headerHash << ": " << f.miningProgress(); - else - cnote << "Getting work package..."; - Json::Value v = rpc.eth_getWork(); - h256 hh(v[0].asString()); - if (hh != current.headerHash) - { - current.headerHash = hh; - current.seedHash = h256(v[1].asString()); - current.boundary = h256(fromHex(v[2].asString()), h256::AlignRight); - cnote << "Got work package:" << current.headerHash << " < " << current.boundary; - f.setWork(current); - } - this_thread::sleep_for(chrono::milliseconds(_recheckPeriod)); - } - cnote << "Solution found; submitting [" << solution.nonce << "," << current.headerHash << "," << solution.mixHash << "] to" << _remote << "..."; - bool ok = rpc.eth_submitWork("0x" + toString(solution.nonce), "0x" + toString(current.headerHash), "0x" + toString(solution.mixHash)); - if (ok) - clog(HappyChannel) << "Submitted and accepted."; - else - clog(SadChannel) << "Not accepted."; - current.reset(); - } - catch (jsonrpc::JsonRpcException&) - { - for (auto i = 3; --i; this_thread::sleep_for(chrono::seconds(1))) - cerr << "JSON-RPC problem. Probably couldn't connect. Retrying in " << i << "... \r"; - cerr << endl; - } -#endif - exit(0); -} - void stopMiningAfterXBlocks(eth::Client* _c, unsigned _start, unsigned _mining) { if (_c->isMining() && _c->blockChain().details().number - _start == _mining) @@ -440,73 +248,6 @@ void stopMiningAfterXBlocks(eth::Client* _c, unsigned _start, unsigned _mining) int main(int argc, char** argv) { -#if 0 - cout << "\x1b[30mEthBlack\x1b[0m" << endl; - cout << "\x1b[90mEthCoal\x1b[0m" << endl; - cout << "\x1b[37mEthGray\x1b[0m" << endl; - cout << "\x1b[97mEthWhite\x1b[0m" << endl; - cout << "\x1b[31mEthRed\x1b[0m" << endl; - cout << "\x1b[32mEthGreen\x1b[0m" << endl; - cout << "\x1b[33mEthYellow\x1b[0m" << endl; - cout << "\x1b[34mEthBlue\x1b[0m" << endl; - cout << "\x1b[35mEthPurple\x1b[0m" << endl; - cout << "\x1b[36mEthCyan\x1b[0m" << endl; - // High Intensity - cout << "\x1b[91mEthRedI\x1b[0m" << endl; - cout << "\x1b[92mEthLime\x1b[0m" << endl; - cout << "\x1b[93mEthYellowI\x1b[0m" << endl; - cout << "\x1b[94mEthBlueI\x1b[0m" << endl; - cout << "\x1b[95mEthPurpleI\x1b[0m" << endl; - cout << "\x1b[96mEthCyanI\x1b[0m" << endl; - - // Bold - cout << "\x1b[1;30mEthBlackB\x1b[0m" << endl; - cout << "\x1b[1;90mEthCoalB\x1b[0m" << endl; - cout << "\x1b[1;37mEthGrayB\x1b[0m" << endl; - cout << "\x1b[1;97mEthWhiteB\x1b[0m" << endl; - cout << "\x1b[1;31mEthRedB\x1b[0m" << endl; - cout << "\x1b[1;32mEthGreenB\x1b[0m" << endl; - cout << "\x1b[1;33mEthYellowB\x1b[0m" << endl; - cout << "\x1b[1;34mEthBlueB\x1b[0m" << endl; - cout << "\x1b[1;35mEthPurpleB\x1b[0m" << endl; - cout << "\x1b[1;36mEthCyanB\x1b[0m" << endl; - // Bold High Intensity - cout << "\x1b[1;91mEthRedBI\x1b[0m" << endl; - cout << "\x1b[1;92mEthGreenBI\x1b[0m" << endl; - cout << "\x1b[1;93mEthYellowBI\x1b[0m" << endl; - cout << "\x1b[1;94mEthBlueBI\x1b[0m" << endl; - cout << "\x1b[1;95mEthPurpleBI\x1b[0m" << endl; - cout << "\x1b[1;96mEthCyanBI\x1b[0m" << endl; - - // Background - cout << "\x1b[40mEthBlackOn\x1b[0m" << endl; - cout << "\x1b[100mEthCoalOn\x1b[0m" << endl; - cout << "\x1b[47mEthGrayOn\x1b[0m" << endl; - cout << "\x1b[107mEthWhiteOn\x1b[0m" << endl; - cout << "\x1b[41mEthRedOn\x1b[0m" << endl; - cout << "\x1b[42mEthGreenOn\x1b[0m" << endl; - cout << "\x1b[43mEthYellowOn\x1b[0m" << endl; - cout << "\x1b[44mEthBlueOn\x1b[0m" << endl; - cout << "\x1b[45mEthPurpleOn\x1b[0m" << endl; - cout << "\x1b[46mEthCyanOn\x1b[0m" << endl; - // High Intensity backgrounds - cout << "\x1b[101mEthRedOnI\x1b[0m" << endl; - cout << "\x1b[102mEthGreenOnI\x1b[0m" << endl; - cout << "\x1b[103mEthYellowOnI\x1b[0m" << endl; - cout << "\x1b[104mEthBlueOnI\x1b[0m" << endl; - cout << "\x1b[105mEthPurpleOnI\x1b[0m" << endl; - cout << "\x1b[106mEthCyanOnI\x1b[0m" << endl; - - // Underline - cout << "\x1b[4;30mEthBlackU\x1b[0m" << endl; - cout << "\x1b[4;31mEthRedU\x1b[0m" << endl; - cout << "\x1b[4;32mEthGreenU\x1b[0m" << endl; - cout << "\x1b[4;33mEthYellowU\x1b[0m" << endl; - cout << "\x1b[4;34mEthBlueU\x1b[0m" << endl; - cout << "\x1b[4;35mEthPurpleU\x1b[0m" << endl; - cout << "\x1b[4;36mEthCyanU\x1b[0m" << endl; - cout << "\x1b[4;37mEthWhiteU\x1b[0m" << endl; -#endif // Init defaults Defaults::get(); @@ -514,12 +255,6 @@ int main(int argc, char** argv) OperationMode mode = OperationMode::Node; string dbPath; - /// Mining options - MinerType minerType = MinerType::CPU; - unsigned openclPlatform = 0; - unsigned openclDevice = 0; - unsigned miningThreads = UINT_MAX; - /// File name for import/export. string filename; @@ -528,9 +263,6 @@ int main(int argc, char** argv) string exportTo = "latest"; Format exportFormat = Format::Binary; - /// DAG initialisation param. - unsigned initDAG = 0; - /// General params for Node operation NodeMode nodeMode = NodeMode::Full; bool interactive = false; @@ -569,19 +301,9 @@ int main(int argc, char** argv) double etherPrice = 30.679; double blockFees = 15.0; - /// Benchmarking params - bool phoneHome = true; - unsigned benchmarkWarmup = 3; - unsigned benchmarkTrial = 3; - unsigned benchmarkTrials = 5; - // javascript console bool useConsole = false; - /// Farm params - string farmURL = "http://127.0.0.1:8545"; - unsigned farmRecheckPeriod = 500; - /// Wallet password stuff string masterPassword; @@ -603,10 +325,13 @@ int main(int argc, char** argv) beneficiary = config[1].toHash
(); } + MinerCLI m(MinerCLI::OperationMode::None); + for (int i = 1; i < argc; ++i) { string arg = argv[i]; - if (arg == "--listen-ip" && i + 1 < argc) + if (m.interpretOption(i, argc, argv)) {} + else if (arg == "--listen-ip" && i + 1 < argc) listenIP = argv[++i]; else if ((arg == "-l" || arg == "--listen" || arg == "--listen-port") && i + 1 < argc) { @@ -642,52 +367,6 @@ int main(int argc, char** argv) mode = OperationMode::Export; filename = argv[++i]; } - else if ((arg == "-F" || arg == "--farm") && i + 1 < argc) - { - mode = OperationMode::Farm; - farmURL = argv[++i]; - } - else if (arg == "--farm-recheck" && i + 1 < argc) - try { - farmRecheckPeriod = stol(argv[++i]); - } - catch (...) - { - cerr << "Bad " << arg << " option: " << argv[i] << endl; - return -1; - } - else if (arg == "--opencl-platform" && i + 1 < argc) - try { - openclPlatform = stol(argv[++i]); - } - catch (...) - { - cerr << "Bad " << arg << " option: " << argv[i] << endl; - return -1; - } - else if (arg == "--opencl-device" && i + 1 < argc) - try { - openclDevice = stol(argv[++i]); - miningThreads = 1; - } - catch (...) - { - cerr << "Bad " << arg << " option: " << argv[i] << endl; - return -1; - } - else if (arg == "--phone-home" && i + 1 < argc) - { - string m = argv[++i]; - if (isTrue(m)) - phoneHome = true; - else if (isFalse(m)) - phoneHome = false; - else - { - cerr << "Bad " << arg << " option: " << m << endl; - return -1; - } - } else if (arg == "--format" && i + 1 < argc) { string m = argv[++i]; @@ -733,33 +412,6 @@ int main(int argc, char** argv) cerr << "Bad " << arg << " option: " << argv[i] << endl; return -1; } - else if (arg == "--benchmark-warmup" && i + 1 < argc) - try { - benchmarkWarmup = stol(argv[++i]); - } - catch (...) - { - cerr << "Bad " << arg << " option: " << argv[i] << endl; - return -1; - } - else if (arg == "--benchmark-trial" && i + 1 < argc) - try { - benchmarkTrial = stol(argv[++i]); - } - catch (...) - { - cerr << "Bad " << arg << " option: " << argv[i] << endl; - return -1; - } - else if (arg == "--benchmark-trials" && i + 1 < argc) - try { - benchmarkTrials = stol(argv[++i]); - } - catch (...) - { - cerr << "Bad " << arg << " option: " << argv[i] << endl; - return -1; - } else if (arg == "-K" || arg == "--kill-blockchain" || arg == "--kill") killChain = WithExisting::Kill; else if (arg == "-R" || arg == "--rebuild") @@ -784,17 +436,6 @@ int main(int argc, char** argv) cerr << "Bad " << arg << " option: " << argv[i] << endl; return -1; } - else if (arg == "-C" || arg == "--cpu") - minerType = MinerType::CPU; - else if (arg == "-G" || arg == "--opencl") - { - minerType = MinerType::GPU; - miningThreads = 1; - /*<< " -s,--import-secret Import a secret key into the key store and use as the default." << endl - << " -S,--import-session-secret Import a secret key into the key store and use as the default for this session only." << endl - << " --sign-key
Sign all transactions with the key of the given address." << endl - << " --session-sign-key
Sign all transactions with the key of the given address for this session only." << endl*/ - } else if ((arg == "-s" || arg == "--import-secret") && i + 1 < argc) { Secret s(fromHex(argv[++i])); @@ -822,64 +463,6 @@ int main(int argc, char** argv) } else if ((arg == "-d" || arg == "--path" || arg == "--db-path") && i + 1 < argc) dbPath = argv[++i]; - else if ((arg == "-D" || arg == "--create-dag") && i + 1 < argc) - { - string m = boost::to_lower_copy(string(argv[++i])); - mode = OperationMode::DAGInit; - if (m == "next") - initDAG = PendingBlock; - else if (m == "this") - initDAG = LatestBlock; - else - try - { - initDAG = stol(m); - } - catch (...) - { - cerr << "Bad " << arg << " option: " << m << endl; - return -1; - } - } - else if ((arg == "-w" || arg == "--check-pow") && i + 4 < argc) - { - string m; - try - { - BlockInfo bi; - m = boost::to_lower_copy(string(argv[++i])); - h256 powHash(m); - m = boost::to_lower_copy(string(argv[++i])); - h256 seedHash; - if (m.size() == 64 || m.size() == 66) - seedHash = h256(m); - else - seedHash = EthashAux::seedHash(stol(m)); - m = boost::to_lower_copy(string(argv[++i])); - bi.difficulty = u256(m); - auto boundary = bi.boundary(); - m = boost::to_lower_copy(string(argv[++i])); - bi.nonce = h64(m); - auto r = EthashAux::eval(bi.seedHash(), powHash, bi.nonce); - bool valid = r.value < boundary; - cout << (valid ? "VALID :-)" : "INVALID :-(") << endl; - cout << r.value << (valid ? " < " : " >= ") << boundary << endl; - cout << " where " << boundary << " = 2^256 / " << bi.difficulty << endl; - cout << " and " << r.value << " = ethash(" << powHash << ", " << bi.nonce << ")" << endl; - cout << " with seed as " << seedHash << endl; - if (valid) - cout << "(mixHash = " << r.mixHash << ")" << endl; - cout << "SHA3( light(seed) ) = " << sha3(EthashAux::light(bi.seedHash())->data()) << endl; - exit(0); - } - catch (...) - { - cerr << "Bad " << arg << " option: " << m << endl; - return -1; - } - } - else if (arg == "-M" || arg == "--benchmark") - mode = OperationMode::Benchmark; else if ((arg == "-B" || arg == "--block-fees") && i + 1 < argc) { try @@ -942,17 +525,6 @@ int main(int argc, char** argv) return -1; } } - else if ((arg == "-t" || arg == "--mining-threads") && i + 1 < argc) - { - try { - miningThreads = stol(argv[++i]); - } - catch (...) - { - cerr << "Bad " << arg << " option: " << argv[i] << endl; - return -1; - } - } else if (arg == "-b" || arg == "--bootstrap") bootstrap = true; else if (arg == "-f" || arg == "--force-mining") @@ -1003,6 +575,8 @@ int main(int argc, char** argv) } } + m.execute(); + KeyManager keyManager; for (auto const& s: passwordsToNote) keyManager.notePassword(s); @@ -1016,26 +590,6 @@ int main(int argc, char** argv) if (sessionKey) signingKey = sessionKey; - if (minerType == MinerType::CPU) - ProofOfWork::CPUMiner::setNumInstances(miningThreads); - else if (minerType == MinerType::GPU) - { - ProofOfWork::GPUMiner::setDefaultPlatform(openclPlatform); - ProofOfWork::GPUMiner::setDefaultDevice(openclDevice); - ProofOfWork::GPUMiner::setNumInstances(miningThreads); - } - - // Two codepaths is necessary since named block require database, but numbered - // blocks are superuseful to have when database is already open in another process. - if (mode == OperationMode::DAGInit && !(initDAG == LatestBlock || initDAG == PendingBlock)) - doInitDAG(initDAG); - - if (mode == OperationMode::Benchmark) - doBenchmark(minerType, phoneHome, benchmarkWarmup, benchmarkTrial, benchmarkTrials); - - if (mode == OperationMode::Farm) - doFarm(minerType, farmURL, farmRecheckPeriod); - if (!clientName.empty()) clientName += "/"; @@ -1074,44 +628,6 @@ int main(int argc, char** argv) netPrefs, &nodesState); - if (mode == OperationMode::DAGInit) - doInitDAG(web3.ethereum()->blockChain().number() + (initDAG == PendingBlock ? 30000 : 0)); - - if (keyManager.exists()) - while (masterPassword.empty()) - { - masterPassword = getPassword("Please enter your MASTER password: "); - if (!keyManager.load(masterPassword)) - { - cout << "Password invalid. Try again." << endl; - masterPassword.clear(); - } - } - else - { - while (masterPassword.empty()) - { - masterPassword = getPassword("Please enter a MASTER password to protect your key store (make it strong!): "); - string confirm = getPassword("Please confirm the password by entering it again: "); - if (masterPassword != confirm) - { - cout << "Passwords were different. Try again." << endl; - masterPassword.clear(); - } - } - keyManager.create(masterPassword); - } - - for (auto const& s: toImport) - { - keyManager.import(s, "Imported key (UNSAFE)"); - if (!signingKey) - signingKey = toAddress(s); - } - - if (keyManager.accounts().empty()) - keyManager.import(Secret::random(), "Default key"); - auto toNumber = [&](string const& s) -> unsigned { if (s == "latest") return web3.ethereum()->number(); @@ -1175,7 +691,42 @@ int main(int argc, char** argv) return 0; } - cout << credits(); + if (keyManager.exists()) + while (masterPassword.empty()) + { + masterPassword = getPassword("Please enter your MASTER password: "); + if (!keyManager.load(masterPassword)) + { + cout << "Password invalid. Try again." << endl; + masterPassword.clear(); + } + } + else + { + while (masterPassword.empty()) + { + masterPassword = getPassword("Please enter a MASTER password to protect your key store (make it strong!): "); + string confirm = getPassword("Please confirm the password by entering it again: "); + if (masterPassword != confirm) + { + cout << "Passwords were different. Try again." << endl; + masterPassword.clear(); + } + } + keyManager.create(masterPassword); + } + + for (auto const& s: toImport) + { + keyManager.import(s, "Imported key (UNSAFE)"); + if (!signingKey) + signingKey = toAddress(s); + } + + if (keyManager.accounts().empty()) + keyManager.import(Secret::random(), "Default key"); + + cout << ethCredits(); web3.setIdealPeerCount(peers); std::shared_ptr gasPricer = make_shared(u256(double(ether / 1000) / etherPrice), u256(blockFees * 1000)); eth::Client* c = nodeMode == NodeMode::Full ? web3.ethereum() : nullptr; @@ -1184,7 +735,7 @@ int main(int argc, char** argv) { c->setGasPricer(gasPricer); c->setForceMining(forceMining); - c->setTurboMining(minerType == MinerType::GPU); + c->setTurboMining(m.minerType() == MinerCLI::MinerType::GPU); c->setAddress(beneficiary); c->setNetworkId(networkId); } diff --git a/ethminer/MinerAux.h b/ethminer/MinerAux.h new file mode 100644 index 000000000..2a2aca10e --- /dev/null +++ b/ethminer/MinerAux.h @@ -0,0 +1,483 @@ +#pragma once + +/* + This file is part of cpp-ethereum. + + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file main.cpp + * @author Gav Wood + * @date 2014 + * Ethereum client. + */ + +#include +#include +#include +#include +#include + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#if ETH_JSONRPC || !ETH_TRUE +#include +#include +#include +#endif +#include "BuildInfo.h" +#if ETH_JSONRPC || !ETH_TRUE +#include "PhoneHome.h" +#include "Farm.h" +#endif +using namespace std; +using namespace dev; +using namespace dev::eth; +using namespace boost::algorithm; +using dev::eth::Instruction; + +#undef RETURN + +bool isTrue(std::string const& _m) +{ + return _m == "on" || _m == "yes" || _m == "true" || _m == "1"; +} + +bool isFalse(std::string const& _m) +{ + return _m == "off" || _m == "no" || _m == "false" || _m == "0"; +} + +inline std::string credits() +{ + std::ostringstream out; + out + << "Ethereum (++) " << dev::Version << endl + << " Code by Gav Wood et al, (c) 2013, 2014, 2015." << endl; + return out.str(); +} + +class BadArgument: public Exception {}; + +class MinerCLI +{ +public: + enum class OperationMode + { + None, + DAGInit, + Benchmark, + Farm + }; + + MinerCLI(OperationMode _mode = OperationMode::None): mode(_mode) {} + + bool interpretOption(int& i, int argc, char** argv) + { + string arg = argv[i]; + if ((arg == "-F" || arg == "--farm") && i + 1 < argc) + { + mode = OperationMode::Farm; + farmURL = argv[++i]; + } + else if (arg == "--farm-recheck" && i + 1 < argc) + try { + farmRecheckPeriod = stol(argv[++i]); + } + catch (...) + { + cerr << "Bad " << arg << " option: " << argv[i] << endl; + throw BadArgument(); + } + else if (arg == "--opencl-platform" && i + 1 < argc) + try { + openclPlatform = stol(argv[++i]); + } + catch (...) + { + cerr << "Bad " << arg << " option: " << argv[i] << endl; + throw BadArgument(); + } + else if (arg == "--opencl-device" && i + 1 < argc) + try { + openclDevice = stol(argv[++i]); + miningThreads = 1; + } + catch (...) + { + cerr << "Bad " << arg << " option: " << argv[i] << endl; + throw BadArgument(); + } + else if (arg == "--phone-home" && i + 1 < argc) + { + string m = argv[++i]; + if (isTrue(m)) + phoneHome = true; + else if (isFalse(m)) + phoneHome = false; + else + { + cerr << "Bad " << arg << " option: " << m << endl; + throw BadArgument(); + } + } + else if (arg == "--benchmark-warmup" && i + 1 < argc) + try { + benchmarkWarmup = stol(argv[++i]); + } + catch (...) + { + cerr << "Bad " << arg << " option: " << argv[i] << endl; + throw BadArgument(); + } + else if (arg == "--benchmark-trial" && i + 1 < argc) + try { + benchmarkTrial = stol(argv[++i]); + } + catch (...) + { + cerr << "Bad " << arg << " option: " << argv[i] << endl; + throw BadArgument(); + } + else if (arg == "--benchmark-trials" && i + 1 < argc) + try { + benchmarkTrials = stol(argv[++i]); + } + catch (...) + { + cerr << "Bad " << arg << " option: " << argv[i] << endl; + throw BadArgument(); + } + else if (arg == "-C" || arg == "--cpu") + m_minerType = MinerType::CPU; + else if (arg == "-G" || arg == "--opencl") + { + m_minerType = MinerType::GPU; + miningThreads = 1; + } + else if ((arg == "-D" || arg == "--create-dag") && i + 1 < argc) + { + string m = boost::to_lower_copy(string(argv[++i])); + mode = OperationMode::DAGInit; + try + { + initDAG = stol(m); + } + catch (...) + { + cerr << "Bad " << arg << " option: " << m << endl; + throw BadArgument(); + } + } + else if ((arg == "-w" || arg == "--check-pow") && i + 4 < argc) + { + string m; + try + { + BlockInfo bi; + m = boost::to_lower_copy(string(argv[++i])); + h256 powHash(m); + m = boost::to_lower_copy(string(argv[++i])); + h256 seedHash; + if (m.size() == 64 || m.size() == 66) + seedHash = h256(m); + else + seedHash = EthashAux::seedHash(stol(m)); + m = boost::to_lower_copy(string(argv[++i])); + bi.difficulty = u256(m); + auto boundary = bi.boundary(); + m = boost::to_lower_copy(string(argv[++i])); + bi.nonce = h64(m); + auto r = EthashAux::eval(bi.seedHash(), powHash, bi.nonce); + bool valid = r.value < boundary; + cout << (valid ? "VALID :-)" : "INVALID :-(") << endl; + cout << r.value << (valid ? " < " : " >= ") << boundary << endl; + cout << " where " << boundary << " = 2^256 / " << bi.difficulty << endl; + cout << " and " << r.value << " = ethash(" << powHash << ", " << bi.nonce << ")" << endl; + cout << " with seed as " << seedHash << endl; + if (valid) + cout << "(mixHash = " << r.mixHash << ")" << endl; + cout << "SHA3( light(seed) ) = " << sha3(EthashAux::light(bi.seedHash())->data()) << endl; + exit(0); + } + catch (...) + { + cerr << "Bad " << arg << " option: " << m << endl; + throw BadArgument(); + } + } + else if (arg == "-M" || arg == "--benchmark") + mode = OperationMode::Benchmark; + else if ((arg == "-t" || arg == "--mining-threads") && i + 1 < argc) + { + try { + miningThreads = stol(argv[++i]); + } + catch (...) + { + cerr << "Bad " << arg << " option: " << argv[i] << endl; + throw BadArgument(); + } + } + else + return false; + return true; + } + + void execute() + { + if (m_minerType == MinerType::CPU) + ProofOfWork::CPUMiner::setNumInstances(miningThreads); + else if (m_minerType == MinerType::GPU) + { + ProofOfWork::GPUMiner::setDefaultPlatform(openclPlatform); + ProofOfWork::GPUMiner::setDefaultDevice(openclDevice); + ProofOfWork::GPUMiner::setNumInstances(miningThreads); + } + if (mode == OperationMode::DAGInit) + doInitDAG(initDAG); + else if (mode == OperationMode::Benchmark) + doBenchmark(m_minerType, phoneHome, benchmarkWarmup, benchmarkTrial, benchmarkTrials); + else if (mode == OperationMode::Farm) + doFarm(m_minerType, farmURL, farmRecheckPeriod); + } + + static void streamHelp(ostream& _out) + { + _out +#if ETH_JSONRPC || !ETH_TRUE + << "Work farming mode:" << endl + << " -F,--farm Put into mining farm mode with the work server at URL (default: http://127.0.0.1:8545)" << endl + << " --farm-recheck Leave n ms between checks for changed work (default: 500)." << endl +#endif + << "Ethash verify mode:" << endl + << " -w,--check-pow Check PoW credentials for validity." << endl + << endl + << "Benchmarking mode:" << endl + << " -M,--benchmark Benchmark for mining and exit; use with --cpu and --opencl." << endl + << " --benchmark-warmup Set the duration of warmup for the benchmark tests (default: 3)." << endl + << " --benchmark-trial Set the duration for each trial for the benchmark tests (default: 3)." << endl + << " --benchmark-trials Set the duration of warmup for the benchmark tests (default: 5)." << endl +#if ETH_JSONRPC || !ETH_TRUE + << " --phone-home When benchmarking, publish results (default: on)" << endl +#endif + << "DAG creation mode:" << endl + << " -D,--create-dag Create the DAG in preparation for mining on given block and exit." << endl + << "Mining configuration:" << endl + << " -C,--cpu When mining, use the CPU." << endl + << " -G,--opencl When mining use the GPU via OpenCL." << endl + << " --opencl-platform When mining using -G/--opencl use OpenCL platform n (default: 0)." << endl + << " --opencl-device When mining using -G/--opencl use OpenCL device n (default: 0)." << endl + << " -t, --mining-threads Limit number of CPU/GPU miners to n (default: use everything available on selected platform)" << endl + ; + } + + enum class MinerType + { + CPU, + GPU + }; + + MinerType minerType() const { return m_minerType; } + +private: + void doInitDAG(unsigned _n) + { + BlockInfo bi; + bi.number = _n; + cout << "Initializing DAG for epoch beginning #" << (bi.number / 30000 * 30000) << " (seedhash " << bi.seedHash().abridged() << "). This will take a while." << endl; + Ethash::prep(bi); + exit(0); + } + + void doBenchmark(MinerType _m, bool _phoneHome, unsigned _warmupDuration = 15, unsigned _trialDuration = 3, unsigned _trials = 5) + { + BlockInfo genesis; + genesis.difficulty = 1 << 18; + cdebug << genesis.boundary(); + + GenericFarm f; + f.onSolutionFound([&](ProofOfWork::Solution) { return false; }); + + string platformInfo = _m == MinerType::CPU ? ProofOfWork::CPUMiner::platformInfo() : _m == MinerType::GPU ? ProofOfWork::GPUMiner::platformInfo() : ""; + cout << "Benchmarking on platform: " << platformInfo << endl; + + cout << "Preparing DAG..." << endl; + Ethash::prep(genesis); + + genesis.difficulty = u256(1) << 63; + genesis.noteDirty(); + f.setWork(genesis); + if (_m == MinerType::CPU) + f.startCPU(); + else if (_m == MinerType::GPU) + f.startGPU(); + + map results; + uint64_t mean = 0; + uint64_t innerMean = 0; + for (unsigned i = 0; i <= _trials; ++i) + { + if (!i) + cout << "Warming up..." << endl; + else + cout << "Trial " << i << "... " << flush; + this_thread::sleep_for(chrono::seconds(i ? _trialDuration : _warmupDuration)); + + auto mp = f.miningProgress(); + f.resetMiningProgress(); + if (!i) + continue; + auto rate = mp.rate(); + + cout << rate << endl; + results[rate] = mp; + mean += rate; + } + f.stop(); + int j = -1; + for (auto const& r: results) + if (++j > 0 && j < (int)_trials - 1) + innerMean += r.second.rate(); + innerMean /= (_trials - 2); + cout << "min/mean/max: " << results.begin()->second.rate() << "/" << (mean / _trials) << "/" << results.rbegin()->second.rate() << " H/s" << endl; + cout << "inner mean: " << innerMean << " H/s" << endl; + + (void)_phoneHome; + #if ETH_JSONRPC || !ETH_TRUE + if (_phoneHome) + { + cout << "Phoning home to find world ranking..." << endl; + jsonrpc::HttpClient client("http://gav.ethdev.com:3000/benchmark"); + PhoneHome rpc(client); + try + { + unsigned ranking = rpc.report_benchmark(platformInfo, innerMean); + cout << "Ranked: " << ranking << " of all benchmarks." << endl; + } + catch (...) + { + cout << "Error phoning home. ET is sad." << endl; + } + } + #endif + exit(0); + } + + void doFarm(MinerType _m, string const& _remote, unsigned _recheckPeriod) + { + (void)_m; + (void)_remote; + (void)_recheckPeriod; + #if ETH_JSONRPC || !ETH_TRUE + jsonrpc::HttpClient client(_remote); + + Farm rpc(client); + GenericFarm f; + if (_m == MinerType::CPU) + f.startCPU(); + else if (_m == MinerType::GPU) + f.startGPU(); + + ProofOfWork::WorkPackage current; + while (true) + try + { + bool completed = false; + ProofOfWork::Solution solution; + f.onSolutionFound([&](ProofOfWork::Solution sol) + { + solution = sol; + return completed = true; + }); + for (unsigned i = 0; !completed; ++i) + { + if (current) + cnote << "Mining on PoWhash" << current.headerHash << ": " << f.miningProgress(); + else + cnote << "Getting work package..."; + Json::Value v = rpc.eth_getWork(); + h256 hh(v[0].asString()); + if (hh != current.headerHash) + { + current.headerHash = hh; + current.seedHash = h256(v[1].asString()); + current.boundary = h256(fromHex(v[2].asString()), h256::AlignRight); + cnote << "Got work package:"; + cnote << " Header-hash:" << current.headerHash.hex(); + cnote << " Seedhash:" << current.seedHash.hex(); + cnote << " Target: " << h256(current.boundary).hex(); + f.setWork(current); + } + this_thread::sleep_for(chrono::milliseconds(_recheckPeriod)); + } + cnote << "Solution found; Submitting to" << _remote << "..."; + cnote << " Nonce:" << solution.nonce.hex(); + cnote << " Mixhash:" << solution.mixHash.hex(); + cnote << " Header-hash:" << current.headerHash.hex(); + cnote << " Seedhash:" << current.seedHash.hex(); + cnote << " Target: " << h256(current.boundary).hex(); + cnote << " Ethash: " << h256(EthashAux::eval(current.seedHash, current.headerHash, solution.nonce).value).hex(); + if (EthashAux::eval(current.seedHash, current.headerHash, solution.nonce).value < current.boundary) + { + bool ok = rpc.eth_submitWork("0x" + toString(solution.nonce), "0x" + toString(current.headerHash), "0x" + toString(solution.mixHash)); + if (ok) + cnote << "B-) Submitted and accepted."; + else + cwarn << ":-( Not accepted."; + } + else + cwarn << "FAILURE: GPU gave incorrect result!"; + current.reset(); + } + catch (jsonrpc::JsonRpcException&) + { + for (auto i = 3; --i; this_thread::sleep_for(chrono::seconds(1))) + cerr << "JSON-RPC problem. Probably couldn't connect. Retrying in " << i << "... \r"; + cerr << endl; + } + #endif + exit(0); + } + + /// Operating mode. + OperationMode mode; + + /// Mining options + MinerType m_minerType = MinerType::CPU; + unsigned openclPlatform = 0; + unsigned openclDevice = 0; + unsigned miningThreads = UINT_MAX; + + /// DAG initialisation param. + unsigned initDAG = 0; + + /// Benchmarking params + bool phoneHome = true; + unsigned benchmarkWarmup = 3; + unsigned benchmarkTrial = 3; + unsigned benchmarkTrials = 5; + + /// Farm params + string farmURL = "http://127.0.0.1:8545"; + unsigned farmRecheckPeriod = 500; + +}; diff --git a/ethminer/main.cpp b/ethminer/main.cpp index a19934ba0..5b82db471 100644 --- a/ethminer/main.cpp +++ b/ethminer/main.cpp @@ -25,441 +25,48 @@ #include #include #include - #include #include - #include -#include -#include -#include -#include -#include -#include -#if ETH_JSONRPC || !ETH_TRUE -#include -#include -#include -#endif -#include "BuildInfo.h" -#if ETH_JSONRPC || !ETH_TRUE -#include "PhoneHome.h" -#include "Farm.h" -#endif +#include "MinerAux.h" using namespace std; using namespace dev; using namespace dev::eth; using namespace boost::algorithm; -using dev::eth::Instruction; #undef RETURN -bool isTrue(std::string const& _m) -{ - return _m == "on" || _m == "yes" || _m == "true" || _m == "1"; -} - -bool isFalse(std::string const& _m) -{ - return _m == "off" || _m == "no" || _m == "false" || _m == "0"; -} - void help() { cout << "Usage ethminer [OPTIONS]" << endl - << "Options:" << endl << endl -#if ETH_JSONRPC || !ETH_TRUE - << "Work farming mode:" << endl - << " -F,--farm Put into mining farm mode with the work server at URL (default: http://127.0.0.1:8545)" << endl - << " --farm-recheck Leave n ms between checks for changed work (default: 500)." << endl -#endif - << "Benchmarking mode:" << endl - << " -M,--benchmark Benchmark for mining and exit; use with --cpu and --opencl." << endl - << " --benchmark-warmup Set the duration of warmup for the benchmark tests (default: 3)." << endl - << " --benchmark-trial Set the duration for each trial for the benchmark tests (default: 3)." << endl - << " --benchmark-trials Set the duration of warmup for the benchmark tests (default: 5)." << endl -#if ETH_JSONRPC || !ETH_TRUE - << " --phone-home When benchmarking, publish results (default: on)" << endl -#endif - << "DAG creation mode:" << endl - << " -D,--create-dag Create the DAG in preparation for mining on given block and exit." << endl + << "Options:" << endl << endl; + MinerCLI::streamHelp(cout); + cout << "General Options:" << endl - << " -C,--cpu When mining, use the CPU." << endl - << " -G,--opencl When mining use the GPU via OpenCL." << endl - << " --opencl-platform When mining using -G/--opencl use OpenCL platform n (default: 0)." << endl - << " --opencl-device When mining using -G/--opencl use OpenCL device n (default: 0)." << endl - << " -t, --mining-threads Limit number of CPU/GPU miners to n (default: use everything available on selected platform)" << endl << " -v,--verbosity <0 - 9> Set the log verbosity from 0 to 9 (default: 8)." << endl << " -V,--version Show the version and exit." << endl << " -h,--help Show this help message and exit." << endl ; - exit(0); -} - -string credits() -{ - std::ostringstream cout; - cout - << "Ethereum (++) " << dev::Version << endl - << " Code by Gav Wood et al, (c) 2013, 2014, 2015." << endl - << " Based on a design by Vitalik Buterin." << endl << endl; - return cout.str(); + exit(0); } void version() { - cout << "eth version " << dev::Version << endl; - cout << "eth network protocol version: " << dev::eth::c_protocolVersion << endl; - cout << "Client database version: " << dev::eth::c_databaseVersion << endl; + cout << "ethminer version " << dev::Version << endl; cout << "Build: " << DEV_QUOTED(ETH_BUILD_PLATFORM) << "/" << DEV_QUOTED(ETH_BUILD_TYPE) << endl; exit(0); } -void doInitDAG(unsigned _n) -{ - BlockInfo bi; - bi.number = _n; - cout << "Initializing DAG for epoch beginning #" << (bi.number / 30000 * 30000) << " (seedhash " << bi.seedHash().abridged() << "). This will take a while." << endl; - Ethash::prep(bi); - exit(0); -} - -enum class OperationMode -{ - DAGInit, - Benchmark, - Farm -}; - -enum class MinerType -{ - CPU, - GPU -}; - -void doBenchmark(MinerType _m, bool _phoneHome, unsigned _warmupDuration = 15, unsigned _trialDuration = 3, unsigned _trials = 5) -{ - BlockInfo genesis; - genesis.difficulty = 1 << 18; - cdebug << genesis.boundary(); - - GenericFarm f; - f.onSolutionFound([&](ProofOfWork::Solution) { return false; }); - - string platformInfo = _m == MinerType::CPU ? ProofOfWork::CPUMiner::platformInfo() : _m == MinerType::GPU ? ProofOfWork::GPUMiner::platformInfo() : ""; - cout << "Benchmarking on platform: " << platformInfo << endl; - - cout << "Preparing DAG..." << endl; - Ethash::prep(genesis); - - genesis.difficulty = u256(1) << 63; - genesis.noteDirty(); - f.setWork(genesis); - if (_m == MinerType::CPU) - f.startCPU(); - else if (_m == MinerType::GPU) - f.startGPU(); - - map results; - uint64_t mean = 0; - uint64_t innerMean = 0; - for (unsigned i = 0; i <= _trials; ++i) - { - if (!i) - cout << "Warming up..." << endl; - else - cout << "Trial " << i << "... " << flush; - this_thread::sleep_for(chrono::seconds(i ? _trialDuration : _warmupDuration)); - - auto mp = f.miningProgress(); - f.resetMiningProgress(); - if (!i) - continue; - auto rate = mp.rate(); - - cout << rate << endl; - results[rate] = mp; - mean += rate; - if (i > 1 && i < 5) - innerMean += rate; - } - f.stop(); - innerMean /= (_trials - 2); - cout << "min/mean/max: " << results.begin()->second.rate() << "/" << (mean / _trials) << "/" << results.rbegin()->second.rate() << " H/s" << endl; - cout << "inner mean: " << innerMean << " H/s" << endl; - - (void)_phoneHome; -#if ETH_JSONRPC || !ETH_TRUE - if (_phoneHome) - { - cout << "Phoning home to find world ranking..." << endl; - jsonrpc::HttpClient client("http://gav.ethdev.com:3000/benchmark"); - PhoneHome rpc(client); - try - { - unsigned ranking = rpc.report_benchmark(platformInfo, innerMean); - cout << "Ranked: " << ranking << " of all benchmarks." << endl; - } - catch (...) - { - cout << "Error phoning home. ET is sad." << endl; - } - } -#endif - exit(0); -} - -struct HappyChannel: public LogChannel { static const char* name() { return ":-D"; } static const int verbosity = 1; }; -struct SadChannel: public LogChannel { static const char* name() { return ":-("; } static const int verbosity = 1; }; - -void doFarm(MinerType _m, string const& _remote, unsigned _recheckPeriod) -{ - (void)_m; - (void)_remote; - (void)_recheckPeriod; -#if ETH_JSONRPC || !ETH_TRUE - jsonrpc::HttpClient client(_remote); - - Farm rpc(client); - GenericFarm f; - if (_m == MinerType::CPU) - f.startCPU(); - else if (_m == MinerType::GPU) - f.startGPU(); - - ProofOfWork::WorkPackage current; - while (true) - try - { - bool completed = false; - ProofOfWork::Solution solution; - f.onSolutionFound([&](ProofOfWork::Solution sol) - { - solution = sol; - return completed = true; - }); - for (unsigned i = 0; !completed; ++i) - { - if (current) - cnote << "Mining on PoWhash" << current.headerHash << ": " << f.miningProgress(); - else - cnote << "Getting work package..."; - Json::Value v = rpc.eth_getWork(); - h256 hh(v[0].asString()); - if (hh != current.headerHash) - { - current.headerHash = hh; - current.seedHash = h256(v[1].asString()); - current.boundary = h256(fromHex(v[2].asString()), h256::AlignRight); - cnote << "Got work package:"; - cnote << " Header-hash:" << current.headerHash.hex(); - cnote << " Seedhash:" << current.seedHash.hex(); - cnote << " Target: " << h256(current.boundary).hex(); - f.setWork(current); - } - this_thread::sleep_for(chrono::milliseconds(_recheckPeriod)); - } - cnote << "Solution found; Submitting to" << _remote << "..."; - cnote << " Nonce:" << solution.nonce.hex(); - cnote << " Mixhash:" << solution.mixHash.hex(); - cnote << " Header-hash:" << current.headerHash.hex(); - cnote << " Seedhash:" << current.seedHash.hex(); - cnote << " Target: " << h256(current.boundary).hex(); - cnote << " Ethash: " << h256(EthashAux::eval(current.seedHash, current.headerHash, solution.nonce).value).hex(); - if (EthashAux::eval(current.seedHash, current.headerHash, solution.nonce).value < current.boundary) - { - bool ok = rpc.eth_submitWork("0x" + toString(solution.nonce), "0x" + toString(current.headerHash), "0x" + toString(solution.mixHash)); - if (ok) - clog(HappyChannel) << "Submitted and accepted."; - else - clog(SadChannel) << "Not accepted."; - } - else - cwarn << "FAILURE: GPU gave incorrect result!"; - current.reset(); - } - catch (jsonrpc::JsonRpcException&) - { - for (auto i = 3; --i; this_thread::sleep_for(chrono::seconds(1))) - cerr << "JSON-RPC problem. Probably couldn't connect. Retrying in " << i << "... \r"; - cerr << endl; - } -#endif - exit(0); -} - int main(int argc, char** argv) { - /// Operating mode. - OperationMode mode = OperationMode::Farm; - - /// Mining options - MinerType minerType = MinerType::CPU; - unsigned openclPlatform = 0; - unsigned openclDevice = 0; - unsigned miningThreads = UINT_MAX; - - /// DAG initialisation param. - unsigned initDAG = 0; - - /// Benchmarking params - bool phoneHome = true; - unsigned benchmarkWarmup = 3; - unsigned benchmarkTrial = 3; - unsigned benchmarkTrials = 5; - - /// Farm params - string farmURL = "http://127.0.0.1:8545"; - unsigned farmRecheckPeriod = 500; + MinerCLI m(MinerCLI::OperationMode::Farm); for (int i = 1; i < argc; ++i) { string arg = argv[i]; - if ((arg == "-F" || arg == "--farm") && i + 1 < argc) - { - mode = OperationMode::Farm; - farmURL = argv[++i]; - } - else if (arg == "--farm-recheck" && i + 1 < argc) - try { - farmRecheckPeriod = stol(argv[++i]); - } - catch (...) - { - cerr << "Bad " << arg << " option: " << argv[i] << endl; - return -1; - } - else if (arg == "--opencl-platform" && i + 1 < argc) - try { - openclPlatform = stol(argv[++i]); - } - catch (...) - { - cerr << "Bad " << arg << " option: " << argv[i] << endl; - return -1; - } - else if (arg == "--opencl-device" && i + 1 < argc) - try { - openclDevice = stol(argv[++i]); - miningThreads = 1; - } - catch (...) - { - cerr << "Bad " << arg << " option: " << argv[i] << endl; - return -1; - } - else if (arg == "--phone-home" && i + 1 < argc) - { - string m = argv[++i]; - if (isTrue(m)) - phoneHome = true; - else if (isFalse(m)) - phoneHome = false; - else - { - cerr << "Bad " << arg << " option: " << m << endl; - return -1; - } - } - else if (arg == "--benchmark-warmup" && i + 1 < argc) - try { - benchmarkWarmup = stol(argv[++i]); - } - catch (...) - { - cerr << "Bad " << arg << " option: " << argv[i] << endl; - return -1; - } - else if (arg == "--benchmark-trial" && i + 1 < argc) - try { - benchmarkTrial = stol(argv[++i]); - } - catch (...) - { - cerr << "Bad " << arg << " option: " << argv[i] << endl; - return -1; - } - else if (arg == "--benchmark-trials" && i + 1 < argc) - try { - benchmarkTrials = stol(argv[++i]); - } - catch (...) - { - cerr << "Bad " << arg << " option: " << argv[i] << endl; - return -1; - } - else if (arg == "-C" || arg == "--cpu") - minerType = MinerType::CPU; - else if (arg == "-G" || arg == "--opencl") - { - minerType = MinerType::GPU; - miningThreads = 1; - } - else if ((arg == "-D" || arg == "--create-dag") && i + 1 < argc) - { - string m = boost::to_lower_copy(string(argv[++i])); - mode = OperationMode::DAGInit; - try - { - initDAG = stol(m); - } - catch (...) - { - cerr << "Bad " << arg << " option: " << m << endl; - return -1; - } - } - else if ((arg == "-w" || arg == "--check-pow") && i + 4 < argc) - { - string m; - try - { - BlockInfo bi; - m = boost::to_lower_copy(string(argv[++i])); - h256 powHash(m); - m = boost::to_lower_copy(string(argv[++i])); - h256 seedHash; - if (m.size() == 64 || m.size() == 66) - seedHash = h256(m); - else - seedHash = EthashAux::seedHash(stol(m)); - m = boost::to_lower_copy(string(argv[++i])); - bi.difficulty = u256(m); - auto boundary = bi.boundary(); - m = boost::to_lower_copy(string(argv[++i])); - bi.nonce = h64(m); - auto r = EthashAux::eval(bi.seedHash(), powHash, bi.nonce); - bool valid = r.value < boundary; - cout << (valid ? "VALID :-)" : "INVALID :-(") << endl; - cout << r.value << (valid ? " < " : " >= ") << boundary << endl; - cout << " where " << boundary << " = 2^256 / " << bi.difficulty << endl; - cout << " and " << r.value << " = ethash(" << powHash << ", " << bi.nonce << ")" << endl; - cout << " with seed as " << seedHash << endl; - if (valid) - cout << "(mixHash = " << r.mixHash << ")" << endl; - cout << "SHA3( light(seed) ) = " << sha3(EthashAux::light(bi.seedHash())->data()) << endl; - exit(0); - } - catch (...) - { - cerr << "Bad " << arg << " option: " << m << endl; - return -1; - } - } - else if (arg == "-M" || arg == "--benchmark") - mode = OperationMode::Benchmark; - else if ((arg == "-t" || arg == "--mining-threads") && i + 1 < argc) - { - try { - miningThreads = stol(argv[++i]); - } - catch (...) - { - cerr << "Bad " << arg << " option: " << argv[i] << endl; - return -1; - } - } + if (m.interpretOption(i, argc, argv)) + {} else if ((arg == "-v" || arg == "--verbosity") && i + 1 < argc) g_logVerbosity = atoi(argv[++i]); else if (arg == "-h" || arg == "--help") @@ -473,23 +80,7 @@ int main(int argc, char** argv) } } - if (minerType == MinerType::CPU) - ProofOfWork::CPUMiner::setNumInstances(miningThreads); - else if (minerType == MinerType::GPU) - { - ProofOfWork::GPUMiner::setDefaultPlatform(openclPlatform); - ProofOfWork::GPUMiner::setDefaultDevice(openclDevice); - ProofOfWork::GPUMiner::setNumInstances(miningThreads); - } - - if (mode == OperationMode::DAGInit) - doInitDAG(initDAG); - - if (mode == OperationMode::Benchmark) - doBenchmark(minerType, phoneHome, benchmarkWarmup, benchmarkTrial, benchmarkTrials); - - if (mode == OperationMode::Farm) - doFarm(minerType, farmURL, farmRecheckPeriod); + m.execute(); return 0; } diff --git a/libethcore/Ethash.cpp b/libethcore/Ethash.cpp index ff7fe47e7..f6872ae95 100644 --- a/libethcore/Ethash.cpp +++ b/libethcore/Ethash.cpp @@ -146,8 +146,8 @@ void Ethash::CPUMiner::workLoop() h256 value = h256((uint8_t*)ðashReturn.result, h256::ConstructFromPointer); if (value <= boundary && submitProof(Solution{(Nonce)(u64)tryNonce, h256((uint8_t*)ðashReturn.mix_hash, h256::ConstructFromPointer)})) break; - if (!(hashCount % 1000)) - accumulateHashes(1000); + if (!(hashCount % 100)) + accumulateHashes(100); } } diff --git a/libethcore/EthashAux.h b/libethcore/EthashAux.h index 3f876f442..b09f6465f 100644 --- a/libethcore/EthashAux.h +++ b/libethcore/EthashAux.h @@ -19,6 +19,8 @@ * @date 2014 */ +#pragma once + #include #include #include From 97d7349bb5f994a887e05d206a55f0ec9aa7642e Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Mon, 18 May 2015 17:26:57 +0200 Subject: [PATCH 260/461] Point at real URL for phoning home. --- ethminer/MinerAux.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ethminer/MinerAux.h b/ethminer/MinerAux.h index 2a2aca10e..31e66d94a 100644 --- a/ethminer/MinerAux.h +++ b/ethminer/MinerAux.h @@ -366,7 +366,7 @@ private: if (_phoneHome) { cout << "Phoning home to find world ranking..." << endl; - jsonrpc::HttpClient client("http://gav.ethdev.com:3000/benchmark"); + jsonrpc::HttpClient client("http://gav.ethdev.com:3000"); PhoneHome rpc(client); try { From 9fcbacc95cea036fc27f53596d49b8bae35b3f48 Mon Sep 17 00:00:00 2001 From: subtly Date: Mon, 18 May 2015 17:35:34 +0200 Subject: [PATCH 261/461] remove apple check, as getpwuid is *nx-safe --- io_posix.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/io_posix.c b/io_posix.c index 1fe82973f..c9a17d845 100644 --- a/io_posix.c +++ b/io_posix.c @@ -26,10 +26,8 @@ #include #include #include -#if defined(__APPLE__) #include #include -#endif FILE* ethash_fopen(char const* file_name, char const* mode) { @@ -93,14 +91,12 @@ bool ethash_get_default_dirname(char* strbuf, size_t buffsize) static const char dir_suffix[] = ".ethash/"; strbuf[0] = '\0'; char* home_dir = getenv("HOME"); -#if defined(__APPLE__) if (!home_dir || strlen(home_dir) == 0) { struct passwd* pwd = getpwuid(getuid()); if (pwd) home_dir = pwd->pw_dir; } -#endif size_t len = strlen(home_dir); if (!ethash_strncat(strbuf, buffsize, home_dir, len)) { From 67e1d52f2ce884c870d89b436e0b9fb72b04730b Mon Sep 17 00:00:00 2001 From: subtly Date: Mon, 18 May 2015 18:09:41 +0200 Subject: [PATCH 262/461] Import changes into MinerAux and retain pointer to dag. --- ethminer/MinerAux.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/ethminer/MinerAux.h b/ethminer/MinerAux.h index 31e66d94a..0441bc412 100644 --- a/ethminer/MinerAux.h +++ b/ethminer/MinerAux.h @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -398,6 +399,7 @@ private: f.startGPU(); ProofOfWork::WorkPackage current; + EthashAux::FullType dag; while (true) try { @@ -416,10 +418,13 @@ private: cnote << "Getting work package..."; Json::Value v = rpc.eth_getWork(); h256 hh(v[0].asString()); + h256 newSeedHash(v[1].asString()); + if (!(dag = EthashAux::full(newSeedHash, true))) + BOOST_THROW_EXCEPTION(DAGCreationFailure()); if (hh != current.headerHash) { current.headerHash = hh; - current.seedHash = h256(v[1].asString()); + current.seedHash = newSeedHash; current.boundary = h256(fromHex(v[2].asString()), h256::AlignRight); cnote << "Got work package:"; cnote << " Header-hash:" << current.headerHash.hex(); From 0768814d7332eb695438e19efb15b01ae3264754 Mon Sep 17 00:00:00 2001 From: subtly Date: Mon, 18 May 2015 18:10:59 +0200 Subject: [PATCH 263/461] reverse commit for ethash --- libethash/io_posix.c | 12 ------------ 1 file changed, 12 deletions(-) diff --git a/libethash/io_posix.c b/libethash/io_posix.c index 1fe82973f..80046252d 100644 --- a/libethash/io_posix.c +++ b/libethash/io_posix.c @@ -26,10 +26,6 @@ #include #include #include -#if defined(__APPLE__) -#include -#include -#endif FILE* ethash_fopen(char const* file_name, char const* mode) { @@ -93,14 +89,6 @@ bool ethash_get_default_dirname(char* strbuf, size_t buffsize) static const char dir_suffix[] = ".ethash/"; strbuf[0] = '\0'; char* home_dir = getenv("HOME"); -#if defined(__APPLE__) - if (!home_dir || strlen(home_dir) == 0) - { - struct passwd* pwd = getpwuid(getuid()); - if (pwd) - home_dir = pwd->pw_dir; - } -#endif size_t len = strlen(home_dir); if (!ethash_strncat(strbuf, buffsize, home_dir, len)) { From 07b0ff85ffcc045991a9c97cf43640a9dbf95271 Mon Sep 17 00:00:00 2001 From: subtly Date: Mon, 18 May 2015 18:11:58 +0200 Subject: [PATCH 264/461] reverse commit for ethash --- libethash/io_win32.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libethash/io_win32.c b/libethash/io_win32.c index 34f1aaa77..e6e332b9f 100644 --- a/libethash/io_win32.c +++ b/libethash/io_win32.c @@ -87,9 +87,9 @@ bool ethash_file_size(FILE* f, size_t* ret_size) bool ethash_get_default_dirname(char* strbuf, size_t buffsize) { - static const char dir_suffix[] = "Ethash\\"; + static const char dir_suffix[] = "AppData\\Ethash\\"; strbuf[0] = '\0'; - if (!SUCCEEDED(SHGetFolderPathA(NULL, CSIDL_LOCAL_APPDATA, NULL, 0, (CHAR*)strbuf))) { + if (!SUCCEEDED(SHGetFolderPathW(NULL, CSIDL_PROFILE, NULL, 0, (WCHAR*)strbuf))) { return false; } if (!ethash_strncat(strbuf, buffsize, "\\", 1)) { From 3bd7b5241c7b940102c939476a713971aaea2687 Mon Sep 17 00:00:00 2001 From: subtly Date: Mon, 18 May 2015 18:12:55 +0200 Subject: [PATCH 265/461] reverse ethash changes --- libethash/io_posix.c | 2 +- libethash/io_win32.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libethash/io_posix.c b/libethash/io_posix.c index 80046252d..1dea66ed1 100644 --- a/libethash/io_posix.c +++ b/libethash/io_posix.c @@ -89,7 +89,7 @@ bool ethash_get_default_dirname(char* strbuf, size_t buffsize) static const char dir_suffix[] = ".ethash/"; strbuf[0] = '\0'; char* home_dir = getenv("HOME"); - + size_t len = strlen(home_dir); if (!ethash_strncat(strbuf, buffsize, home_dir, len)) { return false; diff --git a/libethash/io_win32.c b/libethash/io_win32.c index e6e332b9f..2e6c8deb8 100644 --- a/libethash/io_win32.c +++ b/libethash/io_win32.c @@ -87,7 +87,7 @@ bool ethash_file_size(FILE* f, size_t* ret_size) bool ethash_get_default_dirname(char* strbuf, size_t buffsize) { - static const char dir_suffix[] = "AppData\\Ethash\\"; + static const char dir_suffix[] = "Appdata\\Ethash\\"; strbuf[0] = '\0'; if (!SUCCEEDED(SHGetFolderPathW(NULL, CSIDL_PROFILE, NULL, 0, (WCHAR*)strbuf))) { return false; From 3b233f46e0d37323d2efdb0bb0437d2b1d603b8d Mon Sep 17 00:00:00 2001 From: subtly Date: Mon, 18 May 2015 18:13:52 +0200 Subject: [PATCH 266/461] reverse ethash changes --- libethash/io_posix.c | 1 - 1 file changed, 1 deletion(-) diff --git a/libethash/io_posix.c b/libethash/io_posix.c index 1dea66ed1..7f03d5482 100644 --- a/libethash/io_posix.c +++ b/libethash/io_posix.c @@ -89,7 +89,6 @@ bool ethash_get_default_dirname(char* strbuf, size_t buffsize) static const char dir_suffix[] = ".ethash/"; strbuf[0] = '\0'; char* home_dir = getenv("HOME"); - size_t len = strlen(home_dir); if (!ethash_strncat(strbuf, buffsize, home_dir, len)) { return false; From 352ec1153632903f7c0396f8e32403060fbcf536 Mon Sep 17 00:00:00 2001 From: yann300 Date: Mon, 18 May 2015 19:28:31 +0200 Subject: [PATCH 267/461] add list of second errorannotation instead of single item. --- mix/CodeModel.cpp | 9 ++-- mix/CodeModel.h | 2 +- mix/qml/CodeEditorView.qml | 2 +- mix/qml/WebCodeEditor.qml | 38 ++++++++------- mix/qml/html/cm/errorannotation.js | 2 +- mix/qml/html/codeeditor.js | 75 ++++++++++++------------------ test/libethereum/stateOriginal.cpp | 2 +- 7 files changed, 61 insertions(+), 69 deletions(-) diff --git a/mix/CodeModel.cpp b/mix/CodeModel.cpp index 82f9291df..769497dcd 100644 --- a/mix/CodeModel.cpp +++ b/mix/CodeModel.cpp @@ -313,12 +313,15 @@ void CodeModel::runCompilationJob(int _jobId) solidity::SourceReferenceFormatter::printExceptionInformation(error, _exception, "Error", cs); QString message = QString::fromStdString(error.str()); QVariantMap firstLocation; - QVariantMap secondLocation; + QVariantList secondLocations; if (SourceLocation const* first = boost::get_error_info(_exception)) firstLocation = resolveCompilationErrorLocation(cs, *first); if (SecondarySourceLocation const* second = boost::get_error_info(_exception)) - secondLocation = resolveCompilationErrorLocation(cs, second->infos.front().second); - compilationError(message, firstLocation, secondLocation); + { + for (auto const& c: second->infos) + secondLocations.push_back(resolveCompilationErrorLocation(cs, c.second)); + } + compilationError(message, firstLocation, secondLocations); } m_compiling = false; emit stateChanged(); diff --git a/mix/CodeModel.h b/mix/CodeModel.h index 05d013f9a..2510b4248 100644 --- a/mix/CodeModel.h +++ b/mix/CodeModel.h @@ -175,7 +175,7 @@ signals: /// Emitted on compilation complete void compilationComplete(); /// Emitted on compilation error - void compilationError(QString _error, QVariantMap _firstErrorLoc, QVariantMap _secondErrorLoc); + void compilationError(QString _error, QVariantMap _firstErrorLoc, QVariantList _secondErrorLoc); /// Internal signal used to transfer compilation job to background thread void scheduleCompilationJob(int _jobId); /// Emitted if there are any changes in the code model diff --git a/mix/qml/CodeEditorView.qml b/mix/qml/CodeEditorView.qml index 8ebb7319f..1a5e3f0f8 100644 --- a/mix/qml/CodeEditorView.qml +++ b/mix/qml/CodeEditorView.qml @@ -74,7 +74,7 @@ Item { }); } editor.document = document; - editor.sourceName = document.documentId; + editor.setSourceName(document.documentId); editor.setFontSize(editorSettings.fontSize); editor.setText(data, document.syntaxMode); editor.changeGeneration(); diff --git a/mix/qml/WebCodeEditor.qml b/mix/qml/WebCodeEditor.qml index 49a0576cc..af3eda094 100644 --- a/mix/qml/WebCodeEditor.qml +++ b/mix/qml/WebCodeEditor.qml @@ -83,6 +83,13 @@ Item { editorBrowser.runJavaScript("setFontSize(" + size + ")", function(result) {}); } + function setSourceName(sourceName) + { + sourceName = sourceName; + if (initialized && editorBrowser) + editorBrowser.runJavaScript("setSourceName('" + sourceName + "')", function(result) {}); + } + Clipboard { id: clipboard @@ -137,28 +144,23 @@ Item { editorBrowser.runJavaScript("compilationComplete()", function(result) { }); } - function compilationError(error, firstLocation, secondLocation) + function compilationError(error, firstLocation, secondLocations) { - console.log("current " + parent.sourceName); - console.log("source " + firstLocation.source); - if (firstLocation.source !== parent.sourceName && secondLocation.source !== parent.sourceName) - return; if (!editorBrowser || !error) return; - if (firstLocation.start.line) - { - var detail = error.split('\n')[0]; - var reg = detail.match(/:\d+:\d+:/g); - if (reg !== null) - detail = detail.replace(reg[0], ""); - editorBrowser.runJavaScript("compilationError('" + JSON.stringify(firstLocation) + "', '" + JSON.stringify(secondLocation) + "', '" + detail + "')", function(result){}); - } - else - { - console.log("e d qml"); - editorBrowser.runJavaScript("compilationComplete()", function(result) { }); - } + var detail = error.split('\n')[0]; + var reg = detail.match(/:\d+:\d+:/g); + if (reg !== null) + detail = detail.replace(reg[0], ""); + displayErrorAnnotations(firstLocation, detail, "first"); + for (var k in secondLocations) + displayErrorAnnotations(secondLocations[k], detail, "second"); + } + function displayErrorAnnotations(location, detail, type) + { + //if (location.source === parent.sourceName) + editorBrowser.runJavaScript("compilationError('" + JSON.stringify(location) + "', '" + detail + "', '" + type + "')", function(result){}); } Timer diff --git a/mix/qml/html/cm/errorannotation.js b/mix/qml/html/cm/errorannotation.js index f5266d4dc..a8cdb6fe6 100644 --- a/mix/qml/html/cm/errorannotation.js +++ b/mix/qml/html/cm/errorannotation.js @@ -1,6 +1,6 @@ function ErrorAnnotation(editor, location, content) { - this.location = JSON.parse(location); + this.location = location; this.opened = false; this.rawContent = content; this.content = content.replace("Contract Error:", ""); diff --git a/mix/qml/html/codeeditor.js b/mix/qml/html/codeeditor.js index 4c8af5888..4cf443b72 100644 --- a/mix/qml/html/codeeditor.js +++ b/mix/qml/html/codeeditor.js @@ -8,6 +8,7 @@ var editor = CodeMirror(document.body, { styleSelectedText: true }); var ternServer; +var sourceName = ""; editor.setOption("theme", "inkpot"); editor.setOption("indentUnit", 4); @@ -157,65 +158,46 @@ showWarning = function(content) debugWarning = editor.addLineWidget(0, node, { coverGutter: false, above: true }); } -var annotation = null; -var secondaryAnnotation = null; +var annotations = []; var compilationCompleteBool = true; -compilationError = function(location, secondLocation, error) +compilationError = function(location, error, type) { compilationCompleteBool = false; - window.setTimeout(function(){ - if (compilationCompleteBool) - return; - - var loc = JSON.parse(location); - if (annotation == null) - { - annotation = new ErrorAnnotation(editor, location, error); - if (secondLocation.start) - secondaryAnnotation = new ErrorAnnotation(editor, secondLocation, ""); - } - else if (annotation.location.start.line !== loc.start.line || annotation.location.start.column !== loc.start.column || annotation.rawContent !== error) - { - annotation.destroy(); - annotation = new ErrorAnnotation(editor, location, error); - if (secondaryAnnotation) - secondaryAnnotation.destroy(); - secondaryAnnotation = new ErrorAnnotation(editor, secondLocation, ""); - } - }, 500) + if (compilationCompleteBool) + return; + location = JSON.parse(location); + if (location.start.line) + ensureAnnotation(location, error, type); } -formatSource = function(line, column) +ensureAnnotation = function(location, error, type) { - line = parseInt(line); - column = parseInt(column); - if (line > 0) - line = line - 1; - if (column > 0) - column = column - 1; + for (var k in annotations) + { + if (annotations[k].annotation.location.start.line === location.start.line) + { + annotations[k].annotation.destroy(); + annotations.splice(k, 1); + break; + } + } + if (type === "second") + error = ""; + annotations.push({ "type": type, "annotation": new ErrorAnnotation(editor, location, error)}); } compilationComplete = function() { - if (annotation !== null) - { - annotation.destroy(); - annotation = null; - } - - if (secondaryAnnotation !== null) - { - secondaryAnnotation.destroy(); - secondaryAnnotation = null; - } - + for (var k in annotations) + annotations[k].annotation.destroy(); + annotations.length = 0; compilationCompleteBool = true; - console.log("end"); } goToCompilationError = function() { - editor.setCursor(annotation.start.line, annotation.start.column) + if (annotations.length > 0) + editor.setCursor(annotations[0].annotation.location.start.line, annotations[0].annotation.location.start.column) } setFontSize = function(size) @@ -224,5 +206,10 @@ setFontSize = function(size) editor.refresh(); } +setSourceName = function(_sourceName) +{ + sourceName = _sourceName; +} + editor.setOption("extraKeys", extraKeys); diff --git a/test/libethereum/stateOriginal.cpp b/test/libethereum/stateOriginal.cpp index 82d6288d6..bad0cf223 100644 --- a/test/libethereum/stateOriginal.cpp +++ b/test/libethereum/stateOriginal.cpp @@ -25,7 +25,7 @@ #include #include #include -#include +//#include #include #include "../TestHelper.h" using namespace std; From dd8bc4b78d30a97536001ab8fd37c7b1ac194b04 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Mon, 18 May 2015 21:00:21 +0200 Subject: [PATCH 268/461] Parallelised uncle checking. --- ethminer/MinerAux.h | 4 ++-- libethcore/Common.h | 5 +++-- libethereum/BlockChain.cpp | 4 ++-- libethereum/BlockQueue.cpp | 3 +++ libethereum/State.cpp | 2 +- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/ethminer/MinerAux.h b/ethminer/MinerAux.h index 31e66d94a..ee78dc1c2 100644 --- a/ethminer/MinerAux.h +++ b/ethminer/MinerAux.h @@ -362,7 +362,7 @@ private: cout << "inner mean: " << innerMean << " H/s" << endl; (void)_phoneHome; - #if ETH_JSONRPC || !ETH_TRUE +#if ETH_JSONRPC || !ETH_TRUE if (_phoneHome) { cout << "Phoning home to find world ranking..." << endl; @@ -378,7 +378,7 @@ private: cout << "Error phoning home. ET is sad." << endl; } } - #endif +#endif exit(0); } diff --git a/libethcore/Common.h b/libethcore/Common.h index 8855bc3a7..2cb505905 100644 --- a/libethcore/Common.h +++ b/libethcore/Common.h @@ -100,9 +100,10 @@ struct ImportRequirements using value = unsigned; enum { - ValidNonce = 1, ///< Validate Nonce + ValidNonce = 1, ///< Validate nonce DontHave = 2, ///< Avoid old blocks - Default = ValidNonce | DontHave + CheckUncles = 4, ///< Check uncle nonces + Default = ValidNonce | DontHave | CheckUncles }; }; diff --git a/libethereum/BlockChain.cpp b/libethereum/BlockChain.cpp index f4a1dcec2..73747b25b 100644 --- a/libethereum/BlockChain.cpp +++ b/libethereum/BlockChain.cpp @@ -317,8 +317,8 @@ tuple BlockChain::sync(BlockQueue& _bq, OverlayDB const& _st { try { - // Nonce is already verified thread at this point. - auto r = import(block.first, block.second, _stateDB, ImportRequirements::Default & ~ImportRequirements::ValidNonce); + // Nonce & uncle nonces already verified thread at this point. + auto r = import(block.first, block.second, _stateDB, ImportRequirements::Default & ~ImportRequirements::ValidNonce & ~ImportRequirements::CheckUncles); fresh += r.first; dead += r.second; } diff --git a/libethereum/BlockQueue.cpp b/libethereum/BlockQueue.cpp index df134b246..2af95d00c 100644 --- a/libethereum/BlockQueue.cpp +++ b/libethereum/BlockQueue.cpp @@ -78,6 +78,9 @@ void BlockQueue::verifierBody() try { res.first.populate(res.second, CheckEverything, work.first); res.first.verifyInternals(&res.second); + RLP r(&res.second); + for (auto const& uncle: r[2]) + BlockInfo().populateFromHeader(RLP(uncle.data()), CheckEverything); } catch (...) { diff --git a/libethereum/State.cpp b/libethereum/State.cpp index b9e548ea3..3bf7aaff7 100644 --- a/libethereum/State.cpp +++ b/libethereum/State.cpp @@ -667,7 +667,7 @@ u256 State::enact(bytesConstRef _block, BlockChain const& _bc, ImportRequirement BOOST_THROW_EXCEPTION(UncleInChain() << errinfo_comment("Uncle in block already mentioned") << errinfo_data(toString(excluded)) << errinfo_hash256(sha3(i.data()))); excluded.insert(h); - BlockInfo uncle = BlockInfo::fromHeader(i.data(), CheckEverything, h); + BlockInfo uncle = BlockInfo::fromHeader(i.data(), (_ir & ImportRequirements::CheckUncles) ? CheckEverything : IgnoreNonce, h); BlockInfo uncleParent(_bc.block(uncle.parentHash)); if ((bigint)uncleParent.number < (bigint)m_currentBlock.number - 7) BOOST_THROW_EXCEPTION(UncleTooOld()); From f55975b5dcffd0ebda49fe63eafdc450df486d40 Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Tue, 19 May 2015 09:12:15 +0200 Subject: [PATCH 269/461] cleaner output --- libethereum/Client.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libethereum/Client.cpp b/libethereum/Client.cpp index 6d5e39e39..30eb12352 100644 --- a/libethereum/Client.cpp +++ b/libethereum/Client.cpp @@ -606,9 +606,10 @@ bool Client::remoteActive() const void Client::onPostStateChanged() { - cnote << "Post state changed: Restarting mining..."; + cnote << "Post state changed"; if (isMining() || remoteActive()) { + cnote << "Restarting mining..."; DEV_WRITE_GUARDED(x_working) m_working.commitToMine(m_bc); DEV_READ_GUARDED(x_working) From 4f67ec63c7b44abafcce5a6cd1202417d4a0bfac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Tue, 19 May 2015 10:19:14 +0200 Subject: [PATCH 270/461] Do not override CMAKE_CXX_FLAGS in evmjit. --- evmjit/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/evmjit/CMakeLists.txt b/evmjit/CMakeLists.txt index a0e9c1f46..280fec212 100644 --- a/evmjit/CMakeLists.txt +++ b/evmjit/CMakeLists.txt @@ -7,7 +7,7 @@ set(CMAKE_AUTOMOC OFF) if(${CMAKE_CXX_COMPILER_ID} STREQUAL "MSVC") else() - set(CMAKE_CXX_FLAGS "-std=c++11 -Wall -Wextra -Wconversion -Wno-sign-conversion -Wno-unknown-pragmas") + set(CMAKE_CXX_FLAGS "-std=c++11 -Wall -Wextra -Wconversion -Wno-sign-conversion -Wno-unknown-pragmas ${CMAKE_CXX_FLAGS}") endif() if(${CMAKE_SYSTEM_NAME} STREQUAL "Linux") From babebadc29f217033aca52bee78cf5af46290997 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 19 May 2015 10:33:56 +0200 Subject: [PATCH 271/461] replace sourceNamne by contractName --- mix/CodeModel.cpp | 87 +++++++++++++++++++++------------------ mix/qml/WebCodeEditor.qml | 21 +++++++--- 2 files changed, 62 insertions(+), 46 deletions(-) diff --git a/mix/CodeModel.cpp b/mix/CodeModel.cpp index 769497dcd..9875ee1aa 100644 --- a/mix/CodeModel.cpp +++ b/mix/CodeModel.cpp @@ -45,7 +45,7 @@ using namespace dev::mix; const std::set c_predefinedContracts = - { "Config", "Coin", "CoinReg", "coin", "service", "owned", "mortal", "NameReg", "named", "std", "configUser" }; +{ "Config", "Coin", "CoinReg", "coin", "service", "owned", "mortal", "NameReg", "named", "std", "configUser" }; namespace @@ -56,7 +56,7 @@ class CollectLocalsVisitor: public ASTConstVisitor { public: CollectLocalsVisitor(QHash* _locals): - m_locals(_locals), m_functionScope(false) {} + m_locals(_locals), m_functionScope(false) {} private: LocationPair nodeLocation(ASTNode const& _node) @@ -96,7 +96,7 @@ class CollectLocationsVisitor: public ASTConstVisitor { public: CollectLocationsVisitor(SourceMap* _sourceMap): - m_sourceMap(_sourceMap) {} + m_sourceMap(_sourceMap) {} private: LocationPair nodeLocation(ASTNode const& _node) @@ -339,7 +339,14 @@ QVariantMap CodeModel::resolveCompilationErrorLocation(CompilerStack const& _com QVariantMap error; error.insert("start", startError); error.insert("end", endError); - error.insert("source", QString::fromStdString(*_location.sourceName)); + QString sourceName; + if (_location.sourceName) + sourceName = QString::fromStdString(*_location.sourceName); + error.insert("source", sourceName); + if (!sourceName.isEmpty()) + if (CompiledContract* contract = contractByDocumentId(sourceName)) + sourceName = contract->contract()->name(); //substitute the location to match our contract names + error.insert("contractName", sourceName); return error; } @@ -385,7 +392,7 @@ void CodeModel::collectContracts(dev::solidity::CompilerStack const& _cs, std::v { //make sure there are no other contracts in the same source, otherwise it is not a rename if (!std::any_of(result.begin(),result.end(), [=](ContractMap::const_iterator::value_type _v) { return _v != contract && _v->documentId() == contract->documentId(); })) - prevContract = c.value(); + prevContract = c.value(); } } if (prevContract != nullptr && prevContract->contractInterface() != result[name]->contractInterface()) @@ -435,59 +442,59 @@ SolidityType CodeModel::nodeType(dev::solidity::Type const* _type) switch (_type->getCategory()) { case Type::Category::Integer: - { - IntegerType const* it = dynamic_cast(_type); - r.size = it->getNumBits() / 8; - r.type = it->isAddress() ? SolidityType::Type::Address : it->isSigned() ? SolidityType::Type::SignedInteger : SolidityType::Type::UnsignedInteger; - } + { + IntegerType const* it = dynamic_cast(_type); + r.size = it->getNumBits() / 8; + r.type = it->isAddress() ? SolidityType::Type::Address : it->isSigned() ? SolidityType::Type::SignedInteger : SolidityType::Type::UnsignedInteger; + } break; case Type::Category::Bool: r.type = SolidityType::Type::Bool; break; case Type::Category::FixedBytes: - { - FixedBytesType const* b = dynamic_cast(_type); - r.type = SolidityType::Type::Bytes; - r.size = static_cast(b->getNumBytes()); - } + { + FixedBytesType const* b = dynamic_cast(_type); + r.type = SolidityType::Type::Bytes; + r.size = static_cast(b->getNumBytes()); + } break; case Type::Category::Contract: r.type = SolidityType::Type::Address; break; case Type::Category::Array: + { + ArrayType const* array = dynamic_cast(_type); + if (array->isByteArray()) + r.type = SolidityType::Type::Bytes; + else { - ArrayType const* array = dynamic_cast(_type); - if (array->isByteArray()) - r.type = SolidityType::Type::Bytes; - else - { - SolidityType elementType = nodeType(array->getBaseType().get()); - elementType.name = r.name; - r = elementType; - } - r.count = static_cast(array->getLength()); - r.dynamicSize = _type->isDynamicallySized(); - r.array = true; + SolidityType elementType = nodeType(array->getBaseType().get()); + elementType.name = r.name; + r = elementType; } + r.count = static_cast(array->getLength()); + r.dynamicSize = _type->isDynamicallySized(); + r.array = true; + } break; case Type::Category::Enum: - { - r.type = SolidityType::Type::Enum; - EnumType const* e = dynamic_cast(_type); - for(auto const& enumValue: e->getEnumDefinition().getMembers()) - r.enumNames.push_back(QString::fromStdString(enumValue->getName())); - } + { + r.type = SolidityType::Type::Enum; + EnumType const* e = dynamic_cast(_type); + for(auto const& enumValue: e->getEnumDefinition().getMembers()) + r.enumNames.push_back(QString::fromStdString(enumValue->getName())); + } break; case Type::Category::Struct: + { + r.type = SolidityType::Type::Struct; + StructType const* s = dynamic_cast(_type); + for(auto const& structMember: s->getMembers()) { - r.type = SolidityType::Type::Struct; - StructType const* s = dynamic_cast(_type); - for(auto const& structMember: s->getMembers()) - { - auto slotAndOffset = s->getStorageOffsetsOfMember(structMember.name); - r.members.push_back(SolidityDeclaration { QString::fromStdString(structMember.name), nodeType(structMember.type.get()), slotAndOffset.first, slotAndOffset.second }); - } + auto slotAndOffset = s->getStorageOffsetsOfMember(structMember.name); + r.members.push_back(SolidityDeclaration { QString::fromStdString(structMember.name), nodeType(structMember.type.get()), slotAndOffset.first, slotAndOffset.second }); } + } break; case Type::Category::Function: case Type::Category::IntegerConstant: diff --git a/mix/qml/WebCodeEditor.qml b/mix/qml/WebCodeEditor.qml index af3eda094..32e62d584 100644 --- a/mix/qml/WebCodeEditor.qml +++ b/mix/qml/WebCodeEditor.qml @@ -83,9 +83,9 @@ Item { editorBrowser.runJavaScript("setFontSize(" + size + ")", function(result) {}); } - function setSourceName(sourceName) + function setSourceName(_sourceName) { - sourceName = sourceName; + sourceName = _sourceName; if (initialized && editorBrowser) editorBrowser.runJavaScript("setSourceName('" + sourceName + "')", function(result) {}); } @@ -148,19 +148,28 @@ Item { { if (!editorBrowser || !error) return; + + var lineError = firstLocation.start.line + 1; + var errorOrigin = "source error in " + firstLocation.contractName + " line " + lineError + var secondErrorDetail = " Secondary sources: "; + for (var k in secondLocations) + { + lineError = secondLocations[k].start.line + 1; + secondErrorDetail += secondLocations[k].contractName + " line " + lineError + ", "; + displayErrorAnnotations(secondLocations[k], errorOrigin, "second"); + } var detail = error.split('\n')[0]; var reg = detail.match(/:\d+:\d+:/g); if (reg !== null) detail = detail.replace(reg[0], ""); + detail += secondErrorDetail; displayErrorAnnotations(firstLocation, detail, "first"); - for (var k in secondLocations) - displayErrorAnnotations(secondLocations[k], detail, "second"); } function displayErrorAnnotations(location, detail, type) { - //if (location.source === parent.sourceName) - editorBrowser.runJavaScript("compilationError('" + JSON.stringify(location) + "', '" + detail + "', '" + type + "')", function(result){}); + if (location.source === parent.sourceName) + editorBrowser.runJavaScript("compilationError('" + JSON.stringify(location) + "', '" + detail + "', '" + type + "')", function(result){}); } Timer From 996d340d493360ad0a1c4c635b0ae800357fff97 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 19 May 2015 11:26:52 +0200 Subject: [PATCH 272/461] remove JavaScript ownership --- mix/CodeModel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mix/CodeModel.h b/mix/CodeModel.h index 95c44febe..994e9936a 100644 --- a/mix/CodeModel.h +++ b/mix/CodeModel.h @@ -157,7 +157,7 @@ class GasMap: public QObject Q_PROPERTY(bool isInfinite MEMBER m_isInfinite CONSTANT) public: - GasMap(int _start, int _end, QString _gas, bool _isInfinite, QObject* _parent): QObject(_parent), m_start(_start), m_end(_end), m_gas(_gas), m_isInfinite(_isInfinite) { QQmlEngine::setObjectOwnership(this, QQmlEngine::JavaScriptOwnership); } + GasMap(int _start, int _end, QString _gas, bool _isInfinite, QObject* _parent): QObject(_parent), m_start(_start), m_end(_end), m_gas(_gas), m_isInfinite(_isInfinite) {} int m_start; int m_end; From e19ac5054c6331ffcec05e553087409d9235c53b Mon Sep 17 00:00:00 2001 From: arkpar Date: Mon, 18 May 2015 22:14:03 +0200 Subject: [PATCH 273/461] use TrieHash for transactions and receipts roots --- libdevcore/Common.h | 3 +- libdevcore/CommonData.cpp | 12 ++++++++ libdevcore/CommonData.h | 1 + libdevcrypto/TrieHash.cpp | 29 +++++++++++-------- libdevcrypto/TrieHash.h | 5 ++-- libethereum/State.cpp | 20 ++++--------- test/libdevcrypto/trie.cpp | 57 ++++++++++++++++++++++++-------------- 7 files changed, 76 insertions(+), 51 deletions(-) diff --git a/libdevcore/Common.h b/libdevcore/Common.h index 95817e41c..240746302 100644 --- a/libdevcore/Common.h +++ b/libdevcore/Common.h @@ -86,8 +86,9 @@ extern const u256 UndefinedU256; // Map types. using StringMap = std::map; +using BytesMap = std::map; using u256Map = std::map; -using HexMap = std::map; +using HexMap = std::map; // Hash types. using StringHashMap = std::unordered_map; diff --git a/libdevcore/CommonData.cpp b/libdevcore/CommonData.cpp index 6cad29952..ba2b412fd 100644 --- a/libdevcore/CommonData.cpp +++ b/libdevcore/CommonData.cpp @@ -115,6 +115,18 @@ bytes dev::fromHex(std::string const& _s, WhenError _throw) return ret; } +bytes dev::asNibbles(bytes const& _s) +{ + std::vector ret; + ret.reserve(_s.size() * 2); + for (auto i: _s) + { + ret.push_back(i / 16); + ret.push_back(i % 16); + } + return ret; +} + bytes dev::asNibbles(std::string const& _s) { std::vector ret; diff --git a/libdevcore/CommonData.h b/libdevcore/CommonData.h index 6c1f34667..29cc8e7c7 100644 --- a/libdevcore/CommonData.h +++ b/libdevcore/CommonData.h @@ -96,6 +96,7 @@ inline bytes asBytes(std::string const& _b) /// Converts a string into the big-endian base-16 stream of integers (NOT ASCII). /// @example asNibbles("A")[0] == 4 && asNibbles("A")[1] == 1 bytes asNibbles(std::string const& _s); +bytes asNibbles(bytes const& _s); // Big-endian to/from host endian conversion functions. diff --git a/libdevcrypto/TrieHash.cpp b/libdevcrypto/TrieHash.cpp index 0b02ce77f..4c4ca620d 100644 --- a/libdevcrypto/TrieHash.cpp +++ b/libdevcrypto/TrieHash.cpp @@ -158,43 +158,48 @@ void hash256aux(HexMap const& _s, HexMap::const_iterator _begin, HexMap::const_i } } -h256 hash256(StringMap const& _s) +bytes rlp256(BytesMap const& _s) { // build patricia tree. if (_s.empty()) - return sha3(rlp("")); + return rlp(""); HexMap hexMap; for (auto i = _s.rbegin(); i != _s.rend(); ++i) hexMap[asNibbles(i->first)] = i->second; RLPStream s; hash256rlp(hexMap, hexMap.cbegin(), hexMap.cend(), 0, s); - return sha3(s.out()); + return s.out(); } -bytes rlp256(StringMap const& _s) +h256 hash256(BytesMap const& _s) +{ + return sha3(rlp256(_s)); +} + +h256 hash256(StringMap const& _s) { // build patricia tree. if (_s.empty()) - return rlp(""); + return sha3(rlp("")); HexMap hexMap; for (auto i = _s.rbegin(); i != _s.rend(); ++i) - hexMap[asNibbles(i->first)] = i->second; + hexMap[asNibbles(i->first)] = bytes(i->second.begin(), i->second.end()); RLPStream s; - hash256aux(hexMap, hexMap.cbegin(), hexMap.cend(), 0, s); - return s.out(); + hash256rlp(hexMap, hexMap.cbegin(), hexMap.cend(), 0, s); + return sha3(s.out()); } -h256 hash256(u256Map const& _s) +bytes rlp256(StringMap const& _s) { // build patricia tree. if (_s.empty()) - return sha3(rlp("")); + return rlp(""); HexMap hexMap; for (auto i = _s.rbegin(); i != _s.rend(); ++i) - hexMap[asNibbles(toBigEndianString(i->first))] = asString(rlp(i->second)); + hexMap[asNibbles(i->first)] = bytes(i->second.begin(), i->second.end()); RLPStream s; hash256rlp(hexMap, hexMap.cbegin(), hexMap.cend(), 0, s); - return sha3(s.out()); + return s.out(); } /*h256 orderedTrieRoot(std::vector const& _data) diff --git a/libdevcrypto/TrieHash.h b/libdevcrypto/TrieHash.h index b0588fc38..46f9b1efb 100644 --- a/libdevcrypto/TrieHash.h +++ b/libdevcrypto/TrieHash.h @@ -27,9 +27,10 @@ namespace dev { +bytes rlp256(BytesMap const& _s); +h256 hash256(BytesMap const& _s); bytes rlp256(StringMap const& _s); h256 hash256(StringMap const& _s); -h256 hash256(u256Map const& _s); /*h256 orderedTrieRoot(std::vector const& _data); @@ -41,8 +42,6 @@ template inline h256 trieRootOver(unsigned _itemCount, T cons return hash256(m); }*/ -using bytesMap = std::unordered_map; - h256 orderedTrieRoot(std::vector const& _data); h256 orderedTrieRoot(std::vector const& _data); diff --git a/libethereum/State.cpp b/libethereum/State.cpp index b9e548ea3..d586941b4 100644 --- a/libethereum/State.cpp +++ b/libethereum/State.cpp @@ -840,16 +840,8 @@ void State::commitToMine(BlockChain const& _bc) } } - // TODO: move over to using TrieHash - - - MemoryDB tm; - GenericTrieDB transactionsTrie(&tm); - transactionsTrie.init(); - - MemoryDB rm; - GenericTrieDB receiptsTrie(&rm); - receiptsTrie.init(); + BytesMap transactionsMap; + BytesMap receiptsMap; RLPStream txs; txs.appendList(m_transactions.size()); @@ -861,11 +853,11 @@ void State::commitToMine(BlockChain const& _bc) RLPStream receiptrlp; m_receipts[i].streamRLP(receiptrlp); - receiptsTrie.insert(&k.out(), &receiptrlp.out()); + receiptsMap.insert(std::make_pair(k.out(), receiptrlp.out())); RLPStream txrlp; m_transactions[i].streamRLP(txrlp); - transactionsTrie.insert(&k.out(), &txrlp.out()); + transactionsMap.insert(std::make_pair(k.out(), txrlp.out())); txs.appendRaw(txrlp.out()); } @@ -874,8 +866,8 @@ void State::commitToMine(BlockChain const& _bc) RLPStream(unclesCount).appendRaw(unclesData.out(), unclesCount).swapOut(m_currentUncles); - m_currentBlock.transactionsRoot = transactionsTrie.root(); - m_currentBlock.receiptsRoot = receiptsTrie.root(); + m_currentBlock.transactionsRoot = hash256(transactionsMap); + m_currentBlock.receiptsRoot = hash256(receiptsMap); m_currentBlock.logBloom = logBloom(); m_currentBlock.sha3Uncles = sha3(m_currentUncles); diff --git a/test/libdevcrypto/trie.cpp b/test/libdevcrypto/trie.cpp index ecfc515aa..00bccd241 100644 --- a/test/libdevcrypto/trie.cpp +++ b/test/libdevcrypto/trie.cpp @@ -294,15 +294,27 @@ BOOST_AUTO_TEST_CASE(trie_tests_ordered) } } -inline h256 stringMapHash256(StringMap const& _s) +h256 stringMapHash256(StringMap const& _s) { - return hash256(_s); + //return hash256(_s); + BytesMap bytesMap; + for (auto const& _v: _s) + bytesMap.insert(std::make_pair(bytes(_v.first.begin(), _v.first.end()), bytes(_v.second.begin(), _v.second.end()))); + return hash256(bytesMap); +} + +bytes stringMapRlp256(StringMap const& _s) +{ + //return rlp256(_s); + BytesMap bytesMap; + for (auto const& _v: _s) + bytesMap.insert(std::make_pair(bytes(_v.first.begin(), _v.first.end()), bytes(_v.second.begin(), _v.second.end()))); + return rlp256(bytesMap); } BOOST_AUTO_TEST_CASE(moreTrieTests) { cnote << "Testing Trie more..."; -#if 0 // More tests... { MemoryDB m; @@ -311,7 +323,7 @@ BOOST_AUTO_TEST_CASE(moreTrieTests) cout << t; cout << m; cout << t.root() << endl; - cout << hash256(StringMap()) << endl; + cout << stringMapHash256(StringMap()) << endl; t.insert(string("tesz"), string("test")); cout << t; @@ -336,7 +348,7 @@ BOOST_AUTO_TEST_CASE(moreTrieTests) t.remove(string("test")); cout << m; cout << t.root() << endl; - cout << hash256(StringMap()) << endl; + cout << stringMapHash256(StringMap()) << endl; } { MemoryDB m; @@ -348,20 +360,23 @@ BOOST_AUTO_TEST_CASE(moreTrieTests) cout << m; cout << t.root() << endl; cout << stringMapHash256({{"b", "B"}, {"a", "A"}}) << endl; - cout << RLP(rlp256({{"b", "B"}, {"a", "A"}})) << endl; + bytes r(stringMapRlp256({{"b", "B"}, {"a", "A"}})); + cout << RLP(r) << endl; } { MemTrie t; t.insert("dog", "puppy"); cout << hex << t.hash256() << endl; - cout << RLP(t.rlp()) << endl; + bytes r(t.rlp()); + cout << RLP(r) << endl; } { MemTrie t; t.insert("bed", "d"); t.insert("be", "e"); cout << hex << t.hash256() << endl; - cout << RLP(t.rlp()) << endl; + bytes r(t.rlp()); + cout << RLP(r) << endl; } { cout << hex << stringMapHash256({{"dog", "puppy"}, {"doe", "reindeer"}}) << endl; @@ -369,10 +384,10 @@ BOOST_AUTO_TEST_CASE(moreTrieTests) t.insert("dog", "puppy"); t.insert("doe", "reindeer"); cout << hex << t.hash256() << endl; - cout << RLP(t.rlp()) << endl; + bytes r(t.rlp()); + cout << RLP(r) << endl; cout << toHex(t.rlp()) << endl; } -#endif { MemoryDB m; EnforceRefs r(m, true); @@ -387,16 +402,17 @@ BOOST_AUTO_TEST_CASE(moreTrieTests) t.insert(a, b); s[a] = b; - /*cout << endl << "-------------------------------" << endl; + cout << endl << "-------------------------------" << endl; cout << a << " -> " << b << endl; cout << d; cout << m; cout << d.root() << endl; - cout << hash256(s) << endl;*/ + cout << hash256(s) << endl; + cout << stringMapHash256(s) << endl; BOOST_REQUIRE(d.check(true)); - BOOST_REQUIRE_EQUAL(t.hash256(), hash256(s)); - BOOST_REQUIRE_EQUAL(d.root(), hash256(s)); + BOOST_REQUIRE_EQUAL(t.hash256(), stringMapHash256(s)); + BOOST_REQUIRE_EQUAL(d.root(), stringMapHash256(s)); for (auto const& i: s) { (void)i; @@ -421,8 +437,8 @@ BOOST_AUTO_TEST_CASE(moreTrieTests) BOOST_REQUIRE(d.check(true)); BOOST_REQUIRE(t.at(a).empty()); BOOST_REQUIRE(d.at(string(a)).empty()); - BOOST_REQUIRE_EQUAL(t.hash256(), hash256(s)); - BOOST_REQUIRE_EQUAL(d.root(), hash256(s)); + BOOST_REQUIRE_EQUAL(t.hash256(), stringMapHash256(s)); + BOOST_REQUIRE_EQUAL(d.root(), stringMapHash256(s)); for (auto const& i: s) { (void)i; @@ -493,7 +509,6 @@ BOOST_AUTO_TEST_CASE(trieLowerBound) BOOST_AUTO_TEST_CASE(trieStess) { cnote << "Stress-testing Trie..."; - if (0) { MemoryDB m; MemoryDB dm; @@ -512,8 +527,8 @@ BOOST_AUTO_TEST_CASE(trieStess) m[k] = v; t.insert(k, v); d.insert(k, v); - BOOST_REQUIRE_EQUAL(hash256(m), t.hash256()); - BOOST_REQUIRE_EQUAL(hash256(m), d.root()); + BOOST_REQUIRE_EQUAL(stringMapHash256(m), t.hash256()); + BOOST_REQUIRE_EQUAL(stringMapHash256(m), d.root()); BOOST_REQUIRE(d.check(true)); } while (!m.empty()) @@ -557,8 +572,8 @@ BOOST_AUTO_TEST_CASE(trieStess) cwarn << "Good?" << d2.root(); } BOOST_REQUIRE(d.check(true)); - BOOST_REQUIRE_EQUAL(hash256(m), t.hash256()); - BOOST_REQUIRE_EQUAL(hash256(m), d.root()); + BOOST_REQUIRE_EQUAL(stringMapHash256(m), t.hash256()); + BOOST_REQUIRE_EQUAL(stringMapHash256(m), d.root()); } } } From 4e358001acd9f478d2e69b16794cec4832afb1fa Mon Sep 17 00:00:00 2001 From: arkpar Date: Tue, 19 May 2015 10:39:33 +0200 Subject: [PATCH 274/461] orderedTrieRoot testing --- libdevcore/CommonData.cpp | 14 +--------- libdevcore/CommonData.h | 3 +-- libdevcrypto/TrieHash.cpp | 55 ++++++-------------------------------- libdevcrypto/TrieHash.h | 10 +++---- libethcore/BlockInfo.cpp | 12 +-------- test/libdevcrypto/trie.cpp | 3 --- 6 files changed, 15 insertions(+), 82 deletions(-) diff --git a/libdevcore/CommonData.cpp b/libdevcore/CommonData.cpp index ba2b412fd..f8d8c172f 100644 --- a/libdevcore/CommonData.cpp +++ b/libdevcore/CommonData.cpp @@ -115,19 +115,7 @@ bytes dev::fromHex(std::string const& _s, WhenError _throw) return ret; } -bytes dev::asNibbles(bytes const& _s) -{ - std::vector ret; - ret.reserve(_s.size() * 2); - for (auto i: _s) - { - ret.push_back(i / 16); - ret.push_back(i % 16); - } - return ret; -} - -bytes dev::asNibbles(std::string const& _s) +bytes dev::asNibbles(bytesConstRef const& _s) { std::vector ret; ret.reserve(_s.size() * 2); diff --git a/libdevcore/CommonData.h b/libdevcore/CommonData.h index 29cc8e7c7..702f1f808 100644 --- a/libdevcore/CommonData.h +++ b/libdevcore/CommonData.h @@ -95,8 +95,7 @@ inline bytes asBytes(std::string const& _b) /// Converts a string into the big-endian base-16 stream of integers (NOT ASCII). /// @example asNibbles("A")[0] == 4 && asNibbles("A")[1] == 1 -bytes asNibbles(std::string const& _s); -bytes asNibbles(bytes const& _s); +bytes asNibbles(bytesConstRef const& _s); // Big-endian to/from host endian conversion functions. diff --git a/libdevcrypto/TrieHash.cpp b/libdevcrypto/TrieHash.cpp index 4c4ca620d..0f2d68b91 100644 --- a/libdevcrypto/TrieHash.cpp +++ b/libdevcrypto/TrieHash.cpp @@ -165,7 +165,7 @@ bytes rlp256(BytesMap const& _s) return rlp(""); HexMap hexMap; for (auto i = _s.rbegin(); i != _s.rend(); ++i) - hexMap[asNibbles(i->first)] = i->second; + hexMap[asNibbles(bytesConstRef(&i->first))] = i->second; RLPStream s; hash256rlp(hexMap, hexMap.cbegin(), hexMap.cend(), 0, s); return s.out(); @@ -176,61 +176,22 @@ h256 hash256(BytesMap const& _s) return sha3(rlp256(_s)); } -h256 hash256(StringMap const& _s) -{ - // build patricia tree. - if (_s.empty()) - return sha3(rlp("")); - HexMap hexMap; - for (auto i = _s.rbegin(); i != _s.rend(); ++i) - hexMap[asNibbles(i->first)] = bytes(i->second.begin(), i->second.end()); - RLPStream s; - hash256rlp(hexMap, hexMap.cbegin(), hexMap.cend(), 0, s); - return sha3(s.out()); -} - -bytes rlp256(StringMap const& _s) -{ - // build patricia tree. - if (_s.empty()) - return rlp(""); - HexMap hexMap; - for (auto i = _s.rbegin(); i != _s.rend(); ++i) - hexMap[asNibbles(i->first)] = bytes(i->second.begin(), i->second.end()); - RLPStream s; - hash256rlp(hexMap, hexMap.cbegin(), hexMap.cend(), 0, s); - return s.out(); -} - -/*h256 orderedTrieRoot(std::vector const& _data) +h256 orderedTrieRoot(std::vector const& _data) { - StringMap m; + BytesMap m; unsigned j = 0; for (auto i: _data) - m[asString(rlp(j++))] = asString(i); + m[rlp(j++)] = i; return hash256(m); -}*/ - -h256 orderedTrieRoot(std::vector const& _data) -{ - MemoryDB db; - GenericTrieDB t(&db); - t.init(); - unsigned j = 0; - for (auto i: _data) - t.insert(rlp(j++), i.toBytes()); - return t.root(); } -h256 orderedTrieRoot(std::vector const& _data) +h256 orderedTrieRoot(std::vector const& _data) { - MemoryDB db; - GenericTrieDB t(&db); - t.init(); + BytesMap m; unsigned j = 0; for (auto i: _data) - t.insert(rlp(j++), i); - return t.root(); + m[rlp(j++)] = i.toBytes(); + return hash256(m); } } diff --git a/libdevcrypto/TrieHash.h b/libdevcrypto/TrieHash.h index 46f9b1efb..9649ef0c7 100644 --- a/libdevcrypto/TrieHash.h +++ b/libdevcrypto/TrieHash.h @@ -29,18 +29,16 @@ namespace dev bytes rlp256(BytesMap const& _s); h256 hash256(BytesMap const& _s); -bytes rlp256(StringMap const& _s); -h256 hash256(StringMap const& _s); -/*h256 orderedTrieRoot(std::vector const& _data); +h256 orderedTrieRoot(std::vector const& _data); template inline h256 trieRootOver(unsigned _itemCount, T const& _getKey, U const& _getValue) { - StringMap m; + BytesMap m; for (unsigned i = 0; i < _itemCount; ++i) - m[asString(_getKey(i))] = asString(_getValue(i)); + m[_getKey(i)] = _getValue(i); return hash256(m); -}*/ +} h256 orderedTrieRoot(std::vector const& _data); h256 orderedTrieRoot(std::vector const& _data); diff --git a/libethcore/BlockInfo.cpp b/libethcore/BlockInfo.cpp index 00a5108c4..0c324d70f 100644 --- a/libethcore/BlockInfo.cpp +++ b/libethcore/BlockInfo.cpp @@ -191,22 +191,12 @@ void BlockInfo::populate(bytesConstRef _block, Strictness _s, h256 const& _h) struct BlockInfoDiagnosticsChannel: public LogChannel { static const char* name() { return EthBlue "▧" EthWhite " ◌"; } static const int verbosity = 9; }; -template h256 trieRootOver(unsigned _itemCount, T const& _getKey, U const& _getValue) -{ - MemoryDB db; - GenericTrieDB t(&db); - t.init(); - for (unsigned i = 0; i < _itemCount; ++i) - t.insert(_getKey(i), _getValue(i)); - return t.root(); -} - void BlockInfo::verifyInternals(bytesConstRef _block) const { RLP root(_block); auto txList = root[1]; - auto expectedRoot = trieRootOver(txList.itemCount(), [&](unsigned i){ return rlp(i); }, [&](unsigned i){ return txList[i].data(); }); + auto expectedRoot = trieRootOver(txList.itemCount(), [&](unsigned i){ return rlp(i); }, [&](unsigned i){ return txList[i].data().toBytes(); }); clog(BlockInfoDiagnosticsChannel) << "Expected trie root:" << toString(expectedRoot); if (transactionsRoot != expectedRoot) diff --git a/test/libdevcrypto/trie.cpp b/test/libdevcrypto/trie.cpp index 00bccd241..b32fd70e1 100644 --- a/test/libdevcrypto/trie.cpp +++ b/test/libdevcrypto/trie.cpp @@ -296,7 +296,6 @@ BOOST_AUTO_TEST_CASE(trie_tests_ordered) h256 stringMapHash256(StringMap const& _s) { - //return hash256(_s); BytesMap bytesMap; for (auto const& _v: _s) bytesMap.insert(std::make_pair(bytes(_v.first.begin(), _v.first.end()), bytes(_v.second.begin(), _v.second.end()))); @@ -305,7 +304,6 @@ h256 stringMapHash256(StringMap const& _s) bytes stringMapRlp256(StringMap const& _s) { - //return rlp256(_s); BytesMap bytesMap; for (auto const& _v: _s) bytesMap.insert(std::make_pair(bytes(_v.first.begin(), _v.first.end()), bytes(_v.second.begin(), _v.second.end()))); @@ -407,7 +405,6 @@ BOOST_AUTO_TEST_CASE(moreTrieTests) cout << d; cout << m; cout << d.root() << endl; - cout << hash256(s) << endl; cout << stringMapHash256(s) << endl; BOOST_REQUIRE(d.check(true)); From c8c22fcfbd8afb8ebb3a4f19ba1f5503d354b6a6 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Tue, 19 May 2015 13:17:13 +0200 Subject: [PATCH 275/461] Fixed 1970 More frequent chain updates. --- libethereum/Client.cpp | 2 +- libweb3jsonrpc/WebThreeStubServerBase.cpp | 14 ++++++++------ 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/libethereum/Client.cpp b/libethereum/Client.cpp index 6d5e39e39..c46142fbb 100644 --- a/libethereum/Client.cpp +++ b/libethereum/Client.cpp @@ -484,7 +484,7 @@ void Client::syncBlockQueue() cwork << "BQ ==> CHAIN ==> STATE"; { - tie(ir.first, ir.second, m_syncBlockQueue) = m_bc.sync(m_bq, m_stateDB, 100); + tie(ir.first, ir.second, m_syncBlockQueue) = m_bc.sync(m_bq, m_stateDB, 10); if (ir.first.empty()) return; } diff --git a/libweb3jsonrpc/WebThreeStubServerBase.cpp b/libweb3jsonrpc/WebThreeStubServerBase.cpp index cac634a61..6b714f2ac 100644 --- a/libweb3jsonrpc/WebThreeStubServerBase.cpp +++ b/libweb3jsonrpc/WebThreeStubServerBase.cpp @@ -99,11 +99,12 @@ static Json::Value toJson(dev::eth::Transaction const& _t, std::pair(_blockHash); if (_includeTransactions) - return toJson(client()->blockInfo(h), client()->uncleHashes(h), client()->transactions(h)); + return toJson(client()->blockInfo(h), client()->blockDetails(h), client()->uncleHashes(h), client()->transactions(h)); else - return toJson(client()->blockInfo(h), client()->uncleHashes(h), client()->transactionHashes(h)); + return toJson(client()->blockInfo(h), client()->blockDetails(h), client()->uncleHashes(h), client()->transactionHashes(h)); } catch (...) { @@ -618,9 +620,9 @@ Json::Value WebThreeStubServerBase::eth_getBlockByNumber(string const& _blockNum { auto h = jsToBlockNumber(_blockNumber); if (_includeTransactions) - return toJson(client()->blockInfo(h), client()->uncleHashes(h), client()->transactions(h)); + return toJson(client()->blockInfo(h), client()->blockDetails(h), client()->uncleHashes(h), client()->transactions(h)); else - return toJson(client()->blockInfo(h), client()->uncleHashes(h), client()->transactionHashes(h)); + return toJson(client()->blockInfo(h), client()->blockDetails(h), client()->uncleHashes(h), client()->transactionHashes(h)); } catch (...) { From 6ec7a618c22545ca6bd0b8e76cc7ac5348cb8f12 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 19 May 2015 14:12:33 +0200 Subject: [PATCH 276/461] small changes --- mix/qml/Debugger.qml | 1 - mix/qml/WebCodeEditor.qml | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/mix/qml/Debugger.qml b/mix/qml/Debugger.qml index c6283b60e..9decc91ae 100644 --- a/mix/qml/Debugger.qml +++ b/mix/qml/Debugger.qml @@ -4,7 +4,6 @@ import QtQuick.Controls.Styles 1.1 import QtQuick.Dialogs 1.1 import QtQuick.Layouts 1.1 import Qt.labs.settings 1.0 -import QtGraphicalEffects 1.0 import "js/Debugger.js" as Debugger import "js/ErrorLocationFormater.js" as ErrorLocationFormater import "." diff --git a/mix/qml/WebCodeEditor.qml b/mix/qml/WebCodeEditor.qml index 32e62d584..babb200e8 100644 --- a/mix/qml/WebCodeEditor.qml +++ b/mix/qml/WebCodeEditor.qml @@ -155,14 +155,15 @@ Item { for (var k in secondLocations) { lineError = secondLocations[k].start.line + 1; - secondErrorDetail += secondLocations[k].contractName + " line " + lineError + ", "; + secondErrorDetail += secondLocations[k].contractName + " line " + lineError + " - "; displayErrorAnnotations(secondLocations[k], errorOrigin, "second"); } var detail = error.split('\n')[0]; var reg = detail.match(/:\d+:\d+:/g); if (reg !== null) detail = detail.replace(reg[0], ""); - detail += secondErrorDetail; + if (secondLocations.length > 0) + detail += secondErrorDetail; displayErrorAnnotations(firstLocation, detail, "first"); } From 1a334221eab18ed3a40de80196b0756a9848120f Mon Sep 17 00:00:00 2001 From: arkpar Date: Tue, 19 May 2015 14:23:28 +0200 Subject: [PATCH 277/461] removed unused module --- mix/qml/Debugger.qml | 1 - mix/qml/StatesComboBox.qml | 1 - mix/qml/StatusPane.qml | 1 - 3 files changed, 3 deletions(-) diff --git a/mix/qml/Debugger.qml b/mix/qml/Debugger.qml index c6283b60e..9decc91ae 100644 --- a/mix/qml/Debugger.qml +++ b/mix/qml/Debugger.qml @@ -4,7 +4,6 @@ import QtQuick.Controls.Styles 1.1 import QtQuick.Dialogs 1.1 import QtQuick.Layouts 1.1 import Qt.labs.settings 1.0 -import QtGraphicalEffects 1.0 import "js/Debugger.js" as Debugger import "js/ErrorLocationFormater.js" as ErrorLocationFormater import "." diff --git a/mix/qml/StatesComboBox.qml b/mix/qml/StatesComboBox.qml index 907580ee7..3d2b08eef 100644 --- a/mix/qml/StatesComboBox.qml +++ b/mix/qml/StatesComboBox.qml @@ -23,7 +23,6 @@ import QtQuick 2.0 import QtQuick.Controls 1.0 import QtQuick.Layouts 1.1 -import QtGraphicalEffects 1.0 import org.ethereum.qml.InverseMouseArea 1.0 Rectangle { diff --git a/mix/qml/StatusPane.qml b/mix/qml/StatusPane.qml index 0c01caeb1..1c1453002 100644 --- a/mix/qml/StatusPane.qml +++ b/mix/qml/StatusPane.qml @@ -3,7 +3,6 @@ import QtQuick.Controls 1.1 import QtQuick.Layouts 1.1 import QtQuick.Controls.Styles 1.3 import org.ethereum.qml.InverseMouseArea 1.0 -import QtGraphicalEffects 1.0 import "js/ErrorLocationFormater.js" as ErrorLocationFormater import "." From 5f849c8eed8ce07fe5332df7349c3d2b6af07f5c Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Tue, 19 May 2015 15:18:04 +0200 Subject: [PATCH 278/461] Fix DownloadView Race condition - There is a race condition with potential division by zero which is mostly observed when debugging AZ from gdb where there is a big gap between window refreshes due to breakpoints and such --- alethzero/DownloadView.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/alethzero/DownloadView.cpp b/alethzero/DownloadView.cpp index 009e2dc83..210649edb 100644 --- a/alethzero/DownloadView.cpp +++ b/alethzero/DownloadView.cpp @@ -52,7 +52,10 @@ void DownloadView::paintEvent(QPaintEvent*) QPointF pos(0, 0); auto bg = m_man->blocksGot(); - + unsigned subCount = m_man->subCount(); + if (subCount == 0) + return; + unsigned dh = 360 / subCount; for (unsigned i = bg.all().first, ei = bg.all().second; i < ei; ++i) { int s = -2; @@ -68,7 +71,6 @@ void DownloadView::paintEvent(QPaintEvent*) h++; }); } - unsigned dh = 360 / m_man->subCount(); if (s == -2) p.fillRect(QRectF(QPointF(pos) + QPointF(3 * area.width() / 8, 3 * area.height() / 8), area / 4), Qt::black); else if (s == -1) From f02962a3688e46f22fc8fd4228f2d5d26e8ee899 Mon Sep 17 00:00:00 2001 From: Liana Husikyan Date: Tue, 19 May 2015 15:24:33 +0200 Subject: [PATCH 279/461] added constructor to solidiy abi --- libsolidity/InterfaceHandler.cpp | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/libsolidity/InterfaceHandler.cpp b/libsolidity/InterfaceHandler.cpp index 85026ac12..9817455b9 100644 --- a/libsolidity/InterfaceHandler.cpp +++ b/libsolidity/InterfaceHandler.cpp @@ -107,17 +107,25 @@ std::unique_ptr InterfaceHandler::getABIInterface(ContractDefinitio unique_ptr InterfaceHandler::getABISolidityInterface(ContractDefinition const& _contractDef) { string ret = "contract " + _contractDef.getName() + "{"; + + auto populateParameters = [](vector const& _paramNames, + vector const& _paramTypes) + { + string r = ""; + solAssert(_paramNames.size() == _paramTypes.size(), "Names and types vector size does not match"); + for (unsigned i = 0; i < _paramNames.size(); ++i) + r += (r.size() ? "," : "(") + _paramTypes[i] + " " + _paramNames[i]; + return r.size() ? r + ")" : "()"; + }; + if (_contractDef.getConstructor()) + { + auto externalFunction = FunctionType(*_contractDef.getConstructor()).externalFunctionType(); + solAssert(!!externalFunction, ""); + ret += "function " + _contractDef.getName() + + populateParameters(externalFunction->getParameterNames(), externalFunction->getParameterTypeNames()); + } for (auto const& it: _contractDef.getInterfaceFunctions()) { - auto populateParameters = [](vector const& _paramNames, - vector const& _paramTypes) - { - string r = ""; - solAssert(_paramNames.size() == _paramTypes.size(), "Names and types vector size does not match"); - for (unsigned i = 0; i < _paramNames.size(); ++i) - r += (r.size() ? "," : "(") + _paramTypes[i] + " " + _paramNames[i]; - return r.size() ? r + ")" : "()"; - }; ret += "function " + it.second->getDeclaration().getName() + populateParameters(it.second->getParameterNames(), it.second->getParameterTypeNames()) + (it.second->isConstant() ? "constant " : ""); From 2d377d95eacab568c62139c962b560ed7897f567 Mon Sep 17 00:00:00 2001 From: Liana Husikyan Date: Tue, 19 May 2015 15:33:08 +0200 Subject: [PATCH 280/461] added ';' --- libsolidity/InterfaceHandler.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libsolidity/InterfaceHandler.cpp b/libsolidity/InterfaceHandler.cpp index 9817455b9..9124d210f 100644 --- a/libsolidity/InterfaceHandler.cpp +++ b/libsolidity/InterfaceHandler.cpp @@ -121,8 +121,11 @@ unique_ptr InterfaceHandler::getABISolidityInterface(ContractDefinition { auto externalFunction = FunctionType(*_contractDef.getConstructor()).externalFunctionType(); solAssert(!!externalFunction, ""); - ret += "function " + _contractDef.getName() + - populateParameters(externalFunction->getParameterNames(), externalFunction->getParameterTypeNames()); + ret += + "function " + + _contractDef.getName() + + populateParameters(externalFunction->getParameterNames(), externalFunction->getParameterTypeNames()) + + ";"; } for (auto const& it: _contractDef.getInterfaceFunctions()) { From cbdb46ea435c34485f178f7d9a77ee59a75d8db9 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Tue, 19 May 2015 15:56:56 +0200 Subject: [PATCH 281/461] Miner fix. Possible fix for VM (and remove gas from the interface). --- libethash-cl/ethash_cl_miner.cpp | 15 ++++++++------- libethcore/Ethash.cpp | 4 ++-- libethereum/KeyManager.cpp | 4 ++++ libevm/SmartVM.h | 6 +++++- libevm/VM.cpp | 14 +++++++++----- libevm/VM.h | 8 +++++--- libevm/VMFace.h | 9 +++------ 7 files changed, 36 insertions(+), 24 deletions(-) diff --git a/libethash-cl/ethash_cl_miner.cpp b/libethash-cl/ethash_cl_miner.cpp index 3891f2ef6..be17ba449 100644 --- a/libethash-cl/ethash_cl_miner.cpp +++ b/libethash-cl/ethash_cl_miner.cpp @@ -206,14 +206,15 @@ bool ethash_cl_miner::init(uint8_t const* _dag, uint64_t _dagSize, unsigned work m_header = cl::Buffer(m_context, CL_MEM_READ_ONLY, 32); // compute dag on CPU - { + try { m_queue.enqueueWriteBuffer(m_dag, CL_TRUE, 0, _dagSize, _dag); - - // if this throws then it's because we probably need to subdivide the dag uploads for compatibility -// void* dag_ptr = m_queue.enqueueMapBuffer(m_dag, true, m_opencl_1_1 ? CL_MAP_WRITE : CL_MAP_WRITE_INVALIDATE_REGION, 0, _dagSize); - // memcpying 1GB: horrible... really. horrible. but necessary since we can't mmap *and* gpumap. -// _fillDAG(dag_ptr); -// m_queue.enqueueUnmapMemObject(m_dag, dag_ptr); + } + catch (...) + { + // didn't work. shitty driver. try allocating in CPU RAM and manually memcpying it. + void* dag_ptr = m_queue.enqueueMapBuffer(m_dag, true, m_opencl_1_1 ? CL_MAP_WRITE : CL_MAP_WRITE_INVALIDATE_REGION, 0, _dagSize); + memcpy(dag_ptr, _dag, _dagSize); + m_queue.enqueueUnmapMemObject(m_dag, dag_ptr); } // create mining buffers diff --git a/libethcore/Ethash.cpp b/libethcore/Ethash.cpp index 7609d8b6b..6276dd0a1 100644 --- a/libethcore/Ethash.cpp +++ b/libethcore/Ethash.cpp @@ -333,9 +333,9 @@ void Ethash::GPUMiner::workLoop() uint64_t upper64OfBoundary = (uint64_t)(u64)((u256)w.boundary >> 192); m_miner->search(w.headerHash.data(), upper64OfBoundary, *m_hook); } - catch (...) + catch (cl::Error const& _e) { - cwarn << "Error GPU mining. GPU memory fragmentation?"; + cwarn << "Error GPU mining: " << _e.what() << "(" << _e.err() << ")"; } } diff --git a/libethereum/KeyManager.cpp b/libethereum/KeyManager.cpp index 11b2cb2a6..cba6f4325 100644 --- a/libethereum/KeyManager.cpp +++ b/libethereum/KeyManager.cpp @@ -61,7 +61,11 @@ bool KeyManager::load(std::string const& _pass) if (version == 1) { for (auto const& i: s[1]) + { m_keyInfo[m_addrLookup[(Address)i[0]] = (h128)i[1]] = KeyInfo((h256)i[2], (std::string)i[3]); + cdebug << toString((Address)i[0]) << toString((h128)i[1]) << toString((h256)i[2]) << (std::string)i[3]; + } + for (auto const& i: s[2]) m_passwordInfo[(h256)i[0]] = (std::string)i[1]; m_password = (string)s[3]; diff --git a/libevm/SmartVM.h b/libevm/SmartVM.h index 29f464ecd..e21af23b0 100644 --- a/libevm/SmartVM.h +++ b/libevm/SmartVM.h @@ -31,12 +31,16 @@ namespace eth class SmartVM: public VMFace { public: - SmartVM(u256 _gas): VMFace(_gas) {} + SmartVM(u256 const& _gas): m_gas(_gas) {} virtual bytesConstRef go(ExtVMFace& _ext, OnOpFunc const& _onOp = {}, uint64_t _steps = (uint64_t)-1) override final; + void reset(u256 const& _gas = 0) noexcept override { m_gas = _gas; } + u256 gas() const noexcept override { return (u256)m_gas; } + private: std::unique_ptr m_selectedVM; + bigint m_gas; }; } diff --git a/libevm/VM.cpp b/libevm/VM.cpp index 853ac25f6..368d27389 100644 --- a/libevm/VM.cpp +++ b/libevm/VM.cpp @@ -25,9 +25,9 @@ using namespace std; using namespace dev; using namespace dev::eth; -void VM::reset(u256 _gas) noexcept +void VM::reset(u256 const& _gas) noexcept { - VMFace::reset(_gas); + m_gas = _gas; m_curPC = 0; m_jumpDests.clear(); } @@ -206,7 +206,7 @@ bytesConstRef VM::go(ExtVMFace& _ext, OnOpFunc const& _onOp, uint64_t _steps) BOOST_THROW_EXCEPTION(OutOfGas()); } - m_gas = (u256)((bigint)m_gas - runGas); + m_gas -= runGas; if (newTempSize > m_temp.size()) m_temp.resize((size_t)newTempSize); @@ -565,7 +565,7 @@ bytesConstRef VM::go(ExtVMFace& _ext, OnOpFunc const& _onOp, uint64_t _steps) m_stack.push_back(m_temp.size()); break; case Instruction::GAS: - m_stack.push_back(m_gas); + m_stack.push_back((u256)m_gas); break; case Instruction::JUMPDEST: break; @@ -614,7 +614,11 @@ bytesConstRef VM::go(ExtVMFace& _ext, OnOpFunc const& _onOp, uint64_t _steps) m_stack.pop_back(); if (_ext.balance(_ext.myAddress) >= endowment && _ext.depth < 1024) - m_stack.push_back((u160)_ext.create(endowment, m_gas, bytesConstRef(m_temp.data() + initOff, initSize), _onOp)); + { + u256 g(m_gas); + m_stack.push_back((u160)_ext.create(endowment, g, bytesConstRef(m_temp.data() + initOff, initSize), _onOp)); + m_gas = g; + } else m_stack.push_back(0); break; diff --git a/libevm/VM.h b/libevm/VM.h index 30007e0b3..668544f9d 100644 --- a/libevm/VM.h +++ b/libevm/VM.h @@ -52,8 +52,6 @@ inline u256 fromAddress(Address _a) class VM: public VMFace { public: - virtual void reset(u256 _gas = 0) noexcept override final; - virtual bytesConstRef go(ExtVMFace& _ext, OnOpFunc const& _onOp = {}, uint64_t _steps = (uint64_t)-1) override final; void require(u256 _n, u256 _d) { if (m_stack.size() < _n) { if (m_onFail) m_onFail(); BOOST_THROW_EXCEPTION(StackUnderflow() << RequirementError((bigint)_n, (bigint)m_stack.size())); } if (m_stack.size() - _n + _d > c_stackLimit) { if (m_onFail) m_onFail(); BOOST_THROW_EXCEPTION(OutOfStack() << RequirementError((bigint)(_d - _n), (bigint)m_stack.size())); } } @@ -64,17 +62,21 @@ public: bytes const& memory() const { return m_temp; } u256s const& stack() const { return m_stack; } + void reset(u256 const& _gas = 0) noexcept override; + u256 gas() const noexcept override { return (u256)m_gas; } + private: friend class VMFactory; /// Construct VM object. - explicit VM(u256 _gas): VMFace(_gas) {} + explicit VM(u256 _gas): m_gas(_gas) {} u256 m_curPC = 0; bytes m_temp; u256s m_stack; std::set m_jumpDests; std::function m_onFail; + bigint m_gas = 0; }; } diff --git a/libevm/VMFace.h b/libevm/VMFace.h index d2689d13e..92e6d4c4f 100644 --- a/libevm/VMFace.h +++ b/libevm/VMFace.h @@ -38,18 +38,15 @@ struct StackUnderflow: virtual VMException {}; class VMFace { public: - explicit VMFace(u256 _gas): m_gas(_gas) {} + VMFace() = default; virtual ~VMFace() = default; VMFace(VMFace const&) = delete; VMFace& operator=(VMFace const&) = delete; - virtual void reset(u256 _gas = 0) noexcept { m_gas = _gas; } - u256 gas() const noexcept { return m_gas; } + virtual void reset(u256 const& _gas = 0) noexcept = 0; + virtual u256 gas() const noexcept = 0; virtual bytesConstRef go(ExtVMFace& _ext, OnOpFunc const& _onOp = {}, uint64_t _steps = (uint64_t)-1) = 0; - -protected: - u256 m_gas = 0; }; } From bb7ca7a6b44ff776b86e42dc262f3b3293a6ba4f Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Tue, 19 May 2015 16:46:00 +0200 Subject: [PATCH 282/461] handle output larger than 4069 bytes in test --- test/TestHelper.cpp | 9 +++++++-- .../StateTestsFiller/stMemoryStressTestFiller.json | 6 +++--- test/libevm/vm.cpp | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/test/TestHelper.cpp b/test/TestHelper.cpp index aada83041..476d1ecf9 100644 --- a/test/TestHelper.cpp +++ b/test/TestHelper.cpp @@ -327,7 +327,8 @@ void ImportTest::checkExpectedState(State const& _stateExpect, State const& _sta void ImportTest::exportTest(bytes const& _output, State const& _statePost) { // export output - m_TestObject["out"] = toHex(_output, 2, HexPrefix::Add); + + m_TestObject["out"] = _output.size() > 4096 ? "#" + toString(_output.size()) : toHex(_output, 2, HexPrefix::Add); // export logs m_TestObject["logs"] = exportLog(_statePost.pending().size() ? _statePost.log(0) : LogEntries()); @@ -489,7 +490,11 @@ LogEntries importLog(json_spirit::mArray& _a) void checkOutput(bytes const& _output, json_spirit::mObject& _o) { int j = 0; - if (_o["out"].type() == json_spirit::array_type) + + if (_o["out"].get_str().find("#") == 0) + BOOST_CHECK((u256)_output.size() == toInt(_o["out"].get_str().substr(1))); + + else if (_o["out"].type() == json_spirit::array_type) for (auto const& d: _o["out"].get_array()) { BOOST_CHECK_MESSAGE(_output[j] == toInt(d), "Output byte [" << j << "] different!"); diff --git a/test/libethereum/StateTestsFiller/stMemoryStressTestFiller.json b/test/libethereum/StateTestsFiller/stMemoryStressTestFiller.json index 3893223eb..b5a531520 100644 --- a/test/libethereum/StateTestsFiller/stMemoryStressTestFiller.json +++ b/test/libethereum/StateTestsFiller/stMemoryStressTestFiller.json @@ -58,7 +58,7 @@ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "balance" : "1000000000000000000", "nonce" : "0", - "code" : "{ (RETURN 0 4294967297) } ", + "code" : "{ (RETURN 0 4294967295) } ", "storage": {} }, "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { @@ -77,7 +77,7 @@ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", "data" : "" } - }, + }, "mload32bitBound_return2": { "env" : { @@ -98,7 +98,7 @@ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "balance" : "1000000000000000000", "nonce" : "0", - "code" : "{[ 0 ] 1 (RETURN 0 4294967296) } ", + "code" : "{[ 0 ] 1 (RETURN 0 4294967295) } ", "storage": {} }, "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { diff --git a/test/libevm/vm.cpp b/test/libevm/vm.cpp index 10670bfe3..18153f2bf 100644 --- a/test/libevm/vm.cpp +++ b/test/libevm/vm.cpp @@ -393,7 +393,7 @@ void doVMTests(json_spirit::mValue& v, bool _fillin) } o["callcreates"] = fev.exportCallCreates(); - o["out"] = toHex(output, 2, HexPrefix::Add); + o["out"] = output.size() > 4096 ? "#" + toString(output.size()) : toHex(output, 2, HexPrefix::Add); o["gas"] = toCompactHex(gas, HexPrefix::Add, 1); o["logs"] = exportLog(fev.sub.logs); } From 465179e6f93b0f4dcdb71a4e7c6d4b17b5231915 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Tue, 19 May 2015 17:44:07 +0200 Subject: [PATCH 283/461] Avoid forbidden function pointer cast. --- evmjit/include/evmjit/JIT.h | 4 ++-- evmjit/libevmjit/ExecutionEngine.cpp | 2 +- evmjit/libevmjit/JIT.cpp | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/evmjit/include/evmjit/JIT.h b/evmjit/include/evmjit/JIT.h index 446dd9e56..c9ddde705 100644 --- a/evmjit/include/evmjit/JIT.h +++ b/evmjit/include/evmjit/JIT.h @@ -28,8 +28,8 @@ public: private: friend class dev::eth::jit::ExecutionEngine; - static void* getCode(h256 _codeHash); - static void mapCode(h256 _codeHash, void* _funcAddr); + static uint64_t getCode(h256 _codeHash); + static void mapCode(h256 _codeHash, uint64_t _funcAddr); }; } diff --git a/evmjit/libevmjit/ExecutionEngine.cpp b/evmjit/libevmjit/ExecutionEngine.cpp index 08ca403b5..e5abb36b3 100644 --- a/evmjit/libevmjit/ExecutionEngine.cpp +++ b/evmjit/libevmjit/ExecutionEngine.cpp @@ -183,7 +183,7 @@ ReturnCode ExecutionEngine::run(RuntimeData* _data, Env* _env) entryFuncPtr = (EntryFuncPtr)ee->getFunctionAddress(mainFuncName); if (!CHECK(entryFuncPtr)) return ReturnCode::LLVMLinkError; - JIT::mapCode(_data->codeHash, (void*)entryFuncPtr); // FIXME: Remove cast + JIT::mapCode(_data->codeHash, (uint64_t)entryFuncPtr); // FIXME: Remove cast } listener->stateChanged(ExecState::Execution); diff --git a/evmjit/libevmjit/JIT.cpp b/evmjit/libevmjit/JIT.cpp index 9774c7396..8617fab6d 100644 --- a/evmjit/libevmjit/JIT.cpp +++ b/evmjit/libevmjit/JIT.cpp @@ -12,7 +12,7 @@ namespace class JITImpl: JIT { public: - std::unordered_map codeMap; + std::unordered_map codeMap; static JITImpl& instance() { @@ -28,16 +28,16 @@ bool JIT::isCodeReady(h256 _codeHash) return JITImpl::instance().codeMap.count(_codeHash) != 0; } -void* JIT::getCode(h256 _codeHash) +uint64_t JIT::getCode(h256 _codeHash) { auto& codeMap = JITImpl::instance().codeMap; auto it = codeMap.find(_codeHash); if (it != codeMap.end()) return it->second; - return nullptr; + return 0; } -void JIT::mapCode(h256 _codeHash, void* _funcAddr) +void JIT::mapCode(h256 _codeHash, uint64_t _funcAddr) { JITImpl::instance().codeMap.insert(std::make_pair(_codeHash, _funcAddr)); } From 9adde95145acc8f097c828dc362e8c0f22a090c6 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Tue, 19 May 2015 19:38:17 +0200 Subject: [PATCH 284/461] SHA3, RIPEMD160 and SHA256 are now not cryptopp impls. --- libdevcrypto/AES.cpp | 32 +- libdevcrypto/AES.h | 5 +- libdevcrypto/Common.cpp | 1 + libdevcrypto/Hash.cpp | 440 ++++++++++++++++++++++ libdevcrypto/Hash.h | 38 ++ libdevcrypto/SHA3.cpp | 255 +++++++++---- libdevcrypto/SHA3.h | 37 +- libdevcrypto/picosha2.h | 360 ++++++++++++++++++ libethereum/Precompiled.cpp | 13 +- test/libdevcrypto/crypto.cpp | 14 +- test/libsolidity/SolidityEndToEndTest.cpp | 10 +- 11 files changed, 1075 insertions(+), 130 deletions(-) create mode 100644 libdevcrypto/Hash.cpp create mode 100644 libdevcrypto/Hash.h create mode 100644 libdevcrypto/picosha2.h diff --git a/libdevcrypto/AES.cpp b/libdevcrypto/AES.cpp index 56885ae36..e9edac0d3 100644 --- a/libdevcrypto/AES.cpp +++ b/libdevcrypto/AES.cpp @@ -19,9 +19,9 @@ * @date 2014 */ -#include "CryptoPP.h" #include "AES.h" - +#include +#include "CryptoPP.h" using namespace std; using namespace dev; using namespace dev::crypto; @@ -58,3 +58,31 @@ size_t Stream::streamOut(bytes&) return 0; } +bytes dev::aesDecrypt(bytesConstRef _ivCipher, std::string const& _password, unsigned _rounds, bytesConstRef _salt) +{ + bytes pw = asBytes(_password); + + if (!_salt.size()) + _salt = &pw; + + bytes target(64); + CryptoPP::PKCS5_PBKDF2_HMAC().DeriveKey(target.data(), target.size(), 0, pw.data(), pw.size(), _salt.data(), _salt.size(), _rounds); + + try + { + CryptoPP::AES::Decryption aesDecryption(target.data(), 16); + auto cipher = _ivCipher.cropped(16); + auto iv = _ivCipher.cropped(0, 16); + CryptoPP::CBC_Mode_ExternalCipher::Decryption cbcDecryption(aesDecryption, iv.data()); + std::string decrypted; + CryptoPP::StreamTransformationFilter stfDecryptor(cbcDecryption, new CryptoPP::StringSink(decrypted)); + stfDecryptor.Put(cipher.data(), cipher.size()); + stfDecryptor.MessageEnd(); + return asBytes(decrypted); + } + catch (exception const& e) + { + cerr << e.what() << endl; + return bytes(); + } +} diff --git a/libdevcrypto/AES.h b/libdevcrypto/AES.h index f0646eb85..32d1880dc 100644 --- a/libdevcrypto/AES.h +++ b/libdevcrypto/AES.h @@ -86,4 +86,7 @@ private: } } -} \ No newline at end of file + +bytes aesDecrypt(bytesConstRef _cipher, std::string const& _password, unsigned _rounds = 2000, bytesConstRef _salt = bytesConstRef()); + +} diff --git a/libdevcrypto/Common.cpp b/libdevcrypto/Common.cpp index a5c176fe6..52be6ce3b 100644 --- a/libdevcrypto/Common.cpp +++ b/libdevcrypto/Common.cpp @@ -27,6 +27,7 @@ #include #include #include "SHA3.h" +#include "AES.h" #include "FileSystem.h" #include "CryptoPP.h" using namespace std; diff --git a/libdevcrypto/Hash.cpp b/libdevcrypto/Hash.cpp new file mode 100644 index 000000000..c6b917b90 --- /dev/null +++ b/libdevcrypto/Hash.cpp @@ -0,0 +1,440 @@ +/* + This file is part of cpp-ethereum. + + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file Hash.cpp + * @author Gav Wood + * @date 2014 + */ + +#include "Hash.h" +#include +#include +#include +#include "picosha2.h" +using namespace std; +using namespace dev; + +namespace dev +{ + +h256 sha256(bytesConstRef _input) +{ + h256 ret; + picosha2::hash256(_input.begin(), _input.end(), ret.data(), ret.data() + 32); + return ret; +} + +namespace rmd160 +{ + +/********************************************************************\ + * + * FILE: rmd160.h + * FILE: rmd160.c + * + * CONTENTS: Header file for a sample C-implementation of the + * RIPEMD-160 hash-function. + * TARGET: any computer with an ANSI C compiler + * + * AUTHOR: Antoon Bosselaers, ESAT-COSIC + * DATE: 1 March 1996 + * VERSION: 1.0 + * + * Copyright (c) Katholieke Universiteit Leuven + * 1996, All Rights Reserved + * + \********************************************************************/ + +// Adapted into "header-only" format by Gav Wood. + +/* macro definitions */ + +#define RMDsize 160 + +/* collect four bytes into one word: */ +#define BYTES_TO_DWORD(strptr) \ +(((uint32_t) *((strptr)+3) << 24) | \ +((uint32_t) *((strptr)+2) << 16) | \ +((uint32_t) *((strptr)+1) << 8) | \ +((uint32_t) *(strptr))) + +/* ROL(x, n) cyclically rotates x over n bits to the left */ +/* x must be of an unsigned 32 bits type and 0 <= n < 32. */ +#define ROL(x, n) (((x) << (n)) | ((x) >> (32-(n)))) + +/* the five basic functions F(), G() and H() */ +#define F(x, y, z) ((x) ^ (y) ^ (z)) +#define G(x, y, z) (((x) & (y)) | (~(x) & (z))) +#define H(x, y, z) (((x) | ~(y)) ^ (z)) +#define I(x, y, z) (((x) & (z)) | ((y) & ~(z))) +#define J(x, y, z) ((x) ^ ((y) | ~(z))) + +/* the ten basic operations FF() through III() */ +#define FF(a, b, c, d, e, x, s) {\ +(a) += F((b), (c), (d)) + (x);\ +(a) = ROL((a), (s)) + (e);\ +(c) = ROL((c), 10);\ +} +#define GG(a, b, c, d, e, x, s) {\ +(a) += G((b), (c), (d)) + (x) + 0x5a827999UL;\ +(a) = ROL((a), (s)) + (e);\ +(c) = ROL((c), 10);\ +} +#define HH(a, b, c, d, e, x, s) {\ +(a) += H((b), (c), (d)) + (x) + 0x6ed9eba1UL;\ +(a) = ROL((a), (s)) + (e);\ +(c) = ROL((c), 10);\ +} +#define II(a, b, c, d, e, x, s) {\ +(a) += I((b), (c), (d)) + (x) + 0x8f1bbcdcUL;\ +(a) = ROL((a), (s)) + (e);\ +(c) = ROL((c), 10);\ +} +#define JJ(a, b, c, d, e, x, s) {\ +(a) += J((b), (c), (d)) + (x) + 0xa953fd4eUL;\ +(a) = ROL((a), (s)) + (e);\ +(c) = ROL((c), 10);\ +} +#define FFF(a, b, c, d, e, x, s) {\ +(a) += F((b), (c), (d)) + (x);\ +(a) = ROL((a), (s)) + (e);\ +(c) = ROL((c), 10);\ +} +#define GGG(a, b, c, d, e, x, s) {\ +(a) += G((b), (c), (d)) + (x) + 0x7a6d76e9UL;\ +(a) = ROL((a), (s)) + (e);\ +(c) = ROL((c), 10);\ +} +#define HHH(a, b, c, d, e, x, s) {\ +(a) += H((b), (c), (d)) + (x) + 0x6d703ef3UL;\ +(a) = ROL((a), (s)) + (e);\ +(c) = ROL((c), 10);\ +} +#define III(a, b, c, d, e, x, s) {\ +(a) += I((b), (c), (d)) + (x) + 0x5c4dd124UL;\ +(a) = ROL((a), (s)) + (e);\ +(c) = ROL((c), 10);\ +} +#define JJJ(a, b, c, d, e, x, s) {\ +(a) += J((b), (c), (d)) + (x) + 0x50a28be6UL;\ +(a) = ROL((a), (s)) + (e);\ +(c) = ROL((c), 10);\ +} + +void MDinit(uint32_t *MDbuf) +{ + MDbuf[0] = 0x67452301UL; + MDbuf[1] = 0xefcdab89UL; + MDbuf[2] = 0x98badcfeUL; + MDbuf[3] = 0x10325476UL; + MDbuf[4] = 0xc3d2e1f0UL; + + return; +} + +/********************************************************************/ + +void MDcompress(uint32_t *MDbuf, uint32_t *X) +{ + uint32_t aa = MDbuf[0], bb = MDbuf[1], cc = MDbuf[2], + dd = MDbuf[3], ee = MDbuf[4]; + uint32_t aaa = MDbuf[0], bbb = MDbuf[1], ccc = MDbuf[2], + ddd = MDbuf[3], eee = MDbuf[4]; + + /* round 1 */ + FF(aa, bb, cc, dd, ee, X[ 0], 11); + FF(ee, aa, bb, cc, dd, X[ 1], 14); + FF(dd, ee, aa, bb, cc, X[ 2], 15); + FF(cc, dd, ee, aa, bb, X[ 3], 12); + FF(bb, cc, dd, ee, aa, X[ 4], 5); + FF(aa, bb, cc, dd, ee, X[ 5], 8); + FF(ee, aa, bb, cc, dd, X[ 6], 7); + FF(dd, ee, aa, bb, cc, X[ 7], 9); + FF(cc, dd, ee, aa, bb, X[ 8], 11); + FF(bb, cc, dd, ee, aa, X[ 9], 13); + FF(aa, bb, cc, dd, ee, X[10], 14); + FF(ee, aa, bb, cc, dd, X[11], 15); + FF(dd, ee, aa, bb, cc, X[12], 6); + FF(cc, dd, ee, aa, bb, X[13], 7); + FF(bb, cc, dd, ee, aa, X[14], 9); + FF(aa, bb, cc, dd, ee, X[15], 8); + + /* round 2 */ + GG(ee, aa, bb, cc, dd, X[ 7], 7); + GG(dd, ee, aa, bb, cc, X[ 4], 6); + GG(cc, dd, ee, aa, bb, X[13], 8); + GG(bb, cc, dd, ee, aa, X[ 1], 13); + GG(aa, bb, cc, dd, ee, X[10], 11); + GG(ee, aa, bb, cc, dd, X[ 6], 9); + GG(dd, ee, aa, bb, cc, X[15], 7); + GG(cc, dd, ee, aa, bb, X[ 3], 15); + GG(bb, cc, dd, ee, aa, X[12], 7); + GG(aa, bb, cc, dd, ee, X[ 0], 12); + GG(ee, aa, bb, cc, dd, X[ 9], 15); + GG(dd, ee, aa, bb, cc, X[ 5], 9); + GG(cc, dd, ee, aa, bb, X[ 2], 11); + GG(bb, cc, dd, ee, aa, X[14], 7); + GG(aa, bb, cc, dd, ee, X[11], 13); + GG(ee, aa, bb, cc, dd, X[ 8], 12); + + /* round 3 */ + HH(dd, ee, aa, bb, cc, X[ 3], 11); + HH(cc, dd, ee, aa, bb, X[10], 13); + HH(bb, cc, dd, ee, aa, X[14], 6); + HH(aa, bb, cc, dd, ee, X[ 4], 7); + HH(ee, aa, bb, cc, dd, X[ 9], 14); + HH(dd, ee, aa, bb, cc, X[15], 9); + HH(cc, dd, ee, aa, bb, X[ 8], 13); + HH(bb, cc, dd, ee, aa, X[ 1], 15); + HH(aa, bb, cc, dd, ee, X[ 2], 14); + HH(ee, aa, bb, cc, dd, X[ 7], 8); + HH(dd, ee, aa, bb, cc, X[ 0], 13); + HH(cc, dd, ee, aa, bb, X[ 6], 6); + HH(bb, cc, dd, ee, aa, X[13], 5); + HH(aa, bb, cc, dd, ee, X[11], 12); + HH(ee, aa, bb, cc, dd, X[ 5], 7); + HH(dd, ee, aa, bb, cc, X[12], 5); + + /* round 4 */ + II(cc, dd, ee, aa, bb, X[ 1], 11); + II(bb, cc, dd, ee, aa, X[ 9], 12); + II(aa, bb, cc, dd, ee, X[11], 14); + II(ee, aa, bb, cc, dd, X[10], 15); + II(dd, ee, aa, bb, cc, X[ 0], 14); + II(cc, dd, ee, aa, bb, X[ 8], 15); + II(bb, cc, dd, ee, aa, X[12], 9); + II(aa, bb, cc, dd, ee, X[ 4], 8); + II(ee, aa, bb, cc, dd, X[13], 9); + II(dd, ee, aa, bb, cc, X[ 3], 14); + II(cc, dd, ee, aa, bb, X[ 7], 5); + II(bb, cc, dd, ee, aa, X[15], 6); + II(aa, bb, cc, dd, ee, X[14], 8); + II(ee, aa, bb, cc, dd, X[ 5], 6); + II(dd, ee, aa, bb, cc, X[ 6], 5); + II(cc, dd, ee, aa, bb, X[ 2], 12); + + /* round 5 */ + JJ(bb, cc, dd, ee, aa, X[ 4], 9); + JJ(aa, bb, cc, dd, ee, X[ 0], 15); + JJ(ee, aa, bb, cc, dd, X[ 5], 5); + JJ(dd, ee, aa, bb, cc, X[ 9], 11); + JJ(cc, dd, ee, aa, bb, X[ 7], 6); + JJ(bb, cc, dd, ee, aa, X[12], 8); + JJ(aa, bb, cc, dd, ee, X[ 2], 13); + JJ(ee, aa, bb, cc, dd, X[10], 12); + JJ(dd, ee, aa, bb, cc, X[14], 5); + JJ(cc, dd, ee, aa, bb, X[ 1], 12); + JJ(bb, cc, dd, ee, aa, X[ 3], 13); + JJ(aa, bb, cc, dd, ee, X[ 8], 14); + JJ(ee, aa, bb, cc, dd, X[11], 11); + JJ(dd, ee, aa, bb, cc, X[ 6], 8); + JJ(cc, dd, ee, aa, bb, X[15], 5); + JJ(bb, cc, dd, ee, aa, X[13], 6); + + /* parallel round 1 */ + JJJ(aaa, bbb, ccc, ddd, eee, X[ 5], 8); + JJJ(eee, aaa, bbb, ccc, ddd, X[14], 9); + JJJ(ddd, eee, aaa, bbb, ccc, X[ 7], 9); + JJJ(ccc, ddd, eee, aaa, bbb, X[ 0], 11); + JJJ(bbb, ccc, ddd, eee, aaa, X[ 9], 13); + JJJ(aaa, bbb, ccc, ddd, eee, X[ 2], 15); + JJJ(eee, aaa, bbb, ccc, ddd, X[11], 15); + JJJ(ddd, eee, aaa, bbb, ccc, X[ 4], 5); + JJJ(ccc, ddd, eee, aaa, bbb, X[13], 7); + JJJ(bbb, ccc, ddd, eee, aaa, X[ 6], 7); + JJJ(aaa, bbb, ccc, ddd, eee, X[15], 8); + JJJ(eee, aaa, bbb, ccc, ddd, X[ 8], 11); + JJJ(ddd, eee, aaa, bbb, ccc, X[ 1], 14); + JJJ(ccc, ddd, eee, aaa, bbb, X[10], 14); + JJJ(bbb, ccc, ddd, eee, aaa, X[ 3], 12); + JJJ(aaa, bbb, ccc, ddd, eee, X[12], 6); + + /* parallel round 2 */ + III(eee, aaa, bbb, ccc, ddd, X[ 6], 9); + III(ddd, eee, aaa, bbb, ccc, X[11], 13); + III(ccc, ddd, eee, aaa, bbb, X[ 3], 15); + III(bbb, ccc, ddd, eee, aaa, X[ 7], 7); + III(aaa, bbb, ccc, ddd, eee, X[ 0], 12); + III(eee, aaa, bbb, ccc, ddd, X[13], 8); + III(ddd, eee, aaa, bbb, ccc, X[ 5], 9); + III(ccc, ddd, eee, aaa, bbb, X[10], 11); + III(bbb, ccc, ddd, eee, aaa, X[14], 7); + III(aaa, bbb, ccc, ddd, eee, X[15], 7); + III(eee, aaa, bbb, ccc, ddd, X[ 8], 12); + III(ddd, eee, aaa, bbb, ccc, X[12], 7); + III(ccc, ddd, eee, aaa, bbb, X[ 4], 6); + III(bbb, ccc, ddd, eee, aaa, X[ 9], 15); + III(aaa, bbb, ccc, ddd, eee, X[ 1], 13); + III(eee, aaa, bbb, ccc, ddd, X[ 2], 11); + + /* parallel round 3 */ + HHH(ddd, eee, aaa, bbb, ccc, X[15], 9); + HHH(ccc, ddd, eee, aaa, bbb, X[ 5], 7); + HHH(bbb, ccc, ddd, eee, aaa, X[ 1], 15); + HHH(aaa, bbb, ccc, ddd, eee, X[ 3], 11); + HHH(eee, aaa, bbb, ccc, ddd, X[ 7], 8); + HHH(ddd, eee, aaa, bbb, ccc, X[14], 6); + HHH(ccc, ddd, eee, aaa, bbb, X[ 6], 6); + HHH(bbb, ccc, ddd, eee, aaa, X[ 9], 14); + HHH(aaa, bbb, ccc, ddd, eee, X[11], 12); + HHH(eee, aaa, bbb, ccc, ddd, X[ 8], 13); + HHH(ddd, eee, aaa, bbb, ccc, X[12], 5); + HHH(ccc, ddd, eee, aaa, bbb, X[ 2], 14); + HHH(bbb, ccc, ddd, eee, aaa, X[10], 13); + HHH(aaa, bbb, ccc, ddd, eee, X[ 0], 13); + HHH(eee, aaa, bbb, ccc, ddd, X[ 4], 7); + HHH(ddd, eee, aaa, bbb, ccc, X[13], 5); + + /* parallel round 4 */ + GGG(ccc, ddd, eee, aaa, bbb, X[ 8], 15); + GGG(bbb, ccc, ddd, eee, aaa, X[ 6], 5); + GGG(aaa, bbb, ccc, ddd, eee, X[ 4], 8); + GGG(eee, aaa, bbb, ccc, ddd, X[ 1], 11); + GGG(ddd, eee, aaa, bbb, ccc, X[ 3], 14); + GGG(ccc, ddd, eee, aaa, bbb, X[11], 14); + GGG(bbb, ccc, ddd, eee, aaa, X[15], 6); + GGG(aaa, bbb, ccc, ddd, eee, X[ 0], 14); + GGG(eee, aaa, bbb, ccc, ddd, X[ 5], 6); + GGG(ddd, eee, aaa, bbb, ccc, X[12], 9); + GGG(ccc, ddd, eee, aaa, bbb, X[ 2], 12); + GGG(bbb, ccc, ddd, eee, aaa, X[13], 9); + GGG(aaa, bbb, ccc, ddd, eee, X[ 9], 12); + GGG(eee, aaa, bbb, ccc, ddd, X[ 7], 5); + GGG(ddd, eee, aaa, bbb, ccc, X[10], 15); + GGG(ccc, ddd, eee, aaa, bbb, X[14], 8); + + /* parallel round 5 */ + FFF(bbb, ccc, ddd, eee, aaa, X[12] , 8); + FFF(aaa, bbb, ccc, ddd, eee, X[15] , 5); + FFF(eee, aaa, bbb, ccc, ddd, X[10] , 12); + FFF(ddd, eee, aaa, bbb, ccc, X[ 4] , 9); + FFF(ccc, ddd, eee, aaa, bbb, X[ 1] , 12); + FFF(bbb, ccc, ddd, eee, aaa, X[ 5] , 5); + FFF(aaa, bbb, ccc, ddd, eee, X[ 8] , 14); + FFF(eee, aaa, bbb, ccc, ddd, X[ 7] , 6); + FFF(ddd, eee, aaa, bbb, ccc, X[ 6] , 8); + FFF(ccc, ddd, eee, aaa, bbb, X[ 2] , 13); + FFF(bbb, ccc, ddd, eee, aaa, X[13] , 6); + FFF(aaa, bbb, ccc, ddd, eee, X[14] , 5); + FFF(eee, aaa, bbb, ccc, ddd, X[ 0] , 15); + FFF(ddd, eee, aaa, bbb, ccc, X[ 3] , 13); + FFF(ccc, ddd, eee, aaa, bbb, X[ 9] , 11); + FFF(bbb, ccc, ddd, eee, aaa, X[11] , 11); + + /* combine results */ + ddd += cc + MDbuf[1]; /* final result for MDbuf[0] */ + MDbuf[1] = MDbuf[2] + dd + eee; + MDbuf[2] = MDbuf[3] + ee + aaa; + MDbuf[3] = MDbuf[4] + aa + bbb; + MDbuf[4] = MDbuf[0] + bb + ccc; + MDbuf[0] = ddd; + + return; +} + +void MDfinish(uint32_t *MDbuf, byte const *strptr, uint32_t lswlen, uint32_t mswlen) +{ + unsigned int i; /* counter */ + uint32_t X[16]; /* message words */ + + memset(X, 0, 16*sizeof(uint32_t)); + + /* put bytes from strptr into X */ + for (i=0; i<(lswlen&63); i++) { + /* byte i goes into word X[i div 4] at pos. 8*(i mod 4) */ + X[i>>2] ^= (uint32_t) *strptr++ << (8 * (i&3)); + } + + /* append the bit m_n == 1 */ + X[(lswlen>>2)&15] ^= (uint32_t)1 << (8*(lswlen&3) + 7); + + if ((lswlen & 63) > 55) { + /* length goes to next block */ + MDcompress(MDbuf, X); + memset(X, 0, 16*sizeof(uint32_t)); + } + + /* append length in bits*/ + X[14] = lswlen << 3; + X[15] = (lswlen >> 29) | (mswlen << 3); + MDcompress(MDbuf, X); + + return; +} + +#undef ROL +#undef F +#undef G +#undef H +#undef I +#undef J +#undef FF +#undef GG +#undef HH +#undef II +#undef JJ +#undef FFF +#undef GGG +#undef HHH +#undef III +#undef JJJ + +} + +/* + * @returns RMD(_input) + */ +h160 ripemd160(bytesConstRef _input) +{ + h160 hashcode; + uint32_t buffer[RMDsize / 32]; // contains (A, B, C, D(, E)) + uint32_t current[16]; // current 16-word chunk + + // initialize + rmd160::MDinit(buffer); + byte const* message = _input.data(); + uint32_t remaining = _input.size(); // # of bytes not yet processed + + // process message in 16x 4-byte chunks + for (; remaining >= 64; remaining -= 64) + { + for (unsigned i = 0; i < 16; i++) + { + current[i] = BYTES_TO_DWORD(message); + message += 4; + } + rmd160::MDcompress(buffer, current); + } + // length mod 64 bytes left + + // finish: + rmd160::MDfinish(buffer, message, _input.size(), 0); + + for (unsigned i = 0; i < RMDsize / 8; i += 4) + { + hashcode[i] = buffer[i >> 2]; // implicit cast to byte + hashcode[i + 1] = (buffer[i >> 2] >> 8); //extracts the 8 least + hashcode[i + 2] = (buffer[i >> 2] >> 16); // significant bits. + hashcode[i + 3] = (buffer[i >> 2] >> 24); + } + + return hashcode; +} + +#undef BYTES_TO_DWORD +#undef RMDsize + +} diff --git a/libdevcrypto/Hash.h b/libdevcrypto/Hash.h new file mode 100644 index 000000000..7c5fcd67a --- /dev/null +++ b/libdevcrypto/Hash.h @@ -0,0 +1,38 @@ +/* + This file is part of cpp-ethereum. + + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file Hash.h + * @author Gav Wood + * @date 2014 + * + * The FixedHash fixed-size "hash" container type. + */ + +#pragma once + +#include +#include +#include +#include "SHA3.h" + +namespace dev +{ + +h256 sha256(bytesConstRef _input); + +h160 ripemd160(bytesConstRef _input); + +} diff --git a/libdevcrypto/SHA3.cpp b/libdevcrypto/SHA3.cpp index b7a47b745..250936db1 100644 --- a/libdevcrypto/SHA3.cpp +++ b/libdevcrypto/SHA3.cpp @@ -20,8 +20,12 @@ */ #include "SHA3.h" - +#include +#include +#include +#include #include +#include "picosha2.h" #include "CryptoPP.h" using namespace std; using namespace dev; @@ -32,98 +36,189 @@ namespace dev h256 EmptySHA3 = sha3(bytesConstRef()); h256 EmptyListSHA3 = sha3(rlpList()); -std::string sha3(std::string const& _input, bool _hex) +namespace keccak { - if (!_hex) - { - string ret(32, '\0'); - sha3(bytesConstRef((byte const*)_input.data(), _input.size()), bytesRef((byte*)ret.data(), 32)); - return ret; - } - - uint8_t buf[32]; - sha3(bytesConstRef((byte const*)_input.data(), _input.size()), bytesRef((byte*)&(buf[0]), 32)); - std::string ret(64, '\0'); - for (unsigned int i = 0; i < 32; i++) - sprintf((char*)(ret.data())+i*2, "%02x", buf[i]); - return ret; -} -void sha3(bytesConstRef _input, bytesRef _output) -{ - CryptoPP::SHA3_256 ctx; - ctx.Update((byte*)_input.data(), _input.size()); - assert(_output.size() >= 32); - ctx.Final(_output.data()); -} +/** libkeccak-tiny + * + * A single-file implementation of SHA-3 and SHAKE. + * + * Implementor: David Leon Gil + * License: CC0, attribution kindly requested. Blame taken too, + * but not liability. + */ -void ripemd160(bytesConstRef _input, bytesRef _output) -{ - CryptoPP::RIPEMD160 ctx; - ctx.Update((byte*)_input.data(), _input.size()); - assert(_output.size() >= 32); - ctx.Final(_output.data()); +#define decshake(bits) \ + int shake##bits(uint8_t*, size_t, const uint8_t*, size_t); + +#define decsha3(bits) \ + int sha3_##bits(uint8_t*, size_t, const uint8_t*, size_t); + +decshake(128) +decshake(256) +decsha3(224) +decsha3(256) +decsha3(384) +decsha3(512) + +/******** The Keccak-f[1600] permutation ********/ + +/*** Constants. ***/ +static const uint8_t rho[24] = \ + { 1, 3, 6, 10, 15, 21, + 28, 36, 45, 55, 2, 14, + 27, 41, 56, 8, 25, 43, + 62, 18, 39, 61, 20, 44}; +static const uint8_t pi[24] = \ + {10, 7, 11, 17, 18, 3, + 5, 16, 8, 21, 24, 4, + 15, 23, 19, 13, 12, 2, + 20, 14, 22, 9, 6, 1}; +static const uint64_t RC[24] = \ + {1ULL, 0x8082ULL, 0x800000000000808aULL, 0x8000000080008000ULL, + 0x808bULL, 0x80000001ULL, 0x8000000080008081ULL, 0x8000000000008009ULL, + 0x8aULL, 0x88ULL, 0x80008009ULL, 0x8000000aULL, + 0x8000808bULL, 0x800000000000008bULL, 0x8000000000008089ULL, 0x8000000000008003ULL, + 0x8000000000008002ULL, 0x8000000000000080ULL, 0x800aULL, 0x800000008000000aULL, + 0x8000000080008081ULL, 0x8000000000008080ULL, 0x80000001ULL, 0x8000000080008008ULL}; + +/*** Helper macros to unroll the permutation. ***/ +#define rol(x, s) (((x) << s) | ((x) >> (64 - s))) +#define REPEAT6(e) e e e e e e +#define REPEAT24(e) REPEAT6(e e e e) +#define REPEAT5(e) e e e e e +#define FOR5(v, s, e) \ + v = 0; \ + REPEAT5(e; v += s;) + +/*** Keccak-f[1600] ***/ +static inline void keccakf(void* state) { + uint64_t* a = (uint64_t*)state; + uint64_t b[5] = {0}; + uint64_t t = 0; + uint8_t x, y; + + for (int i = 0; i < 24; i++) { + // Theta + FOR5(x, 1, + b[x] = 0; + FOR5(y, 5, + b[x] ^= a[x + y]; )) + FOR5(x, 1, + FOR5(y, 5, + a[y + x] ^= b[(x + 4) % 5] ^ rol(b[(x + 1) % 5], 1); )) + // Rho and pi + t = a[1]; + x = 0; + REPEAT24(b[0] = a[pi[x]]; + a[pi[x]] = rol(t, rho[x]); + t = b[0]; + x++; ) + // Chi + FOR5(y, + 5, + FOR5(x, 1, + b[x] = a[y + x];) + FOR5(x, 1, + a[y + x] = b[x] ^ ((~b[(x + 1) % 5]) & b[(x + 2) % 5]); )) + // Iota + a[0] ^= RC[i]; + } } -void sha256(bytesConstRef _input, bytesRef _output) -{ - CryptoPP::SHA256 ctx; - ctx.Update((byte*)_input.data(), _input.size()); - assert(_output.size() >= 32); - ctx.Final(_output.data()); +/******** The FIPS202-defined functions. ********/ + +/*** Some helper macros. ***/ + +#define _(S) do { S } while (0) +#define FOR(i, ST, L, S) \ + _(for (size_t i = 0; i < L; i += ST) { S; }) +#define mkapply_ds(NAME, S) \ + static inline void NAME(uint8_t* dst, \ + const uint8_t* src, \ + size_t len) { \ + FOR(i, 1, len, S); \ + } +#define mkapply_sd(NAME, S) \ + static inline void NAME(const uint8_t* src, \ + uint8_t* dst, \ + size_t len) { \ + FOR(i, 1, len, S); \ + } + +mkapply_ds(xorin, dst[i] ^= src[i]) // xorin +mkapply_sd(setout, dst[i] = src[i]) // setout + +#define P keccakf +#define Plen 200 + +// Fold P*F over the full blocks of an input. +#define foldP(I, L, F) \ + while (L >= rate) { \ + F(a, I, rate); \ + P(a); \ + I += rate; \ + L -= rate; \ + } + +/** The sponge-based hash construction. **/ +static inline int hash(uint8_t* out, size_t outlen, + const uint8_t* in, size_t inlen, + size_t rate, uint8_t delim) { + if ((out == NULL) || ((in == NULL) && inlen != 0) || (rate >= Plen)) { + return -1; + } + uint8_t a[Plen] = {0}; + // Absorb input. + foldP(in, inlen, xorin); + // Xor in the DS and pad frame. + a[inlen] ^= delim; + a[rate - 1] ^= 0x80; + // Xor in the last block. + xorin(a, in, inlen); + // Apply P + P(a); + // Squeeze output. + foldP(out, outlen, setout); + setout(a, out, outlen); + memset(a, 0, 200); + return 0; } -bytes sha3Bytes(bytesConstRef _input) -{ - bytes ret(32); - sha3(_input, &ret); - return ret; +/*** Helper macros to define SHA3 and SHAKE instances. ***/ +#define defshake(bits) \ + int shake##bits(uint8_t* out, size_t outlen, \ + const uint8_t* in, size_t inlen) { \ + return hash(out, outlen, in, inlen, 200 - (bits / 4), 0x1f); \ + } +#define defsha3(bits) \ + int sha3_##bits(uint8_t* out, size_t outlen, \ + const uint8_t* in, size_t inlen) { \ + if (outlen > (bits/8)) { \ + return -1; \ + } \ + return hash(out, outlen, in, inlen, 200 - (bits / 4), 0x01); \ + } + +/*** FIPS202 SHAKE VOFs ***/ +defshake(128) +defshake(256) + +/*** FIPS202 SHA3 FOFs ***/ +defsha3(224) +defsha3(256) +defsha3(384) +defsha3(512) + } h256 sha3(bytesConstRef _input) { + // FIXME: What with unaligned memory? h256 ret; - sha3(_input, bytesRef(&ret[0], 32)); + keccak::sha3_256(ret.data(), 32, _input.data(), _input.size()); +// keccak::keccak(ret.data(), 32, (uint64_t const*)_input.data(), _input.size()); return ret; } - -void sha3mac(bytesConstRef _secret, bytesConstRef _plain, bytesRef _output) -{ - CryptoPP::SHA3_256 ctx; - assert(_secret.size() > 0); - ctx.Update((byte*)_secret.data(), _secret.size()); - ctx.Update((byte*)_plain.data(), _plain.size()); - assert(_output.size() >= 32); - ctx.Final(_output.data()); -} - -bytes aesDecrypt(bytesConstRef _ivCipher, std::string const& _password, unsigned _rounds, bytesConstRef _salt) -{ - bytes pw = asBytes(_password); - - if (!_salt.size()) - _salt = &pw; - - bytes target(64); - CryptoPP::PKCS5_PBKDF2_HMAC().DeriveKey(target.data(), target.size(), 0, pw.data(), pw.size(), _salt.data(), _salt.size(), _rounds); - - try - { - CryptoPP::AES::Decryption aesDecryption(target.data(), 16); - auto cipher = _ivCipher.cropped(16); - auto iv = _ivCipher.cropped(0, 16); - CryptoPP::CBC_Mode_ExternalCipher::Decryption cbcDecryption(aesDecryption, iv.data()); - std::string decrypted; - CryptoPP::StreamTransformationFilter stfDecryptor(cbcDecryption, new CryptoPP::StringSink(decrypted)); - stfDecryptor.Put(cipher.data(), cipher.size()); - stfDecryptor.MessageEnd(); - return asBytes(decrypted); - } - catch (exception const& e) - { - cerr << e.what() << endl; - return bytes(); - } -} } diff --git a/libdevcrypto/SHA3.h b/libdevcrypto/SHA3.h index 66b8efe11..c3ef524fe 100644 --- a/libdevcrypto/SHA3.h +++ b/libdevcrypto/SHA3.h @@ -32,46 +32,29 @@ namespace dev // SHA-3 convenience routines. -/// Calculate SHA3-256 hash of the given input and load it into the given output. -void sha3(bytesConstRef _input, bytesRef _output); - -/// Calculate SHA3-256 hash of the given input, possibly interpreting it as nibbles, and return the hash as a string filled with binary data. -std::string sha3(std::string const& _input, bool _isNibbles); - -/// Calculate SHA3-256 hash of the given input, returning as a byte array. -bytes sha3Bytes(bytesConstRef _input); - -/// Calculate SHA3-256 hash of the given input (presented as a binary string), returning as a byte array. -inline bytes sha3Bytes(std::string const& _input) { return sha3Bytes((std::string*)&_input); } - -/// Calculate SHA3-256 hash of the given input, returning as a byte array. -inline bytes sha3Bytes(bytes const& _input) { return sha3Bytes((bytes*)&_input); } - /// Calculate SHA3-256 hash of the given input, returning as a 256-bit hash. h256 sha3(bytesConstRef _input); +/// Calculate SHA3-256 hash of the given input and load it into the given output. +inline void sha3(bytesConstRef _input, bytesRef _output) { sha3(_input).ref().populate(_output); } + /// Calculate SHA3-256 hash of the given input, returning as a 256-bit hash. -inline h256 sha3(bytes const& _input) { return sha3(bytesConstRef((bytes*)&_input)); } +inline h256 sha3(bytes const& _input) { return sha3(bytesConstRef(&_input)); } /// Calculate SHA3-256 hash of the given input (presented as a binary-filled string), returning as a 256-bit hash. inline h256 sha3(std::string const& _input) { return sha3(bytesConstRef(_input)); } - -/// Calculate SHA3-256 MAC -void sha3mac(bytesConstRef _secret, bytesConstRef _plain, bytesRef _output); /// Calculate SHA3-256 hash of the given input (presented as a FixedHash), returns a 256-bit hash. template inline h256 sha3(FixedHash const& _input) { return sha3(_input.ref()); } -extern h256 EmptySHA3; - -extern h256 EmptyListSHA3; - -// Other crypto convenience routines +/// Calculate SHA3-256 hash of the given input, possibly interpreting it as nibbles, and return the hash as a string filled with binary data. +inline std::string sha3(std::string const& _input, bool _isNibbles) { return asString((_isNibbles ? sha3(fromHex(_input)) : sha3(bytesConstRef(&_input))).asBytes()); } -bytes aesDecrypt(bytesConstRef _cipher, std::string const& _password, unsigned _rounds = 2000, bytesConstRef _salt = bytesConstRef()); +/// Calculate SHA3-256 MAC +inline void sha3mac(bytesConstRef _secret, bytesConstRef _plain, bytesRef _output) { sha3(_secret.toBytes() + _plain.toBytes()).ref().populate(_output); } -void sha256(bytesConstRef _input, bytesRef _output); +extern h256 EmptySHA3; -void ripemd160(bytesConstRef _input, bytesRef _output); +extern h256 EmptyListSHA3; } diff --git a/libdevcrypto/picosha2.h b/libdevcrypto/picosha2.h new file mode 100644 index 000000000..44b6bee59 --- /dev/null +++ b/libdevcrypto/picosha2.h @@ -0,0 +1,360 @@ +/* +The MIT License (MIT) + +Copyright (C) 2014 okdshin + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. +*/ +#ifndef PICOSHA2_H +#define PICOSHA2_H +//picosha2:20140213 +#include +#include +#include +#include +#include +#include +#include + +namespace picosha2 +{ + +namespace detail +{ + +inline uint8_t mask_8bit(uint8_t x){ + return x&0xff; +} + +inline uint32_t mask_32bit(uint32_t x){ + return x&0xffffffff; +} + +static const uint32_t add_constant[64] = { + 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, + 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, + 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, + 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, + 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, + 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, + 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, + 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, + 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, + 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, + 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, + 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, + 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, + 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, + 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, + 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 +}; + +static const uint32_t initial_message_digest[8] = { + 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, + 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19 +}; + +inline uint32_t ch(uint32_t x, uint32_t y, uint32_t z){ + return (x&y)^((~x)&z); +} + +inline uint32_t maj(uint32_t x, uint32_t y, uint32_t z){ + return (x&y)^(x&z)^(y&z); +} + +inline uint32_t rotr(uint32_t x, std::size_t n){ + assert(n < 32); + return mask_32bit((x>>n)|(x<<(32-n))); +} + +inline uint32_t bsig0(uint32_t x){ + return rotr(x, 2)^rotr(x, 13)^rotr(x, 22); +} + +inline uint32_t bsig1(uint32_t x){ + return rotr(x, 6)^rotr(x, 11)^rotr(x, 25); +} + +inline uint32_t shr(uint32_t x, std::size_t n){ + assert(n < 32); + return x >> n; +} + +inline uint32_t ssig0(uint32_t x){ + return rotr(x, 7)^rotr(x, 18)^shr(x, 3); +} + +inline uint32_t ssig1(uint32_t x){ + return rotr(x, 17)^rotr(x, 19)^shr(x, 10); +} + +template +void hash256_block(RaIter1 message_digest, RaIter2 first, RaIter2 last){ + (void)last; // FIXME: check this is valid + uint32_t w[64]; + std::fill(w, w+64, 0); + for(std::size_t i = 0; i < 16; ++i){ + w[i] = (static_cast(mask_8bit(*(first+i*4)))<<24) + |(static_cast(mask_8bit(*(first+i*4+1)))<<16) + |(static_cast(mask_8bit(*(first+i*4+2)))<<8) + |(static_cast(mask_8bit(*(first+i*4+3)))); + } + for(std::size_t i = 16; i < 64; ++i){ + w[i] = mask_32bit(ssig1(w[i-2])+w[i-7]+ssig0(w[i-15])+w[i-16]); + } + + uint32_t a = *message_digest; + uint32_t b = *(message_digest+1); + uint32_t c = *(message_digest+2); + uint32_t d = *(message_digest+3); + uint32_t e = *(message_digest+4); + uint32_t f = *(message_digest+5); + uint32_t g = *(message_digest+6); + uint32_t h = *(message_digest+7); + + for(std::size_t i = 0; i < 64; ++i){ + uint32_t temp1 = h+bsig1(e)+ch(e,f,g)+add_constant[i]+w[i]; + uint32_t temp2 = bsig0(a)+maj(a,b,c); + h = g; + g = f; + f = e; + e = mask_32bit(d+temp1); + d = c; + c = b; + b = a; + a = mask_32bit(temp1+temp2); + } + *message_digest += a; + *(message_digest+1) += b; + *(message_digest+2) += c; + *(message_digest+3) += d; + *(message_digest+4) += e; + *(message_digest+5) += f; + *(message_digest+6) += g; + *(message_digest+7) += h; + for(std::size_t i = 0; i < 8; ++i){ + *(message_digest+i) = mask_32bit(*(message_digest+i)); + } +} + +}//namespace detail + +template +void output_hex(InIter first, InIter last, std::ostream& os){ + os.setf(std::ios::hex, std::ios::basefield); + while(first != last){ + os.width(2); + os.fill('0'); + os << static_cast(*first); + ++first; + } + os.setf(std::ios::dec, std::ios::basefield); +} + +template +void bytes_to_hex_string(InIter first, InIter last, std::string& hex_str){ + std::ostringstream oss; + output_hex(first, last, oss); + hex_str.assign(oss.str()); +} + +template +void bytes_to_hex_string(const InContainer& bytes, std::string& hex_str){ + bytes_to_hex_string(bytes.begin(), bytes.end(), hex_str); +} + +template +std::string bytes_to_hex_string(InIter first, InIter last){ + std::string hex_str; + bytes_to_hex_string(first, last, hex_str); + return hex_str; +} + +template +std::string bytes_to_hex_string(const InContainer& bytes){ + std::string hex_str; + bytes_to_hex_string(bytes, hex_str); + return hex_str; +} + +class hash256_one_by_one { +public: + hash256_one_by_one(){ + init(); + } + + void init(){ + buffer_.clear(); + std::fill(data_length_digits_, data_length_digits_+4, 0); + std::copy(detail::initial_message_digest, detail::initial_message_digest+8, h_); + } + + template + void process(RaIter first, RaIter last){ + add_to_data_length(std::distance(first, last)); + std::copy(first, last, std::back_inserter(buffer_)); + std::size_t i = 0; + for(;i+64 <= buffer_.size(); i+=64){ + detail::hash256_block(h_, buffer_.begin()+i, buffer_.begin()+i+64); + } + buffer_.erase(buffer_.begin(), buffer_.begin()+i); + } + + void finish(){ + uint8_t temp[64]; + std::fill(temp, temp+64, 0); + std::size_t remains = buffer_.size(); + std::copy(buffer_.begin(), buffer_.end(), temp); + temp[remains] = 0x80; + + if(remains > 55){ + std::fill(temp+remains+1, temp+64, 0); + detail::hash256_block(h_, temp, temp+64); + std::fill(temp, temp+64-4, 0); + } + else { + std::fill(temp+remains+1, temp+64-4, 0); + } + + write_data_bit_length(&(temp[56])); + detail::hash256_block(h_, temp, temp+64); + } + + template + void get_hash_bytes(OutIter first, OutIter last)const{ + for(const uint32_t* iter = h_; iter != h_+8; ++iter){ + for(std::size_t i = 0; i < 4 && first != last; ++i){ + *(first++) = detail::mask_8bit(static_cast((*iter >> (24-8*i)))); + } + } + } + +private: + void add_to_data_length(uint32_t n) { + uint32_t carry = 0; + data_length_digits_[0] += n; + for(std::size_t i = 0; i < 4; ++i) { + data_length_digits_[i] += carry; + if(data_length_digits_[i] >= 65536u) { + data_length_digits_[i] -= 65536u; + carry = 1; + } + else { + break; + } + } + } + void write_data_bit_length(uint8_t* begin) { + uint32_t data_bit_length_digits[4]; + std::copy( + data_length_digits_, data_length_digits_+4, + data_bit_length_digits + ); + + // convert byte length to bit length (multiply 8 or shift 3 times left) + uint32_t carry = 0; + for(std::size_t i = 0; i < 4; ++i) { + uint32_t before_val = data_bit_length_digits[i]; + data_bit_length_digits[i] <<= 3; + data_bit_length_digits[i] |= carry; + data_bit_length_digits[i] &= 65535u; + carry = (before_val >> (16-3)) & 65535u; + } + + // write data_bit_length + for(int i = 3; i >= 0; --i) { + (*begin++) = static_cast(data_bit_length_digits[i] >> 8); + (*begin++) = static_cast(data_bit_length_digits[i]); + } + } + std::vector buffer_; + uint32_t data_length_digits_[4]; //as 64bit integer (16bit x 4 integer) + uint32_t h_[8]; +}; + +inline void get_hash_hex_string(const hash256_one_by_one& hasher, std::string& hex_str){ + uint8_t hash[32]; + hasher.get_hash_bytes(hash, hash+32); + return bytes_to_hex_string(hash, hash+32, hex_str); +} + +inline std::string get_hash_hex_string(const hash256_one_by_one& hasher){ + std::string hex_str; + get_hash_hex_string(hasher, hex_str); + return hex_str; +} + +template +void hash256(RaIter first, RaIter last, OutIter first2, OutIter last2){ + hash256_one_by_one hasher; + //hasher.init(); + hasher.process(first, last); + hasher.finish(); + hasher.get_hash_bytes(first2, last2); +} + +template +void hash256(RaIter first, RaIter last, OutContainer& dst){ + hash256(first, last, dst.begin(), dst.end()); +} + +template +void hash256(const RaContainer& src, OutIter first, OutIter last){ + hash256(src.begin(), src.end(), first, last); +} + +template +void hash256(const RaContainer& src, OutContainer& dst){ + hash256(src.begin(), src.end(), dst.begin(), dst.end()); +} + + +template +void hash256_hex_string(RaIter first, RaIter last, std::string& hex_str){ + uint8_t hashed[32]; + hash256(first, last, hashed, hashed+32); + std::ostringstream oss; + output_hex(hashed, hashed+32, oss); + hex_str.assign(oss.str()); +} + +template +std::string hash256_hex_string(RaIter first, RaIter last){ + std::string hex_str; + hash256_hex_string(first, last, hex_str); + return hex_str; +} + +inline void hash256_hex_string(const std::string& src, std::string& hex_str){ + hash256_hex_string(src.begin(), src.end(), hex_str); +} + +template +void hash256_hex_string(const RaContainer& src, std::string& hex_str){ + hash256_hex_string(src.begin(), src.end(), hex_str); +} + +template +std::string hash256_hex_string(const RaContainer& src){ + return hash256_hex_string(src.begin(), src.end()); +} + +}//namespace picosha2 + +#endif //PICOSHA2_H diff --git a/libethereum/Precompiled.cpp b/libethereum/Precompiled.cpp index cdcb4a46a..9373697e1 100644 --- a/libethereum/Precompiled.cpp +++ b/libethereum/Precompiled.cpp @@ -21,7 +21,9 @@ #include "Precompiled.h" +#include #include +#include #include #include #include @@ -61,19 +63,12 @@ static bytes ecrecoverCode(bytesConstRef _in) static bytes sha256Code(bytesConstRef _in) { - bytes ret(32); - sha256(_in, &ret); - return ret; + return sha256(_in).asBytes(); } static bytes ripemd160Code(bytesConstRef _in) { - bytes ret(32); - ripemd160(_in, &ret); - // leaves the 20-byte hash left-aligned. we want it right-aligned: - memmove(ret.data() + 12, ret.data(), 20); - memset(ret.data(), 0, 12); - return ret; + return h256(ripemd160(_in), h256::AlignRight).asBytes(); } static bytes identityCode(bytesConstRef _in) diff --git a/test/libdevcrypto/crypto.cpp b/test/libdevcrypto/crypto.cpp index 88ff98965..3381c45da 100644 --- a/test/libdevcrypto/crypto.cpp +++ b/test/libdevcrypto/crypto.cpp @@ -45,13 +45,19 @@ static CryptoPP::OID s_curveOID(CryptoPP::ASN1::secp256k1()); static CryptoPP::DL_GroupParameters_EC s_params(s_curveOID); static CryptoPP::DL_GroupParameters_EC::EllipticCurve s_curve(s_params.GetCurve()); -BOOST_AUTO_TEST_CASE(emptySHA3Types) +BOOST_AUTO_TEST_CASE(sha3general) { - h256 emptyListSHA3(fromHex("1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347")); - BOOST_REQUIRE_EQUAL(emptyListSHA3, EmptyListSHA3); + BOOST_REQUIRE_EQUAL(sha3(""), h256("c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470")); + BOOST_REQUIRE_EQUAL(sha3("hello"), h256("1c8aff950685c2ed4bc3174f3472287b56d9517b9c948127319a09a7a36deac8")); +} +BOOST_AUTO_TEST_CASE(emptySHA3Types) +{ h256 emptySHA3(fromHex("c5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470")); BOOST_REQUIRE_EQUAL(emptySHA3, EmptySHA3); + + h256 emptyListSHA3(fromHex("1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347")); + BOOST_REQUIRE_EQUAL(emptyListSHA3, EmptyListSHA3); } BOOST_AUTO_TEST_CASE(cryptopp_patch) @@ -805,7 +811,7 @@ int cryptoTest() std::string hmsg = sha3(t.rlp(false), false); cout << "SHA256(RLP(TX w/o SIG)): 0x" << toHex(hmsg) << endl; - bytes privkey = sha3Bytes("123"); + bytes privkey = sha3("123").asBytes(); { bytes pubkey(65); diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index 6713382fa..aa51a674d 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include using namespace std; @@ -1501,9 +1501,7 @@ BOOST_AUTO_TEST_CASE(sha256) compileAndRun(sourceCode); auto f = [&](u256 const& _input) -> u256 { - h256 ret; - dev::sha256(dev::ref(toBigEndian(_input)), bytesRef(&ret[0], 32)); - return ret; + return dev::sha256(dev::ref(toBigEndian(_input))); }; testSolidityAgainstCpp("a(bytes32)", f, u256(4)); testSolidityAgainstCpp("a(bytes32)", f, u256(5)); @@ -1520,9 +1518,7 @@ BOOST_AUTO_TEST_CASE(ripemd) compileAndRun(sourceCode); auto f = [&](u256 const& _input) -> u256 { - h256 ret; - dev::ripemd160(dev::ref(toBigEndian(_input)), bytesRef(&ret[0], 32)); - return u256(ret); + return h256(dev::ripemd160(h256(_input).ref()), h256::AlignLeft); // This should be aligned right. i guess it's fixed elsewhere? }; testSolidityAgainstCpp("a(bytes32)", f, u256(4)); testSolidityAgainstCpp("a(bytes32)", f, u256(5)); From 05ea9941c9b468222026ad9923964456ce195496 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Tue, 19 May 2015 19:51:38 +0200 Subject: [PATCH 285/461] Move non-cryptopp dependent stuff into devcore. --- abi/main.cpp | 2 +- alethzero/DappLoader.cpp | 2 +- alethzero/MainWin.cpp | 2 +- alethzero/NatspecHandler.cpp | 2 +- eth/main.cpp | 2 +- ethminer/MinerAux.h | 4 ++-- ethminer/main.cpp | 2 +- evmjit/libevmjit-cpp/Env.cpp | 2 +- evmjit/libevmjit-cpp/JitVM.cpp | 2 +- exp/main.cpp | 4 ++-- {libdevcrypto => libdevcore}/FileSystem.cpp | 4 ++-- {libdevcrypto => libdevcore}/FileSystem.h | 0 {libdevcrypto => libdevcore}/Hash.cpp | 0 {libdevcrypto => libdevcore}/Hash.h | 0 {libdevcrypto => libdevcore}/MemoryDB.cpp | 0 {libdevcrypto => libdevcore}/MemoryDB.h | 0 {libdevcrypto => libdevcore}/OverlayDB.cpp | 0 {libdevcrypto => libdevcore}/OverlayDB.h | 0 {libdevcrypto => libdevcore}/SHA3.cpp | 1 - {libdevcrypto => libdevcore}/SHA3.h | 0 {libdevcrypto => libdevcore}/TrieCommon.cpp | 0 {libdevcrypto => libdevcore}/TrieCommon.h | 0 {libdevcrypto => libdevcore}/TrieDB.cpp | 0 {libdevcrypto => libdevcore}/TrieDB.h | 2 +- {libdevcrypto => libdevcore}/TrieHash.cpp | 6 +++--- {libdevcrypto => libdevcore}/TrieHash.h | 0 {libdevcrypto => libdevcore}/picosha2.h | 0 libdevcrypto/Common.cpp | 4 ++-- libdevcrypto/CryptoPP.h | 2 +- libdevcrypto/ECDHE.cpp | 4 ++-- libdevcrypto/SecretStore.cpp | 4 ++-- libdevcrypto/SecretStore.h | 2 +- libethcore/ABI.h | 2 +- libethcore/BlockInfo.cpp | 4 ++-- libethcore/Common.cpp | 2 +- libethcore/Ethash.cpp | 2 +- libethcore/EthashAux.cpp | 4 ++-- libethcore/ICAP.cpp | 2 +- libethereum/Account.h | 4 ++-- libethereum/BlockChain.cpp | 2 +- libethereum/CachedAddressState.cpp | 2 +- libethereum/CanonBlockChain.cpp | 2 +- libethereum/Defaults.cpp | 2 +- libethereum/KeyManager.h | 2 +- libethereum/LogFilter.cpp | 2 +- libethereum/Precompiled.cpp | 4 ++-- libethereum/State.cpp | 2 +- libethereum/State.h | 2 +- libethereum/Transaction.h | 2 +- libethereum/Utility.cpp | 2 +- libevm/ExtVMFace.h | 2 +- libevm/SmartVM.cpp | 2 +- libevm/VM.h | 2 +- libevmasm/CommonSubexpressionEliminator.cpp | 2 +- libevmasm/KnownState.cpp | 2 +- libp2p/Host.cpp | 2 +- libp2p/UDP.h | 2 +- libsolidity/AST.cpp | 2 +- libsolidity/CompilerStack.cpp | 2 +- libsolidity/ExpressionCompiler.cpp | 2 +- libsolidity/Types.cpp | 2 +- libtestutils/Common.cpp | 2 +- libweb3jsonrpc/WebThreeStubServer.cpp | 2 +- libwhisper/Common.cpp | 2 +- libwhisper/Interface.h | 2 +- libwhisper/Message.h | 2 +- libwhisper/WhisperHost.h | 2 +- libwhisper/WhisperPeer.h | 2 +- mix/FileIo.cpp | 2 +- mix/QFunctionDefinition.cpp | 2 +- neth/main.cpp | 2 +- rlp/main.cpp | 2 +- test/deprecated/main.cpp | 2 +- test/libdevcrypto/MemTrie.cpp | 4 ++-- test/libdevcrypto/crypto.cpp | 2 +- test/libdevcrypto/hexPrefix.cpp | 2 +- test/libdevcrypto/trie.cpp | 4 ++-- test/libethereum/blockchain.cpp | 2 +- test/libp2p/rlpx.cpp | 2 +- test/libsolidity/SolidityEndToEndTest.cpp | 2 +- test/libsolidity/SolidityNameAndTypeResolution.cpp | 2 +- third/MainWin.cpp | 2 +- 82 files changed, 82 insertions(+), 83 deletions(-) rename {libdevcrypto => libdevcore}/FileSystem.cpp (97%) rename {libdevcrypto => libdevcore}/FileSystem.h (100%) rename {libdevcrypto => libdevcore}/Hash.cpp (100%) rename {libdevcrypto => libdevcore}/Hash.h (100%) rename {libdevcrypto => libdevcore}/MemoryDB.cpp (100%) rename {libdevcrypto => libdevcore}/MemoryDB.h (100%) rename {libdevcrypto => libdevcore}/OverlayDB.cpp (100%) rename {libdevcrypto => libdevcore}/OverlayDB.h (100%) rename {libdevcrypto => libdevcore}/SHA3.cpp (99%) rename {libdevcrypto => libdevcore}/SHA3.h (100%) rename {libdevcrypto => libdevcore}/TrieCommon.cpp (100%) rename {libdevcrypto => libdevcore}/TrieCommon.h (100%) rename {libdevcrypto => libdevcore}/TrieDB.cpp (100%) rename {libdevcrypto => libdevcore}/TrieDB.h (99%) rename {libdevcrypto => libdevcore}/TrieHash.cpp (97%) rename {libdevcrypto => libdevcore}/TrieHash.h (100%) rename {libdevcrypto => libdevcore}/picosha2.h (100%) diff --git a/abi/main.cpp b/abi/main.cpp index 27c5eea1b..df7fa8811 100644 --- a/abi/main.cpp +++ b/abi/main.cpp @@ -26,7 +26,7 @@ #include "../test/JsonSpiritHeaders.h" #include #include -#include +#include #include using namespace std; using namespace dev; diff --git a/alethzero/DappLoader.cpp b/alethzero/DappLoader.cpp index a91beb2f7..b2249ae5b 100644 --- a/alethzero/DappLoader.cpp +++ b/alethzero/DappLoader.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index 9486f9f01..b59e9ce1f 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -44,7 +44,7 @@ #include #include #endif -#include +#include #include #include #include diff --git a/alethzero/NatspecHandler.cpp b/alethzero/NatspecHandler.cpp index a7cad6853..d00abc44f 100644 --- a/alethzero/NatspecHandler.cpp +++ b/alethzero/NatspecHandler.cpp @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include using namespace dev; diff --git a/eth/main.cpp b/eth/main.cpp index 1cf918346..33d049843 100644 --- a/eth/main.cpp +++ b/eth/main.cpp @@ -29,7 +29,7 @@ #include #include -#include +#include #include #include #include diff --git a/ethminer/MinerAux.h b/ethminer/MinerAux.h index 040bd945c..8e480a3ff 100644 --- a/ethminer/MinerAux.h +++ b/ethminer/MinerAux.h @@ -31,11 +31,11 @@ #include #include -#include +#include #include #include #include -#include +#include #include #include #include diff --git a/ethminer/main.cpp b/ethminer/main.cpp index 5b82db471..4deba38d1 100644 --- a/ethminer/main.cpp +++ b/ethminer/main.cpp @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include "MinerAux.h" using namespace std; using namespace dev; diff --git a/evmjit/libevmjit-cpp/Env.cpp b/evmjit/libevmjit-cpp/Env.cpp index a5a60f48c..d1f239f9f 100644 --- a/evmjit/libevmjit-cpp/Env.cpp +++ b/evmjit/libevmjit-cpp/Env.cpp @@ -1,6 +1,6 @@ #pragma GCC diagnostic ignored "-Wconversion" -#include +#include #include #include #include diff --git a/evmjit/libevmjit-cpp/JitVM.cpp b/evmjit/libevmjit-cpp/JitVM.cpp index 7acbec5c1..6efd4c31a 100644 --- a/evmjit/libevmjit-cpp/JitVM.cpp +++ b/evmjit/libevmjit-cpp/JitVM.cpp @@ -4,7 +4,7 @@ #include "JitVM.h" #include -#include +#include #include #include #include diff --git a/exp/main.cpp b/exp/main.cpp index 138ae76a4..d31306496 100644 --- a/exp/main.cpp +++ b/exp/main.cpp @@ -41,12 +41,12 @@ #include #include #include -#include +#include #include #include #include #include -#include +#include #include #include #include diff --git a/libdevcrypto/FileSystem.cpp b/libdevcore/FileSystem.cpp similarity index 97% rename from libdevcrypto/FileSystem.cpp rename to libdevcore/FileSystem.cpp index adf3a2946..dfda891f5 100644 --- a/libdevcrypto/FileSystem.cpp +++ b/libdevcore/FileSystem.cpp @@ -22,8 +22,8 @@ */ #include "FileSystem.h" -#include -#include +#include "Common.h" +#include "Log.h" #if defined(_WIN32) #include diff --git a/libdevcrypto/FileSystem.h b/libdevcore/FileSystem.h similarity index 100% rename from libdevcrypto/FileSystem.h rename to libdevcore/FileSystem.h diff --git a/libdevcrypto/Hash.cpp b/libdevcore/Hash.cpp similarity index 100% rename from libdevcrypto/Hash.cpp rename to libdevcore/Hash.cpp diff --git a/libdevcrypto/Hash.h b/libdevcore/Hash.h similarity index 100% rename from libdevcrypto/Hash.h rename to libdevcore/Hash.h diff --git a/libdevcrypto/MemoryDB.cpp b/libdevcore/MemoryDB.cpp similarity index 100% rename from libdevcrypto/MemoryDB.cpp rename to libdevcore/MemoryDB.cpp diff --git a/libdevcrypto/MemoryDB.h b/libdevcore/MemoryDB.h similarity index 100% rename from libdevcrypto/MemoryDB.h rename to libdevcore/MemoryDB.h diff --git a/libdevcrypto/OverlayDB.cpp b/libdevcore/OverlayDB.cpp similarity index 100% rename from libdevcrypto/OverlayDB.cpp rename to libdevcore/OverlayDB.cpp diff --git a/libdevcrypto/OverlayDB.h b/libdevcore/OverlayDB.h similarity index 100% rename from libdevcrypto/OverlayDB.h rename to libdevcore/OverlayDB.h diff --git a/libdevcrypto/SHA3.cpp b/libdevcore/SHA3.cpp similarity index 99% rename from libdevcrypto/SHA3.cpp rename to libdevcore/SHA3.cpp index 250936db1..880f23d6e 100644 --- a/libdevcrypto/SHA3.cpp +++ b/libdevcore/SHA3.cpp @@ -26,7 +26,6 @@ #include #include #include "picosha2.h" -#include "CryptoPP.h" using namespace std; using namespace dev; diff --git a/libdevcrypto/SHA3.h b/libdevcore/SHA3.h similarity index 100% rename from libdevcrypto/SHA3.h rename to libdevcore/SHA3.h diff --git a/libdevcrypto/TrieCommon.cpp b/libdevcore/TrieCommon.cpp similarity index 100% rename from libdevcrypto/TrieCommon.cpp rename to libdevcore/TrieCommon.cpp diff --git a/libdevcrypto/TrieCommon.h b/libdevcore/TrieCommon.h similarity index 100% rename from libdevcrypto/TrieCommon.h rename to libdevcore/TrieCommon.h diff --git a/libdevcrypto/TrieDB.cpp b/libdevcore/TrieDB.cpp similarity index 100% rename from libdevcrypto/TrieDB.cpp rename to libdevcore/TrieDB.cpp diff --git a/libdevcrypto/TrieDB.h b/libdevcore/TrieDB.h similarity index 99% rename from libdevcrypto/TrieDB.h rename to libdevcore/TrieDB.h index cf85148d2..13a520311 100644 --- a/libdevcrypto/TrieDB.h +++ b/libdevcore/TrieDB.h @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include "MemoryDB.h" #include "OverlayDB.h" #include "TrieCommon.h" diff --git a/libdevcrypto/TrieHash.cpp b/libdevcore/TrieHash.cpp similarity index 97% rename from libdevcrypto/TrieHash.cpp rename to libdevcore/TrieHash.cpp index 0b02ce77f..ec0a92f90 100644 --- a/libdevcrypto/TrieHash.cpp +++ b/libdevcore/TrieHash.cpp @@ -20,9 +20,9 @@ */ #include "TrieHash.h" -#include -#include // @TODO replace ASAP! -#include +#include +#include // @TODO replace ASAP! +#include #include using namespace std; using namespace dev; diff --git a/libdevcrypto/TrieHash.h b/libdevcore/TrieHash.h similarity index 100% rename from libdevcrypto/TrieHash.h rename to libdevcore/TrieHash.h diff --git a/libdevcrypto/picosha2.h b/libdevcore/picosha2.h similarity index 100% rename from libdevcrypto/picosha2.h rename to libdevcore/picosha2.h diff --git a/libdevcrypto/Common.cpp b/libdevcrypto/Common.cpp index 52be6ce3b..87e258573 100644 --- a/libdevcrypto/Common.cpp +++ b/libdevcrypto/Common.cpp @@ -26,9 +26,9 @@ #include #include #include -#include "SHA3.h" +#include +#include #include "AES.h" -#include "FileSystem.h" #include "CryptoPP.h" using namespace std; using namespace dev; diff --git a/libdevcrypto/CryptoPP.h b/libdevcrypto/CryptoPP.h index 4991e3713..ca8a2e6b5 100644 --- a/libdevcrypto/CryptoPP.h +++ b/libdevcrypto/CryptoPP.h @@ -49,7 +49,7 @@ #include #pragma warning(pop) #pragma GCC diagnostic pop -#include "SHA3.h" +#include #include "Common.h" namespace dev diff --git a/libdevcrypto/ECDHE.cpp b/libdevcrypto/ECDHE.cpp index a00a92872..a5aaf3984 100644 --- a/libdevcrypto/ECDHE.cpp +++ b/libdevcrypto/ECDHE.cpp @@ -19,9 +19,9 @@ * @date 2014 */ -#include "SHA3.h" -#include "CryptoPP.h" #include "ECDHE.h" +#include +#include "CryptoPP.h" using namespace std; using namespace dev; diff --git a/libdevcrypto/SecretStore.cpp b/libdevcrypto/SecretStore.cpp index 9be0b89e8..0416aa9f4 100644 --- a/libdevcrypto/SecretStore.cpp +++ b/libdevcrypto/SecretStore.cpp @@ -25,9 +25,9 @@ #include #include #include +#include +#include #include -#include "SHA3.h" -#include "FileSystem.h" using namespace std; using namespace dev; namespace js = json_spirit; diff --git a/libdevcrypto/SecretStore.h b/libdevcrypto/SecretStore.h index 1fb6adf4a..18c290c1f 100644 --- a/libdevcrypto/SecretStore.h +++ b/libdevcrypto/SecretStore.h @@ -24,8 +24,8 @@ #include #include #include +#include #include "Common.h" -#include "FileSystem.h" namespace dev { diff --git a/libethcore/ABI.h b/libethcore/ABI.h index 7fca09c9a..09aca6754 100644 --- a/libethcore/ABI.h +++ b/libethcore/ABI.h @@ -24,7 +24,7 @@ #include #include #include -#include +#include namespace dev { diff --git a/libethcore/BlockInfo.cpp b/libethcore/BlockInfo.cpp index 00a5108c4..22e171e31 100644 --- a/libethcore/BlockInfo.cpp +++ b/libethcore/BlockInfo.cpp @@ -21,8 +21,8 @@ #include #include -#include -#include +#include +#include #include #include #include "EthashAux.h" diff --git a/libethcore/Common.cpp b/libethcore/Common.cpp index c74aeba5e..56db647f3 100644 --- a/libethcore/Common.cpp +++ b/libethcore/Common.cpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include "Exceptions.h" #include "ProofOfWork.h" using namespace std; diff --git a/libethcore/Ethash.cpp b/libethcore/Ethash.cpp index 6276dd0a1..1f16166f0 100644 --- a/libethcore/Ethash.cpp +++ b/libethcore/Ethash.cpp @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include #include #if ETH_ETHASHCL || !ETH_TRUE diff --git a/libethcore/EthashAux.cpp b/libethcore/EthashAux.cpp index eccb986a7..38425aca2 100644 --- a/libethcore/EthashAux.cpp +++ b/libethcore/EthashAux.cpp @@ -31,8 +31,8 @@ #include #include #include -#include -#include +#include +#include #include #include "BlockInfo.h" #include "Exceptions.h" diff --git a/libethcore/ICAP.cpp b/libethcore/ICAP.cpp index 6fce19a62..158c297f8 100644 --- a/libethcore/ICAP.cpp +++ b/libethcore/ICAP.cpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include "Exceptions.h" #include "ABI.h" using namespace std; diff --git a/libethereum/Account.h b/libethereum/Account.h index 660dc0a4c..87fc82b6c 100644 --- a/libethereum/Account.h +++ b/libethereum/Account.h @@ -23,8 +23,8 @@ #include #include -#include -#include +#include +#include namespace dev { diff --git a/libethereum/BlockChain.cpp b/libethereum/BlockChain.cpp index 73747b25b..c46127303 100644 --- a/libethereum/BlockChain.cpp +++ b/libethereum/BlockChain.cpp @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/libethereum/CachedAddressState.cpp b/libethereum/CachedAddressState.cpp index a25017793..7c2f0a80c 100644 --- a/libethereum/CachedAddressState.cpp +++ b/libethereum/CachedAddressState.cpp @@ -22,7 +22,7 @@ #include "CachedAddressState.h" #include -#include +#include #include "Account.h" using namespace std; using namespace dev; diff --git a/libethereum/CanonBlockChain.cpp b/libethereum/CanonBlockChain.cpp index f1de7292b..5dd7dc2ce 100644 --- a/libethereum/CanonBlockChain.cpp +++ b/libethereum/CanonBlockChain.cpp @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/libethereum/Defaults.cpp b/libethereum/Defaults.cpp index febe53d84..b839bbb5c 100644 --- a/libethereum/Defaults.cpp +++ b/libethereum/Defaults.cpp @@ -21,7 +21,7 @@ #include "Defaults.h" -#include +#include using namespace std; using namespace dev; using namespace dev::eth; diff --git a/libethereum/KeyManager.h b/libethereum/KeyManager.h index 38e8d8853..bb537e1f1 100644 --- a/libethereum/KeyManager.h +++ b/libethereum/KeyManager.h @@ -24,7 +24,7 @@ #include #include #include -#include +#include namespace dev { diff --git a/libethereum/LogFilter.cpp b/libethereum/LogFilter.cpp index ab9848d59..21ba9d3ef 100644 --- a/libethereum/LogFilter.cpp +++ b/libethereum/LogFilter.cpp @@ -21,7 +21,7 @@ #include "LogFilter.h" -#include +#include #include "State.h" using namespace std; using namespace dev; diff --git a/libethereum/Precompiled.cpp b/libethereum/Precompiled.cpp index 9373697e1..0e80949fe 100644 --- a/libethereum/Precompiled.cpp +++ b/libethereum/Precompiled.cpp @@ -22,8 +22,8 @@ #include "Precompiled.h" #include -#include -#include +#include +#include #include #include #include diff --git a/libethereum/State.cpp b/libethereum/State.cpp index 3bf7aaff7..d302e7381 100644 --- a/libethereum/State.cpp +++ b/libethereum/State.cpp @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/libethereum/State.h b/libethereum/State.h index d9fc9d2b5..971c2220a 100644 --- a/libethereum/State.h +++ b/libethereum/State.h @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/libethereum/Transaction.h b/libethereum/Transaction.h index 78852b7b8..09d6cd54c 100644 --- a/libethereum/Transaction.h +++ b/libethereum/Transaction.h @@ -22,7 +22,7 @@ #pragma once #include -#include +#include #include #include namespace dev diff --git a/libethereum/Utility.cpp b/libethereum/Utility.cpp index 7b0a961b2..adfea4a51 100644 --- a/libethereum/Utility.cpp +++ b/libethereum/Utility.cpp @@ -23,7 +23,7 @@ #include #include -#include +#include using namespace std; using namespace dev; using namespace dev::eth; diff --git a/libevm/ExtVMFace.h b/libevm/ExtVMFace.h index 48fbd0b01..8ebfd8fa5 100644 --- a/libevm/ExtVMFace.h +++ b/libevm/ExtVMFace.h @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/libevm/SmartVM.cpp b/libevm/SmartVM.cpp index 4f759a745..89397987e 100644 --- a/libevm/SmartVM.cpp +++ b/libevm/SmartVM.cpp @@ -21,7 +21,7 @@ #include "SmartVM.h" #include #include -#include +#include #include #include #include "VMFactory.h" diff --git a/libevm/VM.h b/libevm/VM.h index 668544f9d..181fcdc2e 100644 --- a/libevm/VM.h +++ b/libevm/VM.h @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include "VMFace.h" diff --git a/libevmasm/CommonSubexpressionEliminator.cpp b/libevmasm/CommonSubexpressionEliminator.cpp index 9f6f9dd63..b2fa73116 100644 --- a/libevmasm/CommonSubexpressionEliminator.cpp +++ b/libevmasm/CommonSubexpressionEliminator.cpp @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include diff --git a/libevmasm/KnownState.cpp b/libevmasm/KnownState.cpp index 0aac9cedb..895778ed1 100644 --- a/libevmasm/KnownState.cpp +++ b/libevmasm/KnownState.cpp @@ -23,7 +23,7 @@ #include "KnownState.h" #include -#include +#include #include using namespace std; diff --git a/libp2p/Host.cpp b/libp2p/Host.cpp index e2599c1d5..998579a90 100644 --- a/libp2p/Host.cpp +++ b/libp2p/Host.cpp @@ -31,7 +31,7 @@ #include #include #include -#include +#include #include "Session.h" #include "Common.h" #include "Capability.h" diff --git a/libp2p/UDP.h b/libp2p/UDP.h index b09d556e7..a455b5057 100644 --- a/libp2p/UDP.h +++ b/libp2p/UDP.h @@ -29,7 +29,7 @@ #include #include -#include +#include #include #include #include "Common.h" diff --git a/libsolidity/AST.cpp b/libsolidity/AST.cpp index 9842901e7..14884254e 100644 --- a/libsolidity/AST.cpp +++ b/libsolidity/AST.cpp @@ -28,7 +28,7 @@ #include #include -#include +#include using namespace std; diff --git a/libsolidity/CompilerStack.cpp b/libsolidity/CompilerStack.cpp index b3fedc45d..bffa4158f 100644 --- a/libsolidity/CompilerStack.cpp +++ b/libsolidity/CompilerStack.cpp @@ -31,7 +31,7 @@ #include #include -#include +#include using namespace std; diff --git a/libsolidity/ExpressionCompiler.cpp b/libsolidity/ExpressionCompiler.cpp index 838ee264e..2e513b7fc 100644 --- a/libsolidity/ExpressionCompiler.cpp +++ b/libsolidity/ExpressionCompiler.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/libsolidity/Types.cpp b/libsolidity/Types.cpp index d1f51decf..7577b83a1 100644 --- a/libsolidity/Types.cpp +++ b/libsolidity/Types.cpp @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include diff --git a/libtestutils/Common.cpp b/libtestutils/Common.cpp index 5767be32c..cff21d464 100644 --- a/libtestutils/Common.cpp +++ b/libtestutils/Common.cpp @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include "Common.h" using namespace std; diff --git a/libweb3jsonrpc/WebThreeStubServer.cpp b/libweb3jsonrpc/WebThreeStubServer.cpp index 5235b0c4f..44f7f521c 100644 --- a/libweb3jsonrpc/WebThreeStubServer.cpp +++ b/libweb3jsonrpc/WebThreeStubServer.cpp @@ -26,7 +26,7 @@ #include #include -#include +#include #include "WebThreeStubServer.h" using namespace std; diff --git a/libwhisper/Common.cpp b/libwhisper/Common.cpp index c29ac6bf6..dd9172c70 100644 --- a/libwhisper/Common.cpp +++ b/libwhisper/Common.cpp @@ -21,7 +21,7 @@ #include "Common.h" -#include +#include #include "Message.h" using namespace std; using namespace dev; diff --git a/libwhisper/Interface.h b/libwhisper/Interface.h index db595e21e..8b84193aa 100644 --- a/libwhisper/Interface.h +++ b/libwhisper/Interface.h @@ -29,7 +29,7 @@ #include #include -#include +#include #include "Common.h" #include "Message.h" diff --git a/libwhisper/Message.h b/libwhisper/Message.h index bd73df268..893602190 100644 --- a/libwhisper/Message.h +++ b/libwhisper/Message.h @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include "Common.h" namespace dev diff --git a/libwhisper/WhisperHost.h b/libwhisper/WhisperHost.h index ebbbcf8ed..cd427da35 100644 --- a/libwhisper/WhisperHost.h +++ b/libwhisper/WhisperHost.h @@ -30,7 +30,7 @@ #include #include #include -#include +#include #include "Common.h" #include "WhisperPeer.h" #include "Interface.h" diff --git a/libwhisper/WhisperPeer.h b/libwhisper/WhisperPeer.h index 8542e987d..ab9c8222a 100644 --- a/libwhisper/WhisperPeer.h +++ b/libwhisper/WhisperPeer.h @@ -29,7 +29,7 @@ #include #include -#include +#include #include "Common.h" #include "Message.h" diff --git a/mix/FileIo.cpp b/mix/FileIo.cpp index 22538194c..cf8300677 100644 --- a/mix/FileIo.cpp +++ b/mix/FileIo.cpp @@ -34,7 +34,7 @@ #include #include #include -#include +#include #include "FileIo.h" using namespace dev; diff --git a/mix/QFunctionDefinition.cpp b/mix/QFunctionDefinition.cpp index 13dbd4821..e6764d712 100644 --- a/mix/QFunctionDefinition.cpp +++ b/mix/QFunctionDefinition.cpp @@ -20,7 +20,7 @@ */ #include -#include +#include #include #include "QVariableDeclaration.h" #include "QFunctionDefinition.h" diff --git a/neth/main.cpp b/neth/main.cpp index 7ce64cba5..a6e661d2e 100644 --- a/neth/main.cpp +++ b/neth/main.cpp @@ -29,7 +29,7 @@ #include #include -#include +#include #include #include #include diff --git a/rlp/main.cpp b/rlp/main.cpp index 5f2f7f358..3924f9c44 100644 --- a/rlp/main.cpp +++ b/rlp/main.cpp @@ -25,7 +25,7 @@ #include "../test/JsonSpiritHeaders.h" #include #include -#include +#include using namespace std; using namespace dev; namespace js = json_spirit; diff --git a/test/deprecated/main.cpp b/test/deprecated/main.cpp index 6ec8885b3..6cb098228 100644 --- a/test/deprecated/main.cpp +++ b/test/deprecated/main.cpp @@ -20,7 +20,7 @@ * Main test functions. */ -#include +#include #include "TrieHash.h" #include "MemTrie.h" diff --git a/test/libdevcrypto/MemTrie.cpp b/test/libdevcrypto/MemTrie.cpp index ab5a13b60..4507d1d80 100644 --- a/test/libdevcrypto/MemTrie.cpp +++ b/test/libdevcrypto/MemTrie.cpp @@ -21,8 +21,8 @@ #include "MemTrie.h" -#include -#include +#include +#include #include using namespace std; using namespace dev; diff --git a/test/libdevcrypto/crypto.cpp b/test/libdevcrypto/crypto.cpp index 3381c45da..497887145 100644 --- a/test/libdevcrypto/crypto.cpp +++ b/test/libdevcrypto/crypto.cpp @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include diff --git a/test/libdevcrypto/hexPrefix.cpp b/test/libdevcrypto/hexPrefix.cpp index c72f24535..223f1ac7b 100644 --- a/test/libdevcrypto/hexPrefix.cpp +++ b/test/libdevcrypto/hexPrefix.cpp @@ -27,7 +27,7 @@ #include "../JsonSpiritHeaders.h" #include #include -#include +#include #include "../TestHelper.h" using namespace std; diff --git a/test/libdevcrypto/trie.cpp b/test/libdevcrypto/trie.cpp index ecfc515aa..3d6d493dd 100644 --- a/test/libdevcrypto/trie.cpp +++ b/test/libdevcrypto/trie.cpp @@ -27,8 +27,8 @@ #include "../JsonSpiritHeaders.h" #include -#include -#include +#include +#include #include "MemTrie.h" #include "../TestHelper.h" diff --git a/test/libethereum/blockchain.cpp b/test/libethereum/blockchain.cpp index 191b94cc3..4e98b4036 100644 --- a/test/libethereum/blockchain.cpp +++ b/test/libethereum/blockchain.cpp @@ -21,7 +21,7 @@ */ #include -#include +#include #include #include #include diff --git a/test/libp2p/rlpx.cpp b/test/libp2p/rlpx.cpp index 6a86652fb..620ddd952 100644 --- a/test/libp2p/rlpx.cpp +++ b/test/libp2p/rlpx.cpp @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index aa51a674d..90ce20d26 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -24,7 +24,7 @@ #include #include #include -#include +#include #include using namespace std; diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp index 4ec7b8bda..c52bbf9de 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -23,7 +23,7 @@ #include #include -#include +#include #include #include #include diff --git a/third/MainWin.cpp b/third/MainWin.cpp index 12625ffbc..3cfc016e3 100644 --- a/third/MainWin.cpp +++ b/third/MainWin.cpp @@ -32,7 +32,7 @@ #include #include #include -#include +#include #include #include #include From 715a63620bd9ac7a51164f45dec2a694962b7ab1 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Tue, 19 May 2015 20:04:48 +0200 Subject: [PATCH 286/461] Move OverlayDB (leveldb dependent) back into libdevcrypto. --- libdevcore/TrieDB.h | 1 - {libdevcore => libdevcrypto}/OverlayDB.cpp | 0 {libdevcore => libdevcrypto}/OverlayDB.h | 2 +- libethereum/CachedAddressState.cpp | 7 ++++--- libethereum/State.h | 1 + test/deprecated/main.cpp | 4 ---- 6 files changed, 6 insertions(+), 9 deletions(-) rename {libdevcore => libdevcrypto}/OverlayDB.cpp (100%) rename {libdevcore => libdevcrypto}/OverlayDB.h (97%) diff --git a/libdevcore/TrieDB.h b/libdevcore/TrieDB.h index 13a520311..f9d7bff5f 100644 --- a/libdevcore/TrieDB.h +++ b/libdevcore/TrieDB.h @@ -32,7 +32,6 @@ #include #include #include "MemoryDB.h" -#include "OverlayDB.h" #include "TrieCommon.h" namespace ldb = leveldb; diff --git a/libdevcore/OverlayDB.cpp b/libdevcrypto/OverlayDB.cpp similarity index 100% rename from libdevcore/OverlayDB.cpp rename to libdevcrypto/OverlayDB.cpp diff --git a/libdevcore/OverlayDB.h b/libdevcrypto/OverlayDB.h similarity index 97% rename from libdevcore/OverlayDB.h rename to libdevcrypto/OverlayDB.h index 2e5428bdf..b37d2c11b 100644 --- a/libdevcore/OverlayDB.h +++ b/libdevcrypto/OverlayDB.h @@ -29,7 +29,7 @@ #include #include #include -#include "MemoryDB.h" +#include namespace ldb = leveldb; namespace dev diff --git a/libethereum/CachedAddressState.cpp b/libethereum/CachedAddressState.cpp index 7c2f0a80c..757aef466 100644 --- a/libethereum/CachedAddressState.cpp +++ b/libethereum/CachedAddressState.cpp @@ -21,8 +21,9 @@ #include "CachedAddressState.h" -#include #include +#include +#include #include "Account.h" using namespace std; using namespace dev; @@ -57,8 +58,8 @@ std::unordered_map CachedAddressState::storage() const if (m_r) { SecureTrieDB memdb(const_cast(m_o), m_r[2].toHash()); // promise we won't alter the overlay! :) -// for (auto const& j: memdb) -// ret[j.first] = RLP(j.second).toInt(); + for (auto const& j: memdb) + ret[j.first] = RLP(j.second).toInt(); } if (m_s) for (auto const& j: m_s->storageOverlay()) diff --git a/libethereum/State.h b/libethereum/State.h index 971c2220a..f46d0e222 100644 --- a/libethereum/State.h +++ b/libethereum/State.h @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include diff --git a/test/deprecated/main.cpp b/test/deprecated/main.cpp index 6cb098228..47e96f337 100644 --- a/test/deprecated/main.cpp +++ b/test/deprecated/main.cpp @@ -20,10 +20,6 @@ * Main test functions. */ -#include -#include "TrieHash.h" -#include "MemTrie.h" - #include int trieTest(); From c4df26e82ed48138e5e8cf9323467f3113bc4506 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Tue, 19 May 2015 22:15:23 +0200 Subject: [PATCH 287/461] Actually load the DAG. --- alethzero/MainWin.cpp | 2 +- ethminer/MinerAux.h | 12 ++++++------ libethcore/EthashAux.cpp | 6 +++--- libethcore/EthashAux.h | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index b59e9ce1f..a09966679 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -1166,7 +1166,7 @@ void Main::on_turboMining_triggered() void Main::refreshBlockChain() { - if (!ui->blocks->isVisible()) + if (!ui->blocks->isVisible() || !isVisible()) return; DEV_TIMED_FUNCTION; diff --git a/ethminer/MinerAux.h b/ethminer/MinerAux.h index 8e480a3ff..53a5fa7e4 100644 --- a/ethminer/MinerAux.h +++ b/ethminer/MinerAux.h @@ -388,7 +388,7 @@ private: (void)_m; (void)_remote; (void)_recheckPeriod; - #if ETH_JSONRPC || !ETH_TRUE +#if ETH_JSONRPC || !ETH_TRUE jsonrpc::HttpClient client(_remote); Farm rpc(client); @@ -399,7 +399,7 @@ private: f.startGPU(); ProofOfWork::WorkPackage current; - EthashAux::FullType dag; + EthashAux::FullType dag; while (true) try { @@ -418,9 +418,9 @@ private: cnote << "Getting work package..."; Json::Value v = rpc.eth_getWork(); h256 hh(v[0].asString()); - h256 newSeedHash(v[1].asString()); - if (!(dag = EthashAux::full(newSeedHash, true))) - BOOST_THROW_EXCEPTION(DAGCreationFailure()); + h256 newSeedHash(v[1].asString()); + if (!(dag = EthashAux::full(newSeedHash, true, [&](unsigned _pc){ cout << "\rCreating DAG. " << _pc << "% done..." << flush; return 0; }))) + BOOST_THROW_EXCEPTION(DAGCreationFailure()); if (hh != current.headerHash) { current.headerHash = hh; @@ -459,7 +459,7 @@ private: cerr << "JSON-RPC problem. Probably couldn't connect. Retrying in " << i << "... \r"; cerr << endl; } - #endif +#endif exit(0); } diff --git a/libethcore/EthashAux.cpp b/libethcore/EthashAux.cpp index 38425aca2..a94c1237d 100644 --- a/libethcore/EthashAux.cpp +++ b/libethcore/EthashAux.cpp @@ -167,7 +167,7 @@ EthashAux::FullType EthashAux::full(h256 const& _seedHash, bool _createIfMissing return ret; } - if (_createIfMissing || computeFull(_seedHash) == 100) + if (_createIfMissing || computeFull(_seedHash, false) == 100) { s_dagCallback = _f; cnote << "Loading from libethash..."; @@ -183,7 +183,7 @@ EthashAux::FullType EthashAux::full(h256 const& _seedHash, bool _createIfMissing #define DEV_IF_THROWS(X) try { X; } catch (...) -unsigned EthashAux::computeFull(h256 const& _seedHash) +unsigned EthashAux::computeFull(h256 const& _seedHash, bool _createIfMissing) { Guard l(get()->x_fulls); uint64_t blockNumber; @@ -199,7 +199,7 @@ unsigned EthashAux::computeFull(h256 const& _seedHash) return 100; } - if (!get()->m_fullGenerator || !get()->m_fullGenerator->joinable()) + if (_createIfMissing && (!get()->m_fullGenerator || !get()->m_fullGenerator->joinable())) { get()->m_fullProgress = 0; get()->m_generatingFullNumber = blockNumber / ETHASH_EPOCH_LENGTH * ETHASH_EPOCH_LENGTH; diff --git a/libethcore/EthashAux.h b/libethcore/EthashAux.h index b09f6465f..e6fed519f 100644 --- a/libethcore/EthashAux.h +++ b/libethcore/EthashAux.h @@ -71,7 +71,7 @@ public: static const uint64_t NotGenerating = (uint64_t)-1; /// Kicks off generation of DAG for @a _seedHash and @returns false or @returns true if ready. - static unsigned computeFull(h256 const& _seedHash); + static unsigned computeFull(h256 const& _seedHash, bool _createIfMissing = true); /// Information on the generation progress. static std::pair fullGeneratingProgress() { return std::make_pair(get()->m_generatingFullNumber, get()->m_fullProgress); } /// Kicks off generation of DAG for @a _blocknumber and blocks until ready; @returns result or empty pointer if not existing and _createIfMissing is false. From c4b044d9263b7f425a0dd8acf080f61a5d082624 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Tue, 19 May 2015 22:47:07 +0200 Subject: [PATCH 288/461] Improve AZ & eth latency. --- libethereum/BlockChain.cpp | 6 ++++-- libethereum/Client.cpp | 7 ++++++- libethereum/Client.h | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/libethereum/BlockChain.cpp b/libethereum/BlockChain.cpp index c46127303..e23fde6b6 100644 --- a/libethereum/BlockChain.cpp +++ b/libethereum/BlockChain.cpp @@ -96,7 +96,7 @@ ldb::Slice dev::eth::toSlice(h256 const& _h, unsigned _sub) #endif } -#if ETH_DEBUG +#if ETH_DEBUG&&0 static const chrono::system_clock::duration c_collectionDuration = chrono::seconds(15); static const unsigned c_collectionQueueSize = 2; static const unsigned c_maxCacheSize = 1024 * 1024 * 1; @@ -318,7 +318,9 @@ tuple BlockChain::sync(BlockQueue& _bq, OverlayDB const& _st try { // Nonce & uncle nonces already verified thread at this point. - auto r = import(block.first, block.second, _stateDB, ImportRequirements::Default & ~ImportRequirements::ValidNonce & ~ImportRequirements::CheckUncles); + ImportRoute r; + DEV_TIMED_ABOVE(Block import, 500) + r = import(block.first, block.second, _stateDB, ImportRequirements::Default & ~ImportRequirements::ValidNonce & ~ImportRequirements::CheckUncles); fresh += r.first; dead += r.second; } diff --git a/libethereum/Client.cpp b/libethereum/Client.cpp index 97118a7a9..e39126713 100644 --- a/libethereum/Client.cpp +++ b/libethereum/Client.cpp @@ -172,6 +172,7 @@ Client::Client(p2p::Host* _extNet, std::string const& _dbPath, WithExisting _for m_preMine(m_stateDB, BaseState::CanonGenesis), m_postMine(m_stateDB) { + m_lastGetWork = std::chrono::system_clock::now() - chrono::seconds(30); m_tqReady = m_tq.onReady([=](){ this->onTransactionQueueReady(); }); // TODO: should read m_tq->onReady(thisThread, syncTransactionQueue); m_bqReady = m_bq.onReady([=](){ this->onBlockQueueReady(); }); // TODO: should read m_bq->onReady(thisThread, syncBlockQueue); m_farm.onSolutionFound([=](ProofOfWork::Solution const& s){ return this->submitWork(s); }); @@ -197,6 +198,7 @@ Client::Client(p2p::Host* _extNet, std::shared_ptr _gp, std::string c m_preMine(m_stateDB), m_postMine(m_stateDB) { + m_lastGetWork = std::chrono::system_clock::now() - chrono::seconds(30); m_tqReady = m_tq.onReady([=](){ this->onTransactionQueueReady(); }); // TODO: should read m_tq->onReady(thisThread, syncTransactionQueue); m_bqReady = m_bq.onReady([=](){ this->onBlockQueueReady(); }); // TODO: should read m_bq->onReady(thisThread, syncBlockQueue); m_farm.onSolutionFound([=](ProofOfWork::Solution const& s){ return this->submitWork(s); }); @@ -484,7 +486,7 @@ void Client::syncBlockQueue() cwork << "BQ ==> CHAIN ==> STATE"; { - tie(ir.first, ir.second, m_syncBlockQueue) = m_bc.sync(m_bq, m_stateDB, 10); + tie(ir.first, ir.second, m_syncBlockQueue) = m_bc.sync(m_bq, m_stateDB, rand() % 90 + 10); if (ir.first.empty()) return; } @@ -601,6 +603,9 @@ void Client::onChainChanged(ImportRoute const& _ir) bool Client::remoteActive() const { + cnote << chrono::duration_cast(chrono::system_clock::now().time_since_epoch()).count(); + cnote << chrono::duration_cast(m_lastGetWork.time_since_epoch()).count(); + cnote << chrono::duration_cast(chrono::system_clock::now() - m_lastGetWork).count(); return chrono::system_clock::now() - m_lastGetWork < chrono::seconds(30); } diff --git a/libethereum/Client.h b/libethereum/Client.h index 7eeb7fb2d..4fa6da8b1 100644 --- a/libethereum/Client.h +++ b/libethereum/Client.h @@ -289,7 +289,7 @@ private: BlockInfo m_miningInfo; ///< The header we're attempting to mine on (derived from m_postMine). bool remoteActive() const; ///< Is there an active and valid remote worker? bool m_remoteWorking = false; ///< Has the remote worker recently been reset? - std::chrono::system_clock::time_point m_lastGetWork = std::chrono::system_clock::time_point::min(); ///< Is there an active and valid remote worker? + std::chrono::system_clock::time_point m_lastGetWork; ///< Is there an active and valid remote worker? std::weak_ptr m_host; ///< Our Ethereum Host. Don't do anything if we can't lock. From 3c58d68fe28c9a4fd9eeb21aa432225c5e947bc7 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Tue, 19 May 2015 22:47:59 +0200 Subject: [PATCH 289/461] Quieter timing reporting. --- alethzero/MainWin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index a09966679..076e9d547 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -1169,7 +1169,7 @@ void Main::refreshBlockChain() if (!ui->blocks->isVisible() || !isVisible()) return; - DEV_TIMED_FUNCTION; + DEV_TIMED_FUNCTION_ABOVE(500); cwatch << "refreshBlockChain()"; // TODO: keep the same thing highlighted. From 742f2dbcc8691581400be7ef2f5202046b5c321a Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Tue, 19 May 2015 23:04:54 +0200 Subject: [PATCH 290/461] Build fix. --- libdevcore/Common.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libdevcore/Common.h b/libdevcore/Common.h index 240746302..ac4d89103 100644 --- a/libdevcore/Common.h +++ b/libdevcore/Common.h @@ -201,7 +201,7 @@ private: #endif #define DEV_TIMED_ABOVE(S, MS) for (::std::pair<::dev::TimerHelper, bool> __eth_t(::dev::TimerHelper(#S, MS), true); __eth_t.second; __eth_t.second = false) -#define DEV_TIMED_SCOPE_ABOVE(S) ::dev::TimerHelper __eth_t(S, MS) +#define DEV_TIMED_SCOPE_ABOVE(S, MS) ::dev::TimerHelper __eth_t(S, MS) #if WIN32 #define DEV_TIMED_FUNCTION_ABOVE(MS) DEV_TIMED_SCOPE_ABOVE(__FUNCSIG__, MS) #else From ce205f382cb1f2964f1edcbbb08e43e93bd200c9 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Tue, 19 May 2015 23:22:44 +0200 Subject: [PATCH 291/461] Remote mining fixes. --- alethzero/MainWin.cpp | 2 +- ethminer/MinerAux.h | 2 ++ libethereum/BlockQueue.h | 2 +- libethereum/Client.cpp | 8 +++++++- libethereum/Client.h | 3 +++ 5 files changed, 14 insertions(+), 3 deletions(-) diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index 076e9d547..4f236b3e8 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -1166,7 +1166,7 @@ void Main::on_turboMining_triggered() void Main::refreshBlockChain() { - if (!ui->blocks->isVisible() || !isVisible()) + if (!ui->blocks->isVisible() && isVisible()) return; DEV_TIMED_FUNCTION_ABOVE(500); diff --git a/ethminer/MinerAux.h b/ethminer/MinerAux.h index 53a5fa7e4..d99e36976 100644 --- a/ethminer/MinerAux.h +++ b/ethminer/MinerAux.h @@ -419,6 +419,8 @@ private: Json::Value v = rpc.eth_getWork(); h256 hh(v[0].asString()); h256 newSeedHash(v[1].asString()); + if (current.seedHash != newSeedHash) + cnote << "Grabbing DAG for" << newSeedHash; if (!(dag = EthashAux::full(newSeedHash, true, [&](unsigned _pc){ cout << "\rCreating DAG. " << _pc << "% done..." << flush; return 0; }))) BOOST_THROW_EXCEPTION(DAGCreationFailure()); if (hh != current.headerHash) diff --git a/libethereum/BlockQueue.h b/libethereum/BlockQueue.h index c865bac32..d0437739d 100644 --- a/libethereum/BlockQueue.h +++ b/libethereum/BlockQueue.h @@ -94,7 +94,7 @@ public: void retryAllUnknown(); /// Get information on the items queued. - std::pair items() const { ReadGuard l(m_lock); return std::make_pair(m_verified.size(), m_unknown.size()); } + std::pair items() const { ReadGuard l(m_lock); return std::make_pair(m_readySet.size(), m_unknownSet.size()); } /// Clear everything. void clear() { WriteGuard l(m_lock); DEV_INVARIANT_CHECK; Guard l2(m_verification); m_readySet.clear(); m_drainingSet.clear(); m_verified.clear(); m_unverified.clear(); m_unknownSet.clear(); m_unknown.clear(); m_future.clear(); } diff --git a/libethereum/Client.cpp b/libethereum/Client.cpp index e39126713..0fd27520d 100644 --- a/libethereum/Client.cpp +++ b/libethereum/Client.cpp @@ -455,8 +455,13 @@ ProofOfWork::WorkPackage Client::getWork() { // lock the work so a later submission isn't invalidated by processing a transaction elsewhere. // this will be reset as soon as a new block arrives, allowing more transactions to be processed. + bool oldShould = shouldServeWork(); m_lastGetWork = chrono::system_clock::now(); m_remoteWorking = true; + + // if this request has made us bother to serve work, prep it now. + if (!oldShould && shouldServeWork()) + onPostStateChanged(); return ProofOfWork::package(m_miningInfo); } @@ -612,7 +617,8 @@ bool Client::remoteActive() const void Client::onPostStateChanged() { cnote << "Post state changed"; - if (isMining() || remoteActive()) + + if (m_bq.items().first == 0 && (isMining() || remoteActive())) { cnote << "Restarting mining..."; DEV_WRITE_GUARDED(x_working) diff --git a/libethereum/Client.h b/libethereum/Client.h index 4fa6da8b1..c77cb6034 100644 --- a/libethereum/Client.h +++ b/libethereum/Client.h @@ -274,6 +274,9 @@ private: /// Ticks various system-level objects. void tick(); + /// @returns true only if it's worth bothering to prep the mining block. + bool shouldServeWork() const { return m_bq.items().first == 0 && (isMining() || remoteActive()); } + VersionChecker m_vc; ///< Dummy object to check & update the protocol version. CanonBlockChain m_bc; ///< Maintains block database. BlockQueue m_bq; ///< Maintains a list of incoming blocks not yet on the blockchain (to be imported). From cfb9bd15b02e0d7c914cb00b8216d44089b11b37 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Tue, 19 May 2015 23:29:13 +0200 Subject: [PATCH 292/461] Tidy up notifications. --- alethzero/MainWin.cpp | 2 +- libethcore/Miner.h | 10 ++++------ libethereum/Client.cpp | 5 +---- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index 4f236b3e8..07f48c0bc 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -1353,7 +1353,7 @@ void Main::timerEvent(QTimerEvent*) auto ls = ethereum()->checkWatchSafe(i.first); if (ls.size()) { - cnote << "FIRING WATCH" << i.first << ls.size(); +// cnote << "FIRING WATCH" << i.first << ls.size(); i.second(ls); } } diff --git a/libethcore/Miner.h b/libethcore/Miner.h index 3a68491ff..cede34475 100644 --- a/libethcore/Miner.h +++ b/libethcore/Miner.h @@ -107,12 +107,10 @@ public: } if (!!_work) { - boost::timer t; - pause(); - cdebug << "pause took" << t.elapsed(); - t.restart(); - kickOff(); - cdebug << "kickOff took" << t.elapsed(); + DEV_TIMED_ABOVE(pause, 250) + pause(); + DEV_TIMED_ABOVE(kickOff, 250) + kickOff(); } else if (!_work && !!old) pause(); diff --git a/libethereum/Client.cpp b/libethereum/Client.cpp index 0fd27520d..f10eda55a 100644 --- a/libethereum/Client.cpp +++ b/libethereum/Client.cpp @@ -608,9 +608,6 @@ void Client::onChainChanged(ImportRoute const& _ir) bool Client::remoteActive() const { - cnote << chrono::duration_cast(chrono::system_clock::now().time_since_epoch()).count(); - cnote << chrono::duration_cast(m_lastGetWork.time_since_epoch()).count(); - cnote << chrono::duration_cast(chrono::system_clock::now() - m_lastGetWork).count(); return chrono::system_clock::now() - m_lastGetWork < chrono::seconds(30); } @@ -647,7 +644,7 @@ void Client::noteChanged(h256Hash const& _filters) { Guard l(x_filtersWatches); if (_filters.size()) - filtersStreamOut(cnote << "noteChanged:", _filters); + filtersStreamOut(cwatch << "noteChanged:", _filters); // accrue all changes left in each filter into the watches. for (auto& w: m_watches) if (_filters.count(w.second.id)) From 31c6ee40f6a752558ce35e0b1f10a0c12a66c676 Mon Sep 17 00:00:00 2001 From: chriseth Date: Wed, 20 May 2015 00:27:07 +0200 Subject: [PATCH 293/461] Gas estimation taking known state into account. --- libevmasm/Assembly.cpp | 1 + libevmasm/AssemblyItem.h | 6 + libevmasm/GasMeter.cpp | 132 ++++++++++++++++-- libevmasm/GasMeter.h | 27 +++- libevmasm/KnownState.cpp | 13 +- libevmasm/KnownState.h | 4 + libsolidity/ASTVisitor.h | 20 +++ libsolidity/CompilerStack.cpp | 38 ++--- libsolidity/CompilerStack.h | 5 +- libsolidity/StructuralGasEstimator.cpp | 39 +++++- libsolidity/StructuralGasEstimator.h | 4 + test/{ => libsolidity}/GasMeter.cpp | 60 +++++++- test/libsolidity/solidityExecutionFramework.h | 11 +- 13 files changed, 315 insertions(+), 45 deletions(-) rename test/{ => libsolidity}/GasMeter.cpp (66%) diff --git a/libevmasm/Assembly.cpp b/libevmasm/Assembly.cpp index 6f38b0f42..5cf3b787a 100644 --- a/libevmasm/Assembly.cpp +++ b/libevmasm/Assembly.cpp @@ -431,6 +431,7 @@ bytes Assembly::assemble() const case PushSubSize: { auto s = m_data[i.data()].size(); + i.setPushedValue(u256(s)); byte b = max(1, dev::bytesRequired(s)); ret.push_back((byte)Instruction::PUSH1 - 1 + b); ret.resize(ret.size() + b); diff --git a/libevmasm/AssemblyItem.h b/libevmasm/AssemblyItem.h index b3012a7ea..7d8f3d9a4 100644 --- a/libevmasm/AssemblyItem.h +++ b/libevmasm/AssemblyItem.h @@ -84,11 +84,17 @@ public: JumpType getJumpType() const { return m_jumpType; } std::string getJumpTypeAsString() const; + void setPushedValue(u256 const& _value) const { m_pushedValue = std::make_shared(_value); } + u256 const* pushedValue() const { return m_pushedValue.get(); } + private: AssemblyItemType m_type; u256 m_data; SourceLocation m_location; JumpType m_jumpType = JumpType::Ordinary; + /// Pushed value for operations with data to be determined during assembly stage, + /// e.g. PushSubSize, PushTag, PushSub, etc. + mutable std::shared_ptr m_pushedValue; }; using AssemblyItems = std::vector; diff --git a/libevmasm/GasMeter.cpp b/libevmasm/GasMeter.cpp index e5fb0e09a..a8dc4dd58 100644 --- a/libevmasm/GasMeter.cpp +++ b/libevmasm/GasMeter.cpp @@ -20,6 +20,7 @@ */ #include "GasMeter.h" +#include #include using namespace std; @@ -41,55 +42,162 @@ GasMeter::GasConsumption& GasMeter::GasConsumption::operator+=(GasConsumption co GasMeter::GasConsumption GasMeter::estimateMax(AssemblyItem const& _item) { - switch (_item.type()) { + GasConsumption gas; + switch (_item.type()) + { case Push: case PushTag: - return runGas(Instruction::PUSH1); + case PushData: + case PushString: + case PushSub: + case PushSubSize: + case PushProgramSize: + gas = runGas(Instruction::PUSH1); + break; case Tag: - return runGas(Instruction::JUMPDEST); + gas = runGas(Instruction::JUMPDEST); + break; case Operation: { - GasConsumption gas = runGas(_item.instruction()); + ExpressionClasses& classes = m_state->expressionClasses(); + gas = runGas(_item.instruction()); switch (_item.instruction()) { case Instruction::SSTORE: - // @todo logic can be improved - gas += c_sstoreSetGas; + { + ExpressionClasses::Id slot = m_state->relativeStackElement(0); + ExpressionClasses::Id value = m_state->relativeStackElement(-1); + if (classes.knownZero(value) || ( + m_state->storageContent().count(slot) && + classes.knownNonZero(m_state->storageContent().at(slot)) + )) + gas += c_sstoreResetGas; //@todo take refunds into account + else + gas += c_sstoreSetGas; break; + } case Instruction::SLOAD: gas += c_sloadGas; break; + case Instruction::RETURN: + gas += memoryGas(0, -1); + break; + case Instruction::MLOAD: case Instruction::MSTORE: + gas += memoryGas(classes.find(eth::Instruction::ADD, { + m_state->relativeStackElement(0), + classes.find(AssemblyItem(32)) + })); + break; case Instruction::MSTORE8: - case Instruction::MLOAD: - case Instruction::RETURN: + gas += memoryGas(classes.find(eth::Instruction::ADD, { + m_state->relativeStackElement(0), + classes.find(AssemblyItem(1)) + })); + break; case Instruction::SHA3: + gas = c_sha3Gas; + gas += wordGas(c_sha3WordGas, m_state->relativeStackElement(-1)); + gas += memoryGas(0, -1); + break; case Instruction::CALLDATACOPY: case Instruction::CODECOPY: + gas += memoryGas(0, -2); + gas += wordGas(c_copyGas, m_state->relativeStackElement(-2)); + break; case Instruction::EXTCODECOPY: + gas += memoryGas(-1, -3); + gas += wordGas(c_copyGas, m_state->relativeStackElement(-3)); + break; case Instruction::LOG0: case Instruction::LOG1: case Instruction::LOG2: case Instruction::LOG3: case Instruction::LOG4: + { + unsigned n = unsigned(_item.instruction()) - unsigned(Instruction::LOG0); + gas = c_logGas + c_logTopicGas * n; + gas += memoryGas(0, -1); + if (u256 const* value = classes.knownConstant(m_state->relativeStackElement(-1))) + gas += c_logDataGas * (*value); + else + gas = GasConsumption::infinite(); + break; + } case Instruction::CALL: case Instruction::CALLCODE: + gas = c_callGas; + if (u256 const* value = classes.knownConstant(m_state->relativeStackElement(0))) + gas += (*value); + else + gas = GasConsumption::infinite(); + if (_item.instruction() != Instruction::CALLCODE) + gas += c_callNewAccountGas; // We very rarely know whether the address exists. + if (!classes.knownZero(m_state->relativeStackElement(-2))) + gas += c_callValueTransferGas; + gas += memoryGas(-3, -4); + gas += memoryGas(-5, -6); + break; case Instruction::CREATE: + gas = c_createGas; + gas += memoryGas(-1, -2); + break; case Instruction::EXP: - // @todo logic can be improved - gas = GasConsumption::infinite(); + gas = c_expGas; + if (u256 const* value = classes.knownConstant(m_state->relativeStackElement(-1))) + gas += c_expByteGas * (32 - (h256(*value).firstBitSet() / 8)); + else + gas = GasConsumption::infinite(); break; default: break; } - return gas; break; } default: + gas = GasConsumption::infinite(); break; } - return GasConsumption::infinite(); + m_state->feedItem(_item); + return gas; +} + +GasMeter::GasConsumption GasMeter::wordGas(u256 const& _multiplier, ExpressionClasses::Id _position) +{ + u256 const* value = m_state->expressionClasses().knownConstant(_position); + if (!value) + return GasConsumption::infinite(); + return GasConsumption(_multiplier * ((*value + 31) / 32)); +} + +GasMeter::GasConsumption GasMeter::memoryGas(ExpressionClasses::Id _position) +{ + u256 const* value = m_state->expressionClasses().knownConstant(_position); + if (!value) + return GasConsumption::infinite(); + if (*value < m_largestMemoryAccess) + return GasConsumption(u256(0)); + u256 previous = m_largestMemoryAccess; + m_largestMemoryAccess = *value; + auto memGas = [](u256 const& pos) -> u256 + { + u256 size = (pos + 31) / 32; + return c_memoryGas * size + size * size / c_quadCoeffDiv; + }; + return memGas(*value) - memGas(previous); +} + +GasMeter::GasConsumption GasMeter::memoryGas(int _stackPosOffset, int _stackPosSize) +{ + ExpressionClasses& classes = m_state->expressionClasses(); + if (classes.knownZero(m_state->relativeStackElement(_stackPosSize))) + return GasConsumption(0); + else + return memoryGas(classes.find(eth::Instruction::ADD, { + m_state->relativeStackElement(_stackPosOffset), + m_state->relativeStackElement(_stackPosSize) + })); } GasMeter::GasConsumption GasMeter::runGas(Instruction _instruction) diff --git a/libevmasm/GasMeter.h b/libevmasm/GasMeter.h index 63dbc1380..ab6d5613b 100644 --- a/libevmasm/GasMeter.h +++ b/libevmasm/GasMeter.h @@ -22,6 +22,7 @@ #pragma once #include +#include #include namespace dev @@ -29,8 +30,13 @@ namespace dev namespace eth { +class KnownState; + /** * Class that helps computing the maximum gas consumption for instructions. + * Has to be initialized with a certain known state that will be automatically updated for + * each call to estimateMax. These calls have to supply strictly subsequent AssemblyItems. + * A new gas meter has to be constructed (with a new state) for control flow changes. */ class GasMeter { @@ -47,11 +53,28 @@ public: bool isInfinite; }; - /// Returns an upper bound on the gas consumed by the given instruction. + /// Constructs a new gas meter given the current state. + GasMeter(std::shared_ptr const& _state): m_state(_state) {} + + /// @returns an upper bound on the gas consumed by the given instruction and updates + /// the state. GasConsumption estimateMax(AssemblyItem const& _item); private: + /// @returns _multiplier * (_value + 31) / 32, if _value is a known constant and infinite otherwise. + GasConsumption wordGas(u256 const& _multiplier, ExpressionClasses::Id _value); + /// @returns the gas needed to access the given memory position. + /// @todo this assumes that memory was never accessed before and thus over-estimates gas usage. + GasConsumption memoryGas(ExpressionClasses::Id _position); + /// @returns the memory gas for accessing the memory at a specific offset for a number of bytes + /// given as values on the stack at the given relative positions. + GasConsumption memoryGas(int _stackPosOffset, int _stackPosSize); + static GasConsumption runGas(Instruction _instruction); + + std::shared_ptr m_state; + /// Largest point where memory was accessed since the creation of this object. + u256 m_largestMemoryAccess; }; inline std::ostream& operator<<(std::ostream& _str, GasMeter::GasConsumption const& _consumption) @@ -59,7 +82,7 @@ inline std::ostream& operator<<(std::ostream& _str, GasMeter::GasConsumption con if (_consumption.isInfinite) return _str << "inf"; else - return _str << _consumption.value; + return _str << std::dec << _consumption.value; } diff --git a/libevmasm/KnownState.cpp b/libevmasm/KnownState.cpp index 895778ed1..d62dbf17e 100644 --- a/libevmasm/KnownState.cpp +++ b/libevmasm/KnownState.cpp @@ -92,7 +92,11 @@ KnownState::StoreOperation KnownState::feedItem(AssemblyItem const& _item, bool else if (_item.type() != Operation) { assertThrow(_item.deposit() == 1, InvalidDeposit, ""); - setStackElement(++m_stackHeight, m_expressionClasses->find(_item, {}, _copyItem)); + if (_item.pushedValue()) + // only available after assembly stage, should not be used for optimisation + setStackElement(++m_stackHeight, m_expressionClasses->find(*_item.pushedValue())); + else + setStackElement(++m_stackHeight, m_expressionClasses->find(_item, {}, _copyItem)); } else { @@ -230,7 +234,12 @@ ExpressionClasses::Id KnownState::stackElement(int _stackHeight, SourceLocation return m_stackElements.at(_stackHeight); // Stack element not found (not assigned yet), create new unknown equivalence class. return m_stackElements[_stackHeight] = - m_expressionClasses->find(AssemblyItem(UndefinedItem, _stackHeight, _location)); + m_expressionClasses->find(AssemblyItem(UndefinedItem, _stackHeight, _location)); +} + +KnownState::Id KnownState::relativeStackElement(int _stackOffset, SourceLocation const& _location) +{ + return stackElement(m_stackHeight + _stackOffset, _location); } void KnownState::clearTagUnions() diff --git a/libevmasm/KnownState.h b/libevmasm/KnownState.h index 3505df74f..9d28ef21a 100644 --- a/libevmasm/KnownState.h +++ b/libevmasm/KnownState.h @@ -111,6 +111,8 @@ public: /// Retrieves the current equivalence class fo the given stack element (or generates a new /// one if it does not exist yet). Id stackElement(int _stackHeight, SourceLocation const& _location); + /// @returns the stackElement relative to the current stack height. + Id relativeStackElement(int _stackOffset, SourceLocation const& _location = SourceLocation()); /// @returns its set of tags if the given expression class is a known tag union; returns a set /// containing the tag if it is a PushTag expression and the empty set otherwise. @@ -123,6 +125,8 @@ public: std::map const& stackElements() const { return m_stackElements; } ExpressionClasses& expressionClasses() const { return *m_expressionClasses; } + std::map const& storageContent() const { return m_storageContent; } + private: /// Assigns a new equivalence class to the next sequence number of the given stack element. void setStackElement(int _stackHeight, Id _class); diff --git a/libsolidity/ASTVisitor.h b/libsolidity/ASTVisitor.h index fbda50791..f78472208 100644 --- a/libsolidity/ASTVisitor.h +++ b/libsolidity/ASTVisitor.h @@ -220,6 +220,26 @@ protected: virtual void endVisitNode(ASTNode const&) { } }; +/** + * Utility class that accepts std::functions and calls them for visitNode and endVisitNode. + */ +class SimpleASTVisitor: public ASTConstVisitor +{ +public: + SimpleASTVisitor( + std::function _onVisit, + std::function _onEndVisit + ): m_onVisit(_onVisit), m_onEndVisit(_onEndVisit) {} + +protected: + virtual bool visitNode(ASTNode const& _n) override { return m_onVisit ? m_onVisit(_n) : true; } + virtual void endVisitNode(ASTNode const& _n) override { m_onEndVisit(_n); } + +private: + std::function m_onVisit; + std::function m_onEndVisit; +}; + /** * Utility class that visits the AST in depth-first order and calls a function on each node and each edge. * Child nodes are only visited if the node callback of the parent returns true. diff --git a/libsolidity/CompilerStack.cpp b/libsolidity/CompilerStack.cpp index bffa4158f..4f9764075 100644 --- a/libsolidity/CompilerStack.cpp +++ b/libsolidity/CompilerStack.cpp @@ -55,12 +55,29 @@ const map StandardSources = map{ }; CompilerStack::CompilerStack(bool _addStandardSources): - m_addStandardSources(_addStandardSources), m_parseSuccessful(false) + m_parseSuccessful(false) { - if (m_addStandardSources) + if (_addStandardSources) addSources(StandardSources, true); // add them as libraries } +void CompilerStack::reset(bool _keepSources, bool _addStandardSources) +{ + m_parseSuccessful = false; + if (_keepSources) + for (auto sourcePair: m_sources) + sourcePair.second.reset(); + else + { + m_sources.clear(); + if (_addStandardSources) + addSources(StandardSources, true); + } + m_globalContext.reset(); + m_sourceOrder.clear(); + m_contracts.clear(); +} + bool CompilerStack::addSource(string const& _name, string const& _content, bool _isLibrary) { bool existed = m_sources.count(_name) != 0; @@ -269,23 +286,6 @@ tuple CompilerStack::positionFromSourceLocation(SourceLocati return make_tuple(++startLine, ++startColumn, ++endLine, ++endColumn); } -void CompilerStack::reset(bool _keepSources) -{ - m_parseSuccessful = false; - if (_keepSources) - for (auto sourcePair: m_sources) - sourcePair.second.reset(); - else - { - m_sources.clear(); - if (m_addStandardSources) - addSources(StandardSources, true); - } - m_globalContext.reset(); - m_sourceOrder.clear(); - m_contracts.clear(); -} - void CompilerStack::resolveImports() { // topological sorting (depth first search) of the import graph, cutting potential cycles diff --git a/libsolidity/CompilerStack.h b/libsolidity/CompilerStack.h index 2ad791f22..0bc109a26 100644 --- a/libsolidity/CompilerStack.h +++ b/libsolidity/CompilerStack.h @@ -72,6 +72,9 @@ public: /// Creates a new compiler stack. Adds standard sources if @a _addStandardSources. explicit CompilerStack(bool _addStandardSources = true); + /// Resets the compiler to a state where the sources are not parsed or even removed. + void reset(bool _keepSources = false, bool _addStandardSources = true); + /// Adds a source object (e.g. file) to the parser. After this, parse has to be called again. /// @returns true if a source object by the name already existed and was replaced. void addSources(StringMap const& _nameContents, bool _isLibrary = false) { for (auto const& i: _nameContents) addSource(i.first, i.second, _isLibrary); } @@ -165,13 +168,11 @@ private: Contract(); }; - void reset(bool _keepSources = false); void resolveImports(); Contract const& getContract(std::string const& _contractName = "") const; Source const& getSource(std::string const& _sourceName = "") const; - bool m_addStandardSources; ///< If true, standard sources are added. bool m_parseSuccessful; std::map m_sources; std::shared_ptr m_globalContext; diff --git a/libsolidity/StructuralGasEstimator.cpp b/libsolidity/StructuralGasEstimator.cpp index ececd7116..9ce32ca54 100644 --- a/libsolidity/StructuralGasEstimator.cpp +++ b/libsolidity/StructuralGasEstimator.cpp @@ -23,6 +23,9 @@ #include "StructuralGasEstimator.h" #include #include +#include +#include +#include #include #include @@ -38,14 +41,23 @@ StructuralGasEstimator::ASTGasConsumptionSelfAccumulated StructuralGasEstimator: { solAssert(std::count(_ast.begin(), _ast.end(), nullptr) == 0, ""); map particularCosts; - GasMeter meter; - for (auto const& item: _items) - particularCosts[item.getLocation()] += meter.estimateMax(item); + ControlFlowGraph cfg(_items); + for (BasicBlock const& block: cfg.optimisedBlocks()) + { + assertThrow(!!block.startState, OptimizerException, ""); + GasMeter meter(block.startState->copy()); + auto const end = _items.begin() + block.end; + for (auto iter = _items.begin() + block.begin; iter != end; ++iter) + particularCosts[iter->getLocation()] += meter.estimateMax(*iter); + } + set finestNodes = finestNodesAtLocation(_ast); ASTGasConsumptionSelfAccumulated gasCosts; auto onNode = [&](ASTNode const& _node) { + if (!finestNodes.count(&_node)) + return true; gasCosts[&_node][0] = gasCosts[&_node][1] = particularCosts[_node.getLocation()]; return true; }; @@ -108,3 +120,24 @@ map StructuralGasEstimator::breakToSta // gasCosts should only contain non-overlapping locations return gasCosts; } + +set StructuralGasEstimator::finestNodesAtLocation( + vector const& _roots +) +{ + map locations; + set nodes; + SimpleASTVisitor visitor(function(), [&](ASTNode const& _n) + { + if (!locations.count(_n.getLocation())) + { + locations[_n.getLocation()] = &_n; + nodes.insert(&_n); + } + }); + + for (ASTNode const* root: _roots) + root->accept(visitor); + return nodes; +} + diff --git a/libsolidity/StructuralGasEstimator.h b/libsolidity/StructuralGasEstimator.h index df1ae509d..ddc7c186c 100644 --- a/libsolidity/StructuralGasEstimator.h +++ b/libsolidity/StructuralGasEstimator.h @@ -56,6 +56,10 @@ public: ASTGasConsumptionSelfAccumulated const& _gasCosts, std::vector const& _roots ); + +private: + /// @returns the set of AST nodes which are the finest nodes at their location. + std::set finestNodesAtLocation(std::vector const& _roots); }; } diff --git a/test/GasMeter.cpp b/test/libsolidity/GasMeter.cpp similarity index 66% rename from test/GasMeter.cpp rename to test/libsolidity/GasMeter.cpp index 0ffe41712..43eb3f956 100644 --- a/test/GasMeter.cpp +++ b/test/libsolidity/GasMeter.cpp @@ -21,6 +21,8 @@ */ #include +#include +#include #include #include #include @@ -55,8 +57,21 @@ public: ); } + void testCreationTimeGas(string const& _sourceCode, string const& _contractName = "") + { + compileAndRun(_sourceCode); + auto state = make_shared(); + GasMeter meter(state); + GasMeter::GasConsumption gas; + for (AssemblyItem const& item: *m_compiler.getAssemblyItems(_contractName)) + gas += meter.estimateMax(item); + u256 bytecodeSize(m_compiler.getRuntimeBytecode(_contractName).size()); + gas += bytecodeSize * c_createDataGas; + BOOST_REQUIRE(!gas.isInfinite); + BOOST_CHECK(gas.value == m_gasUsed); + } + protected: - dev::solidity::CompilerStack m_compiler; map m_gasCosts; }; @@ -91,6 +106,49 @@ BOOST_AUTO_TEST_CASE(non_overlapping_filtered_costs) } } +BOOST_AUTO_TEST_CASE(simple_contract) +{ + // Tests a simple "deploy contract" code without constructor. The actual contract is not relevant. + char const* sourceCode = R"( + contract test { + bytes32 public shaValue; + function f(uint a) { + shaValue = sha3(a); + } + } + )"; + testCreationTimeGas(sourceCode); +} + +BOOST_AUTO_TEST_CASE(store_sha3) +{ + char const* sourceCode = R"( + contract test { + bytes32 public shaValue; + function test(uint a) { + shaValue = sha3(a); + } + } + )"; + testCreationTimeGas(sourceCode); +} + +BOOST_AUTO_TEST_CASE(updating_store) +{ + char const* sourceCode = R"( + contract test { + uint data; + uint data2; + function test() { + data = 1; + data = 2; + data2 = 0; + } + } + )"; + testCreationTimeGas(sourceCode); +} + BOOST_AUTO_TEST_SUITE_END() } diff --git a/test/libsolidity/solidityExecutionFramework.h b/test/libsolidity/solidityExecutionFramework.h index f76465f23..fa25fb12c 100644 --- a/test/libsolidity/solidityExecutionFramework.h +++ b/test/libsolidity/solidityExecutionFramework.h @@ -44,11 +44,11 @@ public: bytes const& compileAndRun(std::string const& _sourceCode, u256 const& _value = 0, std::string const& _contractName = "") { - dev::solidity::CompilerStack compiler(m_addStandardSources); - compiler.addSource("", _sourceCode); - ETH_TEST_REQUIRE_NO_THROW(compiler.compile(m_optimize), "Compiling contract failed"); + m_compiler.reset(false, m_addStandardSources); + m_compiler.addSource("", _sourceCode); + ETH_TEST_REQUIRE_NO_THROW(m_compiler.compile(m_optimize), "Compiling contract failed"); - bytes code = compiler.getBytecode(_contractName); + bytes code = m_compiler.getBytecode(_contractName); sendMessage(code, true, _value); BOOST_REQUIRE(!m_output.empty()); return m_output; @@ -160,12 +160,14 @@ protected: BOOST_REQUIRE(executive.go()); m_state.noteSending(m_sender); executive.finalize(); + m_gasUsed = executive.gasUsed(); m_output = executive.out().toVector(); m_logs = executive.logs(); } bool m_optimize = false; bool m_addStandardSources = false; + dev::solidity::CompilerStack m_compiler; Address m_sender; Address m_contractAddress; eth::State m_state; @@ -173,6 +175,7 @@ protected: u256 const m_gas = 100000000; bytes m_output; eth::LogEntries m_logs; + u256 m_gasUsed; }; } From 846de9aceaca7fae862c2fbe7b6fb5612e80a5b2 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Wed, 20 May 2015 09:31:38 +0200 Subject: [PATCH 294/461] Pregenerate DAG when mining on AZ/eth/ethminer. Use regeneratable key for decrets by default. --- ethminer/MinerAux.h | 9 ++++++++- libethcore/Ethash.cpp | 8 ++++++++ libethcore/Ethash.h | 1 + libethereum/Client.cpp | 6 +++++- libethereum/Executive.cpp | 36 ++++++++++++++++++++++++++++++++++++ libethereum/Executive.h | 1 + libethereum/ExtVM.cpp | 10 +++++----- libethereum/ExtVM.h | 2 +- libethereum/KeyManager.cpp | 3 +++ libethereum/KeyManager.h | 10 ++++++++-- libevm/ExtVMFace.h | 14 +++++++++++++- libevm/VM.cpp | 26 +++++++++++++++++++------- test/libevm/vm.cpp | 7 ++----- test/libevm/vm.h | 2 +- 14 files changed, 111 insertions(+), 24 deletions(-) diff --git a/ethminer/MinerAux.h b/ethminer/MinerAux.h index d99e36976..ef0621b7f 100644 --- a/ethminer/MinerAux.h +++ b/ethminer/MinerAux.h @@ -174,6 +174,10 @@ public: m_minerType = MinerType::GPU; miningThreads = 1; } + else if (arg == "--no-precompute") + { + precompute = false; + } else if ((arg == "-D" || arg == "--create-dag") && i + 1 < argc) { string m = boost::to_lower_copy(string(argv[++i])); @@ -268,6 +272,7 @@ public: << "Work farming mode:" << endl << " -F,--farm Put into mining farm mode with the work server at URL (default: http://127.0.0.1:8545)" << endl << " --farm-recheck Leave n ms between checks for changed work (default: 500)." << endl + << " --no-precompute Don't precompute the next epoch's DAG." << endl #endif << "Ethash verify mode:" << endl << " -w,--check-pow Check PoW credentials for validity." << endl @@ -423,6 +428,8 @@ private: cnote << "Grabbing DAG for" << newSeedHash; if (!(dag = EthashAux::full(newSeedHash, true, [&](unsigned _pc){ cout << "\rCreating DAG. " << _pc << "% done..." << flush; return 0; }))) BOOST_THROW_EXCEPTION(DAGCreationFailure()); + if (precompute) + EthashAux::computeFull(sha3(newSeedHash), true); if (hh != current.headerHash) { current.headerHash = hh; @@ -486,5 +493,5 @@ private: /// Farm params string farmURL = "http://127.0.0.1:8545"; unsigned farmRecheckPeriod = 500; - + bool precompute = true; }; diff --git a/libethcore/Ethash.cpp b/libethcore/Ethash.cpp index 1f16166f0..228f03f8e 100644 --- a/libethcore/Ethash.cpp +++ b/libethcore/Ethash.cpp @@ -75,6 +75,13 @@ Ethash::WorkPackage Ethash::package(BlockInfo const& _bi) return ret; } +void Ethash::ensurePrecomputed(unsigned _number) +{ + if (_number % ETHASH_EPOCH_LENGTH > ETHASH_EPOCH_LENGTH * 9 / 10) + // 90% of the way to the new epoch + EthashAux::computeFull(EthashAux::seedHash(_number + ETHASH_EPOCH_LENGTH), true); +} + void Ethash::prep(BlockInfo const& _header, std::function const& _f) { EthashAux::full(_header.seedHash(), true, _f); @@ -306,6 +313,7 @@ void Ethash::GPUMiner::workLoop() cnote << "workLoop" << !!m_miner << m_minerSeed << w.seedHash; if (!m_miner || m_minerSeed != w.seedHash) { + cnote << "Initialising miner..."; m_minerSeed = w.seedHash; delete m_miner; diff --git a/libethcore/Ethash.h b/libethcore/Ethash.h index 81f842e4f..86540678f 100644 --- a/libethcore/Ethash.h +++ b/libethcore/Ethash.h @@ -74,6 +74,7 @@ public: static std::string name(); static unsigned revision(); static void prep(BlockInfo const& _header, std::function const& _f = std::function()); + static void ensurePrecomputed(unsigned _number); static bool verify(BlockInfo const& _header); static bool preVerify(BlockInfo const& _header); static WorkPackage package(BlockInfo const& _header); diff --git a/libethereum/Client.cpp b/libethereum/Client.cpp index f10eda55a..e372e611a 100644 --- a/libethereum/Client.cpp +++ b/libethereum/Client.cpp @@ -457,11 +457,13 @@ ProofOfWork::WorkPackage Client::getWork() // this will be reset as soon as a new block arrives, allowing more transactions to be processed. bool oldShould = shouldServeWork(); m_lastGetWork = chrono::system_clock::now(); - m_remoteWorking = true; // if this request has made us bother to serve work, prep it now. if (!oldShould && shouldServeWork()) onPostStateChanged(); + else + // otherwise, set this to true so that it gets prepped next time. + m_remoteWorking = true; return ProofOfWork::package(m_miningInfo); } @@ -627,6 +629,8 @@ void Client::onPostStateChanged() m_miningInfo = m_postMine.info(); } m_farm.setWork(m_miningInfo); + + Ethash::ensurePrecomputed(m_bc.number()); } m_remoteWorking = false; } diff --git a/libethereum/Executive.cpp b/libethereum/Executive.cpp index a1eee9440..4fbf51244 100644 --- a/libethereum/Executive.cpp +++ b/libethereum/Executive.cpp @@ -159,6 +159,42 @@ bool Executive::call(Address _receiveAddress, Address _codeAddress, Address _sen return !m_ext; } +bool Executive::call(CallParameters const& _p, u256 const& _gasPrice, Address const& _origin) +{ + m_isCreation = false; +// cnote << "Transferring" << formatBalance(_value) << "to receiver."; + auto it = !(_p.codeAddress & ~h160(0xffffffff)) ? precompiled().find((unsigned)(u160)_p.codeAddress) : precompiled().end(); + if (it != precompiled().end()) + { + bigint g = it->second.gas(_p.data); + if (_p.gas < g) + { + m_endGas = 0; + m_excepted = TransactionException::OutOfGasBase; + // Bail from exception. + return true; // true actually means "all finished - nothing more to be done regarding go(). + } + else + { + m_endGas = (u256)(_p.gas - g); + m_precompiledOut = it->second.exec(_p.data); + m_out = &m_precompiledOut; + } + } + else if (m_s.addressHasCode(_p.codeAddress)) + { + m_vm = VMFactory::create(_p.gas); + bytes const& c = m_s.code(_p.codeAddress); + m_ext = make_shared(m_s, m_lastHashes, _p.receiveAddress, _p.senderAddress, _origin, _p.value, _gasPrice, _p.data, &c, m_depth); + } + else + m_endGas = _p.gas; + + m_s.transferBalance(_p.senderAddress, _p.receiveAddress, _p.value); + + return !m_ext; +} + bool Executive::create(Address _sender, u256 _endowment, u256 _gasPrice, u256 _gas, bytesConstRef _init, Address _origin) { m_isCreation = true; diff --git a/libethereum/Executive.h b/libethereum/Executive.h index 3806221be..8bb0ab771 100644 --- a/libethereum/Executive.h +++ b/libethereum/Executive.h @@ -95,6 +95,7 @@ public: /// Set up the executive for evaluating a bare CALL (message call) operation. /// @returns false iff go() must be called (and thus a VM execution in required). bool call(Address _myAddress, Address _codeAddress, Address _txSender, u256 _txValue, u256 _gasPrice, bytesConstRef _txData, u256 _gas, Address _originAddress); + bool call(CallParameters const& _cp, u256 const& _gasPrice, Address const& _origin); /// Finalise an operation through accruing the substate into the parent context. void accrueSubState(SubState& _parentContext); diff --git a/libethereum/ExtVM.cpp b/libethereum/ExtVM.cpp index 68d146ce1..c0591cef5 100644 --- a/libethereum/ExtVM.cpp +++ b/libethereum/ExtVM.cpp @@ -26,16 +26,16 @@ using namespace std; using namespace dev; using namespace dev::eth; -bool ExtVM::call(Address _receiveAddress, u256 _txValue, bytesConstRef _txData, u256& io_gas, bytesRef _out, OnOpFunc const& _onOp, Address _myAddressOverride, Address _codeAddressOverride) +bool ExtVM::call(CallParameters& _p) { Executive e(m_s, lastHashes, depth + 1); - if (!e.call(_receiveAddress, _codeAddressOverride, _myAddressOverride ? _myAddressOverride : myAddress, _txValue, gasPrice, _txData, io_gas, origin)) + if (!e.call(_p, gasPrice, origin)) { - e.go(_onOp); + e.go(_p.onOp); e.accrueSubState(sub); } - io_gas = e.endGas(); - e.out().copyTo(_out); + _p.gas = e.endGas(); + e.out().copyTo(_p.out); return !e.excepted(); } diff --git a/libethereum/ExtVM.h b/libethereum/ExtVM.h index 1a2d180dd..babff4edf 100644 --- a/libethereum/ExtVM.h +++ b/libethereum/ExtVM.h @@ -58,7 +58,7 @@ public: virtual h160 create(u256 _endowment, u256& io_gas, bytesConstRef _code, OnOpFunc const& _onOp = {}) override final; /// Create a new message call. Leave _myAddressOverride as the default to use the present address as caller. - virtual bool call(Address _receiveAddress, u256 _txValue, bytesConstRef _txData, u256& io_gas, bytesRef _out, OnOpFunc const& _onOp = {}, Address _myAddressOverride = {}, Address _codeAddressOverride = {}) override final; + virtual bool call(CallParameters& _params) override final; /// Read address's balance. virtual u256 balance(Address _a) override final { return m_s.balance(_a); } diff --git a/libethereum/KeyManager.cpp b/libethereum/KeyManager.cpp index cba6f4325..8c3fd28c3 100644 --- a/libethereum/KeyManager.cpp +++ b/libethereum/KeyManager.cpp @@ -71,6 +71,7 @@ bool KeyManager::load(std::string const& _pass) m_password = (string)s[3]; } m_cachedPasswords[hashPassword(m_password)] = m_password; + m_cachedPasswords[hashPassword(defaultPassword())] = defaultPassword(); return true; } catch (...) { @@ -214,4 +215,6 @@ void KeyManager::write(h128 const& _key, std::string const& _keysFile) const writeFile(_keysFile, encryptSymNoAuth(_key, h128(), &s.out())); m_key = _key; + m_cachedPasswords[hashPassword(defaultPassword())] = defaultPassword(); + } diff --git a/libethereum/KeyManager.h b/libethereum/KeyManager.h index bb537e1f1..0a83fcc00 100644 --- a/libethereum/KeyManager.h +++ b/libethereum/KeyManager.h @@ -75,10 +75,11 @@ public: Address address(h128 const& _uuid) const; h128 import(Secret const& _s, std::string const& _info, std::string const& _pass, std::string const& _passInfo); - h128 import(Secret const& _s, std::string const& _info) { return import(_s, _info, m_password, std::string()); } + h128 import(Secret const& _s, std::string const& _info) { return import(_s, _info, defaultPassword(), std::string()); } SecretStore& store() { return m_store; } void importExisting(h128 const& _uuid, std::string const& _info, std::string const& _pass, std::string const& _passInfo); + void importExisting(h128 const& _uuid, std::string const& _info) { importExisting(_uuid, _info, defaultPassword(), std::string()); } Secret secret(Address const& _address, std::function const& _pass = DontKnowThrow) const; Secret secret(h128 const& _uuid, std::function const& _pass = DontKnowThrow) const; @@ -87,6 +88,7 @@ public: void kill(Address const& _a); private: + std::string defaultPassword() const { return asString(m_key.ref()); } h256 hashPassword(std::string const& _pass) const; // Only use if previously loaded ok. @@ -103,7 +105,11 @@ private: // Passwords that we're storing. mutable std::unordered_map m_cachedPasswords; - // The default password for keys in the keystore - protected by the master password. + // DEPRECATED. + // Used to be the default password for keys in the keystore, stored in the keys file. + // Now the default password is based off the key of the keys file directly, so this is redundant + // except for the fact that people have existing keys stored with it. Leave for now until/unless + // we have an upgrade strategy. std::string m_password; SecretStore m_store; diff --git a/libevm/ExtVMFace.h b/libevm/ExtVMFace.h index 8ebfd8fa5..ce259bef2 100644 --- a/libevm/ExtVMFace.h +++ b/libevm/ExtVMFace.h @@ -108,6 +108,18 @@ using LastHashes = std::vector; using OnOpFunc = std::function; +struct CallParameters +{ + Address senderAddress; + Address codeAddress; + Address receiveAddress; + u256 gas; + u256 value; + bytesConstRef data; + bytesRef out; + OnOpFunc onOp; +}; + /** * @brief Interface and null implementation of the class for specifying VM externalities. */ @@ -153,7 +165,7 @@ public: virtual h160 create(u256, u256&, bytesConstRef, OnOpFunc const&) { return h160(); } /// Make a new message call. - virtual bool call(Address, u256, bytesConstRef, u256&, bytesRef, OnOpFunc const&, Address, Address) { return false; } + virtual bool call(CallParameters&) { return false; } /// Revert any changes made (by any of the other calls). virtual void log(h256s&& _topics, bytesConstRef _data) { sub.logs.push_back(LogEntry(myAddress, std::move(_topics), _data.toBytes())); } diff --git a/libevm/VM.cpp b/libevm/VM.cpp index 368d27389..27650e3ad 100644 --- a/libevm/VM.cpp +++ b/libevm/VM.cpp @@ -56,6 +56,8 @@ bytesConstRef VM::go(ExtVMFace& _ext, OnOpFunc const& _onOp, uint64_t _steps) { m_stack.reserve((unsigned)c_stackLimit); + unique_ptr callParams; + static const array c_metrics = metrics(); auto memNeed = [](u256 _offset, dev::u256 _size) { return _size ? (bigint)_offset + _size : (bigint)0; }; @@ -626,13 +628,16 @@ bytesConstRef VM::go(ExtVMFace& _ext, OnOpFunc const& _onOp, uint64_t _steps) case Instruction::CALL: case Instruction::CALLCODE: { - u256 gas = m_stack.back(); + if (!callParams) + callParams.reset(new CallParameters); + + callParams->gas = m_stack.back(); if (m_stack[m_stack.size() - 3] > 0) - gas += c_callStipend; + callParams->gas += c_callStipend; m_stack.pop_back(); - Address receiveAddress = asAddress(m_stack.back()); + callParams->receiveAddress = asAddress(m_stack.back()); m_stack.pop_back(); - u256 value = m_stack.back(); + callParams->value = m_stack.back(); m_stack.pop_back(); unsigned inOff = (unsigned)m_stack.back(); @@ -644,12 +649,19 @@ bytesConstRef VM::go(ExtVMFace& _ext, OnOpFunc const& _onOp, uint64_t _steps) unsigned outSize = (unsigned)m_stack.back(); m_stack.pop_back(); - if (_ext.balance(_ext.myAddress) >= value && _ext.depth < 1024) - m_stack.push_back(_ext.call(inst == Instruction::CALL ? receiveAddress : _ext.myAddress, value, bytesConstRef(m_temp.data() + inOff, inSize), gas, bytesRef(m_temp.data() + outOff, outSize), _onOp, {}, receiveAddress)); + if (_ext.balance(_ext.myAddress) >= callParams->value && _ext.depth < 1024) + { + callParams->onOp = _onOp; + callParams->senderAddress = _ext.myAddress; + callParams->codeAddress = inst == Instruction::CALL ? callParams->receiveAddress : callParams->senderAddress; + callParams->data = bytesConstRef(m_temp.data() + inOff, inSize); + callParams->out = bytesRef(m_temp.data() + outOff, outSize); + m_stack.push_back(_ext.call(*callParams)); + } else m_stack.push_back(0); - m_gas += gas; + m_gas += callParams->gas; break; } case Instruction::RETURN: diff --git a/test/libevm/vm.cpp b/test/libevm/vm.cpp index 10670bfe3..bda751af4 100644 --- a/test/libevm/vm.cpp +++ b/test/libevm/vm.cpp @@ -44,13 +44,10 @@ h160 FakeExtVM::create(u256 _endowment, u256& io_gas, bytesConstRef _init, OnOpF return na; } -bool FakeExtVM::call(Address _receiveAddress, u256 _value, bytesConstRef _data, u256& io_gas, bytesRef _out, OnOpFunc const&, Address _myAddressOverride, Address _codeAddressOverride) +bool FakeExtVM::call(CallParameters& _p) { - Transaction t(_value, gasPrice, io_gas, _receiveAddress, _data.toVector()); + Transaction t(_p.value, gasPrice, _p.gas, _p.receiveAddress, _p.data.toVector()); callcreates.push_back(t); - (void)_out; - (void)_myAddressOverride; - (void)_codeAddressOverride; return true; } diff --git a/test/libevm/vm.h b/test/libevm/vm.h index dff89d98d..18fa1ca25 100644 --- a/test/libevm/vm.h +++ b/test/libevm/vm.h @@ -59,7 +59,7 @@ public: virtual void suicide(Address _a) override { std::get<0>(addresses[_a]) += std::get<0>(addresses[myAddress]); addresses.erase(myAddress); } virtual bytes const& codeAt(Address _a) override { return std::get<3>(addresses[_a]); } virtual h160 create(u256 _endowment, u256& io_gas, bytesConstRef _init, eth::OnOpFunc const&) override; - virtual bool call(Address _receiveAddress, u256 _value, bytesConstRef _data, u256& io_gas, bytesRef _out, eth::OnOpFunc const&, Address, Address) override; + virtual bool call(eth::CallParameters&) override; void setTransaction(Address _caller, u256 _value, u256 _gasPrice, bytes const& _data); void setContract(Address _myAddress, u256 _myBalance, u256 _myNonce, std::map const& _storage, bytes const& _code); void set(Address _a, u256 _myBalance, u256 _myNonce, std::map const& _storage, bytes const& _code); From 32a850a9ff42d775f0d0ee0868db88f4f748504d Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Wed, 20 May 2015 09:59:18 +0200 Subject: [PATCH 295/461] Trie timing. --- exp/main.cpp | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/exp/main.cpp b/exp/main.cpp index d31306496..47efe576a 100644 --- a/exp/main.cpp +++ b/exp/main.cpp @@ -34,6 +34,9 @@ #include #include #include +#include +#include +/* #include #include #include @@ -41,7 +44,6 @@ #include #include #include -#include #include #include #include @@ -55,17 +57,43 @@ #include #include #include -#include +#include */ using namespace std; using namespace dev; -using namespace dev::eth; +/*using namespace dev::eth; using namespace dev::p2p; using namespace dev::shh; namespace js = json_spirit; namespace fs = boost::filesystem; - +*/ #if 1 +int main() +{ + cdebug << "EXP"; + vector data; + for (unsigned i = 0; i < 10000; ++i) + data.push_back(rlp(i)); + + h256 ret; + DEV_TIMED(triedb) + { + MemoryDB mdb; + GenericTrieDB t(&mdb); + t.init(); + unsigned i = 0; + for (auto const& d: data) + t.insert(rlp(i++), d); + ret = t.root(); + } + cdebug << ret; + DEV_TIMED(hash256) + ret = orderedTrieRoot(data); + cdebug << ret; +} + +#elif 0 + int main() { KeyManager keyman; From b5822c7d9549c2e541a7165c48c5587b7dc19359 Mon Sep 17 00:00:00 2001 From: subtly Date: Wed, 20 May 2015 10:10:56 +0200 Subject: [PATCH 296/461] Change c_zero to non-static as macos can't enqueue with static const ptr. --- libethash-cl/ethash_cl_miner.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libethash-cl/ethash_cl_miner.cpp b/libethash-cl/ethash_cl_miner.cpp index be17ba449..97443ce77 100644 --- a/libethash-cl/ethash_cl_miner.cpp +++ b/libethash-cl/ethash_cl_miner.cpp @@ -304,7 +304,7 @@ void ethash_cl_miner::search(uint8_t const* header, uint64_t target, search_hook }; std::queue pending; - static uint32_t const c_zero = 0; + uint32_t const c_zero = 0; // update header constant buffer m_queue.enqueueWriteBuffer(m_header, false, 0, 32, header); From e37ddf8eac99eebcf8b48f446665418c0e3315f3 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 20 May 2015 11:45:39 +0200 Subject: [PATCH 297/461] bug fix --- mix/CodeModel.cpp | 8 +++---- mix/qml/CodeEditorView.qml | 2 +- mix/qml/StateListModel.qml | 1 + mix/qml/WebCodeEditor.qml | 26 +++------------------ mix/qml/html/cm/errorannotation.js | 3 --- mix/qml/html/codeeditor.js | 37 +++++++++++++++--------------- 6 files changed, 27 insertions(+), 50 deletions(-) diff --git a/mix/CodeModel.cpp b/mix/CodeModel.cpp index 9875ee1aa..f10b33408 100644 --- a/mix/CodeModel.cpp +++ b/mix/CodeModel.cpp @@ -331,11 +331,11 @@ QVariantMap CodeModel::resolveCompilationErrorLocation(CompilerStack const& _com { std::tuple pos = _compiler.positionFromSourceLocation(_location); QVariantMap startError; - startError.insert("line", std::get<0>(pos) - 1); - startError.insert("column", std::get<1>(pos) - 1); + startError.insert("line", std::get<0>(pos) > 1 ? (std::get<0>(pos) - 1) : 1); + startError.insert("column", std::get<1>(pos) > 1 ? (std::get<1>(pos) - 1) : 1); QVariantMap endError; - endError.insert("line", std::get<2>(pos) - 1); - endError.insert("column", std::get<3>(pos) - 1); + endError.insert("line", std::get<2>(pos) > 1 ? (std::get<2>(pos) - 1) : 1); + endError.insert("column", std::get<3>(pos) > 1 ? (std::get<3>(pos) - 1) : 1); QVariantMap error; error.insert("start", startError); error.insert("end", endError); diff --git a/mix/qml/CodeEditorView.qml b/mix/qml/CodeEditorView.qml index 1a5e3f0f8..4f5516264 100644 --- a/mix/qml/CodeEditorView.qml +++ b/mix/qml/CodeEditorView.qml @@ -74,8 +74,8 @@ Item { }); } editor.document = document; - editor.setSourceName(document.documentId); editor.setFontSize(editorSettings.fontSize); + editor.sourceName = document.documentId; editor.setText(data, document.syntaxMode); editor.changeGeneration(); } diff --git a/mix/qml/StateListModel.qml b/mix/qml/StateListModel.qml index f21c93199..a94188a23 100644 --- a/mix/qml/StateListModel.qml +++ b/mix/qml/StateListModel.qml @@ -225,6 +225,7 @@ Item { var ctorTr = defaultTransactionItem(); ctorTr.functionId = c; ctorTr.contractId = c; + ctorTr.label = qsTr("Deploy") + " " + ctorTr.contractId; ctorTr.sender = item.accounts[0].secret; item.transactions.push(ctorTr); } diff --git a/mix/qml/WebCodeEditor.qml b/mix/qml/WebCodeEditor.qml index babb200e8..b188cacd6 100644 --- a/mix/qml/WebCodeEditor.qml +++ b/mix/qml/WebCodeEditor.qml @@ -83,13 +83,6 @@ Item { editorBrowser.runJavaScript("setFontSize(" + size + ")", function(result) {}); } - function setSourceName(_sourceName) - { - sourceName = _sourceName; - if (initialized && editorBrowser) - editorBrowser.runJavaScript("setSourceName('" + sourceName + "')", function(result) {}); - } - Clipboard { id: clipboard @@ -148,29 +141,16 @@ Item { { if (!editorBrowser || !error) return; - - var lineError = firstLocation.start.line + 1; - var errorOrigin = "source error in " + firstLocation.contractName + " line " + lineError - var secondErrorDetail = " Secondary sources: "; - for (var k in secondLocations) - { - lineError = secondLocations[k].start.line + 1; - secondErrorDetail += secondLocations[k].contractName + " line " + lineError + " - "; - displayErrorAnnotations(secondLocations[k], errorOrigin, "second"); - } var detail = error.split('\n')[0]; var reg = detail.match(/:\d+:\d+:/g); if (reg !== null) detail = detail.replace(reg[0], ""); - if (secondLocations.length > 0) - detail += secondErrorDetail; - displayErrorAnnotations(firstLocation, detail, "first"); + displayErrorAnnotations(detail, firstLocation, secondLocations); } - function displayErrorAnnotations(location, detail, type) + function displayErrorAnnotations(detail, location, secondaryErrors) { - if (location.source === parent.sourceName) - editorBrowser.runJavaScript("compilationError('" + JSON.stringify(location) + "', '" + detail + "', '" + type + "')", function(result){}); + editorBrowser.runJavaScript("compilationError('" + sourceName + "', '" + JSON.stringify(location) + "', '" + detail + "', '" + JSON.stringify(secondaryErrors) + "')", function(result){}); } Timer diff --git a/mix/qml/html/cm/errorannotation.js b/mix/qml/html/cm/errorannotation.js index a8cdb6fe6..33837ed37 100644 --- a/mix/qml/html/cm/errorannotation.js +++ b/mix/qml/html/cm/errorannotation.js @@ -44,6 +44,3 @@ ErrorAnnotation.prototype.destroy = function() if (this.errorMark) this.errorMark.clear(); } - - - diff --git a/mix/qml/html/codeeditor.js b/mix/qml/html/codeeditor.js index fd5d88df0..c85a87597 100644 --- a/mix/qml/html/codeeditor.js +++ b/mix/qml/html/codeeditor.js @@ -8,7 +8,6 @@ var editor = CodeMirror(document.body, { styleSelectedText: true }); var ternServer; -var sourceName = ""; editor.setOption("theme", "inkpot"); editor.setOption("indentUnit", 4); @@ -160,35 +159,40 @@ showWarning = function(content) var annotations = []; var compilationCompleteBool = true; -compilationError = function(location, error, type) +compilationError = function(currentSourceName, location, error, secondaryErrors) { compilationCompleteBool = false; if (compilationCompleteBool) return; + clearAnnotations(); location = JSON.parse(location); - if (location.start.line) - ensureAnnotation(location, error, type); + if (location.source === currentSourceName) + ensureAnnotation(location, error, "first"); + var lineError = location.start.line + 1; + var errorOrigin = "Source " + location.contractName + " line " + lineError; + secondaryErrors = JSON.parse(secondaryErrors); + for(var i in secondaryErrors) + { + if (secondaryErrors[i].source === currentSourceName) + ensureAnnotation(secondaryErrors[i], errorOrigin, "second"); + } } ensureAnnotation = function(location, error, type) { - for (var k in annotations) - { - if (annotations[k].annotation.location.start.line === location.start.line) - { - annotations[k].annotation.destroy(); - annotations.splice(k, 1); - break; - } - } annotations.push({ "type": type, "annotation": new ErrorAnnotation(editor, location, error)}); } -compilationComplete = function() +clearAnnotations = function() { for (var k in annotations) annotations[k].annotation.destroy(); annotations.length = 0; +} + +compilationComplete = function() +{ + clearAnnotations(); compilationCompleteBool = true; } @@ -204,10 +208,5 @@ setFontSize = function(size) editor.refresh(); } -setSourceName = function(_sourceName) -{ - sourceName = _sourceName; -} - editor.setOption("extraKeys", extraKeys); From 8b7ec057f4d01e9e42ee2ce31f8abf5fcd8f3be1 Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Wed, 20 May 2015 13:20:34 +0200 Subject: [PATCH 298/461] remove eth_solidity dependency for statetests --- test/libethereum/state.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/libethereum/state.cpp b/test/libethereum/state.cpp index fe0f10ca3..ed5cf14ac 100644 --- a/test/libethereum/state.cpp +++ b/test/libethereum/state.cpp @@ -176,12 +176,10 @@ BOOST_AUTO_TEST_CASE(stMemoryStressTest) dev::test::executeTests("stMemoryStressTest", "/StateTests",dev::test::getFolder(__FILE__) + "/StateTestsFiller", dev::test::doStateTests); } -#if ETH_SOLIDITY BOOST_AUTO_TEST_CASE(stSolidityTest) { dev::test::executeTests("stSolidityTest", "/StateTests",dev::test::getFolder(__FILE__) + "/StateTestsFiller", dev::test::doStateTests); } -#endif BOOST_AUTO_TEST_CASE(stMemoryTest) { From 68c9eb2937667a3f2b6d157d40be9f3864d222d3 Mon Sep 17 00:00:00 2001 From: subtly Date: Wed, 20 May 2015 15:32:52 +0200 Subject: [PATCH 299/461] fix whitespace --- libethash-cl/ethash_cl_miner.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libethash-cl/ethash_cl_miner.cpp b/libethash-cl/ethash_cl_miner.cpp index 97443ce77..93ce9ab22 100644 --- a/libethash-cl/ethash_cl_miner.cpp +++ b/libethash-cl/ethash_cl_miner.cpp @@ -304,7 +304,7 @@ void ethash_cl_miner::search(uint8_t const* header, uint64_t target, search_hook }; std::queue pending; - uint32_t const c_zero = 0; + uint32_t const c_zero = 0; // update header constant buffer m_queue.enqueueWriteBuffer(m_header, false, 0, 32, header); From 8c118dc6b76b1a1f3e8d2fdd534cf21173f3a4f9 Mon Sep 17 00:00:00 2001 From: chriseth Date: Wed, 20 May 2015 17:21:48 +0200 Subject: [PATCH 300/461] Bugfix concerning receive address for CALLCODE. --- libevm/VM.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libevm/VM.cpp b/libevm/VM.cpp index 27650e3ad..ff771d21c 100644 --- a/libevm/VM.cpp +++ b/libevm/VM.cpp @@ -635,7 +635,7 @@ bytesConstRef VM::go(ExtVMFace& _ext, OnOpFunc const& _onOp, uint64_t _steps) if (m_stack[m_stack.size() - 3] > 0) callParams->gas += c_callStipend; m_stack.pop_back(); - callParams->receiveAddress = asAddress(m_stack.back()); + callParams->codeAddress = asAddress(m_stack.back()); m_stack.pop_back(); callParams->value = m_stack.back(); m_stack.pop_back(); @@ -653,7 +653,7 @@ bytesConstRef VM::go(ExtVMFace& _ext, OnOpFunc const& _onOp, uint64_t _steps) { callParams->onOp = _onOp; callParams->senderAddress = _ext.myAddress; - callParams->codeAddress = inst == Instruction::CALL ? callParams->receiveAddress : callParams->senderAddress; + callParams->receiveAddress = inst == Instruction::CALL ? callParams->codeAddress : callParams->senderAddress; callParams->data = bytesConstRef(m_temp.data() + inOff, inSize); callParams->out = bytesRef(m_temp.data() + outOff, outSize); m_stack.push_back(_ext.call(*callParams)); From c16ee526d527e41e5d6e1160c728ab1290e4d73d Mon Sep 17 00:00:00 2001 From: Liana Husikyan Date: Wed, 20 May 2015 17:57:41 +0200 Subject: [PATCH 301/461] added tests to check references to struct type. --- test/libsolidity/SolidityEndToEndTest.cpp | 87 +++++++++++++++++++++++ 1 file changed, 87 insertions(+) diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index 90ce20d26..f9870a9ad 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -4023,9 +4023,96 @@ BOOST_AUTO_TEST_CASE(overwriting_inheritance) BOOST_CHECK(callContractFunction("checkOk()") == encodeArgs(6)); } +BOOST_AUTO_TEST_CASE(struct_assign_reference_to_struct) +{ + char const* sourceCode = R"( + contract test { + struct testStruct + { + uint m_value; + } + testStruct data1; + testStruct data2; + testStruct data3; + function test() + { + data1.m_value = 2; + } + function assign() returns (uint ret_local, uint ret_global, uint ret_global3, uint ret_global1) + { + testStruct x = data1; //x is a reference data1..m_value == 2 as well as x.m_value = 2 + data2 = data1; // should copy data. data2.m_value == 2 + + ret_local = x.m_value; // = 2 + ret_global = data2.m_value; // = 2 + + x.m_value = 3; + data3 = x; //should copy the data. data3.m_value == 3 + ret_global3 = data3.m_value; // = 3 + ret_global1 = data1.m_value; // =3 + } + } + )"; + compileAndRun(sourceCode, 0, "test"); + BOOST_CHECK(callContractFunction("assign()") == encodeArgs(2, 2, 3, 3)); +} + +BOOST_AUTO_TEST_CASE(struct_delete_member) +{ + char const* sourceCode = R"( + contract test { + struct testStruct + { + uint m_value; + } + testStruct data1; + function test() + { + data1.m_value = 2; + } + function deleteMember() returns (uint ret_value) + { + testStruct x = data1; //should not copy the data. data1.m_value == 2 but x.m_value = 0 + x.m_value = 4; + delete x.m_value; + ret_value = x.m_value; + } + } + )"; + compileAndRun(sourceCode, 0, "test"); + auto res = callContractFunction("deleteMember()"); + BOOST_CHECK(callContractFunction("deleteMember()") == encodeArgs(0)); +} + +BOOST_AUTO_TEST_CASE(struct_delete_struct_in_mapping) +{ + char const* sourceCode = R"( + contract test { + struct testStruct + { + uint m_value; + } + mapping (uint => testStruct) campaigns; + + function test() + { + campaigns[0].m_value = 2; + } + function deleteIt() returns (uint) + { + delete campaigns[0]; + return campaigns[0].m_value; + } + } + )"; + compileAndRun(sourceCode, 0, "test"); + auto res = callContractFunction("deleteIt()"); + BOOST_CHECK(callContractFunction("deleteIt()") == encodeArgs(0)); +} BOOST_AUTO_TEST_SUITE_END() } } } // end namespaces + From 4268174af782c03ea828b76e00644ca9ba3e8ed3 Mon Sep 17 00:00:00 2001 From: Liana Husikyan Date: Wed, 20 May 2015 18:05:51 +0200 Subject: [PATCH 302/461] Update SolidityEndToEndTest.cpp --- test/libsolidity/SolidityEndToEndTest.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index f9870a9ad..c900fff4c 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -4115,4 +4115,3 @@ BOOST_AUTO_TEST_SUITE_END() } } } // end namespaces - From 259dc9a63bd8aebbea8d8a57116dca93906ab000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Wed, 20 May 2015 18:16:18 +0200 Subject: [PATCH 303/461] testeth: let expected be expected. --- test/libevm/vm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/libevm/vm.cpp b/test/libevm/vm.cpp index d00396472..f60ca44ce 100644 --- a/test/libevm/vm.cpp +++ b/test/libevm/vm.cpp @@ -422,7 +422,7 @@ void doVMTests(json_spirit::mValue& v, bool _fillin) checkAddresses, bytes> > >(test.addresses, fev.addresses); - checkCallCreates(fev.callcreates, test.callcreates); + checkCallCreates(test.callcreates, fev.callcreates); checkLog(fev.sub.logs, test.sub.logs); } From bede7bcf104d753e1ed01bdec0bbf2d31441382c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Wed, 20 May 2015 18:22:54 +0200 Subject: [PATCH 304/461] Simplify gas related expression. NFC. --- libevm/VM.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libevm/VM.cpp b/libevm/VM.cpp index f1bfc1f8a..101b210b7 100644 --- a/libevm/VM.cpp +++ b/libevm/VM.cpp @@ -199,7 +199,7 @@ bytesConstRef VM::go(u256& io_gas, ExtVMFace& _ext, OnOpFunc const& _onOp, uint6 if (io_gas < runGas) BOOST_THROW_EXCEPTION(OutOfGas()); - io_gas = (u256)((bigint)io_gas - runGas); + io_gas -= (u256)runGas; if (newTempSize > m_temp.size()) m_temp.resize((size_t)newTempSize); From f3b89a9677ed7b2df1c9a1f5e16e112f75f18a57 Mon Sep 17 00:00:00 2001 From: Liana Husikyan Date: Wed, 20 May 2015 18:35:05 +0200 Subject: [PATCH 305/461] style fix --- test/libsolidity/SolidityEndToEndTest.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index c900fff4c..6b7007a29 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -4040,7 +4040,7 @@ BOOST_AUTO_TEST_CASE(struct_assign_reference_to_struct) } function assign() returns (uint ret_local, uint ret_global, uint ret_global3, uint ret_global1) { - testStruct x = data1; //x is a reference data1..m_value == 2 as well as x.m_value = 2 + testStruct x = data1; //x is a reference data1.m_value == 2 as well as x.m_value = 2 data2 = data1; // should copy data. data2.m_value == 2 ret_local = x.m_value; // = 2 @@ -4049,7 +4049,7 @@ BOOST_AUTO_TEST_CASE(struct_assign_reference_to_struct) x.m_value = 3; data3 = x; //should copy the data. data3.m_value == 3 ret_global3 = data3.m_value; // = 3 - ret_global1 = data1.m_value; // =3 + ret_global1 = data1.m_value; // = 3 } } )"; From 7c35547631e456a4594e41ec229f3fe9f6e97201 Mon Sep 17 00:00:00 2001 From: Liana Husikyan Date: Wed, 20 May 2015 18:37:09 +0200 Subject: [PATCH 306/461] Update InterfaceHandler.cpp --- libsolidity/InterfaceHandler.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libsolidity/InterfaceHandler.cpp b/libsolidity/InterfaceHandler.cpp index 9124d210f..9a2acd5ba 100644 --- a/libsolidity/InterfaceHandler.cpp +++ b/libsolidity/InterfaceHandler.cpp @@ -108,8 +108,7 @@ unique_ptr InterfaceHandler::getABISolidityInterface(ContractDefinition { string ret = "contract " + _contractDef.getName() + "{"; - auto populateParameters = [](vector const& _paramNames, - vector const& _paramTypes) + auto populateParameters = [](vector const& _paramNames, vector const& _paramTypes) { string r = ""; solAssert(_paramNames.size() == _paramTypes.size(), "Names and types vector size does not match"); From 050883805b68bb495583b87b51378d4b28943e0d Mon Sep 17 00:00:00 2001 From: Liana Husikyan Date: Wed, 20 May 2015 18:38:52 +0200 Subject: [PATCH 307/461] Update SolidityEndToEndTest.cpp --- test/libsolidity/SolidityEndToEndTest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index 6b7007a29..88a3613ad 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -4049,7 +4049,7 @@ BOOST_AUTO_TEST_CASE(struct_assign_reference_to_struct) x.m_value = 3; data3 = x; //should copy the data. data3.m_value == 3 ret_global3 = data3.m_value; // = 3 - ret_global1 = data1.m_value; // = 3 + ret_global1 = data1.m_value; // = 3. Changed due to the assignment to x.m_value } } )"; From 378341ce6026db3bf64341a7ad9d409904af8f85 Mon Sep 17 00:00:00 2001 From: Liana Husikyan Date: Wed, 20 May 2015 18:40:00 +0200 Subject: [PATCH 308/461] Update SolidityEndToEndTest.cpp --- test/libsolidity/SolidityEndToEndTest.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index 88a3613ad..503615a5a 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -4075,7 +4075,7 @@ BOOST_AUTO_TEST_CASE(struct_delete_member) testStruct x = data1; //should not copy the data. data1.m_value == 2 but x.m_value = 0 x.m_value = 4; delete x.m_value; - ret_value = x.m_value; + ret_value = data1.m_value; } } )"; From 663adb4492db65ec206a7b459e8e50003f3ac559 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Wed, 20 May 2015 18:59:48 +0200 Subject: [PATCH 309/461] Apply chriseth's idea about improving find_base64_char_index helper function. --- libdevcore/Base64.cpp | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/libdevcore/Base64.cpp b/libdevcore/Base64.cpp index cb6e873df..e36f8a18a 100644 --- a/libdevcore/Base64.cpp +++ b/libdevcore/Base64.cpp @@ -29,21 +29,25 @@ #include "Base64.h" using namespace dev; -static const char base64_chars[] = - "ABCDEFGHIJKLMNOPQRSTUVWXYZ" - "abcdefghijklmnopqrstuvwxyz" - "0123456789+/"; - static inline bool is_base64(byte c) { return (isalnum(c) || (c == '+') || (c == '/')); } static inline byte find_base64_char_index(byte c) { - auto it = std::find(base64_chars, base64_chars + sizeof(base64_chars), c); - return static_cast(it - base64_chars); + if ('A' <= c && c <= 'Z') return c - 'A'; + else if ('a' <= c && c <= 'z') return c - 'a' + 1 + find_base64_char_index('Z'); + else if ('0' <= c && c <= '9') return c - '0' + 1 + find_base64_char_index('z'); + else if (c == '+') return 1 + find_base64_char_index('9'); + else if (c == '/') return 1 + find_base64_char_index('+'); + else return 1 + find_base64_char_index('/'); } std::string dev::toBase64(bytesConstRef _in) { + static const char base64_chars[] = + "ABCDEFGHIJKLMNOPQRSTUVWXYZ" + "abcdefghijklmnopqrstuvwxyz" + "0123456789+/"; + std::string ret; int i = 0; int j = 0; From 0cee9e6a6a930c7548e012ee7f49838ced58efbd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Wed, 20 May 2015 19:10:55 +0200 Subject: [PATCH 310/461] One more unit test for base64 encoding. --- test/libdevcrypto/hexPrefix.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/test/libdevcrypto/hexPrefix.cpp b/test/libdevcrypto/hexPrefix.cpp index cecd40101..53e0d3dbd 100644 --- a/test/libdevcrypto/hexPrefix.cpp +++ b/test/libdevcrypto/hexPrefix.cpp @@ -63,14 +63,26 @@ BOOST_AUTO_TEST_CASE(hexPrefix_test) BOOST_AUTO_TEST_CASE(base64) { - static char const* const s_tests[][2] = { + static char const* const s_tests[][2] = + { {"", ""}, {"f", "Zg=="}, {"fo", "Zm8="}, {"foo", "Zm9v"}, {"foob", "Zm9vYg=="}, {"fooba", "Zm9vYmE="}, - {"foobar", "Zm9vYmFy"} + {"foobar", "Zm9vYmFy"}, + { + "So?

" + "This 4, 5, 6, 7, 8, 9, z, {, |, } tests Base64 encoder. " + "Show me: @, A, B, C, D, E, F, G, H, I, J, K, L, M, " + "N, O, P, Q, R, S, T, U, V, W, X, Y, Z, [, \\, ], ^, _, `, " + "a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s.", + "U28/PHA+VGhpcyA0LCA1LCA2LCA3LCA4LCA5LCB6LCB7LCB8LCB9IHRlc3RzIEJhc2U2NCBlbmNv" + "ZGVyLiBTaG93IG1lOiBALCBBLCBCLCBDLCBELCBFLCBGLCBHLCBILCBJLCBKLCBLLCBMLCBNLCBO" + "LCBPLCBQLCBRLCBSLCBTLCBULCBVLCBWLCBXLCBYLCBZLCBaLCBbLCBcLCBdLCBeLCBfLCBgLCBh" + "LCBiLCBjLCBkLCBlLCBmLCBnLCBoLCBpLCBqLCBrLCBsLCBtLCBuLCBvLCBwLCBxLCByLCBzLg==" + } }; static const auto c_numTests = sizeof(s_tests) / sizeof(s_tests[0]); From 27654ae52c54eb9419d843fb2025a01adef0fc33 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Wed, 20 May 2015 19:22:16 +0200 Subject: [PATCH 311/461] Scrypt support --- CMakeLists.txt | 1 + exp/main.cpp | 19 +- libdevcrypto/CMakeLists.txt | 1 + libdevcrypto/Common.cpp | 8 + libdevcrypto/Common.h | 3 + libdevcrypto/SecretStore.cpp | 5 + libscrypt/CMakeLists.txt | 24 ++ libscrypt/LICENSE | 9 + libscrypt/b64.c | 313 ++++++++++++++++++++ libscrypt/b64.h | 10 + libscrypt/crypto-mcf.c | 73 +++++ libscrypt/crypto-scrypt-saltgen.c | 48 ++++ libscrypt/crypto_scrypt-check.c | 100 +++++++ libscrypt/crypto_scrypt-hash.c | 44 +++ libscrypt/crypto_scrypt-hexconvert.c | 35 +++ libscrypt/crypto_scrypt-hexconvert.h | 9 + libscrypt/crypto_scrypt-nosse.c | 342 ++++++++++++++++++++++ libscrypt/libscrypt.h | 67 +++++ libscrypt/libscrypt.version | 8 + libscrypt/sha256.c | 411 +++++++++++++++++++++++++++ libscrypt/sha256.h | 70 +++++ libscrypt/slowequals.c | 26 ++ libscrypt/slowequals.h | 5 + libscrypt/sysendian.h | 144 ++++++++++ 24 files changed, 1771 insertions(+), 4 deletions(-) create mode 100644 libscrypt/CMakeLists.txt create mode 100644 libscrypt/LICENSE create mode 100644 libscrypt/b64.c create mode 100644 libscrypt/b64.h create mode 100644 libscrypt/crypto-mcf.c create mode 100644 libscrypt/crypto-scrypt-saltgen.c create mode 100644 libscrypt/crypto_scrypt-check.c create mode 100644 libscrypt/crypto_scrypt-hash.c create mode 100644 libscrypt/crypto_scrypt-hexconvert.c create mode 100644 libscrypt/crypto_scrypt-hexconvert.h create mode 100644 libscrypt/crypto_scrypt-nosse.c create mode 100644 libscrypt/libscrypt.h create mode 100644 libscrypt/libscrypt.version create mode 100644 libscrypt/sha256.c create mode 100644 libscrypt/sha256.h create mode 100644 libscrypt/slowequals.c create mode 100644 libscrypt/slowequals.h create mode 100644 libscrypt/sysendian.h diff --git a/CMakeLists.txt b/CMakeLists.txt index aafdad099..8239e20a4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -364,6 +364,7 @@ if (JSCONSOLE) endif () add_subdirectory(secp256k1) +add_subdirectory(libscrypt) add_subdirectory(libdevcrypto) if (GENERAL) diff --git a/exp/main.cpp b/exp/main.cpp index 47efe576a..5162d915b 100644 --- a/exp/main.cpp +++ b/exp/main.cpp @@ -36,7 +36,6 @@ #include #include #include -/* #include #include #include @@ -57,17 +56,29 @@ #include #include #include -#include */ +#include using namespace std; using namespace dev; -/*using namespace dev::eth; +using namespace dev::eth; using namespace dev::p2p; using namespace dev::shh; namespace js = json_spirit; namespace fs = boost::filesystem; -*/ + #if 1 +int main() +{ + cdebug << pbkdf2("password", asBytes("salt"), 1, 32); + cdebug << pbkdf2("password", asBytes("salt"), 1, 16); + cdebug << pbkdf2("password", asBytes("salt"), 2, 16); + cdebug << pbkdf2("testpassword", fromHex("de5742f1f1045c402296422cee5a8a9ecf0ac5bf594deca1170d22aef33a79cf"), 262144, 16); + return 0; +} + + +#elif 0 + int main() { cdebug << "EXP"; diff --git a/libdevcrypto/CMakeLists.txt b/libdevcrypto/CMakeLists.txt index 295dd257a..7df1149b0 100644 --- a/libdevcrypto/CMakeLists.txt +++ b/libdevcrypto/CMakeLists.txt @@ -22,6 +22,7 @@ add_library(${EXECUTABLE} ${SRC_LIST} ${HEADERS}) target_link_libraries(${EXECUTABLE} ${Boost_FILESYSTEM_LIBRARIES}) target_link_libraries(${EXECUTABLE} ${LEVELDB_LIBRARIES}) target_link_libraries(${EXECUTABLE} ${CRYPTOPP_LIBRARIES}) +target_link_libraries(${EXECUTABLE} scrypt) target_link_libraries(${EXECUTABLE} devcore) install( TARGETS ${EXECUTABLE} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) diff --git a/libdevcrypto/Common.cpp b/libdevcrypto/Common.cpp index 87e258573..2a3561314 100644 --- a/libdevcrypto/Common.cpp +++ b/libdevcrypto/Common.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -180,6 +181,13 @@ bytes dev::pbkdf2(string const& _pass, bytes const& _salt, unsigned _iterations, return ret; } +bytes dev::scrypt(std::string const& _pass, bytes const& _salt, uint64_t _n, uint32_t _r, uint32_t _p, unsigned _dkLen) +{ + bytes ret(_dkLen); + libscrypt_scrypt((uint8_t const*)_pass.data(), _pass.size(), _salt.data(), _salt.size(), _n, _r, _p, ret.data(), ret.size()); + return ret; +} + KeyPair KeyPair::create() { static boost::thread_specific_ptr s_eng; diff --git a/libdevcrypto/Common.h b/libdevcrypto/Common.h index 6464c7ede..a0f894a25 100644 --- a/libdevcrypto/Common.h +++ b/libdevcrypto/Common.h @@ -123,6 +123,9 @@ bool verify(Public const& _k, Signature const& _s, h256 const& _hash); /// Derive key via PBKDF2. bytes pbkdf2(std::string const& _pass, bytes const& _salt, unsigned _iterations, unsigned _dkLen = 32); +/// Derive key via Scrypt. +bytes scrypt(std::string const& _pass, bytes const& _salt, uint64_t _n, uint32_t _r, uint32_t _p, unsigned _dkLen); + /// Simple class that represents a "key pair". /// All of the data of the class can be regenerated from the secret key (m_secret) alone. /// Actually stores a tuplet of secret, public and address (the right 160-bits of the public). diff --git a/libdevcrypto/SecretStore.cpp b/libdevcrypto/SecretStore.cpp index 0416aa9f4..7bc870bcf 100644 --- a/libdevcrypto/SecretStore.cpp +++ b/libdevcrypto/SecretStore.cpp @@ -188,6 +188,11 @@ bytes SecretStore::decrypt(std::string const& _v, std::string const& _pass) bytes salt = fromHex(params["salt"].get_str()); derivedKey = pbkdf2(_pass, salt, iterations, params["dklen"].get_int()); } + else if (o["kdf"].get_str() == "scrypt") + { + auto p = o["kdfparams"].get_obj(); + derivedKey = scrypt(_pass, fromHex(p["salt"].get_str()), p["n"].get_int(), p["p"].get_int(), p["r"].get_int(), p["dklen"].get_int()); + } else { cwarn << "Unknown KDF" << o["kdf"].get_str() << "not supported."; diff --git a/libscrypt/CMakeLists.txt b/libscrypt/CMakeLists.txt new file mode 100644 index 000000000..8543244c5 --- /dev/null +++ b/libscrypt/CMakeLists.txt @@ -0,0 +1,24 @@ +cmake_policy(SET CMP0015 NEW) +# this policy was introduced in cmake 3.0 +# remove if, once 3.0 will be used on unix +if (${CMAKE_MAJOR_VERSION} GREATER 2) + # old policy do not use MACOSX_RPATH + cmake_policy(SET CMP0042 OLD) +endif() +set(CMAKE_AUTOMOC OFF) + +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSTATICLIB") + +aux_source_directory(. SRC_LIST) + +include_directories(BEFORE ..) + +set(EXECUTABLE scrypt) + +file(GLOB HEADERS "*.h") + +add_library(${EXECUTABLE} ${SRC_LIST} ${HEADERS}) + +install( TARGETS ${EXECUTABLE} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) +install( FILES ${HEADERS} DESTINATION include/${EXECUTABLE} ) + diff --git a/libscrypt/LICENSE b/libscrypt/LICENSE new file mode 100644 index 000000000..46a743175 --- /dev/null +++ b/libscrypt/LICENSE @@ -0,0 +1,9 @@ +Copyright (c) 2013, Joshua Small + All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: +Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + diff --git a/libscrypt/b64.c b/libscrypt/b64.c new file mode 100644 index 000000000..b797dd0d9 --- /dev/null +++ b/libscrypt/b64.c @@ -0,0 +1,313 @@ +/* + * Copyright (c) 1996 by Internet Software Consortium. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS + * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE + * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + * SOFTWARE. + */ + +/* + * Portions Copyright (c) 1995 by International Business Machines, Inc. + * + * International Business Machines, Inc. (hereinafter called IBM) grants + * permission under its copyrights to use, copy, modify, and distribute this + * Software with or without fee, provided that the above copyright notice and + * all paragraphs of this notice appear in all copies, and that the name of IBM + * not be used in connection with the marketing of any product incorporating + * the Software or modifications thereof, without specific, written prior + * permission. + * + * To the extent it has a right to do so, IBM grants an immunity from suit + * under its patents, if any, for the use, sale or manufacture of products to + * the extent that such products are used for performing Domain Name System + * dynamic updates in TCP/IP networks by means of the Software. No immunity is + * granted for any product per se or for any other function of any product. + * + * THE SOFTWARE IS PROVIDED "AS IS", AND IBM DISCLAIMS ALL WARRANTIES, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, + * DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE, EVEN + * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES. + */ + +/* + * Base64 encode/decode functions from OpenBSD (src/lib/libc/net/base64.c). + */ +#include +#include +#include +#include +#include + +#include "b64.h" + + +static const char Base64[] = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; +static const char Pad64 = '='; + +/* (From RFC1521 and draft-ietf-dnssec-secext-03.txt) + The following encoding technique is taken from RFC 1521 by Borenstein + and Freed. It is reproduced here in a slightly edited form for + convenience. + + A 65-character subset of US-ASCII is used, enabling 6 bits to be + represented per printable character. (The extra 65th character, "=", + is used to signify a special processing function.) + + The encoding process represents 24-bit groups of input bits as output + strings of 4 encoded characters. Proceeding from left to right, a + 24-bit input group is formed by concatenating 3 8-bit input groups. + These 24 bits are then treated as 4 concatenated 6-bit groups, each + of which is translated into a single digit in the base64 alphabet. + + Each 6-bit group is used as an index into an array of 64 printable + characters. The character referenced by the index is placed in the + output string. + + Table 1: The Base64 Alphabet + + Value Encoding Value Encoding Value Encoding Value Encoding + 0 A 17 R 34 i 51 z + 1 B 18 S 35 j 52 0 + 2 C 19 T 36 k 53 1 + 3 D 20 U 37 l 54 2 + 4 E 21 V 38 m 55 3 + 5 F 22 W 39 n 56 4 + 6 G 23 X 40 o 57 5 + 7 H 24 Y 41 p 58 6 + 8 I 25 Z 42 q 59 7 + 9 J 26 a 43 r 60 8 + 10 K 27 b 44 s 61 9 + 11 L 28 c 45 t 62 + + 12 M 29 d 46 u 63 / + 13 N 30 e 47 v + 14 O 31 f 48 w (pad) = + 15 P 32 g 49 x + 16 Q 33 h 50 y + + Special processing is performed if fewer than 24 bits are available + at the end of the data being encoded. A full encoding quantum is + always completed at the end of a quantity. When fewer than 24 input + bits are available in an input group, zero bits are added (on the + right) to form an integral number of 6-bit groups. Padding at the + end of the data is performed using the '=' character. + + Since all base64 input is an integral number of octets, only the + ------------------------------------------------- + following cases can arise: + + (1) the final quantum of encoding input is an integral + multiple of 24 bits; here, the final unit of encoded + output will be an integral multiple of 4 characters + with no "=" padding, + (2) the final quantum of encoding input is exactly 8 bits; + here, the final unit of encoded output will be two + characters followed by two "=" padding characters, or + (3) the final quantum of encoding input is exactly 16 bits; + here, the final unit of encoded output will be three + characters followed by one "=" padding character. +*/ + +int +libscrypt_b64_encode(src, srclength, target, targsize) + unsigned char const *src; + size_t srclength; + char *target; + size_t targsize; +{ + size_t datalength = 0; + unsigned char input[3]; + unsigned char output[4]; + unsigned int i; + + while (2 < srclength) { + input[0] = *src++; + input[1] = *src++; + input[2] = *src++; + srclength -= 3; + + output[0] = input[0] >> 2; + output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4); + output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6); + output[3] = input[2] & 0x3f; + + if (datalength + 4 > targsize) + return (-1); + target[datalength++] = Base64[output[0]]; + target[datalength++] = Base64[output[1]]; + target[datalength++] = Base64[output[2]]; + target[datalength++] = Base64[output[3]]; + } + + /* Now we worry about padding. */ + if (0 != srclength) { + /* Get what's left. */ + input[0] = input[1] = input[2] = '\0'; + for (i = 0; i < srclength; i++) + input[i] = *src++; + + output[0] = input[0] >> 2; + output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4); + output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6); + + if (datalength + 4 > targsize) + return (-1); + target[datalength++] = Base64[output[0]]; + target[datalength++] = Base64[output[1]]; + if (srclength == 1) + target[datalength++] = Pad64; + else + target[datalength++] = Base64[output[2]]; + target[datalength++] = Pad64; + } + if (datalength >= targsize) + return (-1); + target[datalength] = '\0'; /* Returned value doesn't count \0. */ + return (int)(datalength); +} + +/* skips all whitespace anywhere. + converts characters, four at a time, starting at (or after) + src from base - 64 numbers into three 8 bit bytes in the target area. + it returns the number of data bytes stored at the target, or -1 on error. + */ + +int +libscrypt_b64_decode(src, target, targsize) + char const *src; + unsigned char *target; + size_t targsize; +{ + int state, ch; + unsigned int tarindex; + unsigned char nextbyte; + char *pos; + + state = 0; + tarindex = 0; + + while ((ch = (unsigned char)*src++) != '\0') { + if (isspace(ch)) /* Skip whitespace anywhere. */ + continue; + + if (ch == Pad64) + break; + + pos = strchr(Base64, ch); + if (pos == 0) /* A non-base64 character. */ + return (-1); + + switch (state) { + case 0: + if (target) { + if (tarindex >= targsize) + return (-1); + target[tarindex] = (pos - Base64) << 2; + } + state = 1; + break; + case 1: + if (target) { + if (tarindex >= targsize) + return (-1); + target[tarindex] |= (pos - Base64) >> 4; + nextbyte = ((pos - Base64) & 0x0f) << 4; + if (tarindex + 1 < targsize) + target[tarindex+1] = nextbyte; + else if (nextbyte) + return (-1); + } + tarindex++; + state = 2; + break; + case 2: + if (target) { + if (tarindex >= targsize) + return (-1); + target[tarindex] |= (pos - Base64) >> 2; + nextbyte = ((pos - Base64) & 0x03) << 6; + if (tarindex + 1 < targsize) + target[tarindex+1] = nextbyte; + else if (nextbyte) + return (-1); + } + tarindex++; + state = 3; + break; + case 3: + if (target) { + if (tarindex >= targsize) + return (-1); + target[tarindex] |= (pos - Base64); + } + tarindex++; + state = 0; + break; + } + } + + /* + * We are done decoding Base-64 chars. Let's see if we ended + * on a byte boundary, and/or with erroneous trailing characters. + */ + + if (ch == Pad64) { /* We got a pad char. */ + ch = (unsigned char)*src++; /* Skip it, get next. */ + switch (state) { + case 0: /* Invalid = in first position */ + case 1: /* Invalid = in second position */ + return (-1); + + case 2: /* Valid, means one byte of info */ + /* Skip any number of spaces. */ + for (; ch != '\0'; ch = (unsigned char)*src++) + if (!isspace(ch)) + break; + /* Make sure there is another trailing = sign. */ + if (ch != Pad64) + return (-1); + ch = (unsigned char)*src++; /* Skip the = */ + /* Fall through to "single trailing =" case. */ + /* FALLTHROUGH */ + + case 3: /* Valid, means two bytes of info */ + /* + * We know this char is an =. Is there anything but + * whitespace after it? + */ + for (; ch != '\0'; ch = (unsigned char)*src++) + if (!isspace(ch)) + return (-1); + + /* + * Now make sure for cases 2 and 3 that the "extra" + * bits that slopped past the last full byte were + * zeros. If we don't check them, they become a + * subliminal channel. + */ + if (target && tarindex < targsize && + target[tarindex] != 0) + return (-1); + } + } else { + /* + * We ended by seeing the end of the string. Make sure we + * have no partial bytes lying around. + */ + if (state != 0) + return (-1); + } + + return (tarindex); +} diff --git a/libscrypt/b64.h b/libscrypt/b64.h new file mode 100644 index 000000000..2e271eb5b --- /dev/null +++ b/libscrypt/b64.h @@ -0,0 +1,10 @@ + +/* BASE64 libraries used internally - should not need to be packaged */ + +#define b64_encode_len(A) ((A+2)/3 * 4 + 1) +#define b64_decode_len(A) (A / 4 * 3 + 2) + +int libscrypt_b64_encode(unsigned char const *src, size_t srclength, + /*@out@*/ char *target, size_t targetsize); +int libscrypt_b64_decode(char const *src, /*@out@*/ unsigned char *target, + size_t targetsize); diff --git a/libscrypt/crypto-mcf.c b/libscrypt/crypto-mcf.c new file mode 100644 index 000000000..8ad3eb826 --- /dev/null +++ b/libscrypt/crypto-mcf.c @@ -0,0 +1,73 @@ +#include +#include +#include +#include +#include +#include +#include + +#ifndef S_SPLINT_S /* Including this here triggers a known bug in splint */ +#include +#endif + +#include "libscrypt.h" + +/* ilog2 for powers of two */ +static uint32_t scrypt_ilog2(uint32_t n) +{ +#ifndef S_SPLINT_S + + /* Check for a valid power of two */ + if (n < 2 || (n & (n - 1))) + return -1; +#endif + uint32_t t = 1; + while (((uint32_t)1 << t) < n) + { + if(t > SCRYPT_SAFE_N) + return (uint32_t) -1; /* Check for insanity */ + t++; + } + + return t; +} + +#ifdef _MSC_VER + #define SNPRINTF _snprintf +#else + #define SNPRINTF snprintf +#endif + +int libscrypt_mcf(uint32_t N, uint32_t r, uint32_t p, const char *salt, + const char *hash, char *mcf) +{ + + uint32_t t, params; + int s; + + if(!mcf || !hash) + return 0; + /* Although larger values of r, p are valid in scrypt, this mcf format + * limits to 8 bits. If your number is larger, current computers will + * struggle + */ + if(r > (uint8_t)(-1) || p > (uint8_t)(-1)) + return 0; + + t = scrypt_ilog2(N); + if (t < 1) + return 0; + + params = (r << 8) + p; + params += (uint32_t)t << 16; + + /* Using snprintf - not checking for overflows. We've already + * determined that mcf should be defined as at least SCRYPT_MCF_LEN + * in length + */ + s = SNPRINTF(mcf, SCRYPT_MCF_LEN, SCRYPT_MCF_ID "$%06x$%s$%s", (unsigned int)params, salt, hash); + if (s > SCRYPT_MCF_LEN) + return 0; + + return 1; +} diff --git a/libscrypt/crypto-scrypt-saltgen.c b/libscrypt/crypto-scrypt-saltgen.c new file mode 100644 index 000000000..a0e29988c --- /dev/null +++ b/libscrypt/crypto-scrypt-saltgen.c @@ -0,0 +1,48 @@ +#include +#include +#include +#include +#include + +#ifndef S_SPLINT_S /* Including this here triggers a known bug in splint */ +#include +#endif + +#define RNGDEV "/dev/urandom" + +int libscrypt_salt_gen(uint8_t *salt, size_t len) +{ + unsigned char buf[len]; + size_t data_read = 0; + int urandom = open(RNGDEV, O_RDONLY); + + if (urandom < 0) + { + return -1; + } + + while (data_read < len) { + ssize_t result = read(urandom, buf + data_read, len - data_read); + + if (result < 0) + { + if (errno == EINTR || errno == EAGAIN) { + continue; + } + + else { + (void)close(urandom); + return -1; + } + } + + data_read += result; + } + + /* Failures on close() shouldn't occur with O_RDONLY */ + (void)close(urandom); + + memcpy(salt, buf, len); + + return 0; +} diff --git a/libscrypt/crypto_scrypt-check.c b/libscrypt/crypto_scrypt-check.c new file mode 100644 index 000000000..99477ffe9 --- /dev/null +++ b/libscrypt/crypto_scrypt-check.c @@ -0,0 +1,100 @@ +#include +#include +#include +#include + +#include "b64.h" +#include "slowequals.h" +#include "libscrypt.h" + +#ifdef _WIN32 +/* On windows, strtok uses a thread-local static variable in strtok to + * make strtok thread-safe. It also neglects to provide a strtok_r. */ +#define strtok_r(str, val, saveptr) strtok((str), (val)) +#endif + +int libscrypt_check(char *mcf, const char *password) +{ + /* Return values: + * <0 error + * == 0 password incorrect + * >0 correct password + */ + +#ifndef _WIN32 + char *saveptr = NULL; +#endif + uint32_t params; + uint64_t N; + uint8_t r, p; + int retval; + uint8_t hashbuf[64]; + char outbuf[128]; + uint8_t salt[32]; + char *tok; + + if(memcmp(mcf, SCRYPT_MCF_ID, 3) != 0) + { + /* Only version 0 supported */ + return -1; + } + + tok = strtok_r(mcf, "$", &saveptr); + if ( !tok ) + return -1; + + tok = strtok_r(NULL, "$", &saveptr); + + if ( !tok ) + return -1; + + params = (uint32_t)strtoul(tok, NULL, 16); + if ( params == 0 ) + return -1; + + tok = strtok_r(NULL, "$", &saveptr); + + if ( !tok ) + return -1; + + p = params & 0xff; + r = (params >> 8) & 0xff; + N = params >> 16; + + if (N > SCRYPT_SAFE_N) + return -1; + + N = (uint64_t)1 << N; + + /* Useful debugging: + printf("We've obtained salt 'N' r p of '%s' %d %d %d\n", tok, N,r,p); + */ + + memset(salt, 0, sizeof(salt)); /* Keeps splint happy */ + retval = libscrypt_b64_decode(tok, (unsigned char*)salt, sizeof(salt)); + if (retval < 1) + return -1; + + retval = libscrypt_scrypt((uint8_t*)password, strlen(password), salt, + (uint32_t)retval, N, r, p, hashbuf, sizeof(hashbuf)); + + if (retval != 0) + return -1; + + retval = libscrypt_b64_encode((unsigned char*)hashbuf, sizeof(hashbuf), + outbuf, sizeof(outbuf)); + + if (retval == 0) + return -1; + + tok = strtok_r(NULL, "$", &saveptr); + + if ( !tok ) + return -1; + + if(slow_equals(tok, outbuf) == 0) + return 0; + + return 1; /* This is the "else" condition */ +} + diff --git a/libscrypt/crypto_scrypt-hash.c b/libscrypt/crypto_scrypt-hash.c new file mode 100644 index 000000000..4b41007db --- /dev/null +++ b/libscrypt/crypto_scrypt-hash.c @@ -0,0 +1,44 @@ +#include +#include +#include +#include + +#include "b64.h" +#include "libscrypt.h" + +int libscrypt_hash(char *dst, const char *passphrase, uint32_t N, uint8_t r, + uint8_t p) +{ + + int retval; + uint8_t salt[SCRYPT_SALT_LEN]; + uint8_t hashbuf[SCRYPT_HASH_LEN]; + char outbuf[256]; + char saltbuf[256]; + + if(libscrypt_salt_gen(salt, SCRYPT_SALT_LEN) == -1) + { + return 0; + } + + retval = libscrypt_scrypt((const uint8_t*)passphrase, strlen(passphrase), + (uint8_t*)salt, SCRYPT_SALT_LEN, N, r, p, hashbuf, sizeof(hashbuf)); + if(retval == -1) + return 0; + + retval = libscrypt_b64_encode((unsigned char*)hashbuf, sizeof(hashbuf), + outbuf, sizeof(outbuf)); + if(retval == -1) + return 0; + + retval = libscrypt_b64_encode((unsigned char *)salt, sizeof(salt), + saltbuf, sizeof(saltbuf)); + if(retval == -1) + return 0; + + retval = libscrypt_mcf(N, r, p, saltbuf, outbuf, dst); + if(retval != 1) + return 0; + + return 1; +} diff --git a/libscrypt/crypto_scrypt-hexconvert.c b/libscrypt/crypto_scrypt-hexconvert.c new file mode 100644 index 000000000..3df12a023 --- /dev/null +++ b/libscrypt/crypto_scrypt-hexconvert.c @@ -0,0 +1,35 @@ +#include +#include +#include +#include + +/* The hexconvert function is only used to test reference vectors against + * known answers. The contents of this file are therefore a component + * to assist with test harnesses only + */ + +int libscrypt_hexconvert(uint8_t *buf, size_t s, char *outbuf, size_t obs) +{ + + size_t i; + int len = 0; + + if (!buf || s < 1 || obs < (s * 2 + 1)) + return 0; + + memset(outbuf, 0, obs); + + + for(i=0; i<=(s-1); i++) + { + /* snprintf(outbuf, s,"%s...", outbuf....) has undefined results + * and can't be used. Using offests like this makes snprintf + * nontrivial. we therefore have use inescure sprintf() and + * lengths checked elsewhere (start of function) */ + /*@ -bufferoverflowhigh @*/ + len += sprintf(outbuf+len, "%02x", (unsigned int) buf[i]); + } + + return 1; +} + diff --git a/libscrypt/crypto_scrypt-hexconvert.h b/libscrypt/crypto_scrypt-hexconvert.h new file mode 100644 index 000000000..8175b24f1 --- /dev/null +++ b/libscrypt/crypto_scrypt-hexconvert.h @@ -0,0 +1,9 @@ + +#include + +/** + * Converts a binary string to a hex representation of that string + * outbuf must have size of at least buf * 2 + 1. + */ +int libscrypt_hexconvert(const uint8_t *buf, size_t s, char *outbuf, + size_t obs); diff --git a/libscrypt/crypto_scrypt-nosse.c b/libscrypt/crypto_scrypt-nosse.c new file mode 100644 index 000000000..12c860f2d --- /dev/null +++ b/libscrypt/crypto_scrypt-nosse.c @@ -0,0 +1,342 @@ +/*- + * Copyright 2009 Colin Percival + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * This file was originally written by Colin Percival as part of the Tarsnap + * online backup system. + */ + +#include +#ifndef _WIN32 +#include +#endif +#include +#include +#include +#include + +#include "sha256.h" +#include "sysendian.h" + +#include "libscrypt.h" + +static void blkcpy(void *, void *, size_t); +static void blkxor(void *, void *, size_t); +static void salsa20_8(uint32_t[16]); +static void blockmix_salsa8(uint32_t *, uint32_t *, uint32_t *, size_t); +static uint64_t integerify(void *, size_t); +static void smix(uint8_t *, size_t, uint64_t, uint32_t *, uint32_t *); + +static void +blkcpy(void * dest, void * src, size_t len) +{ + size_t * D = dest; + size_t * S = src; + size_t L = len / sizeof(size_t); + size_t i; + + for (i = 0; i < L; i++) + D[i] = S[i]; +} + +static void +blkxor(void * dest, void * src, size_t len) +{ + size_t * D = dest; + size_t * S = src; + size_t L = len / sizeof(size_t); + size_t i; + + for (i = 0; i < L; i++) + D[i] ^= S[i]; +} + +/** + * salsa20_8(B): + * Apply the salsa20/8 core to the provided block. + */ +static void +salsa20_8(uint32_t B[16]) +{ + uint32_t x[16]; + size_t i; + + blkcpy(x, B, 64); + for (i = 0; i < 8; i += 2) { +#define R(a,b) (((a) << (b)) | ((a) >> (32 - (b)))) + /* Operate on columns. */ + x[ 4] ^= R(x[ 0]+x[12], 7); x[ 8] ^= R(x[ 4]+x[ 0], 9); + x[12] ^= R(x[ 8]+x[ 4],13); x[ 0] ^= R(x[12]+x[ 8],18); + + x[ 9] ^= R(x[ 5]+x[ 1], 7); x[13] ^= R(x[ 9]+x[ 5], 9); + x[ 1] ^= R(x[13]+x[ 9],13); x[ 5] ^= R(x[ 1]+x[13],18); + + x[14] ^= R(x[10]+x[ 6], 7); x[ 2] ^= R(x[14]+x[10], 9); + x[ 6] ^= R(x[ 2]+x[14],13); x[10] ^= R(x[ 6]+x[ 2],18); + + x[ 3] ^= R(x[15]+x[11], 7); x[ 7] ^= R(x[ 3]+x[15], 9); + x[11] ^= R(x[ 7]+x[ 3],13); x[15] ^= R(x[11]+x[ 7],18); + + /* Operate on rows. */ + x[ 1] ^= R(x[ 0]+x[ 3], 7); x[ 2] ^= R(x[ 1]+x[ 0], 9); + x[ 3] ^= R(x[ 2]+x[ 1],13); x[ 0] ^= R(x[ 3]+x[ 2],18); + + x[ 6] ^= R(x[ 5]+x[ 4], 7); x[ 7] ^= R(x[ 6]+x[ 5], 9); + x[ 4] ^= R(x[ 7]+x[ 6],13); x[ 5] ^= R(x[ 4]+x[ 7],18); + + x[11] ^= R(x[10]+x[ 9], 7); x[ 8] ^= R(x[11]+x[10], 9); + x[ 9] ^= R(x[ 8]+x[11],13); x[10] ^= R(x[ 9]+x[ 8],18); + + x[12] ^= R(x[15]+x[14], 7); x[13] ^= R(x[12]+x[15], 9); + x[14] ^= R(x[13]+x[12],13); x[15] ^= R(x[14]+x[13],18); +#undef R + } + for (i = 0; i < 16; i++) + B[i] += x[i]; +} + +/** + * blockmix_salsa8(Bin, Bout, X, r): + * Compute Bout = BlockMix_{salsa20/8, r}(Bin). The input Bin must be 128r + * bytes in length; the output Bout must also be the same size. The + * temporary space X must be 64 bytes. + */ +static void +blockmix_salsa8(uint32_t * Bin, uint32_t * Bout, uint32_t * X, size_t r) +{ + size_t i; + + /* 1: X <-- B_{2r - 1} */ + blkcpy(X, &Bin[(2 * r - 1) * 16], 64); + + /* 2: for i = 0 to 2r - 1 do */ + for (i = 0; i < 2 * r; i += 2) { + /* 3: X <-- H(X \xor B_i) */ + blkxor(X, &Bin[i * 16], 64); + salsa20_8(X); + + /* 4: Y_i <-- X */ + /* 6: B' <-- (Y_0, Y_2 ... Y_{2r-2}, Y_1, Y_3 ... Y_{2r-1}) */ + blkcpy(&Bout[i * 8], X, 64); + + /* 3: X <-- H(X \xor B_i) */ + blkxor(X, &Bin[i * 16 + 16], 64); + salsa20_8(X); + + /* 4: Y_i <-- X */ + /* 6: B' <-- (Y_0, Y_2 ... Y_{2r-2}, Y_1, Y_3 ... Y_{2r-1}) */ + blkcpy(&Bout[i * 8 + r * 16], X, 64); + } +} + +/** + * integerify(B, r): + * Return the result of parsing B_{2r-1} as a little-endian integer. + */ +static uint64_t +integerify(void * B, size_t r) +{ + uint32_t * X = (void *)((uintptr_t)(B) + (2 * r - 1) * 64); + + return (((uint64_t)(X[1]) << 32) + X[0]); +} + +/** + * smix(B, r, N, V, XY): + * Compute B = SMix_r(B, N). The input B must be 128r bytes in length; + * the temporary storage V must be 128rN bytes in length; the temporary + * storage XY must be 256r + 64 bytes in length. The value N must be a + * power of 2 greater than 1. The arrays B, V, and XY must be aligned to a + * multiple of 64 bytes. + */ +static void +smix(uint8_t * B, size_t r, uint64_t N, uint32_t * V, uint32_t * XY) +{ + uint32_t * X = XY; + uint32_t * Y = &XY[32 * r]; + uint32_t * Z = &XY[64 * r]; + uint64_t i; + uint64_t j; + size_t k; + + /* 1: X <-- B */ + for (k = 0; k < 32 * r; k++) + X[k] = le32dec(&B[4 * k]); + + /* 2: for i = 0 to N - 1 do */ + for (i = 0; i < N; i += 2) { + /* 3: V_i <-- X */ + blkcpy(&V[i * (32 * r)], X, 128 * r); + + /* 4: X <-- H(X) */ + blockmix_salsa8(X, Y, Z, r); + + /* 3: V_i <-- X */ + blkcpy(&V[(i + 1) * (32 * r)], Y, 128 * r); + + /* 4: X <-- H(X) */ + blockmix_salsa8(Y, X, Z, r); + } + + /* 6: for i = 0 to N - 1 do */ + for (i = 0; i < N; i += 2) { + /* 7: j <-- Integerify(X) mod N */ + j = integerify(X, r) & (N - 1); + + /* 8: X <-- H(X \xor V_j) */ + blkxor(X, &V[j * (32 * r)], 128 * r); + blockmix_salsa8(X, Y, Z, r); + + /* 7: j <-- Integerify(X) mod N */ + j = integerify(Y, r) & (N - 1); + + /* 8: X <-- H(X \xor V_j) */ + blkxor(Y, &V[j * (32 * r)], 128 * r); + blockmix_salsa8(Y, X, Z, r); + } + + /* 10: B' <-- X */ + for (k = 0; k < 32 * r; k++) + le32enc(&B[4 * k], X[k]); +} + +/** + * crypto_scrypt(passwd, passwdlen, salt, saltlen, N, r, p, buf, buflen): + * Compute scrypt(passwd[0 .. passwdlen - 1], salt[0 .. saltlen - 1], N, r, + * p, buflen) and write the result into buf. The parameters r, p, and buflen + * must satisfy r * p < 2^30 and buflen <= (2^32 - 1) * 32. The parameter N + * must be a power of 2 greater than 1. + * + * Return 0 on success; or -1 on error + */ +int +libscrypt_scrypt(const uint8_t * passwd, size_t passwdlen, + const uint8_t * salt, size_t saltlen, uint64_t N, uint32_t r, uint32_t p, + uint8_t * buf, size_t buflen) +{ + void * B0, * V0, * XY0; + uint8_t * B; + uint32_t * V; + uint32_t * XY; + uint32_t i; + + /* Sanity-check parameters. */ +#if SIZE_MAX > UINT32_MAX + if (buflen > (((uint64_t)(1) << 32) - 1) * 32) { + errno = EFBIG; + goto err0; + } +#endif + if ((uint64_t)(r) * (uint64_t)(p) >= (1 << 30)) { + errno = EFBIG; + goto err0; + } + if (r == 0 || p == 0) { + errno = EINVAL; + goto err0; + } + if (((N & (N - 1)) != 0) || (N < 2)) { + errno = EINVAL; + goto err0; + } + if ((r > SIZE_MAX / 128 / p) || +#if SIZE_MAX / 256 <= UINT32_MAX + (r > SIZE_MAX / 256) || +#endif + (N > SIZE_MAX / 128 / r)) { + errno = ENOMEM; + goto err0; + } + + /* Allocate memory. */ +#ifdef HAVE_POSIX_MEMALIGN + if ((errno = posix_memalign(&B0, 64, 128 * r * p)) != 0) + goto err0; + B = (uint8_t *)(B0); + if ((errno = posix_memalign(&XY0, 64, 256 * r + 64)) != 0) + goto err1; + XY = (uint32_t *)(XY0); +#ifndef MAP_ANON + if ((errno = posix_memalign(&V0, 64, 128 * r * N)) != 0) + goto err2; + V = (uint32_t *)(V0); +#endif +#else + if ((B0 = malloc(128 * r * p + 63)) == NULL) + goto err0; + B = (uint8_t *)(((uintptr_t)(B0) + 63) & ~ (uintptr_t)(63)); + if ((XY0 = malloc(256 * r + 64 + 63)) == NULL) + goto err1; + XY = (uint32_t *)(((uintptr_t)(XY0) + 63) & ~ (uintptr_t)(63)); +#ifndef MAP_ANON + if ((V0 = malloc(128 * r * N + 63)) == NULL) + goto err2; + V = (uint32_t *)(((uintptr_t)(V0) + 63) & ~ (uintptr_t)(63)); +#endif +#endif +#ifdef MAP_ANON + if ((V0 = mmap(NULL, 128 * r * N, PROT_READ | PROT_WRITE, +#ifdef MAP_NOCORE + MAP_ANON | MAP_PRIVATE | MAP_NOCORE, +#else + MAP_ANON | MAP_PRIVATE, +#endif + -1, 0)) == MAP_FAILED) + goto err2; + V = (uint32_t *)(V0); +#endif + + /* 1: (B_0 ... B_{p-1}) <-- PBKDF2(P, S, 1, p * MFLen) */ + libscrypt_PBKDF2_SHA256(passwd, passwdlen, salt, saltlen, 1, B, p * 128 * r); + + /* 2: for i = 0 to p - 1 do */ + for (i = 0; i < p; i++) { + /* 3: B_i <-- MF(B_i, N) */ + smix(&B[i * 128 * r], r, N, V, XY); + } + + /* 5: DK <-- PBKDF2(P, B, 1, dkLen) */ + libscrypt_PBKDF2_SHA256(passwd, passwdlen, B, p * 128 * r, 1, buf, buflen); + + /* Free memory. */ +#ifdef MAP_ANON + if (munmap(V0, 128 * r * N)) + goto err2; +#else + free(V0); +#endif + free(XY0); + free(B0); + + /* Success! */ + return (0); + +err2: + free(XY0); +err1: + free(B0); +err0: + /* Failure! */ + return (-1); +} diff --git a/libscrypt/libscrypt.h b/libscrypt/libscrypt.h new file mode 100644 index 000000000..b7141f5f5 --- /dev/null +++ b/libscrypt/libscrypt.h @@ -0,0 +1,67 @@ +/*- + */ +#ifndef _CRYPTO_SCRYPT_H_ +#define _CRYPTO_SCRYPT_H_ + + +#include + +#ifdef __cplusplus +extern "C"{ +#endif + +/** + * crypto_scrypt(passwd, passwdlen, salt, saltlen, N, r, p, buf, buflen): + * Compute scrypt(passwd[0 .. passwdlen - 1], salt[0 .. saltlen - 1], N, r, + * p, buflen) and write the result into buf. The parameters r, p, and buflen + * must satisfy r * p < 2^30 and buflen <= (2^32 - 1) * 32. The parameter N + * must be a power of 2 greater than 1. + * + * libscrypt_scrypt(passwd, passwdlen, salt, saltlen, N, r, p, buf, buflen): + * password; duh + * N: CPU AND RAM cost (first modifier) + * r: RAM Cost + * p: CPU cost (parallelisation) + * In short, N is your main performance modifier. Values of r = 8, p = 1 are + * standard unless you want to modify the CPU/RAM ratio. + * Return 0 on success; or -1 on error. + */ +int libscrypt_scrypt(const uint8_t *, size_t, const uint8_t *, size_t, uint64_t, + uint32_t, uint32_t, /*@out@*/ uint8_t *, size_t); + +/* Converts a series of input parameters to a MCF form for storage */ +int libscrypt_mcf(uint32_t N, uint32_t r, uint32_t p, const char *salt, + const char *hash, char *mcf); + +#ifndef _MSC_VER +/* Generates a salt. Uses /dev/urandom/ + */ +int libscrypt_salt_gen(/*@out@*/ uint8_t *rand, size_t len); + +/* Creates a hash of a passphrase using a randomly generated salt */ +/* Returns >0 on success, or 0 for fail */ +int libscrypt_hash(char *dst, const char* passphrase, uint32_t N, uint8_t r, + uint8_t p); +#endif + +/* Checks a given MCF against a password */ +int libscrypt_check(char *mcf, const char *password); + +#ifdef __cplusplus +} +#endif + +/* Sane default values */ +#define SCRYPT_HASH_LEN 64 /* This can be user defined - + *but 64 is the reference size + */ +#define SCRYPT_SAFE_N 30 /* This is much higher than you want. It's just + * a blocker for insane defines + */ +#define SCRYPT_SALT_LEN 16 /* This is just a recommended size */ +#define SCRYPT_MCF_LEN 125 /* mcf is 120 byte + nul */ +#define SCRYPT_MCF_ID "$s1" +#define SCRYPT_N 16384 +#define SCRYPT_r 8 +#define SCRYPT_p 16 +#endif /* !_CRYPTO_SCRYPT_H_ */ diff --git a/libscrypt/libscrypt.version b/libscrypt/libscrypt.version new file mode 100644 index 000000000..9cc574db2 --- /dev/null +++ b/libscrypt/libscrypt.version @@ -0,0 +1,8 @@ +libscrypt { + global: libscrypt_check; +libscrypt_hash; +libscrypt_mcf; +libscrypt_salt_gen; +libscrypt_scrypt; + local: *; +}; diff --git a/libscrypt/sha256.c b/libscrypt/sha256.c new file mode 100644 index 000000000..279e3cf8d --- /dev/null +++ b/libscrypt/sha256.c @@ -0,0 +1,411 @@ +/*- + * Copyright 2005,2007,2009 Colin Percival + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include + +#include +#include + +#include "sysendian.h" + +#include "sha256.h" + +/* + * Encode a length len/4 vector of (uint32_t) into a length len vector of + * (unsigned char) in big-endian form. Assumes len is a multiple of 4. + */ +static void +be32enc_vect(unsigned char *dst, const uint32_t *src, size_t len) +{ + size_t i; + + for (i = 0; i < len / 4; i++) + be32enc(dst + i * 4, src[i]); +} + +/* + * Decode a big-endian length len vector of (unsigned char) into a length + * len/4 vector of (uint32_t). Assumes len is a multiple of 4. + */ +static void +be32dec_vect(uint32_t *dst, const unsigned char *src, size_t len) +{ + size_t i; + + for (i = 0; i < len / 4; i++) + dst[i] = be32dec(src + i * 4); +} + +/* Elementary functions used by SHA256 */ +#define Ch(x, y, z) ((x & (y ^ z)) ^ z) +#define Maj(x, y, z) ((x & (y | z)) | (y & z)) +#define SHR(x, n) (x >> n) +#define ROTR(x, n) ((x >> n) | (x << (32 - n))) +#define S0(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22)) +#define S1(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25)) +#define s0(x) (ROTR(x, 7) ^ ROTR(x, 18) ^ SHR(x, 3)) +#define s1(x) (ROTR(x, 17) ^ ROTR(x, 19) ^ SHR(x, 10)) + +/* SHA256 round function */ +#define RND(a, b, c, d, e, f, g, h, k) \ + t0 = h + S1(e) + Ch(e, f, g) + k; \ + t1 = S0(a) + Maj(a, b, c); \ + d += t0; \ + h = t0 + t1; + +/* Adjusted round function for rotating state */ +#define RNDr(S, W, i, k) \ + RND(S[(64 - i) % 8], S[(65 - i) % 8], \ + S[(66 - i) % 8], S[(67 - i) % 8], \ + S[(68 - i) % 8], S[(69 - i) % 8], \ + S[(70 - i) % 8], S[(71 - i) % 8], \ + W[i] + k) + +/* + * SHA256 block compression function. The 256-bit state is transformed via + * the 512-bit input block to produce a new state. + */ +static void +SHA256_Transform(uint32_t * state, const unsigned char block[64]) +{ + uint32_t W[64]; + uint32_t S[8]; + uint32_t t0, t1; + int i; + + /* 1. Prepare message schedule W. */ + be32dec_vect(W, block, 64); + for (i = 16; i < 64; i++) + W[i] = s1(W[i - 2]) + W[i - 7] + s0(W[i - 15]) + W[i - 16]; + + /* 2. Initialize working variables. */ + memcpy(S, state, 32); + + /* 3. Mix. */ + RNDr(S, W, 0, 0x428a2f98); + RNDr(S, W, 1, 0x71374491); + RNDr(S, W, 2, 0xb5c0fbcf); + RNDr(S, W, 3, 0xe9b5dba5); + RNDr(S, W, 4, 0x3956c25b); + RNDr(S, W, 5, 0x59f111f1); + RNDr(S, W, 6, 0x923f82a4); + RNDr(S, W, 7, 0xab1c5ed5); + RNDr(S, W, 8, 0xd807aa98); + RNDr(S, W, 9, 0x12835b01); + RNDr(S, W, 10, 0x243185be); + RNDr(S, W, 11, 0x550c7dc3); + RNDr(S, W, 12, 0x72be5d74); + RNDr(S, W, 13, 0x80deb1fe); + RNDr(S, W, 14, 0x9bdc06a7); + RNDr(S, W, 15, 0xc19bf174); + RNDr(S, W, 16, 0xe49b69c1); + RNDr(S, W, 17, 0xefbe4786); + RNDr(S, W, 18, 0x0fc19dc6); + RNDr(S, W, 19, 0x240ca1cc); + RNDr(S, W, 20, 0x2de92c6f); + RNDr(S, W, 21, 0x4a7484aa); + RNDr(S, W, 22, 0x5cb0a9dc); + RNDr(S, W, 23, 0x76f988da); + RNDr(S, W, 24, 0x983e5152); + RNDr(S, W, 25, 0xa831c66d); + RNDr(S, W, 26, 0xb00327c8); + RNDr(S, W, 27, 0xbf597fc7); + RNDr(S, W, 28, 0xc6e00bf3); + RNDr(S, W, 29, 0xd5a79147); + RNDr(S, W, 30, 0x06ca6351); + RNDr(S, W, 31, 0x14292967); + RNDr(S, W, 32, 0x27b70a85); + RNDr(S, W, 33, 0x2e1b2138); + RNDr(S, W, 34, 0x4d2c6dfc); + RNDr(S, W, 35, 0x53380d13); + RNDr(S, W, 36, 0x650a7354); + RNDr(S, W, 37, 0x766a0abb); + RNDr(S, W, 38, 0x81c2c92e); + RNDr(S, W, 39, 0x92722c85); + RNDr(S, W, 40, 0xa2bfe8a1); + RNDr(S, W, 41, 0xa81a664b); + RNDr(S, W, 42, 0xc24b8b70); + RNDr(S, W, 43, 0xc76c51a3); + RNDr(S, W, 44, 0xd192e819); + RNDr(S, W, 45, 0xd6990624); + RNDr(S, W, 46, 0xf40e3585); + RNDr(S, W, 47, 0x106aa070); + RNDr(S, W, 48, 0x19a4c116); + RNDr(S, W, 49, 0x1e376c08); + RNDr(S, W, 50, 0x2748774c); + RNDr(S, W, 51, 0x34b0bcb5); + RNDr(S, W, 52, 0x391c0cb3); + RNDr(S, W, 53, 0x4ed8aa4a); + RNDr(S, W, 54, 0x5b9cca4f); + RNDr(S, W, 55, 0x682e6ff3); + RNDr(S, W, 56, 0x748f82ee); + RNDr(S, W, 57, 0x78a5636f); + RNDr(S, W, 58, 0x84c87814); + RNDr(S, W, 59, 0x8cc70208); + RNDr(S, W, 60, 0x90befffa); + RNDr(S, W, 61, 0xa4506ceb); + RNDr(S, W, 62, 0xbef9a3f7); + RNDr(S, W, 63, 0xc67178f2); + + /* 4. Mix local working variables into global state */ + for (i = 0; i < 8; i++) + state[i] += S[i]; + + /* Clean the stack. */ + memset(W, 0, 256); + memset(S, 0, 32); + t0 = t1 = 0; +} + +static unsigned char PAD[64] = { + 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +/* Add padding and terminating bit-count. */ +static void +SHA256_Pad(SHA256_CTX * ctx) +{ + unsigned char len[8]; + uint32_t r, plen; + + /* + * Convert length to a vector of bytes -- we do this now rather + * than later because the length will change after we pad. + */ + be32enc_vect(len, ctx->count, 8); + + /* Add 1--64 bytes so that the resulting length is 56 mod 64 */ + r = (ctx->count[1] >> 3) & 0x3f; + plen = (r < 56) ? (56 - r) : (120 - r); + libscrypt_SHA256_Update(ctx, PAD, (size_t)plen); + + /* Add the terminating bit-count */ + libscrypt_SHA256_Update(ctx, len, 8); +} + +/* SHA-256 initialization. Begins a SHA-256 operation. */ +void +libscrypt_SHA256_Init(SHA256_CTX * ctx) +{ + + /* Zero bits processed so far */ + ctx->count[0] = ctx->count[1] = 0; + + /* Magic initialization constants */ + ctx->state[0] = 0x6A09E667; + ctx->state[1] = 0xBB67AE85; + ctx->state[2] = 0x3C6EF372; + ctx->state[3] = 0xA54FF53A; + ctx->state[4] = 0x510E527F; + ctx->state[5] = 0x9B05688C; + ctx->state[6] = 0x1F83D9AB; + ctx->state[7] = 0x5BE0CD19; +} + +/* Add bytes into the hash */ +void +libscrypt_SHA256_Update(SHA256_CTX * ctx, const void *in, size_t len) +{ + uint32_t bitlen[2]; + uint32_t r; + const unsigned char *src = in; + + /* Number of bytes left in the buffer from previous updates */ + r = (ctx->count[1] >> 3) & 0x3f; + + /* Convert the length into a number of bits */ + bitlen[1] = ((uint32_t)len) << 3; + bitlen[0] = (uint32_t)(len >> 29); + + /* Update number of bits */ + if ((ctx->count[1] += bitlen[1]) < bitlen[1]) + ctx->count[0]++; + ctx->count[0] += bitlen[0]; + + /* Handle the case where we don't need to perform any transforms */ + if (len < 64 - r) { + memcpy(&ctx->buf[r], src, len); + return; + } + + /* Finish the current block */ + memcpy(&ctx->buf[r], src, 64 - r); + SHA256_Transform(ctx->state, ctx->buf); + src += 64 - r; + len -= 64 - r; + + /* Perform complete blocks */ + while (len >= 64) { + SHA256_Transform(ctx->state, src); + src += 64; + len -= 64; + } + + /* Copy left over data into buffer */ + memcpy(ctx->buf, src, len); +} + +/* + * SHA-256 finalization. Pads the input data, exports the hash value, + * and clears the context state. + */ +void +libscrypt_SHA256_Final(unsigned char digest[32], SHA256_CTX * ctx) +{ + + /* Add padding */ + SHA256_Pad(ctx); + + /* Write the hash */ + be32enc_vect(digest, ctx->state, 32); + + /* Clear the context state */ + memset((void *)ctx, 0, sizeof(*ctx)); +} + +/* Initialize an HMAC-SHA256 operation with the given key. */ +void +libscrypt_HMAC_SHA256_Init(HMAC_SHA256_CTX * ctx, const void * _K, size_t Klen) +{ + unsigned char pad[64]; + unsigned char khash[32]; + const unsigned char * K = _K; + size_t i; + + /* If Klen > 64, the key is really SHA256(K). */ + if (Klen > 64) { + libscrypt_SHA256_Init(&ctx->ictx); + libscrypt_SHA256_Update(&ctx->ictx, K, Klen); + libscrypt_SHA256_Final(khash, &ctx->ictx); + K = khash; + Klen = 32; + } + + /* Inner SHA256 operation is SHA256(K xor [block of 0x36] || data). */ + libscrypt_SHA256_Init(&ctx->ictx); + memset(pad, 0x36, 64); + for (i = 0; i < Klen; i++) + pad[i] ^= K[i]; + libscrypt_SHA256_Update(&ctx->ictx, pad, 64); + + /* Outer SHA256 operation is SHA256(K xor [block of 0x5c] || hash). */ + libscrypt_SHA256_Init(&ctx->octx); + memset(pad, 0x5c, 64); + for (i = 0; i < Klen; i++) + pad[i] ^= K[i]; + libscrypt_SHA256_Update(&ctx->octx, pad, 64); + + /* Clean the stack. */ + memset(khash, 0, 32); +} + +/* Add bytes to the HMAC-SHA256 operation. */ +void +libscrypt_HMAC_SHA256_Update(HMAC_SHA256_CTX * ctx, const void *in, size_t len) +{ + + /* Feed data to the inner SHA256 operation. */ + libscrypt_SHA256_Update(&ctx->ictx, in, len); +} + +/* Finish an HMAC-SHA256 operation. */ +void +libscrypt_HMAC_SHA256_Final(unsigned char digest[32], HMAC_SHA256_CTX * ctx) +{ + unsigned char ihash[32]; + + /* Finish the inner SHA256 operation. */ + libscrypt_SHA256_Final(ihash, &ctx->ictx); + + /* Feed the inner hash to the outer SHA256 operation. */ + libscrypt_SHA256_Update(&ctx->octx, ihash, 32); + + /* Finish the outer SHA256 operation. */ + libscrypt_SHA256_Final(digest, &ctx->octx); + + /* Clean the stack. */ + memset(ihash, 0, 32); +} + +/** + * PBKDF2_SHA256(passwd, passwdlen, salt, saltlen, c, buf, dkLen): + * Compute PBKDF2(passwd, salt, c, dkLen) using HMAC-SHA256 as the PRF, and + * write the output to buf. The value dkLen must be at most 32 * (2^32 - 1). + */ +void +libscrypt_PBKDF2_SHA256(const uint8_t * passwd, size_t passwdlen, const uint8_t * salt, + size_t saltlen, uint64_t c, uint8_t * buf, size_t dkLen) +{ + HMAC_SHA256_CTX PShctx, hctx; + size_t i; + uint8_t ivec[4]; + uint8_t U[32]; + uint8_t T[32]; + uint64_t j; + int k; + size_t clen; + + /* Compute HMAC state after processing P and S. */ + libscrypt_HMAC_SHA256_Init(&PShctx, passwd, passwdlen); + libscrypt_HMAC_SHA256_Update(&PShctx, salt, saltlen); + + /* Iterate through the blocks. */ + for (i = 0; i * 32 < dkLen; i++) { + /* Generate INT(i + 1). */ + be32enc(ivec, (uint32_t)(i + 1)); + + /* Compute U_1 = PRF(P, S || INT(i)). */ + memcpy(&hctx, &PShctx, sizeof(HMAC_SHA256_CTX)); + libscrypt_HMAC_SHA256_Update(&hctx, ivec, 4); + libscrypt_HMAC_SHA256_Final(U, &hctx); + + /* T_i = U_1 ... */ + memcpy(T, U, 32); + + for (j = 2; j <= c; j++) { + /* Compute U_j. */ + libscrypt_HMAC_SHA256_Init(&hctx, passwd, passwdlen); + libscrypt_HMAC_SHA256_Update(&hctx, U, 32); + libscrypt_HMAC_SHA256_Final(U, &hctx); + + /* ... xor U_j ... */ + for (k = 0; k < 32; k++) + T[k] ^= U[k]; + } + + /* Copy as many bytes as necessary into buf. */ + clen = dkLen - i * 32; + if (clen > 32) + clen = 32; + memcpy(&buf[i * 32], T, clen); + } + + /* Clean PShctx, since we never called _Final on it. */ + memset(&PShctx, 0, sizeof(HMAC_SHA256_CTX)); +} diff --git a/libscrypt/sha256.h b/libscrypt/sha256.h new file mode 100644 index 000000000..f7138b417 --- /dev/null +++ b/libscrypt/sha256.h @@ -0,0 +1,70 @@ +/*- + * Copyright 2005,2007,2009 Colin Percival + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/lib/libmd/sha256.h,v 1.2 2006/01/17 15:35:56 phk Exp $ + */ + +#ifndef _SHA256_H_ +#define _SHA256_H_ + +#include + +#include + +typedef struct libscrypt_SHA256Context { + uint32_t state[8]; + uint32_t count[2]; + unsigned char buf[64]; +} SHA256_CTX; + +typedef struct libscrypt_HMAC_SHA256Context { + SHA256_CTX ictx; + SHA256_CTX octx; +} HMAC_SHA256_CTX; + +void libscrypt_SHA256_Init(/*@out@*/ SHA256_CTX *); +void libscrypt_SHA256_Update(SHA256_CTX *, const void *, size_t); + +/* Original declaration: + * void SHA256_Final(unsigned char [32], SHA256_CTX *); +*/ +void libscrypt_SHA256_Final(/*@out@*/ unsigned char [], SHA256_CTX *); +void libscrypt_HMAC_SHA256_Init(HMAC_SHA256_CTX *, const void *, size_t); +void libscrypt_HMAC_SHA256_Update(HMAC_SHA256_CTX *, const void *, size_t); + +/* Original declaration: + * void HMAC_SHA256_Final(unsigned char [32], HMAC_SHA256_CTX *); +*/ +void libscrypt_HMAC_SHA256_Final(unsigned char [], HMAC_SHA256_CTX *); + +/** + * PBKDF2_SHA256(passwd, passwdlen, salt, saltlen, c, buf, dkLen): + * Compute PBKDF2(passwd, salt, c, dkLen) using HMAC-SHA256 as the PRF, and + * write the output to buf. The value dkLen must be at most 32 * (2^32 - 1). + */ +void libscrypt_PBKDF2_SHA256(const uint8_t *, size_t, const uint8_t *, size_t, + uint64_t, uint8_t *, size_t); + +#endif /* !_SHA256_H_ */ diff --git a/libscrypt/slowequals.c b/libscrypt/slowequals.c new file mode 100644 index 000000000..48e488e4e --- /dev/null +++ b/libscrypt/slowequals.c @@ -0,0 +1,26 @@ +#include + +/* Implements a constant time version of strcmp() + * Will return 1 if a and b are equal, 0 if they are not */ +int slow_equals(const char* a, const char* b) +{ + size_t lena, lenb, diff, i; + lena = strlen(a); + lenb = strlen(b); + diff = strlen(a) ^ strlen(b); + + for(i=0; i we have isn't usable. */ +#if !HAVE_DECL_BE64ENC +#undef HAVE_SYS_ENDIAN_H +#endif + +#ifdef HAVE_SYS_ENDIAN_H + +#include + +#else + +#include +#ifdef _MSC_VER + #define INLINE __inline +#else + #define INLINE inline +#endif + +static INLINE uint32_t +be32dec(const void *pp) +{ + const uint8_t *p = (uint8_t const *)pp; + + return ((uint32_t)(p[3]) + ((uint32_t)(p[2]) << 8) + + ((uint32_t)(p[1]) << 16) + ((uint32_t)(p[0]) << 24)); +} + +static INLINE void +be32enc(void *pp, uint32_t x) +{ + uint8_t * p = (uint8_t *)pp; + + p[3] = x & 0xff; + p[2] = (x >> 8) & 0xff; + p[1] = (x >> 16) & 0xff; + p[0] = (x >> 24) & 0xff; +} + +static INLINE uint64_t +be64dec(const void *pp) +{ + const uint8_t *p = (uint8_t const *)pp; + + return ((uint64_t)(p[7]) + ((uint64_t)(p[6]) << 8) + + ((uint64_t)(p[5]) << 16) + ((uint64_t)(p[4]) << 24) + + ((uint64_t)(p[3]) << 32) + ((uint64_t)(p[2]) << 40) + + ((uint64_t)(p[1]) << 48) + ((uint64_t)(p[0]) << 56)); +} + +static INLINE void +be64enc(void *pp, uint64_t x) +{ + uint8_t * p = (uint8_t *)pp; + + p[7] = x & 0xff; + p[6] = (x >> 8) & 0xff; + p[5] = (x >> 16) & 0xff; + p[4] = (x >> 24) & 0xff; + p[3] = (x >> 32) & 0xff; + p[2] = (x >> 40) & 0xff; + p[1] = (x >> 48) & 0xff; + p[0] = (x >> 56) & 0xff; +} + +static INLINE uint32_t +le32dec(const void *pp) +{ + const uint8_t *p = (uint8_t const *)pp; + + return ((uint32_t)(p[0]) + ((uint32_t)(p[1]) << 8) + + ((uint32_t)(p[2]) << 16) + ((uint32_t)(p[3]) << 24)); +} + +static INLINE void +le32enc(void *pp, uint32_t x) +{ + uint8_t * p = (uint8_t *)pp; + + p[0] = x & 0xff; + p[1] = (x >> 8) & 0xff; + p[2] = (x >> 16) & 0xff; + p[3] = (x >> 24) & 0xff; +} + +static INLINE uint64_t +le64dec(const void *pp) +{ + const uint8_t *p = (uint8_t const *)pp; + + return ((uint64_t)(p[0]) + ((uint64_t)(p[1]) << 8) + + ((uint64_t)(p[2]) << 16) + ((uint64_t)(p[3]) << 24) + + ((uint64_t)(p[4]) << 32) + ((uint64_t)(p[5]) << 40) + + ((uint64_t)(p[6]) << 48) + ((uint64_t)(p[7]) << 56)); +} + +static INLINE void +le64enc(void *pp, uint64_t x) +{ + uint8_t * p = (uint8_t *)pp; + + p[0] = x & 0xff; + p[1] = (x >> 8) & 0xff; + p[2] = (x >> 16) & 0xff; + p[3] = (x >> 24) & 0xff; + p[4] = (x >> 32) & 0xff; + p[5] = (x >> 40) & 0xff; + p[6] = (x >> 48) & 0xff; + p[7] = (x >> 56) & 0xff; +} +#endif /* !HAVE_SYS_ENDIAN_H */ + +#endif /* !_SYSENDIAN_H_ */ From 3a3647c9f0f77d04a27c4005bc24f3c74aeaac7f Mon Sep 17 00:00:00 2001 From: subtly Date: Wed, 20 May 2015 21:54:35 +0200 Subject: [PATCH 312/461] Guard use of m_writeQueue operator[]. --- libp2p/Session.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/libp2p/Session.cpp b/libp2p/Session.cpp index 8f395158b..1c037e783 100644 --- a/libp2p/Session.cpp +++ b/libp2p/Session.cpp @@ -319,10 +319,14 @@ void Session::send(bytes&& _msg) void Session::write() { - const bytes& bytes = m_writeQueue[0]; - m_io->writeSingleFramePacket(&bytes, m_writeQueue[0]); + bytes *out; + DEV_GUARDED(x_writeQueue) + { + m_io->writeSingleFramePacket(&m_writeQueue[0], m_writeQueue[0]); + out = &m_writeQueue[0]; + } auto self(shared_from_this()); - ba::async_write(m_socket, ba::buffer(bytes), [this, self](boost::system::error_code ec, std::size_t /*length*/) + ba::async_write(m_socket, ba::buffer(*out), [this, self](boost::system::error_code ec, std::size_t /*length*/) { ThreadContext tc(info().id.abridged()); ThreadContext tc2(info().clientVersion); From e789f645eacd213c461277c787bd645c15e52ffd Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Wed, 20 May 2015 22:06:21 +0200 Subject: [PATCH 313/461] Ability to import version 1 keys. Possibly. --- alethzero/Main.ui | 8 ++- alethzero/MainWin.cpp | 27 +++++++++ alethzero/MainWin.h | 1 + libdevcrypto/SecretStore.cpp | 105 +++++++++++++++++++++++++++-------- libdevcrypto/SecretStore.h | 4 +- 5 files changed, 120 insertions(+), 25 deletions(-) diff --git a/alethzero/Main.ui b/alethzero/Main.ui index b5e22409d..f37f532a2 100644 --- a/alethzero/Main.ui +++ b/alethzero/Main.ui @@ -157,6 +157,7 @@ + @@ -1656,7 +1657,7 @@ font-size: 14pt &Enable Local Addresses - + true @@ -1745,6 +1746,11 @@ font-size: 14pt Co&nfirm Transactions + + + Import &Secret Key File... + + diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index 07f48c0bc..4f1da1c1a 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -813,6 +813,33 @@ void Main::on_importKey_triggered() } void Main::on_importKeyFile_triggered() +{ + QString s = QFileDialog::getOpenFileName(this, "Claim Account Contents", QDir::homePath(), "JSON Files (*.json);;All Files (*)"); + h128 uuid = m_keyManager.store().importKey(s.toStdString()); + if (!uuid) + { + QMessageBox::warning(this, "Key File Invalid", "Could not find secret key definition. This is probably not an Web3 key file."); + return; + } + + QString info = QInputDialog::getText(this, "Import Key File", "Enter a description of this key to help you recognise it in the future."); + + QString pass; + for (Secret s; !s;) + { + s = Secret(m_keyManager.store().secret(uuid, [&](){ + pass = QInputDialog::getText(this, "Import Key File", "Enter the password for the key to complete the import.", QLineEdit::Password); + return pass.toStdString(); + }, false)); + if (!s && QMessageBox::question(this, "Import Key File", "The password you provided is incorrect. Would you like to try again?", QMessageBox::Retry, QMessageBox::Cancel) == QMessageBox::Cancel) + return; + } + + QString hint = QInputDialog::getText(this, "Import Key File", "Enter a hint for this password to help you remember it."); + m_keyManager.importExisting(uuid, info.toStdString(), pass.toStdString(), hint.toStdString()); +} + +void Main::on_claimPresale_triggered() { QString s = QFileDialog::getOpenFileName(this, "Claim Account Contents", QDir::homePath(), "JSON Files (*.json);;All Files (*)"); try diff --git a/alethzero/MainWin.h b/alethzero/MainWin.h index 9f2082dd0..fdf7a9a72 100644 --- a/alethzero/MainWin.h +++ b/alethzero/MainWin.h @@ -138,6 +138,7 @@ private slots: void on_killAccount_triggered(); void on_importKey_triggered(); void on_importKeyFile_triggered(); + void on_claimPresale_triggered(); void on_exportKey_triggered(); // Account pane diff --git a/libdevcrypto/SecretStore.cpp b/libdevcrypto/SecretStore.cpp index 7bc870bcf..e422c32f8 100644 --- a/libdevcrypto/SecretStore.cpp +++ b/libdevcrypto/SecretStore.cpp @@ -22,6 +22,7 @@ #include "SecretStore.h" #include #include +#include #include #include #include @@ -42,10 +43,10 @@ SecretStore::~SecretStore() { } -bytes SecretStore::secret(h128 const& _uuid, function const& _pass) const +bytes SecretStore::secret(h128 const& _uuid, function const& _pass, bool _useCache) const { auto rit = m_cached.find(_uuid); - if (rit != m_cached.end()) + if (_useCache && rit != m_cached.end()) return rit->second; auto it = m_keys.find(_uuid); if (it == m_keys.end()) @@ -101,28 +102,71 @@ void SecretStore::save(std::string const& _keysPath) } } +static js::mValue upgraded(std::string const& _s) +{ + js::mValue v; + js::read_string(_s, v); + if (v.type() != js::obj_type) + return js::mValue(); + js::mObject ret = v.get_obj(); + unsigned version = ret.count("Version") ? stoi(ret["Version"].get_str()) : ret.count("version") ? ret["version"].get_int() : 0; + if (version == 1) + { + // upgrade to version 2 + js::mObject old; + swap(old, ret); + + ret["id"] = old["Id"]; + js::mObject c; + c["ciphertext"] = old["Crypto"].get_obj()["CipherText"]; + c["cipher"] = "aes-128-cbc"; + { + js::mObject cp; + cp["iv"] = old["Crypto"].get_obj()["IV"]; + c["cipherparams"] = cp; + } + c["kdf"] = old["Crypto"].get_obj()["KeyHeader"].get_obj()["Kdf"]; + { + js::mObject kp; + kp["salt"] = old["Crypto"].get_obj()["Salt"]; + for (auto const& i: old["Crypto"].get_obj()["KeyHeader"].get_obj()["KdfParams"].get_obj()) + if (i.first != "SaltLen") + kp[boost::to_lower_copy(i.first)] = i.second; + c["kdfparams"] = kp; + } + c["sillymac"] = old["Crypto"].get_obj()["MAC"]; + c["sillymacjson"] = _s; + ret["crypto"] = c; + version = 2; + } + if (version == 2) + return ret; + return js::mValue(); +} + void SecretStore::load(std::string const& _keysPath) { fs::path p(_keysPath); boost::filesystem::create_directories(p); - js::mValue v; for (fs::directory_iterator it(p); it != fs::directory_iterator(); ++it) if (is_regular_file(it->path())) - { - cdebug << "Reading" << it->path(); - js::read_string(contentsString(it->path().string()), v); - if (v.type() == js::obj_type) - { - js::mObject o = v.get_obj(); - int version = o.count("Version") ? stoi(o["Version"].get_str()) : o.count("version") ? o["version"].get_int() : 0; - if (version == 2) - m_keys[fromUUID(o["id"].get_str())] = make_pair(js::write_string(o["crypto"], false), it->path().string()); - else - cwarn << "Cannot read key version" << version; - } -// else -// cwarn << "Invalid JSON in key file" << it->path().string(); - } + readKey(it->path().string(), true); +} + +h128 SecretStore::readKey(std::string const& _file, bool _deleteFile) +{ + cdebug << "Reading" << _file; + js::mValue u = upgraded(contentsString(_file)); + if (u.type() == js::obj_type) + { + js::mObject& o = u.get_obj(); + auto uuid = fromUUID(o["id"].get_str()); + m_keys[uuid] = make_pair(js::write_string(o["crypto"], false), _deleteFile ? _file : string()); + return uuid; + } + else + cwarn << "Invalid JSON in key file" << _file; + return h128(); } std::string SecretStore::encrypt(bytes const& _v, std::string const& _pass) @@ -202,13 +246,28 @@ bytes SecretStore::decrypt(std::string const& _v, std::string const& _pass) bytes cipherText = fromHex(o["ciphertext"].get_str()); // check MAC - h256 mac(o["mac"].get_str()); - h256 macExp = sha3(bytesConstRef(&derivedKey).cropped(derivedKey.size() - 16).toBytes() + cipherText); - if (mac != macExp) + if (o.count("mac")) { - cwarn << "Invalid key - MAC mismatch; expected" << toString(macExp) << ", got" << toString(mac); - return bytes(); + h256 mac(o["mac"].get_str()); + h256 macExp = sha3(bytesConstRef(&derivedKey).cropped(derivedKey.size() - 16).toBytes() + cipherText); + if (mac != macExp) + { + cwarn << "Invalid key - MAC mismatch; expected" << toString(macExp) << ", got" << toString(mac); + return bytes(); + } } + else if (o.count("sillymac")) + { + h256 mac(o["sillymac"].get_str()); + h256 macExp = sha3(asBytes(o["sillymacjson"].get_str()) + bytesConstRef(&derivedKey).cropped(derivedKey.size() - 16).toBytes() + cipherText); + if (mac != macExp) + { + cwarn << "Invalid key - MAC mismatch; expected" << toString(macExp) << ", got" << toString(mac); + return bytes(); + } + } + else + cwarn << "No MAC. Proceeding anyway."; // decrypt if (o["cipher"].get_str() == "aes-128-cbc") diff --git a/libdevcrypto/SecretStore.h b/libdevcrypto/SecretStore.h index 18c290c1f..171603053 100644 --- a/libdevcrypto/SecretStore.h +++ b/libdevcrypto/SecretStore.h @@ -36,7 +36,8 @@ public: SecretStore(); ~SecretStore(); - bytes secret(h128 const& _uuid, std::function const& _pass) const; + bytes secret(h128 const& _uuid, std::function const& _pass, bool _useCache = true) const; + h128 importKey(std::string const& _file) { auto ret = readKey(_file, false); if (ret) save(); return ret; } h128 importSecret(bytes const& _s, std::string const& _pass); void kill(h128 const& _uuid); @@ -48,6 +49,7 @@ private: void load(std::string const& _keysPath = getDataDir("web3") + "/keys"); static std::string encrypt(bytes const& _v, std::string const& _pass); static bytes decrypt(std::string const& _v, std::string const& _pass); + h128 readKey(std::string const& _file, bool _deleteFile); mutable std::unordered_map m_cached; std::unordered_map> m_keys; From b0117dcf575cae67518d37a841c34f0e5409d132 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Wed, 20 May 2015 19:22:16 +0200 Subject: [PATCH 314/461] Scrypt support --- CMakeLists.txt | 1 + exp/main.cpp | 19 +- libdevcrypto/CMakeLists.txt | 1 + libdevcrypto/Common.cpp | 8 + libdevcrypto/Common.h | 3 + libdevcrypto/SecretStore.cpp | 5 + libscrypt/CMakeLists.txt | 24 ++ libscrypt/LICENSE | 9 + libscrypt/b64.c | 313 ++++++++++++++++++++ libscrypt/b64.h | 10 + libscrypt/crypto-mcf.c | 73 +++++ libscrypt/crypto-scrypt-saltgen.c | 48 ++++ libscrypt/crypto_scrypt-check.c | 100 +++++++ libscrypt/crypto_scrypt-hash.c | 44 +++ libscrypt/crypto_scrypt-hexconvert.c | 35 +++ libscrypt/crypto_scrypt-hexconvert.h | 9 + libscrypt/crypto_scrypt-nosse.c | 342 ++++++++++++++++++++++ libscrypt/libscrypt.h | 67 +++++ libscrypt/libscrypt.version | 8 + libscrypt/sha256.c | 411 +++++++++++++++++++++++++++ libscrypt/sha256.h | 70 +++++ libscrypt/slowequals.c | 26 ++ libscrypt/slowequals.h | 5 + libscrypt/sysendian.h | 144 ++++++++++ 24 files changed, 1771 insertions(+), 4 deletions(-) create mode 100644 libscrypt/CMakeLists.txt create mode 100644 libscrypt/LICENSE create mode 100644 libscrypt/b64.c create mode 100644 libscrypt/b64.h create mode 100644 libscrypt/crypto-mcf.c create mode 100644 libscrypt/crypto-scrypt-saltgen.c create mode 100644 libscrypt/crypto_scrypt-check.c create mode 100644 libscrypt/crypto_scrypt-hash.c create mode 100644 libscrypt/crypto_scrypt-hexconvert.c create mode 100644 libscrypt/crypto_scrypt-hexconvert.h create mode 100644 libscrypt/crypto_scrypt-nosse.c create mode 100644 libscrypt/libscrypt.h create mode 100644 libscrypt/libscrypt.version create mode 100644 libscrypt/sha256.c create mode 100644 libscrypt/sha256.h create mode 100644 libscrypt/slowequals.c create mode 100644 libscrypt/slowequals.h create mode 100644 libscrypt/sysendian.h diff --git a/CMakeLists.txt b/CMakeLists.txt index aafdad099..8239e20a4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -364,6 +364,7 @@ if (JSCONSOLE) endif () add_subdirectory(secp256k1) +add_subdirectory(libscrypt) add_subdirectory(libdevcrypto) if (GENERAL) diff --git a/exp/main.cpp b/exp/main.cpp index 47efe576a..5162d915b 100644 --- a/exp/main.cpp +++ b/exp/main.cpp @@ -36,7 +36,6 @@ #include #include #include -/* #include #include #include @@ -57,17 +56,29 @@ #include #include #include -#include */ +#include using namespace std; using namespace dev; -/*using namespace dev::eth; +using namespace dev::eth; using namespace dev::p2p; using namespace dev::shh; namespace js = json_spirit; namespace fs = boost::filesystem; -*/ + #if 1 +int main() +{ + cdebug << pbkdf2("password", asBytes("salt"), 1, 32); + cdebug << pbkdf2("password", asBytes("salt"), 1, 16); + cdebug << pbkdf2("password", asBytes("salt"), 2, 16); + cdebug << pbkdf2("testpassword", fromHex("de5742f1f1045c402296422cee5a8a9ecf0ac5bf594deca1170d22aef33a79cf"), 262144, 16); + return 0; +} + + +#elif 0 + int main() { cdebug << "EXP"; diff --git a/libdevcrypto/CMakeLists.txt b/libdevcrypto/CMakeLists.txt index 295dd257a..7df1149b0 100644 --- a/libdevcrypto/CMakeLists.txt +++ b/libdevcrypto/CMakeLists.txt @@ -22,6 +22,7 @@ add_library(${EXECUTABLE} ${SRC_LIST} ${HEADERS}) target_link_libraries(${EXECUTABLE} ${Boost_FILESYSTEM_LIBRARIES}) target_link_libraries(${EXECUTABLE} ${LEVELDB_LIBRARIES}) target_link_libraries(${EXECUTABLE} ${CRYPTOPP_LIBRARIES}) +target_link_libraries(${EXECUTABLE} scrypt) target_link_libraries(${EXECUTABLE} devcore) install( TARGETS ${EXECUTABLE} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) diff --git a/libdevcrypto/Common.cpp b/libdevcrypto/Common.cpp index 87e258573..2a3561314 100644 --- a/libdevcrypto/Common.cpp +++ b/libdevcrypto/Common.cpp @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include @@ -180,6 +181,13 @@ bytes dev::pbkdf2(string const& _pass, bytes const& _salt, unsigned _iterations, return ret; } +bytes dev::scrypt(std::string const& _pass, bytes const& _salt, uint64_t _n, uint32_t _r, uint32_t _p, unsigned _dkLen) +{ + bytes ret(_dkLen); + libscrypt_scrypt((uint8_t const*)_pass.data(), _pass.size(), _salt.data(), _salt.size(), _n, _r, _p, ret.data(), ret.size()); + return ret; +} + KeyPair KeyPair::create() { static boost::thread_specific_ptr s_eng; diff --git a/libdevcrypto/Common.h b/libdevcrypto/Common.h index 6464c7ede..a0f894a25 100644 --- a/libdevcrypto/Common.h +++ b/libdevcrypto/Common.h @@ -123,6 +123,9 @@ bool verify(Public const& _k, Signature const& _s, h256 const& _hash); /// Derive key via PBKDF2. bytes pbkdf2(std::string const& _pass, bytes const& _salt, unsigned _iterations, unsigned _dkLen = 32); +/// Derive key via Scrypt. +bytes scrypt(std::string const& _pass, bytes const& _salt, uint64_t _n, uint32_t _r, uint32_t _p, unsigned _dkLen); + /// Simple class that represents a "key pair". /// All of the data of the class can be regenerated from the secret key (m_secret) alone. /// Actually stores a tuplet of secret, public and address (the right 160-bits of the public). diff --git a/libdevcrypto/SecretStore.cpp b/libdevcrypto/SecretStore.cpp index 0416aa9f4..7bc870bcf 100644 --- a/libdevcrypto/SecretStore.cpp +++ b/libdevcrypto/SecretStore.cpp @@ -188,6 +188,11 @@ bytes SecretStore::decrypt(std::string const& _v, std::string const& _pass) bytes salt = fromHex(params["salt"].get_str()); derivedKey = pbkdf2(_pass, salt, iterations, params["dklen"].get_int()); } + else if (o["kdf"].get_str() == "scrypt") + { + auto p = o["kdfparams"].get_obj(); + derivedKey = scrypt(_pass, fromHex(p["salt"].get_str()), p["n"].get_int(), p["p"].get_int(), p["r"].get_int(), p["dklen"].get_int()); + } else { cwarn << "Unknown KDF" << o["kdf"].get_str() << "not supported."; diff --git a/libscrypt/CMakeLists.txt b/libscrypt/CMakeLists.txt new file mode 100644 index 000000000..8543244c5 --- /dev/null +++ b/libscrypt/CMakeLists.txt @@ -0,0 +1,24 @@ +cmake_policy(SET CMP0015 NEW) +# this policy was introduced in cmake 3.0 +# remove if, once 3.0 will be used on unix +if (${CMAKE_MAJOR_VERSION} GREATER 2) + # old policy do not use MACOSX_RPATH + cmake_policy(SET CMP0042 OLD) +endif() +set(CMAKE_AUTOMOC OFF) + +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSTATICLIB") + +aux_source_directory(. SRC_LIST) + +include_directories(BEFORE ..) + +set(EXECUTABLE scrypt) + +file(GLOB HEADERS "*.h") + +add_library(${EXECUTABLE} ${SRC_LIST} ${HEADERS}) + +install( TARGETS ${EXECUTABLE} RUNTIME DESTINATION bin ARCHIVE DESTINATION lib LIBRARY DESTINATION lib ) +install( FILES ${HEADERS} DESTINATION include/${EXECUTABLE} ) + diff --git a/libscrypt/LICENSE b/libscrypt/LICENSE new file mode 100644 index 000000000..46a743175 --- /dev/null +++ b/libscrypt/LICENSE @@ -0,0 +1,9 @@ +Copyright (c) 2013, Joshua Small + All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: +Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + diff --git a/libscrypt/b64.c b/libscrypt/b64.c new file mode 100644 index 000000000..b797dd0d9 --- /dev/null +++ b/libscrypt/b64.c @@ -0,0 +1,313 @@ +/* + * Copyright (c) 1996 by Internet Software Consortium. + * + * Permission to use, copy, modify, and distribute this software for any + * purpose with or without fee is hereby granted, provided that the above + * copyright notice and this permission notice appear in all copies. + * + * THE SOFTWARE IS PROVIDED "AS IS" AND INTERNET SOFTWARE CONSORTIUM DISCLAIMS + * ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL INTERNET SOFTWARE + * CONSORTIUM BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL + * DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR + * PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + * ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS + * SOFTWARE. + */ + +/* + * Portions Copyright (c) 1995 by International Business Machines, Inc. + * + * International Business Machines, Inc. (hereinafter called IBM) grants + * permission under its copyrights to use, copy, modify, and distribute this + * Software with or without fee, provided that the above copyright notice and + * all paragraphs of this notice appear in all copies, and that the name of IBM + * not be used in connection with the marketing of any product incorporating + * the Software or modifications thereof, without specific, written prior + * permission. + * + * To the extent it has a right to do so, IBM grants an immunity from suit + * under its patents, if any, for the use, sale or manufacture of products to + * the extent that such products are used for performing Domain Name System + * dynamic updates in TCP/IP networks by means of the Software. No immunity is + * granted for any product per se or for any other function of any product. + * + * THE SOFTWARE IS PROVIDED "AS IS", AND IBM DISCLAIMS ALL WARRANTIES, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + * PARTICULAR PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, + * DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER ARISING + * OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE, EVEN + * IF IBM IS APPRISED OF THE POSSIBILITY OF SUCH DAMAGES. + */ + +/* + * Base64 encode/decode functions from OpenBSD (src/lib/libc/net/base64.c). + */ +#include +#include +#include +#include +#include + +#include "b64.h" + + +static const char Base64[] = + "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; +static const char Pad64 = '='; + +/* (From RFC1521 and draft-ietf-dnssec-secext-03.txt) + The following encoding technique is taken from RFC 1521 by Borenstein + and Freed. It is reproduced here in a slightly edited form for + convenience. + + A 65-character subset of US-ASCII is used, enabling 6 bits to be + represented per printable character. (The extra 65th character, "=", + is used to signify a special processing function.) + + The encoding process represents 24-bit groups of input bits as output + strings of 4 encoded characters. Proceeding from left to right, a + 24-bit input group is formed by concatenating 3 8-bit input groups. + These 24 bits are then treated as 4 concatenated 6-bit groups, each + of which is translated into a single digit in the base64 alphabet. + + Each 6-bit group is used as an index into an array of 64 printable + characters. The character referenced by the index is placed in the + output string. + + Table 1: The Base64 Alphabet + + Value Encoding Value Encoding Value Encoding Value Encoding + 0 A 17 R 34 i 51 z + 1 B 18 S 35 j 52 0 + 2 C 19 T 36 k 53 1 + 3 D 20 U 37 l 54 2 + 4 E 21 V 38 m 55 3 + 5 F 22 W 39 n 56 4 + 6 G 23 X 40 o 57 5 + 7 H 24 Y 41 p 58 6 + 8 I 25 Z 42 q 59 7 + 9 J 26 a 43 r 60 8 + 10 K 27 b 44 s 61 9 + 11 L 28 c 45 t 62 + + 12 M 29 d 46 u 63 / + 13 N 30 e 47 v + 14 O 31 f 48 w (pad) = + 15 P 32 g 49 x + 16 Q 33 h 50 y + + Special processing is performed if fewer than 24 bits are available + at the end of the data being encoded. A full encoding quantum is + always completed at the end of a quantity. When fewer than 24 input + bits are available in an input group, zero bits are added (on the + right) to form an integral number of 6-bit groups. Padding at the + end of the data is performed using the '=' character. + + Since all base64 input is an integral number of octets, only the + ------------------------------------------------- + following cases can arise: + + (1) the final quantum of encoding input is an integral + multiple of 24 bits; here, the final unit of encoded + output will be an integral multiple of 4 characters + with no "=" padding, + (2) the final quantum of encoding input is exactly 8 bits; + here, the final unit of encoded output will be two + characters followed by two "=" padding characters, or + (3) the final quantum of encoding input is exactly 16 bits; + here, the final unit of encoded output will be three + characters followed by one "=" padding character. +*/ + +int +libscrypt_b64_encode(src, srclength, target, targsize) + unsigned char const *src; + size_t srclength; + char *target; + size_t targsize; +{ + size_t datalength = 0; + unsigned char input[3]; + unsigned char output[4]; + unsigned int i; + + while (2 < srclength) { + input[0] = *src++; + input[1] = *src++; + input[2] = *src++; + srclength -= 3; + + output[0] = input[0] >> 2; + output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4); + output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6); + output[3] = input[2] & 0x3f; + + if (datalength + 4 > targsize) + return (-1); + target[datalength++] = Base64[output[0]]; + target[datalength++] = Base64[output[1]]; + target[datalength++] = Base64[output[2]]; + target[datalength++] = Base64[output[3]]; + } + + /* Now we worry about padding. */ + if (0 != srclength) { + /* Get what's left. */ + input[0] = input[1] = input[2] = '\0'; + for (i = 0; i < srclength; i++) + input[i] = *src++; + + output[0] = input[0] >> 2; + output[1] = ((input[0] & 0x03) << 4) + (input[1] >> 4); + output[2] = ((input[1] & 0x0f) << 2) + (input[2] >> 6); + + if (datalength + 4 > targsize) + return (-1); + target[datalength++] = Base64[output[0]]; + target[datalength++] = Base64[output[1]]; + if (srclength == 1) + target[datalength++] = Pad64; + else + target[datalength++] = Base64[output[2]]; + target[datalength++] = Pad64; + } + if (datalength >= targsize) + return (-1); + target[datalength] = '\0'; /* Returned value doesn't count \0. */ + return (int)(datalength); +} + +/* skips all whitespace anywhere. + converts characters, four at a time, starting at (or after) + src from base - 64 numbers into three 8 bit bytes in the target area. + it returns the number of data bytes stored at the target, or -1 on error. + */ + +int +libscrypt_b64_decode(src, target, targsize) + char const *src; + unsigned char *target; + size_t targsize; +{ + int state, ch; + unsigned int tarindex; + unsigned char nextbyte; + char *pos; + + state = 0; + tarindex = 0; + + while ((ch = (unsigned char)*src++) != '\0') { + if (isspace(ch)) /* Skip whitespace anywhere. */ + continue; + + if (ch == Pad64) + break; + + pos = strchr(Base64, ch); + if (pos == 0) /* A non-base64 character. */ + return (-1); + + switch (state) { + case 0: + if (target) { + if (tarindex >= targsize) + return (-1); + target[tarindex] = (pos - Base64) << 2; + } + state = 1; + break; + case 1: + if (target) { + if (tarindex >= targsize) + return (-1); + target[tarindex] |= (pos - Base64) >> 4; + nextbyte = ((pos - Base64) & 0x0f) << 4; + if (tarindex + 1 < targsize) + target[tarindex+1] = nextbyte; + else if (nextbyte) + return (-1); + } + tarindex++; + state = 2; + break; + case 2: + if (target) { + if (tarindex >= targsize) + return (-1); + target[tarindex] |= (pos - Base64) >> 2; + nextbyte = ((pos - Base64) & 0x03) << 6; + if (tarindex + 1 < targsize) + target[tarindex+1] = nextbyte; + else if (nextbyte) + return (-1); + } + tarindex++; + state = 3; + break; + case 3: + if (target) { + if (tarindex >= targsize) + return (-1); + target[tarindex] |= (pos - Base64); + } + tarindex++; + state = 0; + break; + } + } + + /* + * We are done decoding Base-64 chars. Let's see if we ended + * on a byte boundary, and/or with erroneous trailing characters. + */ + + if (ch == Pad64) { /* We got a pad char. */ + ch = (unsigned char)*src++; /* Skip it, get next. */ + switch (state) { + case 0: /* Invalid = in first position */ + case 1: /* Invalid = in second position */ + return (-1); + + case 2: /* Valid, means one byte of info */ + /* Skip any number of spaces. */ + for (; ch != '\0'; ch = (unsigned char)*src++) + if (!isspace(ch)) + break; + /* Make sure there is another trailing = sign. */ + if (ch != Pad64) + return (-1); + ch = (unsigned char)*src++; /* Skip the = */ + /* Fall through to "single trailing =" case. */ + /* FALLTHROUGH */ + + case 3: /* Valid, means two bytes of info */ + /* + * We know this char is an =. Is there anything but + * whitespace after it? + */ + for (; ch != '\0'; ch = (unsigned char)*src++) + if (!isspace(ch)) + return (-1); + + /* + * Now make sure for cases 2 and 3 that the "extra" + * bits that slopped past the last full byte were + * zeros. If we don't check them, they become a + * subliminal channel. + */ + if (target && tarindex < targsize && + target[tarindex] != 0) + return (-1); + } + } else { + /* + * We ended by seeing the end of the string. Make sure we + * have no partial bytes lying around. + */ + if (state != 0) + return (-1); + } + + return (tarindex); +} diff --git a/libscrypt/b64.h b/libscrypt/b64.h new file mode 100644 index 000000000..2e271eb5b --- /dev/null +++ b/libscrypt/b64.h @@ -0,0 +1,10 @@ + +/* BASE64 libraries used internally - should not need to be packaged */ + +#define b64_encode_len(A) ((A+2)/3 * 4 + 1) +#define b64_decode_len(A) (A / 4 * 3 + 2) + +int libscrypt_b64_encode(unsigned char const *src, size_t srclength, + /*@out@*/ char *target, size_t targetsize); +int libscrypt_b64_decode(char const *src, /*@out@*/ unsigned char *target, + size_t targetsize); diff --git a/libscrypt/crypto-mcf.c b/libscrypt/crypto-mcf.c new file mode 100644 index 000000000..8ad3eb826 --- /dev/null +++ b/libscrypt/crypto-mcf.c @@ -0,0 +1,73 @@ +#include +#include +#include +#include +#include +#include +#include + +#ifndef S_SPLINT_S /* Including this here triggers a known bug in splint */ +#include +#endif + +#include "libscrypt.h" + +/* ilog2 for powers of two */ +static uint32_t scrypt_ilog2(uint32_t n) +{ +#ifndef S_SPLINT_S + + /* Check for a valid power of two */ + if (n < 2 || (n & (n - 1))) + return -1; +#endif + uint32_t t = 1; + while (((uint32_t)1 << t) < n) + { + if(t > SCRYPT_SAFE_N) + return (uint32_t) -1; /* Check for insanity */ + t++; + } + + return t; +} + +#ifdef _MSC_VER + #define SNPRINTF _snprintf +#else + #define SNPRINTF snprintf +#endif + +int libscrypt_mcf(uint32_t N, uint32_t r, uint32_t p, const char *salt, + const char *hash, char *mcf) +{ + + uint32_t t, params; + int s; + + if(!mcf || !hash) + return 0; + /* Although larger values of r, p are valid in scrypt, this mcf format + * limits to 8 bits. If your number is larger, current computers will + * struggle + */ + if(r > (uint8_t)(-1) || p > (uint8_t)(-1)) + return 0; + + t = scrypt_ilog2(N); + if (t < 1) + return 0; + + params = (r << 8) + p; + params += (uint32_t)t << 16; + + /* Using snprintf - not checking for overflows. We've already + * determined that mcf should be defined as at least SCRYPT_MCF_LEN + * in length + */ + s = SNPRINTF(mcf, SCRYPT_MCF_LEN, SCRYPT_MCF_ID "$%06x$%s$%s", (unsigned int)params, salt, hash); + if (s > SCRYPT_MCF_LEN) + return 0; + + return 1; +} diff --git a/libscrypt/crypto-scrypt-saltgen.c b/libscrypt/crypto-scrypt-saltgen.c new file mode 100644 index 000000000..a0e29988c --- /dev/null +++ b/libscrypt/crypto-scrypt-saltgen.c @@ -0,0 +1,48 @@ +#include +#include +#include +#include +#include + +#ifndef S_SPLINT_S /* Including this here triggers a known bug in splint */ +#include +#endif + +#define RNGDEV "/dev/urandom" + +int libscrypt_salt_gen(uint8_t *salt, size_t len) +{ + unsigned char buf[len]; + size_t data_read = 0; + int urandom = open(RNGDEV, O_RDONLY); + + if (urandom < 0) + { + return -1; + } + + while (data_read < len) { + ssize_t result = read(urandom, buf + data_read, len - data_read); + + if (result < 0) + { + if (errno == EINTR || errno == EAGAIN) { + continue; + } + + else { + (void)close(urandom); + return -1; + } + } + + data_read += result; + } + + /* Failures on close() shouldn't occur with O_RDONLY */ + (void)close(urandom); + + memcpy(salt, buf, len); + + return 0; +} diff --git a/libscrypt/crypto_scrypt-check.c b/libscrypt/crypto_scrypt-check.c new file mode 100644 index 000000000..99477ffe9 --- /dev/null +++ b/libscrypt/crypto_scrypt-check.c @@ -0,0 +1,100 @@ +#include +#include +#include +#include + +#include "b64.h" +#include "slowequals.h" +#include "libscrypt.h" + +#ifdef _WIN32 +/* On windows, strtok uses a thread-local static variable in strtok to + * make strtok thread-safe. It also neglects to provide a strtok_r. */ +#define strtok_r(str, val, saveptr) strtok((str), (val)) +#endif + +int libscrypt_check(char *mcf, const char *password) +{ + /* Return values: + * <0 error + * == 0 password incorrect + * >0 correct password + */ + +#ifndef _WIN32 + char *saveptr = NULL; +#endif + uint32_t params; + uint64_t N; + uint8_t r, p; + int retval; + uint8_t hashbuf[64]; + char outbuf[128]; + uint8_t salt[32]; + char *tok; + + if(memcmp(mcf, SCRYPT_MCF_ID, 3) != 0) + { + /* Only version 0 supported */ + return -1; + } + + tok = strtok_r(mcf, "$", &saveptr); + if ( !tok ) + return -1; + + tok = strtok_r(NULL, "$", &saveptr); + + if ( !tok ) + return -1; + + params = (uint32_t)strtoul(tok, NULL, 16); + if ( params == 0 ) + return -1; + + tok = strtok_r(NULL, "$", &saveptr); + + if ( !tok ) + return -1; + + p = params & 0xff; + r = (params >> 8) & 0xff; + N = params >> 16; + + if (N > SCRYPT_SAFE_N) + return -1; + + N = (uint64_t)1 << N; + + /* Useful debugging: + printf("We've obtained salt 'N' r p of '%s' %d %d %d\n", tok, N,r,p); + */ + + memset(salt, 0, sizeof(salt)); /* Keeps splint happy */ + retval = libscrypt_b64_decode(tok, (unsigned char*)salt, sizeof(salt)); + if (retval < 1) + return -1; + + retval = libscrypt_scrypt((uint8_t*)password, strlen(password), salt, + (uint32_t)retval, N, r, p, hashbuf, sizeof(hashbuf)); + + if (retval != 0) + return -1; + + retval = libscrypt_b64_encode((unsigned char*)hashbuf, sizeof(hashbuf), + outbuf, sizeof(outbuf)); + + if (retval == 0) + return -1; + + tok = strtok_r(NULL, "$", &saveptr); + + if ( !tok ) + return -1; + + if(slow_equals(tok, outbuf) == 0) + return 0; + + return 1; /* This is the "else" condition */ +} + diff --git a/libscrypt/crypto_scrypt-hash.c b/libscrypt/crypto_scrypt-hash.c new file mode 100644 index 000000000..4b41007db --- /dev/null +++ b/libscrypt/crypto_scrypt-hash.c @@ -0,0 +1,44 @@ +#include +#include +#include +#include + +#include "b64.h" +#include "libscrypt.h" + +int libscrypt_hash(char *dst, const char *passphrase, uint32_t N, uint8_t r, + uint8_t p) +{ + + int retval; + uint8_t salt[SCRYPT_SALT_LEN]; + uint8_t hashbuf[SCRYPT_HASH_LEN]; + char outbuf[256]; + char saltbuf[256]; + + if(libscrypt_salt_gen(salt, SCRYPT_SALT_LEN) == -1) + { + return 0; + } + + retval = libscrypt_scrypt((const uint8_t*)passphrase, strlen(passphrase), + (uint8_t*)salt, SCRYPT_SALT_LEN, N, r, p, hashbuf, sizeof(hashbuf)); + if(retval == -1) + return 0; + + retval = libscrypt_b64_encode((unsigned char*)hashbuf, sizeof(hashbuf), + outbuf, sizeof(outbuf)); + if(retval == -1) + return 0; + + retval = libscrypt_b64_encode((unsigned char *)salt, sizeof(salt), + saltbuf, sizeof(saltbuf)); + if(retval == -1) + return 0; + + retval = libscrypt_mcf(N, r, p, saltbuf, outbuf, dst); + if(retval != 1) + return 0; + + return 1; +} diff --git a/libscrypt/crypto_scrypt-hexconvert.c b/libscrypt/crypto_scrypt-hexconvert.c new file mode 100644 index 000000000..3df12a023 --- /dev/null +++ b/libscrypt/crypto_scrypt-hexconvert.c @@ -0,0 +1,35 @@ +#include +#include +#include +#include + +/* The hexconvert function is only used to test reference vectors against + * known answers. The contents of this file are therefore a component + * to assist with test harnesses only + */ + +int libscrypt_hexconvert(uint8_t *buf, size_t s, char *outbuf, size_t obs) +{ + + size_t i; + int len = 0; + + if (!buf || s < 1 || obs < (s * 2 + 1)) + return 0; + + memset(outbuf, 0, obs); + + + for(i=0; i<=(s-1); i++) + { + /* snprintf(outbuf, s,"%s...", outbuf....) has undefined results + * and can't be used. Using offests like this makes snprintf + * nontrivial. we therefore have use inescure sprintf() and + * lengths checked elsewhere (start of function) */ + /*@ -bufferoverflowhigh @*/ + len += sprintf(outbuf+len, "%02x", (unsigned int) buf[i]); + } + + return 1; +} + diff --git a/libscrypt/crypto_scrypt-hexconvert.h b/libscrypt/crypto_scrypt-hexconvert.h new file mode 100644 index 000000000..8175b24f1 --- /dev/null +++ b/libscrypt/crypto_scrypt-hexconvert.h @@ -0,0 +1,9 @@ + +#include + +/** + * Converts a binary string to a hex representation of that string + * outbuf must have size of at least buf * 2 + 1. + */ +int libscrypt_hexconvert(const uint8_t *buf, size_t s, char *outbuf, + size_t obs); diff --git a/libscrypt/crypto_scrypt-nosse.c b/libscrypt/crypto_scrypt-nosse.c new file mode 100644 index 000000000..12c860f2d --- /dev/null +++ b/libscrypt/crypto_scrypt-nosse.c @@ -0,0 +1,342 @@ +/*- + * Copyright 2009 Colin Percival + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * This file was originally written by Colin Percival as part of the Tarsnap + * online backup system. + */ + +#include +#ifndef _WIN32 +#include +#endif +#include +#include +#include +#include + +#include "sha256.h" +#include "sysendian.h" + +#include "libscrypt.h" + +static void blkcpy(void *, void *, size_t); +static void blkxor(void *, void *, size_t); +static void salsa20_8(uint32_t[16]); +static void blockmix_salsa8(uint32_t *, uint32_t *, uint32_t *, size_t); +static uint64_t integerify(void *, size_t); +static void smix(uint8_t *, size_t, uint64_t, uint32_t *, uint32_t *); + +static void +blkcpy(void * dest, void * src, size_t len) +{ + size_t * D = dest; + size_t * S = src; + size_t L = len / sizeof(size_t); + size_t i; + + for (i = 0; i < L; i++) + D[i] = S[i]; +} + +static void +blkxor(void * dest, void * src, size_t len) +{ + size_t * D = dest; + size_t * S = src; + size_t L = len / sizeof(size_t); + size_t i; + + for (i = 0; i < L; i++) + D[i] ^= S[i]; +} + +/** + * salsa20_8(B): + * Apply the salsa20/8 core to the provided block. + */ +static void +salsa20_8(uint32_t B[16]) +{ + uint32_t x[16]; + size_t i; + + blkcpy(x, B, 64); + for (i = 0; i < 8; i += 2) { +#define R(a,b) (((a) << (b)) | ((a) >> (32 - (b)))) + /* Operate on columns. */ + x[ 4] ^= R(x[ 0]+x[12], 7); x[ 8] ^= R(x[ 4]+x[ 0], 9); + x[12] ^= R(x[ 8]+x[ 4],13); x[ 0] ^= R(x[12]+x[ 8],18); + + x[ 9] ^= R(x[ 5]+x[ 1], 7); x[13] ^= R(x[ 9]+x[ 5], 9); + x[ 1] ^= R(x[13]+x[ 9],13); x[ 5] ^= R(x[ 1]+x[13],18); + + x[14] ^= R(x[10]+x[ 6], 7); x[ 2] ^= R(x[14]+x[10], 9); + x[ 6] ^= R(x[ 2]+x[14],13); x[10] ^= R(x[ 6]+x[ 2],18); + + x[ 3] ^= R(x[15]+x[11], 7); x[ 7] ^= R(x[ 3]+x[15], 9); + x[11] ^= R(x[ 7]+x[ 3],13); x[15] ^= R(x[11]+x[ 7],18); + + /* Operate on rows. */ + x[ 1] ^= R(x[ 0]+x[ 3], 7); x[ 2] ^= R(x[ 1]+x[ 0], 9); + x[ 3] ^= R(x[ 2]+x[ 1],13); x[ 0] ^= R(x[ 3]+x[ 2],18); + + x[ 6] ^= R(x[ 5]+x[ 4], 7); x[ 7] ^= R(x[ 6]+x[ 5], 9); + x[ 4] ^= R(x[ 7]+x[ 6],13); x[ 5] ^= R(x[ 4]+x[ 7],18); + + x[11] ^= R(x[10]+x[ 9], 7); x[ 8] ^= R(x[11]+x[10], 9); + x[ 9] ^= R(x[ 8]+x[11],13); x[10] ^= R(x[ 9]+x[ 8],18); + + x[12] ^= R(x[15]+x[14], 7); x[13] ^= R(x[12]+x[15], 9); + x[14] ^= R(x[13]+x[12],13); x[15] ^= R(x[14]+x[13],18); +#undef R + } + for (i = 0; i < 16; i++) + B[i] += x[i]; +} + +/** + * blockmix_salsa8(Bin, Bout, X, r): + * Compute Bout = BlockMix_{salsa20/8, r}(Bin). The input Bin must be 128r + * bytes in length; the output Bout must also be the same size. The + * temporary space X must be 64 bytes. + */ +static void +blockmix_salsa8(uint32_t * Bin, uint32_t * Bout, uint32_t * X, size_t r) +{ + size_t i; + + /* 1: X <-- B_{2r - 1} */ + blkcpy(X, &Bin[(2 * r - 1) * 16], 64); + + /* 2: for i = 0 to 2r - 1 do */ + for (i = 0; i < 2 * r; i += 2) { + /* 3: X <-- H(X \xor B_i) */ + blkxor(X, &Bin[i * 16], 64); + salsa20_8(X); + + /* 4: Y_i <-- X */ + /* 6: B' <-- (Y_0, Y_2 ... Y_{2r-2}, Y_1, Y_3 ... Y_{2r-1}) */ + blkcpy(&Bout[i * 8], X, 64); + + /* 3: X <-- H(X \xor B_i) */ + blkxor(X, &Bin[i * 16 + 16], 64); + salsa20_8(X); + + /* 4: Y_i <-- X */ + /* 6: B' <-- (Y_0, Y_2 ... Y_{2r-2}, Y_1, Y_3 ... Y_{2r-1}) */ + blkcpy(&Bout[i * 8 + r * 16], X, 64); + } +} + +/** + * integerify(B, r): + * Return the result of parsing B_{2r-1} as a little-endian integer. + */ +static uint64_t +integerify(void * B, size_t r) +{ + uint32_t * X = (void *)((uintptr_t)(B) + (2 * r - 1) * 64); + + return (((uint64_t)(X[1]) << 32) + X[0]); +} + +/** + * smix(B, r, N, V, XY): + * Compute B = SMix_r(B, N). The input B must be 128r bytes in length; + * the temporary storage V must be 128rN bytes in length; the temporary + * storage XY must be 256r + 64 bytes in length. The value N must be a + * power of 2 greater than 1. The arrays B, V, and XY must be aligned to a + * multiple of 64 bytes. + */ +static void +smix(uint8_t * B, size_t r, uint64_t N, uint32_t * V, uint32_t * XY) +{ + uint32_t * X = XY; + uint32_t * Y = &XY[32 * r]; + uint32_t * Z = &XY[64 * r]; + uint64_t i; + uint64_t j; + size_t k; + + /* 1: X <-- B */ + for (k = 0; k < 32 * r; k++) + X[k] = le32dec(&B[4 * k]); + + /* 2: for i = 0 to N - 1 do */ + for (i = 0; i < N; i += 2) { + /* 3: V_i <-- X */ + blkcpy(&V[i * (32 * r)], X, 128 * r); + + /* 4: X <-- H(X) */ + blockmix_salsa8(X, Y, Z, r); + + /* 3: V_i <-- X */ + blkcpy(&V[(i + 1) * (32 * r)], Y, 128 * r); + + /* 4: X <-- H(X) */ + blockmix_salsa8(Y, X, Z, r); + } + + /* 6: for i = 0 to N - 1 do */ + for (i = 0; i < N; i += 2) { + /* 7: j <-- Integerify(X) mod N */ + j = integerify(X, r) & (N - 1); + + /* 8: X <-- H(X \xor V_j) */ + blkxor(X, &V[j * (32 * r)], 128 * r); + blockmix_salsa8(X, Y, Z, r); + + /* 7: j <-- Integerify(X) mod N */ + j = integerify(Y, r) & (N - 1); + + /* 8: X <-- H(X \xor V_j) */ + blkxor(Y, &V[j * (32 * r)], 128 * r); + blockmix_salsa8(Y, X, Z, r); + } + + /* 10: B' <-- X */ + for (k = 0; k < 32 * r; k++) + le32enc(&B[4 * k], X[k]); +} + +/** + * crypto_scrypt(passwd, passwdlen, salt, saltlen, N, r, p, buf, buflen): + * Compute scrypt(passwd[0 .. passwdlen - 1], salt[0 .. saltlen - 1], N, r, + * p, buflen) and write the result into buf. The parameters r, p, and buflen + * must satisfy r * p < 2^30 and buflen <= (2^32 - 1) * 32. The parameter N + * must be a power of 2 greater than 1. + * + * Return 0 on success; or -1 on error + */ +int +libscrypt_scrypt(const uint8_t * passwd, size_t passwdlen, + const uint8_t * salt, size_t saltlen, uint64_t N, uint32_t r, uint32_t p, + uint8_t * buf, size_t buflen) +{ + void * B0, * V0, * XY0; + uint8_t * B; + uint32_t * V; + uint32_t * XY; + uint32_t i; + + /* Sanity-check parameters. */ +#if SIZE_MAX > UINT32_MAX + if (buflen > (((uint64_t)(1) << 32) - 1) * 32) { + errno = EFBIG; + goto err0; + } +#endif + if ((uint64_t)(r) * (uint64_t)(p) >= (1 << 30)) { + errno = EFBIG; + goto err0; + } + if (r == 0 || p == 0) { + errno = EINVAL; + goto err0; + } + if (((N & (N - 1)) != 0) || (N < 2)) { + errno = EINVAL; + goto err0; + } + if ((r > SIZE_MAX / 128 / p) || +#if SIZE_MAX / 256 <= UINT32_MAX + (r > SIZE_MAX / 256) || +#endif + (N > SIZE_MAX / 128 / r)) { + errno = ENOMEM; + goto err0; + } + + /* Allocate memory. */ +#ifdef HAVE_POSIX_MEMALIGN + if ((errno = posix_memalign(&B0, 64, 128 * r * p)) != 0) + goto err0; + B = (uint8_t *)(B0); + if ((errno = posix_memalign(&XY0, 64, 256 * r + 64)) != 0) + goto err1; + XY = (uint32_t *)(XY0); +#ifndef MAP_ANON + if ((errno = posix_memalign(&V0, 64, 128 * r * N)) != 0) + goto err2; + V = (uint32_t *)(V0); +#endif +#else + if ((B0 = malloc(128 * r * p + 63)) == NULL) + goto err0; + B = (uint8_t *)(((uintptr_t)(B0) + 63) & ~ (uintptr_t)(63)); + if ((XY0 = malloc(256 * r + 64 + 63)) == NULL) + goto err1; + XY = (uint32_t *)(((uintptr_t)(XY0) + 63) & ~ (uintptr_t)(63)); +#ifndef MAP_ANON + if ((V0 = malloc(128 * r * N + 63)) == NULL) + goto err2; + V = (uint32_t *)(((uintptr_t)(V0) + 63) & ~ (uintptr_t)(63)); +#endif +#endif +#ifdef MAP_ANON + if ((V0 = mmap(NULL, 128 * r * N, PROT_READ | PROT_WRITE, +#ifdef MAP_NOCORE + MAP_ANON | MAP_PRIVATE | MAP_NOCORE, +#else + MAP_ANON | MAP_PRIVATE, +#endif + -1, 0)) == MAP_FAILED) + goto err2; + V = (uint32_t *)(V0); +#endif + + /* 1: (B_0 ... B_{p-1}) <-- PBKDF2(P, S, 1, p * MFLen) */ + libscrypt_PBKDF2_SHA256(passwd, passwdlen, salt, saltlen, 1, B, p * 128 * r); + + /* 2: for i = 0 to p - 1 do */ + for (i = 0; i < p; i++) { + /* 3: B_i <-- MF(B_i, N) */ + smix(&B[i * 128 * r], r, N, V, XY); + } + + /* 5: DK <-- PBKDF2(P, B, 1, dkLen) */ + libscrypt_PBKDF2_SHA256(passwd, passwdlen, B, p * 128 * r, 1, buf, buflen); + + /* Free memory. */ +#ifdef MAP_ANON + if (munmap(V0, 128 * r * N)) + goto err2; +#else + free(V0); +#endif + free(XY0); + free(B0); + + /* Success! */ + return (0); + +err2: + free(XY0); +err1: + free(B0); +err0: + /* Failure! */ + return (-1); +} diff --git a/libscrypt/libscrypt.h b/libscrypt/libscrypt.h new file mode 100644 index 000000000..b7141f5f5 --- /dev/null +++ b/libscrypt/libscrypt.h @@ -0,0 +1,67 @@ +/*- + */ +#ifndef _CRYPTO_SCRYPT_H_ +#define _CRYPTO_SCRYPT_H_ + + +#include + +#ifdef __cplusplus +extern "C"{ +#endif + +/** + * crypto_scrypt(passwd, passwdlen, salt, saltlen, N, r, p, buf, buflen): + * Compute scrypt(passwd[0 .. passwdlen - 1], salt[0 .. saltlen - 1], N, r, + * p, buflen) and write the result into buf. The parameters r, p, and buflen + * must satisfy r * p < 2^30 and buflen <= (2^32 - 1) * 32. The parameter N + * must be a power of 2 greater than 1. + * + * libscrypt_scrypt(passwd, passwdlen, salt, saltlen, N, r, p, buf, buflen): + * password; duh + * N: CPU AND RAM cost (first modifier) + * r: RAM Cost + * p: CPU cost (parallelisation) + * In short, N is your main performance modifier. Values of r = 8, p = 1 are + * standard unless you want to modify the CPU/RAM ratio. + * Return 0 on success; or -1 on error. + */ +int libscrypt_scrypt(const uint8_t *, size_t, const uint8_t *, size_t, uint64_t, + uint32_t, uint32_t, /*@out@*/ uint8_t *, size_t); + +/* Converts a series of input parameters to a MCF form for storage */ +int libscrypt_mcf(uint32_t N, uint32_t r, uint32_t p, const char *salt, + const char *hash, char *mcf); + +#ifndef _MSC_VER +/* Generates a salt. Uses /dev/urandom/ + */ +int libscrypt_salt_gen(/*@out@*/ uint8_t *rand, size_t len); + +/* Creates a hash of a passphrase using a randomly generated salt */ +/* Returns >0 on success, or 0 for fail */ +int libscrypt_hash(char *dst, const char* passphrase, uint32_t N, uint8_t r, + uint8_t p); +#endif + +/* Checks a given MCF against a password */ +int libscrypt_check(char *mcf, const char *password); + +#ifdef __cplusplus +} +#endif + +/* Sane default values */ +#define SCRYPT_HASH_LEN 64 /* This can be user defined - + *but 64 is the reference size + */ +#define SCRYPT_SAFE_N 30 /* This is much higher than you want. It's just + * a blocker for insane defines + */ +#define SCRYPT_SALT_LEN 16 /* This is just a recommended size */ +#define SCRYPT_MCF_LEN 125 /* mcf is 120 byte + nul */ +#define SCRYPT_MCF_ID "$s1" +#define SCRYPT_N 16384 +#define SCRYPT_r 8 +#define SCRYPT_p 16 +#endif /* !_CRYPTO_SCRYPT_H_ */ diff --git a/libscrypt/libscrypt.version b/libscrypt/libscrypt.version new file mode 100644 index 000000000..9cc574db2 --- /dev/null +++ b/libscrypt/libscrypt.version @@ -0,0 +1,8 @@ +libscrypt { + global: libscrypt_check; +libscrypt_hash; +libscrypt_mcf; +libscrypt_salt_gen; +libscrypt_scrypt; + local: *; +}; diff --git a/libscrypt/sha256.c b/libscrypt/sha256.c new file mode 100644 index 000000000..279e3cf8d --- /dev/null +++ b/libscrypt/sha256.c @@ -0,0 +1,411 @@ +/*- + * Copyright 2005,2007,2009 Colin Percival + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + */ + +#include + +#include +#include + +#include "sysendian.h" + +#include "sha256.h" + +/* + * Encode a length len/4 vector of (uint32_t) into a length len vector of + * (unsigned char) in big-endian form. Assumes len is a multiple of 4. + */ +static void +be32enc_vect(unsigned char *dst, const uint32_t *src, size_t len) +{ + size_t i; + + for (i = 0; i < len / 4; i++) + be32enc(dst + i * 4, src[i]); +} + +/* + * Decode a big-endian length len vector of (unsigned char) into a length + * len/4 vector of (uint32_t). Assumes len is a multiple of 4. + */ +static void +be32dec_vect(uint32_t *dst, const unsigned char *src, size_t len) +{ + size_t i; + + for (i = 0; i < len / 4; i++) + dst[i] = be32dec(src + i * 4); +} + +/* Elementary functions used by SHA256 */ +#define Ch(x, y, z) ((x & (y ^ z)) ^ z) +#define Maj(x, y, z) ((x & (y | z)) | (y & z)) +#define SHR(x, n) (x >> n) +#define ROTR(x, n) ((x >> n) | (x << (32 - n))) +#define S0(x) (ROTR(x, 2) ^ ROTR(x, 13) ^ ROTR(x, 22)) +#define S1(x) (ROTR(x, 6) ^ ROTR(x, 11) ^ ROTR(x, 25)) +#define s0(x) (ROTR(x, 7) ^ ROTR(x, 18) ^ SHR(x, 3)) +#define s1(x) (ROTR(x, 17) ^ ROTR(x, 19) ^ SHR(x, 10)) + +/* SHA256 round function */ +#define RND(a, b, c, d, e, f, g, h, k) \ + t0 = h + S1(e) + Ch(e, f, g) + k; \ + t1 = S0(a) + Maj(a, b, c); \ + d += t0; \ + h = t0 + t1; + +/* Adjusted round function for rotating state */ +#define RNDr(S, W, i, k) \ + RND(S[(64 - i) % 8], S[(65 - i) % 8], \ + S[(66 - i) % 8], S[(67 - i) % 8], \ + S[(68 - i) % 8], S[(69 - i) % 8], \ + S[(70 - i) % 8], S[(71 - i) % 8], \ + W[i] + k) + +/* + * SHA256 block compression function. The 256-bit state is transformed via + * the 512-bit input block to produce a new state. + */ +static void +SHA256_Transform(uint32_t * state, const unsigned char block[64]) +{ + uint32_t W[64]; + uint32_t S[8]; + uint32_t t0, t1; + int i; + + /* 1. Prepare message schedule W. */ + be32dec_vect(W, block, 64); + for (i = 16; i < 64; i++) + W[i] = s1(W[i - 2]) + W[i - 7] + s0(W[i - 15]) + W[i - 16]; + + /* 2. Initialize working variables. */ + memcpy(S, state, 32); + + /* 3. Mix. */ + RNDr(S, W, 0, 0x428a2f98); + RNDr(S, W, 1, 0x71374491); + RNDr(S, W, 2, 0xb5c0fbcf); + RNDr(S, W, 3, 0xe9b5dba5); + RNDr(S, W, 4, 0x3956c25b); + RNDr(S, W, 5, 0x59f111f1); + RNDr(S, W, 6, 0x923f82a4); + RNDr(S, W, 7, 0xab1c5ed5); + RNDr(S, W, 8, 0xd807aa98); + RNDr(S, W, 9, 0x12835b01); + RNDr(S, W, 10, 0x243185be); + RNDr(S, W, 11, 0x550c7dc3); + RNDr(S, W, 12, 0x72be5d74); + RNDr(S, W, 13, 0x80deb1fe); + RNDr(S, W, 14, 0x9bdc06a7); + RNDr(S, W, 15, 0xc19bf174); + RNDr(S, W, 16, 0xe49b69c1); + RNDr(S, W, 17, 0xefbe4786); + RNDr(S, W, 18, 0x0fc19dc6); + RNDr(S, W, 19, 0x240ca1cc); + RNDr(S, W, 20, 0x2de92c6f); + RNDr(S, W, 21, 0x4a7484aa); + RNDr(S, W, 22, 0x5cb0a9dc); + RNDr(S, W, 23, 0x76f988da); + RNDr(S, W, 24, 0x983e5152); + RNDr(S, W, 25, 0xa831c66d); + RNDr(S, W, 26, 0xb00327c8); + RNDr(S, W, 27, 0xbf597fc7); + RNDr(S, W, 28, 0xc6e00bf3); + RNDr(S, W, 29, 0xd5a79147); + RNDr(S, W, 30, 0x06ca6351); + RNDr(S, W, 31, 0x14292967); + RNDr(S, W, 32, 0x27b70a85); + RNDr(S, W, 33, 0x2e1b2138); + RNDr(S, W, 34, 0x4d2c6dfc); + RNDr(S, W, 35, 0x53380d13); + RNDr(S, W, 36, 0x650a7354); + RNDr(S, W, 37, 0x766a0abb); + RNDr(S, W, 38, 0x81c2c92e); + RNDr(S, W, 39, 0x92722c85); + RNDr(S, W, 40, 0xa2bfe8a1); + RNDr(S, W, 41, 0xa81a664b); + RNDr(S, W, 42, 0xc24b8b70); + RNDr(S, W, 43, 0xc76c51a3); + RNDr(S, W, 44, 0xd192e819); + RNDr(S, W, 45, 0xd6990624); + RNDr(S, W, 46, 0xf40e3585); + RNDr(S, W, 47, 0x106aa070); + RNDr(S, W, 48, 0x19a4c116); + RNDr(S, W, 49, 0x1e376c08); + RNDr(S, W, 50, 0x2748774c); + RNDr(S, W, 51, 0x34b0bcb5); + RNDr(S, W, 52, 0x391c0cb3); + RNDr(S, W, 53, 0x4ed8aa4a); + RNDr(S, W, 54, 0x5b9cca4f); + RNDr(S, W, 55, 0x682e6ff3); + RNDr(S, W, 56, 0x748f82ee); + RNDr(S, W, 57, 0x78a5636f); + RNDr(S, W, 58, 0x84c87814); + RNDr(S, W, 59, 0x8cc70208); + RNDr(S, W, 60, 0x90befffa); + RNDr(S, W, 61, 0xa4506ceb); + RNDr(S, W, 62, 0xbef9a3f7); + RNDr(S, W, 63, 0xc67178f2); + + /* 4. Mix local working variables into global state */ + for (i = 0; i < 8; i++) + state[i] += S[i]; + + /* Clean the stack. */ + memset(W, 0, 256); + memset(S, 0, 32); + t0 = t1 = 0; +} + +static unsigned char PAD[64] = { + 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 +}; + +/* Add padding and terminating bit-count. */ +static void +SHA256_Pad(SHA256_CTX * ctx) +{ + unsigned char len[8]; + uint32_t r, plen; + + /* + * Convert length to a vector of bytes -- we do this now rather + * than later because the length will change after we pad. + */ + be32enc_vect(len, ctx->count, 8); + + /* Add 1--64 bytes so that the resulting length is 56 mod 64 */ + r = (ctx->count[1] >> 3) & 0x3f; + plen = (r < 56) ? (56 - r) : (120 - r); + libscrypt_SHA256_Update(ctx, PAD, (size_t)plen); + + /* Add the terminating bit-count */ + libscrypt_SHA256_Update(ctx, len, 8); +} + +/* SHA-256 initialization. Begins a SHA-256 operation. */ +void +libscrypt_SHA256_Init(SHA256_CTX * ctx) +{ + + /* Zero bits processed so far */ + ctx->count[0] = ctx->count[1] = 0; + + /* Magic initialization constants */ + ctx->state[0] = 0x6A09E667; + ctx->state[1] = 0xBB67AE85; + ctx->state[2] = 0x3C6EF372; + ctx->state[3] = 0xA54FF53A; + ctx->state[4] = 0x510E527F; + ctx->state[5] = 0x9B05688C; + ctx->state[6] = 0x1F83D9AB; + ctx->state[7] = 0x5BE0CD19; +} + +/* Add bytes into the hash */ +void +libscrypt_SHA256_Update(SHA256_CTX * ctx, const void *in, size_t len) +{ + uint32_t bitlen[2]; + uint32_t r; + const unsigned char *src = in; + + /* Number of bytes left in the buffer from previous updates */ + r = (ctx->count[1] >> 3) & 0x3f; + + /* Convert the length into a number of bits */ + bitlen[1] = ((uint32_t)len) << 3; + bitlen[0] = (uint32_t)(len >> 29); + + /* Update number of bits */ + if ((ctx->count[1] += bitlen[1]) < bitlen[1]) + ctx->count[0]++; + ctx->count[0] += bitlen[0]; + + /* Handle the case where we don't need to perform any transforms */ + if (len < 64 - r) { + memcpy(&ctx->buf[r], src, len); + return; + } + + /* Finish the current block */ + memcpy(&ctx->buf[r], src, 64 - r); + SHA256_Transform(ctx->state, ctx->buf); + src += 64 - r; + len -= 64 - r; + + /* Perform complete blocks */ + while (len >= 64) { + SHA256_Transform(ctx->state, src); + src += 64; + len -= 64; + } + + /* Copy left over data into buffer */ + memcpy(ctx->buf, src, len); +} + +/* + * SHA-256 finalization. Pads the input data, exports the hash value, + * and clears the context state. + */ +void +libscrypt_SHA256_Final(unsigned char digest[32], SHA256_CTX * ctx) +{ + + /* Add padding */ + SHA256_Pad(ctx); + + /* Write the hash */ + be32enc_vect(digest, ctx->state, 32); + + /* Clear the context state */ + memset((void *)ctx, 0, sizeof(*ctx)); +} + +/* Initialize an HMAC-SHA256 operation with the given key. */ +void +libscrypt_HMAC_SHA256_Init(HMAC_SHA256_CTX * ctx, const void * _K, size_t Klen) +{ + unsigned char pad[64]; + unsigned char khash[32]; + const unsigned char * K = _K; + size_t i; + + /* If Klen > 64, the key is really SHA256(K). */ + if (Klen > 64) { + libscrypt_SHA256_Init(&ctx->ictx); + libscrypt_SHA256_Update(&ctx->ictx, K, Klen); + libscrypt_SHA256_Final(khash, &ctx->ictx); + K = khash; + Klen = 32; + } + + /* Inner SHA256 operation is SHA256(K xor [block of 0x36] || data). */ + libscrypt_SHA256_Init(&ctx->ictx); + memset(pad, 0x36, 64); + for (i = 0; i < Klen; i++) + pad[i] ^= K[i]; + libscrypt_SHA256_Update(&ctx->ictx, pad, 64); + + /* Outer SHA256 operation is SHA256(K xor [block of 0x5c] || hash). */ + libscrypt_SHA256_Init(&ctx->octx); + memset(pad, 0x5c, 64); + for (i = 0; i < Klen; i++) + pad[i] ^= K[i]; + libscrypt_SHA256_Update(&ctx->octx, pad, 64); + + /* Clean the stack. */ + memset(khash, 0, 32); +} + +/* Add bytes to the HMAC-SHA256 operation. */ +void +libscrypt_HMAC_SHA256_Update(HMAC_SHA256_CTX * ctx, const void *in, size_t len) +{ + + /* Feed data to the inner SHA256 operation. */ + libscrypt_SHA256_Update(&ctx->ictx, in, len); +} + +/* Finish an HMAC-SHA256 operation. */ +void +libscrypt_HMAC_SHA256_Final(unsigned char digest[32], HMAC_SHA256_CTX * ctx) +{ + unsigned char ihash[32]; + + /* Finish the inner SHA256 operation. */ + libscrypt_SHA256_Final(ihash, &ctx->ictx); + + /* Feed the inner hash to the outer SHA256 operation. */ + libscrypt_SHA256_Update(&ctx->octx, ihash, 32); + + /* Finish the outer SHA256 operation. */ + libscrypt_SHA256_Final(digest, &ctx->octx); + + /* Clean the stack. */ + memset(ihash, 0, 32); +} + +/** + * PBKDF2_SHA256(passwd, passwdlen, salt, saltlen, c, buf, dkLen): + * Compute PBKDF2(passwd, salt, c, dkLen) using HMAC-SHA256 as the PRF, and + * write the output to buf. The value dkLen must be at most 32 * (2^32 - 1). + */ +void +libscrypt_PBKDF2_SHA256(const uint8_t * passwd, size_t passwdlen, const uint8_t * salt, + size_t saltlen, uint64_t c, uint8_t * buf, size_t dkLen) +{ + HMAC_SHA256_CTX PShctx, hctx; + size_t i; + uint8_t ivec[4]; + uint8_t U[32]; + uint8_t T[32]; + uint64_t j; + int k; + size_t clen; + + /* Compute HMAC state after processing P and S. */ + libscrypt_HMAC_SHA256_Init(&PShctx, passwd, passwdlen); + libscrypt_HMAC_SHA256_Update(&PShctx, salt, saltlen); + + /* Iterate through the blocks. */ + for (i = 0; i * 32 < dkLen; i++) { + /* Generate INT(i + 1). */ + be32enc(ivec, (uint32_t)(i + 1)); + + /* Compute U_1 = PRF(P, S || INT(i)). */ + memcpy(&hctx, &PShctx, sizeof(HMAC_SHA256_CTX)); + libscrypt_HMAC_SHA256_Update(&hctx, ivec, 4); + libscrypt_HMAC_SHA256_Final(U, &hctx); + + /* T_i = U_1 ... */ + memcpy(T, U, 32); + + for (j = 2; j <= c; j++) { + /* Compute U_j. */ + libscrypt_HMAC_SHA256_Init(&hctx, passwd, passwdlen); + libscrypt_HMAC_SHA256_Update(&hctx, U, 32); + libscrypt_HMAC_SHA256_Final(U, &hctx); + + /* ... xor U_j ... */ + for (k = 0; k < 32; k++) + T[k] ^= U[k]; + } + + /* Copy as many bytes as necessary into buf. */ + clen = dkLen - i * 32; + if (clen > 32) + clen = 32; + memcpy(&buf[i * 32], T, clen); + } + + /* Clean PShctx, since we never called _Final on it. */ + memset(&PShctx, 0, sizeof(HMAC_SHA256_CTX)); +} diff --git a/libscrypt/sha256.h b/libscrypt/sha256.h new file mode 100644 index 000000000..f7138b417 --- /dev/null +++ b/libscrypt/sha256.h @@ -0,0 +1,70 @@ +/*- + * Copyright 2005,2007,2009 Colin Percival + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD: src/lib/libmd/sha256.h,v 1.2 2006/01/17 15:35:56 phk Exp $ + */ + +#ifndef _SHA256_H_ +#define _SHA256_H_ + +#include + +#include + +typedef struct libscrypt_SHA256Context { + uint32_t state[8]; + uint32_t count[2]; + unsigned char buf[64]; +} SHA256_CTX; + +typedef struct libscrypt_HMAC_SHA256Context { + SHA256_CTX ictx; + SHA256_CTX octx; +} HMAC_SHA256_CTX; + +void libscrypt_SHA256_Init(/*@out@*/ SHA256_CTX *); +void libscrypt_SHA256_Update(SHA256_CTX *, const void *, size_t); + +/* Original declaration: + * void SHA256_Final(unsigned char [32], SHA256_CTX *); +*/ +void libscrypt_SHA256_Final(/*@out@*/ unsigned char [], SHA256_CTX *); +void libscrypt_HMAC_SHA256_Init(HMAC_SHA256_CTX *, const void *, size_t); +void libscrypt_HMAC_SHA256_Update(HMAC_SHA256_CTX *, const void *, size_t); + +/* Original declaration: + * void HMAC_SHA256_Final(unsigned char [32], HMAC_SHA256_CTX *); +*/ +void libscrypt_HMAC_SHA256_Final(unsigned char [], HMAC_SHA256_CTX *); + +/** + * PBKDF2_SHA256(passwd, passwdlen, salt, saltlen, c, buf, dkLen): + * Compute PBKDF2(passwd, salt, c, dkLen) using HMAC-SHA256 as the PRF, and + * write the output to buf. The value dkLen must be at most 32 * (2^32 - 1). + */ +void libscrypt_PBKDF2_SHA256(const uint8_t *, size_t, const uint8_t *, size_t, + uint64_t, uint8_t *, size_t); + +#endif /* !_SHA256_H_ */ diff --git a/libscrypt/slowequals.c b/libscrypt/slowequals.c new file mode 100644 index 000000000..48e488e4e --- /dev/null +++ b/libscrypt/slowequals.c @@ -0,0 +1,26 @@ +#include + +/* Implements a constant time version of strcmp() + * Will return 1 if a and b are equal, 0 if they are not */ +int slow_equals(const char* a, const char* b) +{ + size_t lena, lenb, diff, i; + lena = strlen(a); + lenb = strlen(b); + diff = strlen(a) ^ strlen(b); + + for(i=0; i we have isn't usable. */ +#if !HAVE_DECL_BE64ENC +#undef HAVE_SYS_ENDIAN_H +#endif + +#ifdef HAVE_SYS_ENDIAN_H + +#include + +#else + +#include +#ifdef _MSC_VER + #define INLINE __inline +#else + #define INLINE inline +#endif + +static INLINE uint32_t +be32dec(const void *pp) +{ + const uint8_t *p = (uint8_t const *)pp; + + return ((uint32_t)(p[3]) + ((uint32_t)(p[2]) << 8) + + ((uint32_t)(p[1]) << 16) + ((uint32_t)(p[0]) << 24)); +} + +static INLINE void +be32enc(void *pp, uint32_t x) +{ + uint8_t * p = (uint8_t *)pp; + + p[3] = x & 0xff; + p[2] = (x >> 8) & 0xff; + p[1] = (x >> 16) & 0xff; + p[0] = (x >> 24) & 0xff; +} + +static INLINE uint64_t +be64dec(const void *pp) +{ + const uint8_t *p = (uint8_t const *)pp; + + return ((uint64_t)(p[7]) + ((uint64_t)(p[6]) << 8) + + ((uint64_t)(p[5]) << 16) + ((uint64_t)(p[4]) << 24) + + ((uint64_t)(p[3]) << 32) + ((uint64_t)(p[2]) << 40) + + ((uint64_t)(p[1]) << 48) + ((uint64_t)(p[0]) << 56)); +} + +static INLINE void +be64enc(void *pp, uint64_t x) +{ + uint8_t * p = (uint8_t *)pp; + + p[7] = x & 0xff; + p[6] = (x >> 8) & 0xff; + p[5] = (x >> 16) & 0xff; + p[4] = (x >> 24) & 0xff; + p[3] = (x >> 32) & 0xff; + p[2] = (x >> 40) & 0xff; + p[1] = (x >> 48) & 0xff; + p[0] = (x >> 56) & 0xff; +} + +static INLINE uint32_t +le32dec(const void *pp) +{ + const uint8_t *p = (uint8_t const *)pp; + + return ((uint32_t)(p[0]) + ((uint32_t)(p[1]) << 8) + + ((uint32_t)(p[2]) << 16) + ((uint32_t)(p[3]) << 24)); +} + +static INLINE void +le32enc(void *pp, uint32_t x) +{ + uint8_t * p = (uint8_t *)pp; + + p[0] = x & 0xff; + p[1] = (x >> 8) & 0xff; + p[2] = (x >> 16) & 0xff; + p[3] = (x >> 24) & 0xff; +} + +static INLINE uint64_t +le64dec(const void *pp) +{ + const uint8_t *p = (uint8_t const *)pp; + + return ((uint64_t)(p[0]) + ((uint64_t)(p[1]) << 8) + + ((uint64_t)(p[2]) << 16) + ((uint64_t)(p[3]) << 24) + + ((uint64_t)(p[4]) << 32) + ((uint64_t)(p[5]) << 40) + + ((uint64_t)(p[6]) << 48) + ((uint64_t)(p[7]) << 56)); +} + +static INLINE void +le64enc(void *pp, uint64_t x) +{ + uint8_t * p = (uint8_t *)pp; + + p[0] = x & 0xff; + p[1] = (x >> 8) & 0xff; + p[2] = (x >> 16) & 0xff; + p[3] = (x >> 24) & 0xff; + p[4] = (x >> 32) & 0xff; + p[5] = (x >> 40) & 0xff; + p[6] = (x >> 48) & 0xff; + p[7] = (x >> 56) & 0xff; +} +#endif /* !HAVE_SYS_ENDIAN_H */ + +#endif /* !_SYSENDIAN_H_ */ From a3cc9cc10bffb3dcbdd06a86d7636993b00c7ff6 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Wed, 20 May 2015 22:06:21 +0200 Subject: [PATCH 315/461] Ability to import version 1 keys. Possibly. --- alethzero/Main.ui | 8 ++- alethzero/MainWin.cpp | 27 +++++++++ alethzero/MainWin.h | 1 + libdevcrypto/SecretStore.cpp | 105 +++++++++++++++++++++++++++-------- libdevcrypto/SecretStore.h | 4 +- 5 files changed, 120 insertions(+), 25 deletions(-) diff --git a/alethzero/Main.ui b/alethzero/Main.ui index b5e22409d..f37f532a2 100644 --- a/alethzero/Main.ui +++ b/alethzero/Main.ui @@ -157,6 +157,7 @@ + @@ -1656,7 +1657,7 @@ font-size: 14pt &Enable Local Addresses - + true @@ -1745,6 +1746,11 @@ font-size: 14pt Co&nfirm Transactions + + + Import &Secret Key File... + + diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index 07f48c0bc..4f1da1c1a 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -813,6 +813,33 @@ void Main::on_importKey_triggered() } void Main::on_importKeyFile_triggered() +{ + QString s = QFileDialog::getOpenFileName(this, "Claim Account Contents", QDir::homePath(), "JSON Files (*.json);;All Files (*)"); + h128 uuid = m_keyManager.store().importKey(s.toStdString()); + if (!uuid) + { + QMessageBox::warning(this, "Key File Invalid", "Could not find secret key definition. This is probably not an Web3 key file."); + return; + } + + QString info = QInputDialog::getText(this, "Import Key File", "Enter a description of this key to help you recognise it in the future."); + + QString pass; + for (Secret s; !s;) + { + s = Secret(m_keyManager.store().secret(uuid, [&](){ + pass = QInputDialog::getText(this, "Import Key File", "Enter the password for the key to complete the import.", QLineEdit::Password); + return pass.toStdString(); + }, false)); + if (!s && QMessageBox::question(this, "Import Key File", "The password you provided is incorrect. Would you like to try again?", QMessageBox::Retry, QMessageBox::Cancel) == QMessageBox::Cancel) + return; + } + + QString hint = QInputDialog::getText(this, "Import Key File", "Enter a hint for this password to help you remember it."); + m_keyManager.importExisting(uuid, info.toStdString(), pass.toStdString(), hint.toStdString()); +} + +void Main::on_claimPresale_triggered() { QString s = QFileDialog::getOpenFileName(this, "Claim Account Contents", QDir::homePath(), "JSON Files (*.json);;All Files (*)"); try diff --git a/alethzero/MainWin.h b/alethzero/MainWin.h index 9f2082dd0..fdf7a9a72 100644 --- a/alethzero/MainWin.h +++ b/alethzero/MainWin.h @@ -138,6 +138,7 @@ private slots: void on_killAccount_triggered(); void on_importKey_triggered(); void on_importKeyFile_triggered(); + void on_claimPresale_triggered(); void on_exportKey_triggered(); // Account pane diff --git a/libdevcrypto/SecretStore.cpp b/libdevcrypto/SecretStore.cpp index 7bc870bcf..e422c32f8 100644 --- a/libdevcrypto/SecretStore.cpp +++ b/libdevcrypto/SecretStore.cpp @@ -22,6 +22,7 @@ #include "SecretStore.h" #include #include +#include #include #include #include @@ -42,10 +43,10 @@ SecretStore::~SecretStore() { } -bytes SecretStore::secret(h128 const& _uuid, function const& _pass) const +bytes SecretStore::secret(h128 const& _uuid, function const& _pass, bool _useCache) const { auto rit = m_cached.find(_uuid); - if (rit != m_cached.end()) + if (_useCache && rit != m_cached.end()) return rit->second; auto it = m_keys.find(_uuid); if (it == m_keys.end()) @@ -101,28 +102,71 @@ void SecretStore::save(std::string const& _keysPath) } } +static js::mValue upgraded(std::string const& _s) +{ + js::mValue v; + js::read_string(_s, v); + if (v.type() != js::obj_type) + return js::mValue(); + js::mObject ret = v.get_obj(); + unsigned version = ret.count("Version") ? stoi(ret["Version"].get_str()) : ret.count("version") ? ret["version"].get_int() : 0; + if (version == 1) + { + // upgrade to version 2 + js::mObject old; + swap(old, ret); + + ret["id"] = old["Id"]; + js::mObject c; + c["ciphertext"] = old["Crypto"].get_obj()["CipherText"]; + c["cipher"] = "aes-128-cbc"; + { + js::mObject cp; + cp["iv"] = old["Crypto"].get_obj()["IV"]; + c["cipherparams"] = cp; + } + c["kdf"] = old["Crypto"].get_obj()["KeyHeader"].get_obj()["Kdf"]; + { + js::mObject kp; + kp["salt"] = old["Crypto"].get_obj()["Salt"]; + for (auto const& i: old["Crypto"].get_obj()["KeyHeader"].get_obj()["KdfParams"].get_obj()) + if (i.first != "SaltLen") + kp[boost::to_lower_copy(i.first)] = i.second; + c["kdfparams"] = kp; + } + c["sillymac"] = old["Crypto"].get_obj()["MAC"]; + c["sillymacjson"] = _s; + ret["crypto"] = c; + version = 2; + } + if (version == 2) + return ret; + return js::mValue(); +} + void SecretStore::load(std::string const& _keysPath) { fs::path p(_keysPath); boost::filesystem::create_directories(p); - js::mValue v; for (fs::directory_iterator it(p); it != fs::directory_iterator(); ++it) if (is_regular_file(it->path())) - { - cdebug << "Reading" << it->path(); - js::read_string(contentsString(it->path().string()), v); - if (v.type() == js::obj_type) - { - js::mObject o = v.get_obj(); - int version = o.count("Version") ? stoi(o["Version"].get_str()) : o.count("version") ? o["version"].get_int() : 0; - if (version == 2) - m_keys[fromUUID(o["id"].get_str())] = make_pair(js::write_string(o["crypto"], false), it->path().string()); - else - cwarn << "Cannot read key version" << version; - } -// else -// cwarn << "Invalid JSON in key file" << it->path().string(); - } + readKey(it->path().string(), true); +} + +h128 SecretStore::readKey(std::string const& _file, bool _deleteFile) +{ + cdebug << "Reading" << _file; + js::mValue u = upgraded(contentsString(_file)); + if (u.type() == js::obj_type) + { + js::mObject& o = u.get_obj(); + auto uuid = fromUUID(o["id"].get_str()); + m_keys[uuid] = make_pair(js::write_string(o["crypto"], false), _deleteFile ? _file : string()); + return uuid; + } + else + cwarn << "Invalid JSON in key file" << _file; + return h128(); } std::string SecretStore::encrypt(bytes const& _v, std::string const& _pass) @@ -202,13 +246,28 @@ bytes SecretStore::decrypt(std::string const& _v, std::string const& _pass) bytes cipherText = fromHex(o["ciphertext"].get_str()); // check MAC - h256 mac(o["mac"].get_str()); - h256 macExp = sha3(bytesConstRef(&derivedKey).cropped(derivedKey.size() - 16).toBytes() + cipherText); - if (mac != macExp) + if (o.count("mac")) { - cwarn << "Invalid key - MAC mismatch; expected" << toString(macExp) << ", got" << toString(mac); - return bytes(); + h256 mac(o["mac"].get_str()); + h256 macExp = sha3(bytesConstRef(&derivedKey).cropped(derivedKey.size() - 16).toBytes() + cipherText); + if (mac != macExp) + { + cwarn << "Invalid key - MAC mismatch; expected" << toString(macExp) << ", got" << toString(mac); + return bytes(); + } } + else if (o.count("sillymac")) + { + h256 mac(o["sillymac"].get_str()); + h256 macExp = sha3(asBytes(o["sillymacjson"].get_str()) + bytesConstRef(&derivedKey).cropped(derivedKey.size() - 16).toBytes() + cipherText); + if (mac != macExp) + { + cwarn << "Invalid key - MAC mismatch; expected" << toString(macExp) << ", got" << toString(mac); + return bytes(); + } + } + else + cwarn << "No MAC. Proceeding anyway."; // decrypt if (o["cipher"].get_str() == "aes-128-cbc") diff --git a/libdevcrypto/SecretStore.h b/libdevcrypto/SecretStore.h index 18c290c1f..171603053 100644 --- a/libdevcrypto/SecretStore.h +++ b/libdevcrypto/SecretStore.h @@ -36,7 +36,8 @@ public: SecretStore(); ~SecretStore(); - bytes secret(h128 const& _uuid, std::function const& _pass) const; + bytes secret(h128 const& _uuid, std::function const& _pass, bool _useCache = true) const; + h128 importKey(std::string const& _file) { auto ret = readKey(_file, false); if (ret) save(); return ret; } h128 importSecret(bytes const& _s, std::string const& _pass); void kill(h128 const& _uuid); @@ -48,6 +49,7 @@ private: void load(std::string const& _keysPath = getDataDir("web3") + "/keys"); static std::string encrypt(bytes const& _v, std::string const& _pass); static bytes decrypt(std::string const& _v, std::string const& _pass); + h128 readKey(std::string const& _file, bool _deleteFile); mutable std::unordered_map m_cached; std::unordered_map> m_keys; From 29cbfdb25dfb2c464038a6ce0c48a60a5eec1167 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Wed, 20 May 2015 23:01:51 +0200 Subject: [PATCH 316/461] allow reencrypting key. windows fix. --- alethzero/Main.ui | 6 +++++ alethzero/MainWin.cpp | 16 +++++++++++- alethzero/MainWin.h | 1 + libdevcrypto/SecretStore.cpp | 47 ++++++++++++++++++++++++++++-------- libdevcrypto/SecretStore.h | 8 +++++- libethereum/KeyManager.cpp | 33 ++++++++++++++++--------- libethereum/KeyManager.h | 3 +++ libscrypt/crypto-mcf.c | 2 +- 8 files changed, 91 insertions(+), 25 deletions(-) diff --git a/alethzero/Main.ui b/alethzero/Main.ui index f37f532a2..b97ed08ed 100644 --- a/alethzero/Main.ui +++ b/alethzero/Main.ui @@ -159,6 +159,7 @@ + @@ -1751,6 +1752,11 @@ font-size: 14pt Import &Secret Key File... + + + &Re-encrypt Key + + diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index 4f1da1c1a..a2d7a3dde 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -2016,7 +2016,7 @@ void Main::on_killAccount_triggered() { if (ui->ourAccounts->currentRow() >= 0) { - auto hba = ui->accounts->currentItem()->data(Qt::UserRole).toByteArray(); + auto hba = ui->ourAccounts->currentItem()->data(Qt::UserRole).toByteArray(); Address h((byte const*)hba.data(), Address::ConstructFromPointer); auto k = m_keyManager.accountDetails()[h]; if ( @@ -2036,6 +2036,20 @@ void Main::on_killAccount_triggered() } } +void Main::on_reencryptKey_triggered() +{ + if (ui->ourAccounts->currentRow() >= 0) + { + auto hba = ui->ourAccounts->currentItem()->data(Qt::UserRole).toByteArray(); + Address a((byte const*)hba.data(), Address::ConstructFromPointer); + QStringList kdfs = {"PBKDF2-SHA256", "Scrypt"}; + QString kdf = QInputDialog::getItem(this, "Re-Encrypt Key", "Select a key derivation function to use for storing your key:", kdfs); + m_keyManager.reencode(a, [&](){ + return QInputDialog::getText(nullptr, "Re-Encrypt Key", "Enter the password for this key to re-encrypt it.", QLineEdit::Password, QString()).toStdString(); + }, (KDF)kdfs.indexOf(kdf)); + } +} + void Main::on_go_triggered() { if (!ui->net->isChecked()) diff --git a/alethzero/MainWin.h b/alethzero/MainWin.h index fdf7a9a72..6628c649b 100644 --- a/alethzero/MainWin.h +++ b/alethzero/MainWin.h @@ -137,6 +137,7 @@ private slots: void on_newAccount_triggered(); void on_killAccount_triggered(); void on_importKey_triggered(); + void on_reencryptKey_triggered(); void on_importKeyFile_triggered(); void on_claimPresale_triggered(); void on_exportKey_triggered(); diff --git a/libdevcrypto/SecretStore.cpp b/libdevcrypto/SecretStore.cpp index e422c32f8..6a975525b 100644 --- a/libdevcrypto/SecretStore.cpp +++ b/libdevcrypto/SecretStore.cpp @@ -169,24 +169,51 @@ h128 SecretStore::readKey(std::string const& _file, bool _deleteFile) return h128(); } -std::string SecretStore::encrypt(bytes const& _v, std::string const& _pass) +void SecretStore::recode(h128 const& _uuid, string const& _pass, KDF _kdf) +{ + m_keys[_uuid].first = encrypt(secret(_uuid, [&](){ return _pass; }), _pass, _kdf); + save(); +} + +std::string SecretStore::encrypt(bytes const& _v, std::string const& _pass, KDF _kdf) { js::mObject ret; // KDF info unsigned dklen = 16; - unsigned iterations = 262144; bytes salt = h256::random().asBytes(); - ret["kdf"] = "pbkdf2"; + bytes derivedKey; + if (_kdf == KDF::Scrypt) { - js::mObject params; - params["prf"] = "hmac-sha256"; - params["c"] = (int)iterations; - params["salt"] = toHex(salt); - params["dklen"] = (int)dklen; - ret["kdfparams"] = params; + unsigned iterations = 262144; + unsigned p = 262144; + unsigned r = 262144; + ret["kdf"] = "scrypt"; + { + js::mObject params; + params["n"] = (int)iterations; + params["p"] = 1; + params["r"] = 8; + params["dklen"] = (int)dklen; + params["salt"] = toHex(salt); + ret["kdfparams"] = params; + } + derivedKey = scrypt(_pass, salt, iterations, p, r, dklen); + } + else + { + unsigned iterations = 262144; + ret["kdf"] = "pbkdf2"; + { + js::mObject params; + params["prf"] = "hmac-sha256"; + params["c"] = (int)iterations; + params["salt"] = toHex(salt); + params["dklen"] = (int)dklen; + ret["kdfparams"] = params; + } + derivedKey = pbkdf2(_pass, salt, iterations, dklen); } - bytes derivedKey = pbkdf2(_pass, salt, iterations, dklen); // cipher info ret["cipher"] = "aes-128-cbc"; diff --git a/libdevcrypto/SecretStore.h b/libdevcrypto/SecretStore.h index 171603053..6e66ce967 100644 --- a/libdevcrypto/SecretStore.h +++ b/libdevcrypto/SecretStore.h @@ -30,6 +30,11 @@ namespace dev { +enum class KDF { + PBKDF2_SHA256, + Scrypt, +}; + class SecretStore { public: @@ -39,6 +44,7 @@ public: bytes secret(h128 const& _uuid, std::function const& _pass, bool _useCache = true) const; h128 importKey(std::string const& _file) { auto ret = readKey(_file, false); if (ret) save(); return ret; } h128 importSecret(bytes const& _s, std::string const& _pass); + void recode(h128 const& _uuid, std::string const& _pass, KDF _kdf = KDF::Scrypt); void kill(h128 const& _uuid); // Clear any cached keys. @@ -47,7 +53,7 @@ public: private: void save(std::string const& _keysPath = getDataDir("web3") + "/keys"); void load(std::string const& _keysPath = getDataDir("web3") + "/keys"); - static std::string encrypt(bytes const& _v, std::string const& _pass); + static std::string encrypt(bytes const& _v, std::string const& _pass, KDF _kdf = KDF::Scrypt); static bytes decrypt(std::string const& _v, std::string const& _pass); h128 readKey(std::string const& _file, bool _deleteFile); diff --git a/libethereum/KeyManager.cpp b/libethereum/KeyManager.cpp index 8c3fd28c3..687e13991 100644 --- a/libethereum/KeyManager.cpp +++ b/libethereum/KeyManager.cpp @@ -49,6 +49,12 @@ void KeyManager::create(std::string const& _pass) write(_pass, m_keysFile); } +void KeyManager::reencode(Address const& _address, std::function const& _pass, KDF _kdf) +{ + h128 u = uuid(_address); + store().recode(u, getPassword(u, _pass), _kdf); +} + bool KeyManager::load(std::string const& _pass) { try { @@ -89,18 +95,21 @@ Secret KeyManager::secret(Address const& _address, function const Secret KeyManager::secret(h128 const& _uuid, function const& _pass) const { - return Secret(m_store.secret(_uuid, [&](){ - auto kit = m_keyInfo.find(_uuid); - if (kit != m_keyInfo.end()) - { - auto it = m_cachedPasswords.find(kit->second.passHash); - if (it != m_cachedPasswords.end()) - return it->second; - } - std::string p = _pass(); - m_cachedPasswords[hashPassword(p)] = p; - return p; - })); + return Secret(m_store.secret(_uuid, [&](){ return getPassword(_uuid, _pass); })); +} + +std::string KeyManager::getPassword(h128 const& _uuid, function const& _pass) const +{ + auto kit = m_keyInfo.find(_uuid); + if (kit != m_keyInfo.end()) + { + auto it = m_cachedPasswords.find(kit->second.passHash); + if (it != m_cachedPasswords.end()) + return it->second; + } + std::string p = _pass(); + m_cachedPasswords[hashPassword(p)] = p; + return p; } h128 KeyManager::uuid(Address const& _a) const diff --git a/libethereum/KeyManager.h b/libethereum/KeyManager.h index 0a83fcc00..2cacf7bfe 100644 --- a/libethereum/KeyManager.h +++ b/libethereum/KeyManager.h @@ -84,10 +84,13 @@ public: Secret secret(Address const& _address, std::function const& _pass = DontKnowThrow) const; Secret secret(h128 const& _uuid, std::function const& _pass = DontKnowThrow) const; + void reencode(Address const& _address, std::function const& _pass = DontKnowThrow, KDF _kdf = KDF::Scrypt); + void kill(h128 const& _id) { kill(address(_id)); } void kill(Address const& _a); private: + std::string getPassword(h128 const& _uuid, std::function const& _pass = DontKnowThrow) const; std::string defaultPassword() const { return asString(m_key.ref()); } h256 hashPassword(std::string const& _pass) const; diff --git a/libscrypt/crypto-mcf.c b/libscrypt/crypto-mcf.c index 8ad3eb826..9f7ddc376 100644 --- a/libscrypt/crypto-mcf.c +++ b/libscrypt/crypto-mcf.c @@ -7,7 +7,7 @@ #include #ifndef S_SPLINT_S /* Including this here triggers a known bug in splint */ -#include +//#include #endif #include "libscrypt.h" From 74a69ebb16804f86ea4efc523d20439028d521d7 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Wed, 20 May 2015 23:23:23 +0200 Subject: [PATCH 317/461] Windows build fix? --- libscrypt/crypto-scrypt-saltgen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libscrypt/crypto-scrypt-saltgen.c b/libscrypt/crypto-scrypt-saltgen.c index a0e29988c..3c22f84f7 100644 --- a/libscrypt/crypto-scrypt-saltgen.c +++ b/libscrypt/crypto-scrypt-saltgen.c @@ -5,7 +5,7 @@ #include #ifndef S_SPLINT_S /* Including this here triggers a known bug in splint */ -#include +//#include #endif #define RNGDEV "/dev/urandom" From 012ffd4adc9cead57b021445cfa3d8267da5b951 Mon Sep 17 00:00:00 2001 From: subtly Date: Thu, 21 May 2015 02:02:57 +0200 Subject: [PATCH 318/461] retain session when interacting with capability --- libethereum/EthereumHost.cpp | 35 +++++++++++++++++++++-------------- libethereum/EthereumHost.h | 2 +- libp2p/HostCapability.cpp | 4 ++-- libp2p/HostCapability.h | 2 +- 4 files changed, 25 insertions(+), 18 deletions(-) diff --git a/libethereum/EthereumHost.cpp b/libethereum/EthereumHost.cpp index d62d6716f..43af332c6 100644 --- a/libethereum/EthereumHost.cpp +++ b/libethereum/EthereumHost.cpp @@ -189,7 +189,7 @@ void EthereumHost::maintainTransactions() for (auto const& i: ts) { bool unsent = !m_transactionsSent.count(i.first); - for (auto const& p: randomSelection(0, [&](EthereumPeer* p) { return p->m_requireTransactions || (unsent && !p->m_knownTransactions.count(i.first)); }).second) + for (auto const& p: get<1>(randomSelection(0, [&](EthereumPeer* p) { return p->m_requireTransactions || (unsent && !p->m_knownTransactions.count(i.first)); }))) peerTransactions[p].push_back(i.first); } for (auto const& t: ts) @@ -218,25 +218,32 @@ void EthereumHost::maintainTransactions() } } -pair>, vector>> EthereumHost::randomSelection(unsigned _percent, std::function const& _allow) +tuple>, vector>, list>> EthereumHost::randomSelection(unsigned _percent, std::function const& _allow) { - pair>, vector>> ret; - ret.second.reserve(peerSessions().size()); - for (auto const& j: peerSessions()) + vector> chosen; + vector> allowed; + list> sessions; + + auto ps = peerSessions(); + allowed.reserve(ps.size()); + for (auto const& j: ps) { auto pp = j.first->cap(); if (_allow(pp.get())) - ret.second.push_back(pp); + { + allowed.push_back(move(pp)); + sessions.push_back(move(j.first)); + } } - ret.second.reserve((peerSessions().size() * _percent + 99) / 100); - for (unsigned i = (peerSessions().size() * _percent + 99) / 100; i-- && ret.second.size();) + chosen.reserve((ps.size() * _percent + 99) / 100); + for (unsigned i = (ps.size() * _percent + 99) / 100; i-- && allowed.size();) { - unsigned n = rand() % ret.second.size(); - ret.first.push_back(std::move(ret.second[n])); - ret.second.erase(ret.second.begin() + n); + unsigned n = rand() % allowed.size(); + chosen.push_back(std::move(allowed[n])); + allowed.erase(allowed.begin() + n); } - return ret; + return make_tuple(chosen, allowed, sessions); } void EthereumHost::maintainBlocks(h256 const& _currentHash) @@ -254,7 +261,7 @@ void EthereumHost::maintainBlocks(h256 const& _currentHash) h256s blocks = get<0>(m_chain.treeRoute(m_latestBlockSent, _currentHash, false, false, true)); auto s = randomSelection(25, [&](EthereumPeer* p){ DEV_GUARDED(p->x_knownBlocks) return !p->m_knownBlocks.count(_currentHash); return false; }); - for (shared_ptr const& p: s.first) + for (shared_ptr const& p: get<0>(s)) for (auto const& b: blocks) { RLPStream ts; @@ -264,7 +271,7 @@ void EthereumHost::maintainBlocks(h256 const& _currentHash) p->sealAndSend(ts); p->m_knownBlocks.clear(); } - for (shared_ptr const& p: s.second) + for (shared_ptr const& p: get<1>(s)) { RLPStream ts; p->prep(ts, NewBlockHashesPacket, blocks.size()); diff --git a/libethereum/EthereumHost.h b/libethereum/EthereumHost.h index 95c7f147a..e8f7a0bad 100644 --- a/libethereum/EthereumHost.h +++ b/libethereum/EthereumHost.h @@ -80,7 +80,7 @@ public: void noteNewBlocks() { m_newBlocks = true; } private: - std::pair>, std::vector>> randomSelection(unsigned _percent = 25, std::function const& _allow = [](EthereumPeer const*){ return true; }); + std::tuple>, std::vector>, std::list>> randomSelection(unsigned _percent = 25, std::function const& _allow = [](EthereumPeer const*){ return true; }); /// Session is tell us that we may need (re-)syncing with the peer. void noteNeedsSyncing(EthereumPeer* _who); diff --git a/libp2p/HostCapability.cpp b/libp2p/HostCapability.cpp index b2acdcd1b..5f097875e 100644 --- a/libp2p/HostCapability.cpp +++ b/libp2p/HostCapability.cpp @@ -27,10 +27,10 @@ using namespace std; using namespace dev; using namespace dev::p2p; -std::vector,std::shared_ptr>> HostCapabilityFace::peerSessions() const +std::vector, std::shared_ptr>> HostCapabilityFace::peerSessions() const { RecursiveGuard l(m_host->x_sessions); - std::vector,std::shared_ptr>> ret; + std::vector, std::shared_ptr>> ret; for (auto const& i: m_host->m_sessions) if (std::shared_ptr s = i.second.lock()) if (s->m_capabilities.count(capDesc())) diff --git a/libp2p/HostCapability.h b/libp2p/HostCapability.h index 93086b1c9..668bcb929 100644 --- a/libp2p/HostCapability.h +++ b/libp2p/HostCapability.h @@ -45,7 +45,7 @@ public: Host* host() const { return m_host; } - std::vector,std::shared_ptr>> peerSessions() const; + std::vector, std::shared_ptr>> peerSessions() const; protected: virtual std::string name() const = 0; From 922c7055b766de9b62a0fb7b17c691bd7c03b48c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Thu, 21 May 2015 10:26:12 +0200 Subject: [PATCH 319/461] Fix Executive::call(CallParameters). --- libethereum/Executive.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/libethereum/Executive.cpp b/libethereum/Executive.cpp index 0bf8bdbb5..ca7a5a38a 100644 --- a/libethereum/Executive.cpp +++ b/libethereum/Executive.cpp @@ -163,14 +163,12 @@ bool Executive::call(Address _receiveAddress, Address _codeAddress, Address _sen bool Executive::call(CallParameters const& _p, u256 const& _gasPrice, Address const& _origin) { m_isCreation = false; -// cnote << "Transferring" << formatBalance(_value) << "to receiver."; auto it = !(_p.codeAddress & ~h160(0xffffffff)) ? precompiled().find((unsigned)(u160)_p.codeAddress) : precompiled().end(); if (it != precompiled().end()) { bigint g = it->second.gas(_p.data); if (_p.gas < g) { - m_gas = 0; m_excepted = TransactionException::OutOfGasBase; // Bail from exception. return true; // true actually means "all finished - nothing more to be done regarding go(). @@ -182,14 +180,16 @@ bool Executive::call(CallParameters const& _p, u256 const& _gasPrice, Address co m_out = &m_precompiledOut; } } - else if (m_s.addressHasCode(_p.codeAddress)) - { - m_vm = VMFactory::create(); - bytes const& c = m_s.code(_p.codeAddress); - m_ext = make_shared(m_s, m_lastHashes, _p.receiveAddress, _p.senderAddress, _origin, _p.value, _gasPrice, _p.data, &c, m_depth); - } else + { m_gas = _p.gas; + if (m_s.addressHasCode(_p.codeAddress)) + { + m_vm = VMFactory::create(); + bytes const& c = m_s.code(_p.codeAddress); + m_ext = make_shared(m_s, m_lastHashes, _p.receiveAddress, _p.senderAddress, _origin, _p.value, _gasPrice, _p.data, &c, m_depth); + } + } m_s.transferBalance(_p.senderAddress, _p.receiveAddress, _p.value); From 33dd3f2e2bc6e4631faf088de4cf64df7b7ccca5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Thu, 21 May 2015 11:01:19 +0200 Subject: [PATCH 320/461] Fix code duplication in Executive::call overloadings. --- libethereum/Client.cpp | 2 +- libethereum/Executive.cpp | 39 ++----------------- libethereum/Executive.h | 2 +- test/libsolidity/solidityExecutionFramework.h | 2 +- 4 files changed, 7 insertions(+), 38 deletions(-) diff --git a/libethereum/Client.cpp b/libethereum/Client.cpp index e372e611a..6dec81b38 100644 --- a/libethereum/Client.cpp +++ b/libethereum/Client.cpp @@ -440,7 +440,7 @@ ExecutionResult Client::call(Address _dest, bytes const& _data, u256 _gas, u256 temp = m_postMine; temp.addBalance(_from, _value + _gasPrice * _gas); Executive e(temp, LastHashes(), 0); - if (!e.call(_dest, _dest, _from, _value, _gasPrice, &_data, _gas, _from)) + if (!e.call(_dest, _from, _value, _gasPrice, &_data, _gas)) e.go(); ret = e.executionResult(); } diff --git a/libethereum/Executive.cpp b/libethereum/Executive.cpp index ca7a5a38a..d7bad0ff9 100644 --- a/libethereum/Executive.cpp +++ b/libethereum/Executive.cpp @@ -120,44 +120,13 @@ bool Executive::execute() if (m_t.isCreation()) return create(m_t.sender(), m_t.value(), m_t.gasPrice(), m_t.gas() - (u256)m_t.gasRequired(), &m_t.data(), m_t.sender()); else - return call(m_t.receiveAddress(), m_t.receiveAddress(), m_t.sender(), m_t.value(), m_t.gasPrice(), bytesConstRef(&m_t.data()), m_t.gas() - (u256)m_t.gasRequired(), m_t.sender()); + return call(m_t.receiveAddress(), m_t.sender(), m_t.value(), m_t.gasPrice(), bytesConstRef(&m_t.data()), m_t.gas() - (u256)m_t.gasRequired()); } -bool Executive::call(Address _receiveAddress, Address _codeAddress, Address _senderAddress, u256 _value, u256 _gasPrice, bytesConstRef _data, u256 _gas, Address _originAddress) +bool Executive::call(Address _receiveAddress, Address _senderAddress, u256 _value, u256 _gasPrice, bytesConstRef _data, u256 _gas) { - m_isCreation = false; -// cnote << "Transferring" << formatBalance(_value) << "to receiver."; - auto it = !(_codeAddress & ~h160(0xffffffff)) ? precompiled().find((unsigned)(u160)_codeAddress) : precompiled().end(); - if (it != precompiled().end()) - { - bigint g = it->second.gas(_data); - if (_gas < g) - { - m_excepted = TransactionException::OutOfGasBase; - // Bail from exception. - return true; // true actually means "all finished - nothing more to be done regarding go(). - } - else - { - m_gas = (u256)(_gas - g); - m_precompiledOut = it->second.exec(_data); - m_out = &m_precompiledOut; - } - } - else - { - m_gas = _gas; - if (m_s.addressHasCode(_codeAddress)) - { - m_vm = VMFactory::create(); - bytes const& c = m_s.code(_codeAddress); - m_ext = make_shared(m_s, m_lastHashes, _receiveAddress, _senderAddress, _originAddress, _value, _gasPrice, _data, &c, m_depth); - } - } - - m_s.transferBalance(_senderAddress, _receiveAddress, _value); - - return !m_ext; + CallParameters params{_senderAddress, _receiveAddress, _receiveAddress, _gas, _value, _data, {}, {}}; + return call(params, _gasPrice, _senderAddress); } bool Executive::call(CallParameters const& _p, u256 const& _gasPrice, Address const& _origin) diff --git a/libethereum/Executive.h b/libethereum/Executive.h index 6f72d0966..04d5857b3 100644 --- a/libethereum/Executive.h +++ b/libethereum/Executive.h @@ -94,7 +94,7 @@ public: bool create(Address _txSender, u256 _endowment, u256 _gasPrice, u256 _gas, bytesConstRef _code, Address _originAddress); /// Set up the executive for evaluating a bare CALL (message call) operation. /// @returns false iff go() must be called (and thus a VM execution in required). - bool call(Address _myAddress, Address _codeAddress, Address _txSender, u256 _txValue, u256 _gasPrice, bytesConstRef _txData, u256 _gas, Address _originAddress); + bool call(Address _receiveAddress, Address _txSender, u256 _txValue, u256 _gasPrice, bytesConstRef _txData, u256 _gas); bool call(CallParameters const& _cp, u256 const& _gasPrice, Address const& _origin); /// Finalise an operation through accruing the substate into the parent context. void accrueSubState(SubState& _parentContext); diff --git a/test/libsolidity/solidityExecutionFramework.h b/test/libsolidity/solidityExecutionFramework.h index fa25fb12c..0f80e9f59 100644 --- a/test/libsolidity/solidityExecutionFramework.h +++ b/test/libsolidity/solidityExecutionFramework.h @@ -155,7 +155,7 @@ protected: else { BOOST_REQUIRE(m_state.addressHasCode(m_contractAddress)); - BOOST_REQUIRE(!executive.call(m_contractAddress, m_contractAddress, m_sender, _value, m_gasPrice, &_data, m_gas, m_sender)); + BOOST_REQUIRE(!executive.call(m_contractAddress, m_sender, _value, m_gasPrice, &_data, m_gas)); } BOOST_REQUIRE(executive.go()); m_state.noteSending(m_sender); From 82145e1bb46c5a098994e3b2232cf433865d1654 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Thu, 21 May 2015 11:03:36 +0200 Subject: [PATCH 321/461] avoid unixy salt gen on windows. --- libscrypt/crypto-scrypt-saltgen.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libscrypt/crypto-scrypt-saltgen.c b/libscrypt/crypto-scrypt-saltgen.c index 3c22f84f7..998a1abcb 100644 --- a/libscrypt/crypto-scrypt-saltgen.c +++ b/libscrypt/crypto-scrypt-saltgen.c @@ -1,3 +1,4 @@ +#ifndef _MSC_VER #include #include #include @@ -46,3 +47,4 @@ int libscrypt_salt_gen(uint8_t *salt, size_t len) return 0; } +#endif From 2bf4c443a9077c5e6c53359bb1f10cbc0280b4a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Thu, 21 May 2015 13:11:13 +0200 Subject: [PATCH 322/461] Apply recent VM interface changes to EVM JIT. --- evmjit/libevmjit-cpp/Env.cpp | 25 +++++++++++++++---------- evmjit/libevmjit-cpp/JitVM.h | 6 +++++- 2 files changed, 20 insertions(+), 11 deletions(-) diff --git a/evmjit/libevmjit-cpp/Env.cpp b/evmjit/libevmjit-cpp/Env.cpp index d1f239f9f..86a65dbab 100644 --- a/evmjit/libevmjit-cpp/Env.cpp +++ b/evmjit/libevmjit-cpp/Env.cpp @@ -64,19 +64,24 @@ extern "C" EXPORT bool env_call(ExtVMFace* _env, int64_t* io_gas, int64_t _callGas, h256* _receiveAddress, i256* _value, byte* _inBeg, uint64_t _inSize, byte* _outBeg, uint64_t _outSize, h256* _codeAddress) { - auto value = llvm2eth(*_value); - auto receiveAddress = right160(*_receiveAddress); - auto codeAddress = right160(*_codeAddress); - const auto isCall = receiveAddress == codeAddress; // OPT: The same address pointer can be used if not CODECALL + CallParameters params; + params.value = llvm2eth(*_value); + params.senderAddress = _env->myAddress; + params.receiveAddress = right160(*_receiveAddress); + params.codeAddress = right160(*_codeAddress); + params.data = {_inBeg, _inSize}; + params.out = {_outBeg, _outSize}; + params.onOp = {}; + const auto isCall = params.receiveAddress == params.codeAddress; // OPT: The same address pointer can be used if not CODECALL *io_gas -= _callGas; if (*io_gas < 0) return false; - if (isCall && !_env->exists(receiveAddress)) + if (isCall && !_env->exists(params.receiveAddress)) *io_gas -= static_cast(c_callNewAccountGas); // no underflow, *io_gas non-negative before - if (value > 0) // value transfer + if (params.value > 0) // value transfer { /*static*/ assert(c_callValueTransferGas > c_callStipend && "Overflow possible"); *io_gas -= static_cast(c_callValueTransferGas); // no underflow @@ -87,11 +92,11 @@ extern "C" return false; auto ret = false; - auto callGas = u256{_callGas}; - if (_env->balance(_env->myAddress) >= value && _env->depth < 1024) - ret = _env->call(receiveAddress, value, {_inBeg, _inSize}, callGas, {_outBeg, _outSize}, {}, {}, codeAddress); + params.gas = u256{_callGas}; + if (_env->balance(_env->myAddress) >= params.value && _env->depth < 1024) + ret = _env->call(params); - *io_gas += static_cast(callGas); // it is never more than initial _callGas + *io_gas += static_cast(params.gas); // it is never more than initial _callGas return ret; } diff --git a/evmjit/libevmjit-cpp/JitVM.h b/evmjit/libevmjit-cpp/JitVM.h index 58caa3648..38ef9ff61 100644 --- a/evmjit/libevmjit-cpp/JitVM.h +++ b/evmjit/libevmjit-cpp/JitVM.h @@ -12,10 +12,14 @@ class JitVM: public VMFace { virtual bytesConstRef go(ExtVMFace& _ext, OnOpFunc const& _onOp = {}, uint64_t _steps = (uint64_t)-1) override final; + virtual u256 gas() const noexcept { return m_gas; } + virtual void reset(u256 const& _gas = 0) noexcept { m_gas = _gas; } + private: friend class VMFactory; - explicit JitVM(u256 _gas = 0) : VMFace(_gas) {} + explicit JitVM(u256 _gas = 0): m_gas(_gas) {} + u256 m_gas; jit::RuntimeData m_data; jit::ExecutionEngine m_engine; std::unique_ptr m_fallbackVM; ///< VM used in case of input data rejected by JIT From 4fefa1f266fcbc9d55e425929ddcd52a7bc1e5c4 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 21 May 2015 17:16:27 +0200 Subject: [PATCH 323/461] bug fix --- mix/ClientModel.cpp | 10 +++++----- mix/CodeModel.cpp | 4 +++- mix/CodeModel.h | 2 +- mix/qml/QBoolTypeView.qml | 29 ++++++++++++++++++++++------- mix/qml/StateDialog.qml | 15 +++++++++++++-- mix/qml/StateListModel.qml | 1 + mix/qml/StructView.qml | 3 +++ mix/qml/TransactionDialog.qml | 3 +-- mix/qml/TransactionLog.qml | 22 ++++++++++++++++++++++ mix/qml/html/cm/inkpot.css | 7 ++++++- mix/qml/html/cm/solarized.css | 1 - 11 files changed, 77 insertions(+), 20 deletions(-) diff --git a/mix/ClientModel.cpp b/mix/ClientModel.cpp index 54d5db2b5..4b4eb70d1 100644 --- a/mix/ClientModel.cpp +++ b/mix/ClientModel.cpp @@ -389,7 +389,7 @@ std::pair ClientModel::resolvePair(QString const& _contractId) { std::pair ret; ret.first = _contractId; - ret.second = -1; + ret.second = 0; if (_contractId.startsWith("<") && _contractId.endsWith(">")) { QStringList values = ret.first.remove("<").remove(">").split(" - "); @@ -401,10 +401,10 @@ std::pair ClientModel::resolvePair(QString const& _contractId) QString ClientModel::resolveToken(std::pair const& _value, vector

const& _contracts) { - if (_value.second != -1) - return QString::fromStdString("0x" + dev::toHex(_contracts.at(_value.second).ref())); - else - return _value.first; + if (_contracts.size() > 0) + return QString::fromStdString("0x" + dev::toHex(_contracts.at(_value.second).ref())); + else + return _value.first; } std::pair ClientModel::retrieveToken(QString const& _value, vector
const& _contracts) diff --git a/mix/CodeModel.cpp b/mix/CodeModel.cpp index a73dc920e..81f01a556 100644 --- a/mix/CodeModel.cpp +++ b/mix/CodeModel.cpp @@ -197,6 +197,8 @@ CodeModel::~CodeModel() stop(); disconnect(this); releaseContracts(); + if (m_gasCostsMaps) + m_gasCostsMaps->deleteLater(); } void CodeModel::stop() @@ -358,7 +360,7 @@ void CodeModel::gasEstimation(solidity::CompilerStack const& _cs) { if (m_gasCostsMaps) m_gasCostsMaps->deleteLater(); - m_gasCostsMaps = new GasMapWrapper(this); + m_gasCostsMaps = new GasMapWrapper(); for (std::string n: _cs.getContractNames()) { ContractDefinition const& contractDefinition = _cs.getContractDefinition(n); diff --git a/mix/CodeModel.h b/mix/CodeModel.h index 5291bdc72..75e350c58 100644 --- a/mix/CodeModel.h +++ b/mix/CodeModel.h @@ -137,7 +137,7 @@ class GasMapWrapper: public QObject Q_PROPERTY(GasCostsMaps gasMaps MEMBER m_gasMaps CONSTANT) public: - GasMapWrapper(QObject* _parent): QObject(_parent){} + GasMapWrapper(QObject* _parent = 0): QObject(_parent){} void push(QString _source, int _start, int _end, QString _value, bool _isInfinite); bool contains(QString _key); void insert(QString _source, QVariantList _variantList); diff --git a/mix/qml/QBoolTypeView.qml b/mix/qml/QBoolTypeView.qml index c68b4e133..a95c12040 100644 --- a/mix/qml/QBoolTypeView.qml +++ b/mix/qml/QBoolTypeView.qml @@ -6,22 +6,37 @@ Item id: editRoot property string value property string defaultValue - property alias readOnly: !boolCombo.enabled + property bool readOnly: !boolCombo.enabled height: 20 width: 150 + onReadOnlyChanged: { + boolCombo.enabled = !readOnly; + } + + function init() + { + value = value === true ? "1" : value + value = value === false ? "0" : value; + value = value === "true" ? "1" : value + value = value === "false" ? "0" : value; + + if (value === "") + boolCombo.currentIndex = parseInt(defaultValue); + else + boolCombo.currentIndex = parseInt(value); + boolCombo.enabled = !readOnly; + } + Rectangle { anchors.fill: parent ComboBox { - property bool inited: false + property bool inited; Component.onCompleted: { - if (value === "") - currentIndex = parseInt(defaultValue); - else - currentIndex = parseInt(value); - inited = true + init(); + inited = true; } id: boolCombo diff --git a/mix/qml/StateDialog.qml b/mix/qml/StateDialog.qml index f8da6dabd..404a524f4 100644 --- a/mix/qml/StateDialog.qml +++ b/mix/qml/StateDialog.qml @@ -507,8 +507,13 @@ Dialog { Button { text: qsTr("OK") onClicked: { - close() - accepted() + if (titleField.text === "") + alertDialog.open() + else + { + close() + accepted() + } } } Button { @@ -517,6 +522,12 @@ Dialog { } } + MessageDialog + { + id: alertDialog + text: qsTr("Please provide a name.") + } + ListModel { id: accountsModel diff --git a/mix/qml/StateListModel.qml b/mix/qml/StateListModel.qml index a94188a23..d3062af9e 100644 --- a/mix/qml/StateListModel.qml +++ b/mix/qml/StateListModel.qml @@ -266,6 +266,7 @@ Item { var ctorTr = defaultTransactionItem(); ctorTr.functionId = c; ctorTr.contractId = c; + ctorTr.label = qsTr("Deploy") + " " + ctorTr.contractId; ctorTr.sender = state.accounts[0].secret; state.transactions.push(ctorTr); changed = true; diff --git a/mix/qml/StructView.qml b/mix/qml/StructView.qml index 4feab2166..cb38ba5ed 100644 --- a/mix/qml/StructView.qml +++ b/mix/qml/StructView.qml @@ -93,6 +93,9 @@ Column else item.value = getValue(); + if (ptype.category === QSolidityType.Bool) + item.init(); + item.onValueChanged.connect(function() { vals[pname] = item.value; valueChanged(); diff --git a/mix/qml/TransactionDialog.qml b/mix/qml/TransactionDialog.qml index 1437c2562..e7fe22e51 100644 --- a/mix/qml/TransactionDialog.qml +++ b/mix/qml/TransactionDialog.qml @@ -94,7 +94,6 @@ Dialog { function loadCtorParameters(contractId) { paramsModel = []; - console.log(contractId); var contract = codeModel.contracts[contractId]; if (contract) { var params = contract.contract.constructor.parameters; @@ -154,7 +153,7 @@ Dialog { if (functionComboBox.currentIndex >= 0 && functionComboBox.currentIndex < functionsModel.count) { var contract = codeModel.contracts[contractFromToken(recipients.currentValue())]; if (contract) { - var func = contract.contract.functions[functionComboBox.currentIndex]; + var func = contract.contract.functions[functionComboBox.currentIndex - 1]; if (func) { var parameters = func.parameters; for (var p = 0; p < parameters.length; p++) diff --git a/mix/qml/TransactionLog.qml b/mix/qml/TransactionLog.qml index 16ed3e9bf..d31fe0786 100644 --- a/mix/qml/TransactionLog.qml +++ b/mix/qml/TransactionLog.qml @@ -73,8 +73,30 @@ Item { } } + CheckBox + { + text: qsTr("Mine") + onCheckedChanged: { + mineAction.enabled = !checked; + mineTimer.running = checked; + } + } + + Timer + { + id: mineTimer + repeat: true; + interval: 12000 + running: false + onTriggered: + { + clientModel.mine(); + } + } + Button { + id: mineBtn anchors.rightMargin: 9 anchors.verticalCenter: parent.verticalCenter action: mineAction diff --git a/mix/qml/html/cm/inkpot.css b/mix/qml/html/cm/inkpot.css index c6863e624..6a2d8d63a 100644 --- a/mix/qml/html/cm/inkpot.css +++ b/mix/qml/html/cm/inkpot.css @@ -52,7 +52,7 @@ span.CodeMirror-selectedtext { color: #ffffff !important; } .CodeMirror-errorannotation { border-bottom: 1px solid #DD3330; margin-bottom: 4px; -} + } .CodeMirror-errorannotation-context { font-family: monospace; @@ -63,3 +63,8 @@ span.CodeMirror-selectedtext { color: #ffffff !important; } border-top: solid 2px #063742; } +.CodeMirror-search-field +{ + font-size: 12px; +} + diff --git a/mix/qml/html/cm/solarized.css b/mix/qml/html/cm/solarized.css index 1d298b990..df0859d25 100644 --- a/mix/qml/html/cm/solarized.css +++ b/mix/qml/html/cm/solarized.css @@ -194,4 +194,3 @@ span.CodeMirror-selectedtext { color: #586e75 !important; } .CodeMirror-gasCosts { border-bottom: double 1px #2aa198; } - From f35a5ca84d4c369dcecb91bd34c1a859ad1a50d5 Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Thu, 21 May 2015 20:43:35 +0200 Subject: [PATCH 324/461] fix mining in tests --- libethcore/Ethash.cpp | 2 +- libethcore/Miner.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libethcore/Ethash.cpp b/libethcore/Ethash.cpp index 228f03f8e..24a6ab41e 100644 --- a/libethcore/Ethash.cpp +++ b/libethcore/Ethash.cpp @@ -142,7 +142,7 @@ void Ethash::CPUMiner::workLoop() WorkPackage w = work(); EthashAux::FullType dag; - while (!shouldStop() && !(dag = EthashAux::full(w.seedHash))) + while (!shouldStop() && !(dag = EthashAux::full(w.seedHash, true))) this_thread::sleep_for(chrono::milliseconds(500)); h256 boundary = w.boundary; diff --git a/libethcore/Miner.h b/libethcore/Miner.h index cede34475..11b9ae140 100644 --- a/libethcore/Miner.h +++ b/libethcore/Miner.h @@ -44,7 +44,7 @@ struct MiningProgress // MiningProgress& operator+=(MiningProgress const& _mp) { hashes += _mp.hashes; ms = std::max(ms, _mp.ms); return *this; } uint64_t hashes = 0; ///< Total number of hashes computed. uint64_t ms = 0; ///< Total number of milliseconds of mining thus far. - uint64_t rate() const { return hashes * 1000 / ms; } + uint64_t rate() const { return ms == 0 ? 0 : hashes * 1000 / ms; } }; struct MineInfo: public MiningProgress {}; From 8399161a8e9b4f0cf3a38e14f5c83e566aad21c2 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Thu, 21 May 2015 23:29:27 +0200 Subject: [PATCH 325/461] Nicer password dialog. Cleanups and fixes for secretstore and keyman. --- alethzero/CMakeLists.txt | 3 +- alethzero/GetPassword.ui | 123 ++++++++++++++++++++++++++++ alethzero/Main.ui | 8 +- alethzero/MainWin.cpp | 98 ++++++++++++++++++---- alethzero/MainWin.h | 3 +- alethzero/Transact.cpp | 27 +++++-- alethzero/Transact.h | 1 + libdevcore/Common.h | 3 + libdevcrypto/Common.cpp | 14 ++-- libdevcrypto/Common.h | 16 +++- libdevcrypto/SecretStore.cpp | 152 ++++++++++++++++++++++------------- libdevcrypto/SecretStore.h | 2 +- libethcore/ICAP.h | 2 - libethereum/AccountDiff.h | 2 +- libethereum/KeyManager.cpp | 14 +++- libethereum/KeyManager.h | 12 ++- 16 files changed, 380 insertions(+), 100 deletions(-) create mode 100644 alethzero/GetPassword.ui diff --git a/alethzero/CMakeLists.txt b/alethzero/CMakeLists.txt index 41d9ea10f..595668cd1 100644 --- a/alethzero/CMakeLists.txt +++ b/alethzero/CMakeLists.txt @@ -23,6 +23,7 @@ qt5_wrap_ui(ui_Connect.h Connect.ui) qt5_wrap_ui(ui_Debugger.h Debugger.ui) qt5_wrap_ui(ui_Transact.h Transact.ui) qt5_wrap_ui(ui_ExportState.h ExportState.ui) +qt5_wrap_ui(ui_GetPassword.h GetPassword.ui) file(GLOB HEADERS "*.h") @@ -35,7 +36,7 @@ endif () # eth_add_executable is defined in cmake/EthExecutableHelper.cmake eth_add_executable(${EXECUTABLE} ICON alethzero - UI_RESOURCES alethzero.icns Main.ui Connect.ui Debugger.ui Transact.ui ExportState.ui + UI_RESOURCES alethzero.icns Main.ui Connect.ui Debugger.ui Transact.ui ExportState.ui GetPassword.ui WIN_RESOURCES alethzero.rc ) diff --git a/alethzero/GetPassword.ui b/alethzero/GetPassword.ui new file mode 100644 index 000000000..753bca565 --- /dev/null +++ b/alethzero/GetPassword.ui @@ -0,0 +1,123 @@ + + + GetPassword + + + + 0 + 0 + 400 + 187 + + + + Enter Password + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + Qt::RichText + + + true + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + QLineEdit::Password + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + buttonBox + accepted() + GetPassword + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + GetPassword + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/alethzero/Main.ui b/alethzero/Main.ui index b97ed08ed..ecdc07ab6 100644 --- a/alethzero/Main.ui +++ b/alethzero/Main.ui @@ -159,6 +159,7 @@ + @@ -1754,7 +1755,12 @@ font-size: 14pt - &Re-encrypt Key + &Re-Encrypt Key + + + + + Re-Encrypt All Keys... diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index a2d7a3dde..1dcdcb67f 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -75,6 +75,7 @@ #include "WebPage.h" #include "ExportState.h" #include "ui_Main.h" +#include "ui_GetPassword.h" using namespace std; using namespace dev; using namespace dev::p2p; @@ -467,7 +468,9 @@ void Main::load(QString _s) void Main::on_newTransaction_triggered() { m_transact.setEnvironment(m_keyManager.accounts(), ethereum(), &m_natSpecDB); - m_transact.exec(); + m_transact.setWindowFlags(Qt::Dialog); + m_transact.setWindowModality(Qt::WindowModal); + m_transact.show(); } void Main::on_loadJS_triggered() @@ -698,12 +701,17 @@ Secret Main::retrieveSecret(Address const& _a) const auto info = m_keyManager.accountDetails()[_a]; while (true) { - if (Secret s = m_keyManager.secret(_a, [&](){ - return QInputDialog::getText(const_cast(this), "Import Account Key", QString("Enter the password for the account %2 (%1). The hint is:\n%3").arg(QString::fromStdString(_a.abridged())).arg(QString::fromStdString(info.first)).arg(QString::fromStdString(info.second)), QLineEdit::Password).toStdString(); - })) + Secret s = m_keyManager.secret(_a, [&](){ + QDialog d; + Ui_GetPassword gp; + gp.setupUi(&d); + d.setWindowTitle("Unlock Account"); + gp.label->setText(QString("Enter the password for the account %2 (%1).").arg(QString::fromStdString(_a.abridged())).arg(QString::fromStdString(info.first))); + gp.entry->setPlaceholderText("Hint: " + QString::fromStdString(info.second)); + return d.exec() == QDialog::Accepted ? gp.entry->text().toStdString() : string(); + }); + if (s || QMessageBox::warning(nullptr, "Unlock Account", "The password you gave is incorrect for this key.", QMessageBox::Retry, QMessageBox::Cancel) == QMessageBox::Cancel) return s; - else if (QMessageBox::warning(const_cast(this), "Incorrect Password", "The password you gave is incorrect for this key.", QMessageBox::Retry, QMessageBox::Cancel) == QMessageBox::Cancel) - return Secret(); } } @@ -771,17 +779,32 @@ void Main::readSettings(bool _skipGeometry) on_urlEdit_returnPressed(); } -std::string Main::getPassword(std::string const& _title, std::string const& _for) +std::string Main::getPassword(std::string const& _title, std::string const& _for, std::string* _hint, bool* _ok) { QString password; while (true) { - password = QInputDialog::getText(nullptr, QString::fromStdString(_title), QString::fromStdString(_for), QLineEdit::Password, QString()); + bool ok; + password = QInputDialog::getText(nullptr, QString::fromStdString(_title), QString::fromStdString(_for), QLineEdit::Password, QString(), &ok); + if (!ok) + { + if (_ok) + *_ok = false; + return string(); + } + if (password.isEmpty()) + break; QString confirm = QInputDialog::getText(nullptr, QString::fromStdString(_title), "Confirm this password by typing it again", QLineEdit::Password, QString()); if (password == confirm) break; QMessageBox::warning(nullptr, QString::fromStdString(_title), "You entered two different passwords - please enter the same password twice.", QMessageBox::Ok); } + + if (!password.isEmpty() && _hint && !m_keyManager.haveHint(password.toStdString())) + *_hint = QInputDialog::getText(this, "Create Account", "Enter a hint to help you remember this password.").toStdString(); + + if (_ok) + *_ok = true; return password.toStdString(); } @@ -797,8 +820,11 @@ void Main::on_importKey_triggered() QString s = QInputDialog::getText(this, "Import Account Key", "Enter this account's name"); if (QMessageBox::question(this, "Additional Security?", "Would you like to use additional security for this key? This lets you protect it with a different password to other keys, but also means you must re-enter the key's password every time you wish to use the account.", QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes) { - std::string password = getPassword("Import Account Key", "Enter the password you would like to use for this key. Don't forget it!"); - std::string hint = QInputDialog::getText(this, "Import Account Key", "Enter a hint to help you remember this password.").toStdString(); + bool ok; + std::string hint; + std::string password = getPassword("Import Account Key", "Enter the password you would like to use for this key. Don't forget it!", &hint, &ok); + if (!ok) + return; m_keyManager.import(k.secret(), s.toStdString(), password, hint); } else @@ -2003,8 +2029,11 @@ void Main::on_newAccount_triggered() QString s = QInputDialog::getText(this, "Create Account", "Enter this account's name"); if (QMessageBox::question(this, "Create Account", "Would you like to use additional security for this key? This lets you protect it with a different password to other keys, but also means you must re-enter the key's password every time you wish to use the account.", QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes) { - std::string password = getPassword("Create Account", "Enter the password you would like to use for this key. Don't forget it!"); - std::string hint = QInputDialog::getText(this, "Create Account", "Enter a hint to help you remember this password.").toStdString(); + bool ok = false; + std::string hint; + std::string password = getPassword("Create Account", "Enter the password you would like to use for this key. Don't forget it!", &hint, &ok); + if (!ok) + return; m_keyManager.import(p.secret(), s.toStdString(), password, hint); } else @@ -2043,11 +2072,48 @@ void Main::on_reencryptKey_triggered() auto hba = ui->ourAccounts->currentItem()->data(Qt::UserRole).toByteArray(); Address a((byte const*)hba.data(), Address::ConstructFromPointer); QStringList kdfs = {"PBKDF2-SHA256", "Scrypt"}; - QString kdf = QInputDialog::getItem(this, "Re-Encrypt Key", "Select a key derivation function to use for storing your key:", kdfs); - m_keyManager.reencode(a, [&](){ - return QInputDialog::getText(nullptr, "Re-Encrypt Key", "Enter the password for this key to re-encrypt it.", QLineEdit::Password, QString()).toStdString(); - }, (KDF)kdfs.indexOf(kdf)); + bool ok = true; + KDF kdf = (KDF)kdfs.indexOf(QInputDialog::getItem(this, "Re-Encrypt Key", "Select a key derivation function to use for storing your key:", kdfs, kdfs.size() - 1, false, &ok)); + if (!ok) + return; + std::string hint; + std::string password = getPassword("Create Account", "Enter the password you would like to use for this key. Don't forget it!\nEnter nothing to use your Master password.", &hint, &ok); + if (!ok) + return; + try { + auto pw = [&](){ + auto p = QInputDialog::getText(this, "Re-Encrypt Key", "Enter the original password for this key.\nHint: " + QString::fromStdString(m_keyManager.hint(a)), QLineEdit::Password, QString()).toStdString(); + if (p.empty()) + throw UnknownPassword(); + return p; + }; + while (!(password.empty() ? m_keyManager.recode(a, SemanticPassword::Master, pw, kdf) : m_keyManager.recode(a, password, hint, pw, kdf))) + if (QMessageBox::question(this, "Re-Encrypt Key", "Password given is incorrect. Would you like to try again?", QMessageBox::Retry, QMessageBox::Cancel) == QMessageBox::Cancel) + return; + } + catch (UnknownPassword&) {} + } +} + +void Main::on_reencryptAll_triggered() +{ + QStringList kdfs = {"PBKDF2-SHA256", "Scrypt"}; + bool ok = false; + QString kdf = QInputDialog::getItem(this, "Re-Encrypt Key", "Select a key derivation function to use for storing your keys:", kdfs, kdfs.size() - 1, false, &ok); + if (!ok) + return; + try { + for (Address const& a: m_keyManager.accounts()) + while (!m_keyManager.recode(a, SemanticPassword::Existing, [&](){ + auto p = QInputDialog::getText(nullptr, "Re-Encrypt Key", QString("Enter the original password for key %1.\nHint: %2").arg(QString::fromStdString(pretty(a))).arg(QString::fromStdString(m_keyManager.hint(a))), QLineEdit::Password, QString()).toStdString(); + if (p.empty()) + throw UnknownPassword(); + return p; + }, (KDF)kdfs.indexOf(kdf))) + if (QMessageBox::question(this, "Re-Encrypt Key", "Password given is incorrect. Would you like to try again?", QMessageBox::Retry, QMessageBox::Cancel) == QMessageBox::Cancel) + return; } + catch (UnknownPassword&) {} } void Main::on_go_triggered() diff --git a/alethzero/MainWin.h b/alethzero/MainWin.h index 6628c649b..0e74d8f69 100644 --- a/alethzero/MainWin.h +++ b/alethzero/MainWin.h @@ -138,6 +138,7 @@ private slots: void on_killAccount_triggered(); void on_importKey_triggered(); void on_reencryptKey_triggered(); + void on_reencryptAll_triggered(); void on_importKeyFile_triggered(); void on_claimPresale_triggered(); void on_exportKey_triggered(); @@ -248,7 +249,7 @@ private: void refreshBalances(); void setBeneficiary(dev::Address const& _b); - std::string getPassword(std::string const& _title, std::string const& _for); + std::string getPassword(std::string const& _title, std::string const& _for, std::string* _hint = nullptr, bool* _ok = nullptr); std::unique_ptr ui; diff --git a/alethzero/Transact.cpp b/alethzero/Transact.cpp index 1336c3f05..fcca822fe 100644 --- a/alethzero/Transact.cpp +++ b/alethzero/Transact.cpp @@ -76,6 +76,7 @@ void Transact::setEnvironment(AddressHash const& _accounts, dev::eth::Client* _e m_ethereum = _eth; m_natSpecDB = _natSpecDB; + auto old = ui->from->currentIndex(); ui->from->clear(); for (auto const& i: m_accounts) { @@ -84,6 +85,10 @@ void Transact::setEnvironment(AddressHash const& _accounts, dev::eth::Client* _e QString s = QString("%4 %2: %1").arg(formatBalance(b).c_str()).arg(QString::fromStdString(m_context->render(i))).arg(QString::fromStdString(d.first)); ui->from->addItem(s); } + if (old > -1 && old < ui->from->count()) + ui->from->setCurrentIndex(old); + else if (ui->from->count()) + ui->from->setCurrentIndex(0); } bool Transact::isCreation() const @@ -301,6 +306,9 @@ void Transact::rejigData() // Determine how much balance we have to play with... //findSecret(value() + ethereum()->gasLimitRemaining() * gasPrice()); auto s = fromAccount(); + if (!s) + return; + auto b = ethereum()->balanceAt(s, PendingBlock); m_allGood = true; @@ -344,7 +352,7 @@ void Transact::rejigData() if (b < value() + baseGas * gasPrice()) { // Not enough - bail. - bail("
ERROR No single account contains enough for paying even the basic amount of gas required.
"); + bail("
ERROR Account doesn't contain enough for paying even the basic amount of gas required.
"); return; } else @@ -417,6 +425,8 @@ Secret Transact::findSecret(u256 _totalReq) const Address Transact::fromAccount() { + if (ui->from->currentIndex() < 0 || ui->from->currentIndex() >= (int)m_accounts.size()) + return Address(); auto it = m_accounts.begin(); std::advance(it, ui->from->currentIndex()); return *it; @@ -425,14 +435,19 @@ Address Transact::fromAccount() void Transact::on_send_clicked() { // Secret s = findSecret(value() + fee()); - Secret s = m_context->retrieveSecret(fromAccount()); - auto b = ethereum()->balanceAt(KeyPair(s).address(), PendingBlock); - if (!s || b < value() + fee()) + auto a = fromAccount(); + auto b = ethereum()->balanceAt(a, PendingBlock); + + if (!a || b < value() + fee()) { - QMessageBox::critical(this, "Transaction Failed", "Couldn't make transaction: no single account contains at least the required amount."); + QMessageBox::critical(nullptr, "Transaction Failed", "Couldn't make transaction: account doesn't contain at least the required amount.", QMessageBox::Ok); return; } + Secret s = m_context->retrieveSecret(a); + if (!s) + return; + if (isCreation()) { // If execution is a contract creation, add Natspec to @@ -467,7 +482,7 @@ void Transact::on_debug_clicked() auto b = ethereum()->balanceAt(from, PendingBlock); if (!from || b < value() + fee()) { - QMessageBox::critical(this, "Transaction Failed", "Couldn't make transaction: no single account contains at least the required amount."); + QMessageBox::critical(this, "Transaction Failed", "Couldn't make transaction: account doesn't contain at least the required amount."); return; } diff --git a/alethzero/Transact.h b/alethzero/Transact.h index cd62c0e20..8c079a2fe 100644 --- a/alethzero/Transact.h +++ b/alethzero/Transact.h @@ -44,6 +44,7 @@ public: void setEnvironment(dev::AddressHash const& _accounts, dev::eth::Client* _eth, NatSpecFace* _natSpecDB); private slots: + void on_from_currentIndexChanged(int) { rejigData(); } void on_destination_currentTextChanged(QString); void on_value_valueChanged(int) { updateFee(); } void on_gas_valueChanged(int) { updateFee(); } diff --git a/libdevcore/Common.h b/libdevcore/Common.h index ac4d89103..ae98861c1 100644 --- a/libdevcore/Common.h +++ b/libdevcore/Common.h @@ -39,6 +39,7 @@ #include #include #include +#include #include #include #pragma warning(push) @@ -63,6 +64,8 @@ namespace dev extern char const* Version; +static const std::string EmptyString; + // Binary data types. using bytes = std::vector; using bytesRef = vector_ref; diff --git a/libdevcrypto/Common.cpp b/libdevcrypto/Common.cpp index 2a3561314..814f8309e 100644 --- a/libdevcrypto/Common.cpp +++ b/libdevcrypto/Common.cpp @@ -120,10 +120,11 @@ std::pair dev::encryptSymNoAuth(h128 const& _k, bytesConstRef _plai return make_pair(encryptSymNoAuth(_k, iv, _plain), iv); } -bytes dev::encryptSymNoAuth(h128 const& _k, h128 const& _iv, bytesConstRef _plain) +bytes dev::encryptAES128CTR(bytesConstRef _k, h128 const& _iv, bytesConstRef _plain) { - const int c_aesKeyLen = 16; - SecByteBlock key(_k.data(), c_aesKeyLen); + if (_k.size() != 16 && _k.size() != 24 && _k.size() != 32) + return bytes(); + SecByteBlock key(_k.data(), _k.size()); try { CTR_Mode::Encryption e; @@ -139,10 +140,11 @@ bytes dev::encryptSymNoAuth(h128 const& _k, h128 const& _iv, bytesConstRef _plai } } -bytes dev::decryptSymNoAuth(h128 const& _k, h128 const& _iv, bytesConstRef _cipher) +bytes dev::decryptAES128CTR(bytesConstRef _k, h128 const& _iv, bytesConstRef _cipher) { - const size_t c_aesKeyLen = 16; - SecByteBlock key(_k.data(), c_aesKeyLen); + if (_k.size() != 16 && _k.size() != 24 && _k.size() != 32) + return bytes(); + SecByteBlock key(_k.data(), _k.size()); try { CTR_Mode::Decryption d; diff --git a/libdevcrypto/Common.h b/libdevcrypto/Common.h index a0f894a25..10bcdd067 100644 --- a/libdevcrypto/Common.h +++ b/libdevcrypto/Common.h @@ -98,18 +98,26 @@ bool decryptSym(Secret const& _k, bytesConstRef _cipher, bytes& o_plaintext); /// Encrypt payload using ECIES standard with AES128-CTR. void encryptECIES(Public const& _k, bytesConstRef _plain, bytes& o_cipher); - + /// Decrypt payload using ECIES standard with AES128-CTR. bool decryptECIES(Secret const& _k, bytesConstRef _cipher, bytes& o_plaintext); - + /// Encrypts payload with random IV/ctr using AES128-CTR. std::pair encryptSymNoAuth(h128 const& _k, bytesConstRef _plain); /// Encrypts payload with specified IV/ctr using AES128-CTR. -bytes encryptSymNoAuth(h128 const& _k, h128 const& _iv, bytesConstRef _plain); +bytes encryptAES128CTR(bytesConstRef _k, h128 const& _iv, bytesConstRef _plain); + +/// Decrypts payload with specified IV/ctr using AES128-CTR. +bytes decryptAES128CTR(bytesConstRef _k, h128 const& _iv, bytesConstRef _cipher); + +/// Encrypts payload with specified IV/ctr using AES128-CTR. +inline bytes encryptSymNoAuth(h128 const& _k, h128 const& _iv, bytesConstRef _plain) { return encryptAES128CTR(_k.ref(), _iv, _plain); } +inline bytes encryptSymNoAuth(h256 const& _k, h128 const& _iv, bytesConstRef _plain) { return encryptAES128CTR(_k.ref(), _iv, _plain); } /// Decrypts payload with specified IV/ctr using AES128-CTR. -bytes decryptSymNoAuth(h128 const& _k, h128 const& _iv, bytesConstRef _cipher); +inline bytes decryptSymNoAuth(h128 const& _k, h128 const& _iv, bytesConstRef _cipher) { return decryptAES128CTR(_k.ref(), _iv, _cipher); } +inline bytes decryptSymNoAuth(h256 const& _k, h128 const& _iv, bytesConstRef _cipher) { return decryptAES128CTR(_k.ref(), _iv, _cipher); } /// Recovers Public key from signed message hash. Public recover(Signature const& _sig, h256 const& _hash); diff --git a/libdevcrypto/SecretStore.cpp b/libdevcrypto/SecretStore.cpp index 6a975525b..982b7bae6 100644 --- a/libdevcrypto/SecretStore.cpp +++ b/libdevcrypto/SecretStore.cpp @@ -34,6 +34,56 @@ using namespace dev; namespace js = json_spirit; namespace fs = boost::filesystem; +static const int c_keyFileVersion = 3; + +static js::mValue upgraded(std::string const& _s) +{ + js::mValue v; + js::read_string(_s, v); + if (v.type() != js::obj_type) + return js::mValue(); + js::mObject ret = v.get_obj(); + unsigned version = ret.count("Version") ? stoi(ret["Version"].get_str()) : ret.count("version") ? ret["version"].get_int() : 0; + if (version == 1) + { + // upgrade to version 2 + js::mObject old; + swap(old, ret); + + ret["id"] = old["Id"]; + js::mObject c; + c["ciphertext"] = old["Crypto"].get_obj()["CipherText"]; + c["cipher"] = "aes-128-cbc"; + { + js::mObject cp; + cp["iv"] = old["Crypto"].get_obj()["IV"]; + c["cipherparams"] = cp; + } + c["kdf"] = old["Crypto"].get_obj()["KeyHeader"].get_obj()["Kdf"]; + { + js::mObject kp; + kp["salt"] = old["Crypto"].get_obj()["Salt"]; + for (auto const& i: old["Crypto"].get_obj()["KeyHeader"].get_obj()["KdfParams"].get_obj()) + if (i.first != "SaltLen") + kp[boost::to_lower_copy(i.first)] = i.second; + c["kdfparams"] = kp; + } + c["sillymac"] = old["Crypto"].get_obj()["MAC"]; + c["sillymacjson"] = _s; + ret["crypto"] = c; + version = 2; + } + if (version == 2) + { + ret["crypto"].get_obj()["cipher"] = "aes-128-ctr"; + ret["crypto"].get_obj()["compat"] = "2"; + version = 3; + } + if (version == c_keyFileVersion) + return ret; + return js::mValue(); +} + SecretStore::SecretStore() { load(); @@ -45,6 +95,7 @@ SecretStore::~SecretStore() bytes SecretStore::secret(h128 const& _uuid, function const& _pass, bool _useCache) const { + (void)_pass; auto rit = m_cached.find(_uuid); if (_useCache && rit != m_cached.end()) return rit->second; @@ -94,7 +145,7 @@ void SecretStore::save(std::string const& _keysPath) js::read_string(k.second.first, crypto); v["crypto"] = crypto; v["id"] = uuid; - v["version"] = 2; + v["version"] = c_keyFileVersion; writeFile(filename, js::write_string(js::mValue(v), true)); if (!k.second.second.empty() && k.second.second != filename) boost::filesystem::remove(k.second.second); @@ -102,48 +153,6 @@ void SecretStore::save(std::string const& _keysPath) } } -static js::mValue upgraded(std::string const& _s) -{ - js::mValue v; - js::read_string(_s, v); - if (v.type() != js::obj_type) - return js::mValue(); - js::mObject ret = v.get_obj(); - unsigned version = ret.count("Version") ? stoi(ret["Version"].get_str()) : ret.count("version") ? ret["version"].get_int() : 0; - if (version == 1) - { - // upgrade to version 2 - js::mObject old; - swap(old, ret); - - ret["id"] = old["Id"]; - js::mObject c; - c["ciphertext"] = old["Crypto"].get_obj()["CipherText"]; - c["cipher"] = "aes-128-cbc"; - { - js::mObject cp; - cp["iv"] = old["Crypto"].get_obj()["IV"]; - c["cipherparams"] = cp; - } - c["kdf"] = old["Crypto"].get_obj()["KeyHeader"].get_obj()["Kdf"]; - { - js::mObject kp; - kp["salt"] = old["Crypto"].get_obj()["Salt"]; - for (auto const& i: old["Crypto"].get_obj()["KeyHeader"].get_obj()["KdfParams"].get_obj()) - if (i.first != "SaltLen") - kp[boost::to_lower_copy(i.first)] = i.second; - c["kdfparams"] = kp; - } - c["sillymac"] = old["Crypto"].get_obj()["MAC"]; - c["sillymacjson"] = _s; - ret["crypto"] = c; - version = 2; - } - if (version == 2) - return ret; - return js::mValue(); -} - void SecretStore::load(std::string const& _keysPath) { fs::path p(_keysPath); @@ -169,10 +178,17 @@ h128 SecretStore::readKey(std::string const& _file, bool _deleteFile) return h128(); } -void SecretStore::recode(h128 const& _uuid, string const& _pass, KDF _kdf) +bool SecretStore::recode(h128 const& _uuid, string const& _newPass, std::function const& _pass, KDF _kdf) { - m_keys[_uuid].first = encrypt(secret(_uuid, [&](){ return _pass; }), _pass, _kdf); + cdebug << "recode:" << toUUID(_uuid); + cdebug << "newPass:" << _newPass; + bytes s = secret(_uuid, _pass, true); + if (s.empty()) + return false; + cdebug << "secret:" << toHex(s); + m_keys[_uuid].first = encrypt(s, _newPass, _kdf); save(); + return true; } std::string SecretStore::encrypt(bytes const& _v, std::string const& _pass, KDF _kdf) @@ -180,25 +196,26 @@ std::string SecretStore::encrypt(bytes const& _v, std::string const& _pass, KDF js::mObject ret; // KDF info - unsigned dklen = 16; + unsigned dklen = 32; bytes salt = h256::random().asBytes(); bytes derivedKey; if (_kdf == KDF::Scrypt) { unsigned iterations = 262144; - unsigned p = 262144; - unsigned r = 262144; + unsigned p = 1; + unsigned r = 8; ret["kdf"] = "scrypt"; { js::mObject params; - params["n"] = (int)iterations; - params["p"] = 1; - params["r"] = 8; + params["n"] = (int64_t)iterations; + params["p"] = (int)p; + params["r"] = (int)r; params["dklen"] = (int)dklen; params["salt"] = toHex(salt); ret["kdfparams"] = params; } derivedKey = scrypt(_pass, salt, iterations, p, r, dklen); + cdebug << "derivedKey" << toHex(derivedKey); } else { @@ -213,11 +230,13 @@ std::string SecretStore::encrypt(bytes const& _v, std::string const& _pass, KDF ret["kdfparams"] = params; } derivedKey = pbkdf2(_pass, salt, iterations, dklen); + cdebug << "derivedKey" << toHex(derivedKey); } // cipher info - ret["cipher"] = "aes-128-cbc"; - h128 key(sha3(h128(derivedKey, h128::AlignRight)), h128::AlignRight); + ret["cipher"] = "aes-128-ctr"; + h128 key(derivedKey, h128::AlignLeft); + cdebug << "cipherKey" << key.hex(); h128 iv = h128::random(); { js::mObject params; @@ -230,7 +249,9 @@ std::string SecretStore::encrypt(bytes const& _v, std::string const& _pass, KDF ret["ciphertext"] = toHex(cipherText); // and mac. - h256 mac = sha3(bytesConstRef(&derivedKey).cropped(derivedKey.size() - 16).toBytes() + cipherText); + h256 mac = sha3(ref(derivedKey).cropped(16, 16).toBytes() + cipherText); + cdebug << "macBody" << toHex(ref(derivedKey).cropped(16, 16).toBytes() + cipherText); + cdebug << "mac" << mac.hex(); ret["mac"] = toHex(mac.ref()); return js::write_string((js::mValue)ret, true); @@ -270,13 +291,23 @@ bytes SecretStore::decrypt(std::string const& _v, std::string const& _pass) return bytes(); } + if (derivedKey.size() < 32 && !(o.count("compat") && o["compat"].get_str() == "2")) + { + cwarn << "Derived key's length too short (<32 bytes)"; + return bytes(); + } + bytes cipherText = fromHex(o["ciphertext"].get_str()); // check MAC if (o.count("mac")) { h256 mac(o["mac"].get_str()); - h256 macExp = sha3(bytesConstRef(&derivedKey).cropped(derivedKey.size() - 16).toBytes() + cipherText); + h256 macExp; + if (o.count("compat") && o["compat"].get_str() == "2") + macExp = sha3(bytesConstRef(&derivedKey).cropped(derivedKey.size() - 16).toBytes() + cipherText); + else + macExp = sha3(bytesConstRef(&derivedKey).cropped(16, 16).toBytes() + cipherText); if (mac != macExp) { cwarn << "Invalid key - MAC mismatch; expected" << toString(macExp) << ", got" << toString(mac); @@ -297,12 +328,17 @@ bytes SecretStore::decrypt(std::string const& _v, std::string const& _pass) cwarn << "No MAC. Proceeding anyway."; // decrypt - if (o["cipher"].get_str() == "aes-128-cbc") + if (o["cipher"].get_str() == "aes-128-ctr") { auto params = o["cipherparams"].get_obj(); - h128 key(sha3(h128(derivedKey, h128::AlignRight)), h128::AlignRight); h128 iv(params["iv"].get_str()); - return decryptSymNoAuth(key, iv, &cipherText); + if (o.count("compat") && o["compat"].get_str() == "2") + { + h128 key(sha3(h128(derivedKey, h128::AlignRight)), h128::AlignRight); + return decryptSymNoAuth(key, iv, &cipherText); + } + else + return decryptSymNoAuth(h128(derivedKey, h128::AlignLeft), iv, &cipherText); } else { diff --git a/libdevcrypto/SecretStore.h b/libdevcrypto/SecretStore.h index 6e66ce967..6a62147b8 100644 --- a/libdevcrypto/SecretStore.h +++ b/libdevcrypto/SecretStore.h @@ -44,7 +44,7 @@ public: bytes secret(h128 const& _uuid, std::function const& _pass, bool _useCache = true) const; h128 importKey(std::string const& _file) { auto ret = readKey(_file, false); if (ret) save(); return ret; } h128 importSecret(bytes const& _s, std::string const& _pass); - void recode(h128 const& _uuid, std::string const& _pass, KDF _kdf = KDF::Scrypt); + bool recode(h128 const& _uuid, std::string const& _newPass, std::function const& _pass, KDF _kdf = KDF::Scrypt); void kill(h128 const& _uuid); // Clear any cached keys. diff --git a/libethcore/ICAP.h b/libethcore/ICAP.h index b4229e1f5..a2456bd40 100644 --- a/libethcore/ICAP.h +++ b/libethcore/ICAP.h @@ -38,8 +38,6 @@ namespace eth struct InvalidICAP: virtual public dev::Exception {}; -static const std::string EmptyString; - /** * @brief Encapsulation of an ICAP address. * Can be encoded, decoded, looked-up and inspected. diff --git a/libethereum/AccountDiff.h b/libethereum/AccountDiff.h index 22107b958..dd494c0a5 100644 --- a/libethereum/AccountDiff.h +++ b/libethereum/AccountDiff.h @@ -62,7 +62,7 @@ struct AccountDiff Diff exist; ///< The account's existance; was it created/deleted or not? Diff balance; ///< The account's balance; did it alter? Diff nonce; ///< The account's nonce; did it alter? - std::unordered_map> storage; ///< The account's storage addresses; each has its own Diff. + std::map> storage; ///< The account's storage addresses; each has its own Diff. Diff code; ///< The account's code; in general this should only have changed if exist also changed. }; diff --git a/libethereum/KeyManager.cpp b/libethereum/KeyManager.cpp index 687e13991..4a03d8435 100644 --- a/libethereum/KeyManager.cpp +++ b/libethereum/KeyManager.cpp @@ -49,10 +49,20 @@ void KeyManager::create(std::string const& _pass) write(_pass, m_keysFile); } -void KeyManager::reencode(Address const& _address, std::function const& _pass, KDF _kdf) +bool KeyManager::recode(Address const& _address, std::string const& _newPass, std::string const& _hint, std::function const& _pass, KDF _kdf) +{ + noteHint(_newPass, _hint); + return store().recode(uuid(_address), _newPass, _pass, _kdf); +} + +bool KeyManager::recode(Address const& _address, SemanticPassword _newPass, std::function const& _pass, KDF _kdf) { h128 u = uuid(_address); - store().recode(u, getPassword(u, _pass), _kdf); + if (_newPass == SemanticPassword::Existing) + return store().recode(u, getPassword(u, _pass), _pass, _kdf); + else if (_newPass == SemanticPassword::Master) + return store().recode(u, defaultPassword(), _pass, _kdf); + return false; } bool KeyManager::load(std::string const& _pass) diff --git a/libethereum/KeyManager.h b/libethereum/KeyManager.h index 2cacf7bfe..2fc47e9b5 100644 --- a/libethereum/KeyManager.h +++ b/libethereum/KeyManager.h @@ -42,6 +42,12 @@ struct KeyInfo static const auto DontKnowThrow = [](){ throw UnknownPassword(); return std::string(); }; +enum class SemanticPassword +{ + Existing, + Master +}; + // TODO: This one is specifically for Ethereum, but we can make it generic in due course. // TODO: hidden-partition style key-store. /** @@ -67,9 +73,12 @@ public: void save(std::string const& _pass) const { write(_pass, m_keysFile); } void notePassword(std::string const& _pass) { m_cachedPasswords[hashPassword(_pass)] = _pass; } + void noteHint(std::string const& _pass, std::string const& _hint) { if (!_hint.empty()) m_passwordInfo[hashPassword(_pass)] = _hint; } + bool haveHint(std::string const& _pass) const { auto h = hashPassword(_pass); return m_cachedPasswords.count(h) && !m_cachedPasswords.at(h).empty(); } AddressHash accounts() const; std::unordered_map> accountDetails() const; + std::string const& hint(Address const& _a) const { try { return m_passwordInfo.at(m_keyInfo.at(m_addrLookup.at(_a)).passHash); } catch (...) { return EmptyString; } } h128 uuid(Address const& _a) const; Address address(h128 const& _uuid) const; @@ -84,7 +93,8 @@ public: Secret secret(Address const& _address, std::function const& _pass = DontKnowThrow) const; Secret secret(h128 const& _uuid, std::function const& _pass = DontKnowThrow) const; - void reencode(Address const& _address, std::function const& _pass = DontKnowThrow, KDF _kdf = KDF::Scrypt); + bool recode(Address const& _address, SemanticPassword _newPass, std::function const& _pass = DontKnowThrow, KDF _kdf = KDF::Scrypt); + bool recode(Address const& _address, std::string const& _newPass, std::string const& _hint, std::function const& _pass = DontKnowThrow, KDF _kdf = KDF::Scrypt); void kill(h128 const& _id) { kill(address(_id)); } void kill(Address const& _a); From 422be5eb46052224efdacae652ccd0483b305323 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Fri, 22 May 2015 00:22:10 +0200 Subject: [PATCH 326/461] Fixes and use actual master password for encrypting by default. --- alethzero/Transact.h | 12 ++++----- libdevcrypto/SecretStore.cpp | 13 ++++----- libethereum/KeyManager.cpp | 52 +++++++++++++++++++++++++++--------- libethereum/KeyManager.h | 5 +++- 4 files changed, 55 insertions(+), 27 deletions(-) diff --git a/alethzero/Transact.h b/alethzero/Transact.h index 8c079a2fe..c14fcc7e1 100644 --- a/alethzero/Transact.h +++ b/alethzero/Transact.h @@ -44,13 +44,13 @@ public: void setEnvironment(dev::AddressHash const& _accounts, dev::eth::Client* _eth, NatSpecFace* _natSpecDB); private slots: - void on_from_currentIndexChanged(int) { rejigData(); } + void on_from_currentIndexChanged(int) { rejigData(); rejigData(); } void on_destination_currentTextChanged(QString); - void on_value_valueChanged(int) { updateFee(); } - void on_gas_valueChanged(int) { updateFee(); } - void on_valueUnits_currentIndexChanged(int) { updateFee(); } - void on_gasPriceUnits_currentIndexChanged(int) { updateFee(); } - void on_gasPrice_valueChanged(int) { updateFee(); } + void on_value_valueChanged(int) { updateFee(); rejigData(); } + void on_gas_valueChanged(int) { updateFee(); rejigData(); } + void on_valueUnits_currentIndexChanged(int) { updateFee(); rejigData(); } + void on_gasPriceUnits_currentIndexChanged(int) { updateFee(); rejigData(); } + void on_gasPrice_valueChanged(int) { updateFee(); rejigData(); } void on_data_textChanged() { rejigData(); } void on_optimize_clicked() { rejigData(); } void on_send_clicked(); diff --git a/libdevcrypto/SecretStore.cpp b/libdevcrypto/SecretStore.cpp index 982b7bae6..68e18b5ab 100644 --- a/libdevcrypto/SecretStore.cpp +++ b/libdevcrypto/SecretStore.cpp @@ -180,12 +180,10 @@ h128 SecretStore::readKey(std::string const& _file, bool _deleteFile) bool SecretStore::recode(h128 const& _uuid, string const& _newPass, std::function const& _pass, KDF _kdf) { - cdebug << "recode:" << toUUID(_uuid); - cdebug << "newPass:" << _newPass; +// cdebug << "recode:" << toUUID(_uuid); bytes s = secret(_uuid, _pass, true); if (s.empty()) return false; - cdebug << "secret:" << toHex(s); m_keys[_uuid].first = encrypt(s, _newPass, _kdf); save(); return true; @@ -215,7 +213,6 @@ std::string SecretStore::encrypt(bytes const& _v, std::string const& _pass, KDF ret["kdfparams"] = params; } derivedKey = scrypt(_pass, salt, iterations, p, r, dklen); - cdebug << "derivedKey" << toHex(derivedKey); } else { @@ -230,13 +227,13 @@ std::string SecretStore::encrypt(bytes const& _v, std::string const& _pass, KDF ret["kdfparams"] = params; } derivedKey = pbkdf2(_pass, salt, iterations, dklen); - cdebug << "derivedKey" << toHex(derivedKey); } +// cdebug << "derivedKey" << toHex(derivedKey); // cipher info ret["cipher"] = "aes-128-ctr"; h128 key(derivedKey, h128::AlignLeft); - cdebug << "cipherKey" << key.hex(); +// cdebug << "cipherKey" << key.hex(); h128 iv = h128::random(); { js::mObject params; @@ -250,8 +247,8 @@ std::string SecretStore::encrypt(bytes const& _v, std::string const& _pass, KDF // and mac. h256 mac = sha3(ref(derivedKey).cropped(16, 16).toBytes() + cipherText); - cdebug << "macBody" << toHex(ref(derivedKey).cropped(16, 16).toBytes() + cipherText); - cdebug << "mac" << mac.hex(); +// cdebug << "macBody" << toHex(ref(derivedKey).cropped(16, 16).toBytes() + cipherText); +// cdebug << "mac" << mac.hex(); ret["mac"] = toHex(mac.ref()); return js::write_string((js::mValue)ret, true); diff --git a/libethereum/KeyManager.cpp b/libethereum/KeyManager.cpp index 4a03d8435..1edfe9cff 100644 --- a/libethereum/KeyManager.cpp +++ b/libethereum/KeyManager.cpp @@ -52,17 +52,27 @@ void KeyManager::create(std::string const& _pass) bool KeyManager::recode(Address const& _address, std::string const& _newPass, std::string const& _hint, std::function const& _pass, KDF _kdf) { noteHint(_newPass, _hint); - return store().recode(uuid(_address), _newPass, _pass, _kdf); + h128 u = uuid(_address); + if (!store().recode(u, _newPass, [&](){ return getPassword(u, _pass); }, _kdf)) + return false; + + m_keyInfo[u].passHash = hashPassword(_newPass); + write(); + return true; } bool KeyManager::recode(Address const& _address, SemanticPassword _newPass, std::function const& _pass, KDF _kdf) { h128 u = uuid(_address); + std::string p; if (_newPass == SemanticPassword::Existing) - return store().recode(u, getPassword(u, _pass), _pass, _kdf); + p = getPassword(u, _pass); else if (_newPass == SemanticPassword::Master) - return store().recode(u, defaultPassword(), _pass, _kdf); - return false; + p = defaultPassword(); + else + return false; + + return recode(_address, p, string(), _pass, _kdf); } bool KeyManager::load(std::string const& _pass) @@ -87,7 +97,8 @@ bool KeyManager::load(std::string const& _pass) m_password = (string)s[3]; } m_cachedPasswords[hashPassword(m_password)] = m_password; - m_cachedPasswords[hashPassword(defaultPassword())] = defaultPassword(); + m_cachedPasswords[hashPassword(asString(m_key.ref()))] = asString(m_key.ref()); + m_cachedPasswords[m_master = hashPassword(_pass)] = _pass; return true; } catch (...) { @@ -111,15 +122,29 @@ Secret KeyManager::secret(h128 const& _uuid, function const& _pas std::string KeyManager::getPassword(h128 const& _uuid, function const& _pass) const { auto kit = m_keyInfo.find(_uuid); + h256 ph; if (kit != m_keyInfo.end()) + ph = kit->second.passHash; + return getPassword(ph, _pass); +} + +std::string KeyManager::getPassword(h256 const& _passHash, function const& _pass) const +{ + auto it = m_cachedPasswords.find(_passHash); + if (it != m_cachedPasswords.end()) + return it->second; + for (unsigned i = 0; i< 10; ++i) { - auto it = m_cachedPasswords.find(kit->second.passHash); - if (it != m_cachedPasswords.end()) - return it->second; + std::string p = _pass(); + if (p.empty()) + break; + if (hashPassword(p) == _passHash || !_passHash) + { + m_cachedPasswords[hashPassword(p)] = p; + return p; + } } - std::string p = _pass(); - m_cachedPasswords[hashPassword(p)] = p; - return p; + return string(); } h128 KeyManager::uuid(Address const& _a) const @@ -190,7 +215,7 @@ std::unordered_map> KeyManager::acc std::unordered_map> ret; for (auto const& i: m_addrLookup) if (m_keyInfo.count(i.second) > 0) - ret[i.first] = make_pair(m_keyInfo.at(i.second).info, m_passwordInfo.at(m_keyInfo.at(i.second).passHash)); + ret[i.first] = make_pair(m_keyInfo.count(i.second) ? m_keyInfo.at(i.second).info : "", m_keyInfo.count(i.second) && m_passwordInfo.count(m_keyInfo.at(i.second).passHash) ? m_passwordInfo.at(m_keyInfo.at(i.second).passHash) : ""); return ret; } @@ -213,6 +238,9 @@ void KeyManager::write(std::string const& _pass, std::string const& _keysFile) c bytes salt = h256::random().asBytes(); writeFile(_keysFile + ".salt", salt); auto key = h128(pbkdf2(_pass, salt, 262144, 16)); + + m_cachedPasswords[hashPassword(_pass)] = _pass; + m_master = hashPassword(_pass); write(key, _keysFile); } diff --git a/libethereum/KeyManager.h b/libethereum/KeyManager.h index 2fc47e9b5..3fcf83c3e 100644 --- a/libethereum/KeyManager.h +++ b/libethereum/KeyManager.h @@ -101,11 +101,13 @@ public: private: std::string getPassword(h128 const& _uuid, std::function const& _pass = DontKnowThrow) const; - std::string defaultPassword() const { return asString(m_key.ref()); } + std::string getPassword(h256 const& _passHash, std::function const& _pass = DontKnowThrow) const; + std::string defaultPassword(std::function const& _pass = DontKnowThrow) const { return getPassword(m_master, _pass); } h256 hashPassword(std::string const& _pass) const; // Only use if previously loaded ok. // @returns false if wasn't previously loaded ok. + bool write() const { return write(m_keysFile); } bool write(std::string const& _keysFile) const; void write(std::string const& _pass, std::string const& _keysFile) const; void write(h128 const& _key, std::string const& _keysFile) const; @@ -127,6 +129,7 @@ private: SecretStore m_store; mutable h128 m_key; + mutable h256 m_master; mutable std::string m_keysFile; }; From 9ba9536f73dcbb9714a6c5c180c67eb2ccac5ca9 Mon Sep 17 00:00:00 2001 From: Vitalik Buterin Date: Thu, 21 May 2015 21:19:57 -0400 Subject: [PATCH 327/461] Switched r and p --- libdevcrypto/SecretStore.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libdevcrypto/SecretStore.cpp b/libdevcrypto/SecretStore.cpp index 68e18b5ab..602ccce8d 100644 --- a/libdevcrypto/SecretStore.cpp +++ b/libdevcrypto/SecretStore.cpp @@ -206,13 +206,13 @@ std::string SecretStore::encrypt(bytes const& _v, std::string const& _pass, KDF { js::mObject params; params["n"] = (int64_t)iterations; - params["p"] = (int)p; params["r"] = (int)r; + params["p"] = (int)p; params["dklen"] = (int)dklen; params["salt"] = toHex(salt); ret["kdfparams"] = params; } - derivedKey = scrypt(_pass, salt, iterations, p, r, dklen); + derivedKey = scrypt(_pass, salt, iterations, r, p, dklen); } else { @@ -280,7 +280,7 @@ bytes SecretStore::decrypt(std::string const& _v, std::string const& _pass) else if (o["kdf"].get_str() == "scrypt") { auto p = o["kdfparams"].get_obj(); - derivedKey = scrypt(_pass, fromHex(p["salt"].get_str()), p["n"].get_int(), p["p"].get_int(), p["r"].get_int(), p["dklen"].get_int()); + derivedKey = scrypt(_pass, fromHex(p["salt"].get_str()), p["n"].get_int(), p["r"].get_int(), p["p"].get_int(), p["dklen"].get_int()); } else { From bcc7ba2aadf7108d788d5211e12f7f1abb7b6fde Mon Sep 17 00:00:00 2001 From: yann300 Date: Fri, 22 May 2015 15:05:13 +0200 Subject: [PATCH 328/461] small changes --- mix/ClientModel.cpp | 7 ++----- mix/CodeModel.cpp | 2 +- mix/CodeModel.h | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/mix/ClientModel.cpp b/mix/ClientModel.cpp index 4b4eb70d1..6b5242084 100644 --- a/mix/ClientModel.cpp +++ b/mix/ClientModel.cpp @@ -387,14 +387,11 @@ void ClientModel::executeSequence(vector const& _sequence, std::pair ClientModel::resolvePair(QString const& _contractId) { - std::pair ret; - ret.first = _contractId; - ret.second = 0; + std::pair ret = std::make_pair(_contractId, 0); if (_contractId.startsWith("<") && _contractId.endsWith(">")) { QStringList values = ret.first.remove("<").remove(">").split(" - "); - ret.first = values[0]; - ret.second = values[1].toUInt(); + ret = std::make_pair(values[0], values[1].toUInt()); } return ret; } diff --git a/mix/CodeModel.cpp b/mix/CodeModel.cpp index 81f01a556..424732c2b 100644 --- a/mix/CodeModel.cpp +++ b/mix/CodeModel.cpp @@ -360,7 +360,7 @@ void CodeModel::gasEstimation(solidity::CompilerStack const& _cs) { if (m_gasCostsMaps) m_gasCostsMaps->deleteLater(); - m_gasCostsMaps = new GasMapWrapper(); + m_gasCostsMaps = new GasMapWrapper; for (std::string n: _cs.getContractNames()) { ContractDefinition const& contractDefinition = _cs.getContractDefinition(n); diff --git a/mix/CodeModel.h b/mix/CodeModel.h index 75e350c58..dcf3d0c1e 100644 --- a/mix/CodeModel.h +++ b/mix/CodeModel.h @@ -137,7 +137,7 @@ class GasMapWrapper: public QObject Q_PROPERTY(GasCostsMaps gasMaps MEMBER m_gasMaps CONSTANT) public: - GasMapWrapper(QObject* _parent = 0): QObject(_parent){} + GasMapWrapper(QObject* _parent = nullptr): QObject(_parent){} void push(QString _source, int _start, int _end, QString _value, bool _isInfinite); bool contains(QString _key); void insert(QString _source, QVariantList _variantList); From 02717e8b0c395408af36543b13597bb828de6732 Mon Sep 17 00:00:00 2001 From: chriseth Date: Fri, 22 May 2015 09:33:57 +0200 Subject: [PATCH 329/461] Path gas meter. --- libevmasm/GasMeter.cpp | 5 +- libevmasm/GasMeter.h | 12 ++- libevmasm/PathGasMeter.cpp | 128 ++++++++++++++++++++++++++++++ libevmasm/PathGasMeter.h | 66 +++++++++++++++ libevmasm/SemanticInformation.cpp | 2 +- test/libsolidity/GasMeter.cpp | 70 ++++++++++++++-- 6 files changed, 271 insertions(+), 12 deletions(-) create mode 100644 libevmasm/PathGasMeter.cpp create mode 100644 libevmasm/PathGasMeter.h diff --git a/libevmasm/GasMeter.cpp b/libevmasm/GasMeter.cpp index a8dc4dd58..3749e635d 100644 --- a/libevmasm/GasMeter.cpp +++ b/libevmasm/GasMeter.cpp @@ -29,12 +29,13 @@ using namespace dev::eth; GasMeter::GasConsumption& GasMeter::GasConsumption::operator+=(GasConsumption const& _other) { - isInfinite = isInfinite || _other.isInfinite; + if (_other.isInfinite && !isInfinite) + *this = infinite(); if (isInfinite) return *this; bigint v = bigint(value) + _other.value; if (v > std::numeric_limits::max()) - isInfinite = true; + *this = infinite(); else value = u256(v); return *this; diff --git a/libevmasm/GasMeter.h b/libevmasm/GasMeter.h index ab6d5613b..95593b565 100644 --- a/libevmasm/GasMeter.h +++ b/libevmasm/GasMeter.h @@ -22,6 +22,7 @@ #pragma once #include +#include #include #include @@ -46,20 +47,25 @@ public: GasConsumption(u256 _value = 0, bool _infinite = false): value(_value), isInfinite(_infinite) {} static GasConsumption infinite() { return GasConsumption(0, true); } - GasConsumption& operator+=(GasConsumption const& _otherS); - std::ostream& operator<<(std::ostream& _str) const; + GasConsumption& operator+=(GasConsumption const& _other); + bool operator<(GasConsumption const& _other) const { return this->tuple() < _other.tuple(); } + + std::tuple tuple() const { return std::tie(isInfinite, value); } u256 value; bool isInfinite; }; /// Constructs a new gas meter given the current state. - GasMeter(std::shared_ptr const& _state): m_state(_state) {} + explicit GasMeter(std::shared_ptr const& _state, u256 const& _largestMemoryAccess = 0): + m_state(_state), m_largestMemoryAccess(_largestMemoryAccess) {} /// @returns an upper bound on the gas consumed by the given instruction and updates /// the state. GasConsumption estimateMax(AssemblyItem const& _item); + u256 const& largestMemoryAccess() const { return m_largestMemoryAccess; } + private: /// @returns _multiplier * (_value + 31) / 32, if _value is a known constant and infinite otherwise. GasConsumption wordGas(u256 const& _multiplier, ExpressionClasses::Id _value); diff --git a/libevmasm/PathGasMeter.cpp b/libevmasm/PathGasMeter.cpp new file mode 100644 index 000000000..8f7314f89 --- /dev/null +++ b/libevmasm/PathGasMeter.cpp @@ -0,0 +1,128 @@ +/* + This file is part of cpp-ethereum. + + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file PathGasMeter.cpp + * @author Christian + * @date 2015 + */ + +#include "PathGasMeter.h" +#include +#include + +using namespace std; +using namespace dev; +using namespace dev::eth; + +PathGasMeter::PathGasMeter(AssemblyItems const& _items): + m_items(_items) +{ + for (size_t i = 0; i < m_items.size(); ++i) + if (m_items[i].type() == Tag) + m_tagPositions[m_items[i].data()] = i; +} + +GasMeter::GasConsumption PathGasMeter::estimateMax( + size_t _startIndex, + shared_ptr const& _state +) +{ + auto path = unique_ptr(new GasPath()); + path->index = _startIndex; + path->state = _state->copy(); + m_queue.push_back(move(path)); + + GasMeter::GasConsumption gas; + while (!m_queue.empty() && !gas.isInfinite) + gas = max(gas, handleQueueItem()); + return gas; +} + +GasMeter::GasConsumption PathGasMeter::handleQueueItem() +{ + assertThrow(!m_queue.empty(), OptimizerException, ""); + + unique_ptr path = move(m_queue.back()); + m_queue.pop_back(); + + shared_ptr state = path->state; + GasMeter meter(state, path->largestMemoryAccess); + ExpressionClasses& classes = state->expressionClasses(); + GasMeter::GasConsumption gas = path->gas; + size_t index = path->index; + + if (index >= m_items.size() || (index > 0 && m_items.at(index).type() != Tag)) + // Invalid jump usually provokes an out-of-gas exception, but we want to give an upper + // bound on the gas that is needed without changing the behaviour, so it is fine to + // return the current gas value. + return gas; + + set jumpTags; + for (; index < m_items.size() && !gas.isInfinite; ++index) + { + bool branchStops = false; + jumpTags.clear(); + AssemblyItem const& item = m_items.at(index); + if (item.type() == Tag || item == AssemblyItem(eth::Instruction::JUMPDEST)) + { + // Do not allow any backwards jump. This is quite restrictive but should work for + // the simplest things. + if (path->visitedJumpdests.count(index)) + return GasMeter::GasConsumption::infinite(); + path->visitedJumpdests.insert(index); + } + else if (item == AssemblyItem(eth::Instruction::JUMP)) + { + branchStops = true; + jumpTags = state->tagsInExpression(state->relativeStackElement(0)); + if (jumpTags.empty()) // unknown jump destination + return GasMeter::GasConsumption::infinite(); + } + else if (item == AssemblyItem(eth::Instruction::JUMPI)) + { + ExpressionClasses::Id condition = state->relativeStackElement(-1); + if (classes.knownNonZero(condition) || !classes.knownZero(condition)) + { + jumpTags = state->tagsInExpression(state->relativeStackElement(0)); + if (jumpTags.empty()) // unknown jump destination + return GasMeter::GasConsumption::infinite(); + } + branchStops = classes.knownNonZero(condition); + } + else if (SemanticInformation::altersControlFlow(item)) + branchStops = true; + + gas += meter.estimateMax(item); + + for (u256 const& tag: jumpTags) + { + auto newPath = unique_ptr(new GasPath()); + newPath->index = m_items.size(); + if (m_tagPositions.count(tag)) + newPath->index = m_tagPositions.at(tag); + newPath->gas = gas; + newPath->largestMemoryAccess = meter.largestMemoryAccess(); + newPath->state = state->copy(); + newPath->visitedJumpdests = path->visitedJumpdests; + m_queue.push_back(move(newPath)); + } + + if (branchStops) + break; + } + + return gas; +} diff --git a/libevmasm/PathGasMeter.h b/libevmasm/PathGasMeter.h new file mode 100644 index 000000000..1ada460aa --- /dev/null +++ b/libevmasm/PathGasMeter.h @@ -0,0 +1,66 @@ +/* + This file is part of cpp-ethereum. + + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file PathGasMeter.cpp + * @author Christian + * @date 2015 + */ + +#pragma once + +#include +#include +#include +#include + +namespace dev +{ +namespace eth +{ + +class KnownState; + +struct GasPath +{ + size_t index = 0; + std::shared_ptr state; + u256 largestMemoryAccess; + GasMeter::GasConsumption gas; + std::set visitedJumpdests; +}; + +/** + * Computes an upper bound on the gas usage of a computation starting at a certain position in + * a list of AssemblyItems in a given state until the computation stops. + * Can be used to estimate the gas usage of functions on any given input. + */ +class PathGasMeter +{ +public: + PathGasMeter(AssemblyItems const& _items); + + GasMeter::GasConsumption estimateMax(size_t _startIndex, std::shared_ptr const& _state); + +private: + GasMeter::GasConsumption handleQueueItem(); + + std::vector> m_queue; + std::map m_tagPositions; + AssemblyItems const& m_items; +}; + +} +} diff --git a/libevmasm/SemanticInformation.cpp b/libevmasm/SemanticInformation.cpp index 056162b5f..91f93e7ef 100644 --- a/libevmasm/SemanticInformation.cpp +++ b/libevmasm/SemanticInformation.cpp @@ -111,7 +111,7 @@ bool SemanticInformation::altersControlFlow(AssemblyItem const& _item) switch (_item.instruction()) { // note that CALL, CALLCODE and CREATE do not really alter the control flow, because we - // continue on the next instruction (unless an exception happens which can always happen) + // continue on the next instruction case Instruction::JUMP: case Instruction::JUMPI: case Instruction::RETURN: diff --git a/test/libsolidity/GasMeter.cpp b/test/libsolidity/GasMeter.cpp index 43eb3f956..2508399ff 100644 --- a/test/libsolidity/GasMeter.cpp +++ b/test/libsolidity/GasMeter.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -57,20 +58,38 @@ public: ); } - void testCreationTimeGas(string const& _sourceCode, string const& _contractName = "") + void testCreationTimeGas(string const& _sourceCode) { compileAndRun(_sourceCode); auto state = make_shared(); - GasMeter meter(state); - GasMeter::GasConsumption gas; - for (AssemblyItem const& item: *m_compiler.getAssemblyItems(_contractName)) - gas += meter.estimateMax(item); - u256 bytecodeSize(m_compiler.getRuntimeBytecode(_contractName).size()); + PathGasMeter meter(*m_compiler.getAssemblyItems()); + GasMeter::GasConsumption gas = meter.estimateMax(0, state); + u256 bytecodeSize(m_compiler.getRuntimeBytecode().size()); gas += bytecodeSize * c_createDataGas; BOOST_REQUIRE(!gas.isInfinite); BOOST_CHECK(gas.value == m_gasUsed); } + void testRunTimeGas(std::string const& _sig, vector _argumentVariants) + { + u256 gasUsed = 0; + FixedHash<4> hash(dev::sha3(_sig)); + for (bytes const& arguments: _argumentVariants) + { + sendMessage(hash.asBytes() + arguments, false, 0); + gasUsed = max(gasUsed, m_gasUsed); + } + + auto state = make_shared(); + //TODO modify state to include function hash in calldata + PathGasMeter meter(*m_compiler.getRuntimeAssemblyItems()); + GasMeter::GasConsumption gas = meter.estimateMax(0, state); + cout << "VM: " << gasUsed << endl; + cout << "est: " << gas << endl; + BOOST_REQUIRE(!gas.isInfinite); + BOOST_CHECK(gas.value == m_gasUsed); + } + protected: map m_gasCosts; }; @@ -149,6 +168,45 @@ BOOST_AUTO_TEST_CASE(updating_store) testCreationTimeGas(sourceCode); } +BOOST_AUTO_TEST_CASE(branches) +{ + char const* sourceCode = R"( + contract test { + uint data; + uint data2; + function f(uint x) { + if (x > 7) + data2 = 1; + else + data = 1; + } + } + )"; + testCreationTimeGas(sourceCode); + testRunTimeGas("f(uint256)", vector{encodeArgs(2), encodeArgs(8)}); +} + +BOOST_AUTO_TEST_CASE(function_calls) +{ + char const* sourceCode = R"( + contract test { + uint data; + uint data2; + function f(uint x) { + if (x > 7) + data2 = g(x**8) + 1; + else + data = 1; + } + function g(uint x) internal returns (uint) { + return data2; + } + } + )"; + testCreationTimeGas(sourceCode); + testRunTimeGas("f(uint256)", vector{encodeArgs(2), encodeArgs(8)}); +} + BOOST_AUTO_TEST_SUITE_END() } From 9e2e73da3a5c2fc1dc7f720636f64f5b000bdc0b Mon Sep 17 00:00:00 2001 From: chriseth Date: Fri, 22 May 2015 10:48:54 +0200 Subject: [PATCH 330/461] Functional gas estimator. --- libevmasm/ExpressionClasses.cpp | 27 ++++++++++-- libevmasm/ExpressionClasses.h | 5 +++ libsolidity/ASTPrinter.cpp | 2 +- libsolidity/ASTPrinter.h | 6 +-- ...turalGasEstimator.cpp => GasEstimator.cpp} | 36 ++++++++++++---- ...tructuralGasEstimator.h => GasEstimator.h} | 20 ++++++--- mix/CodeModel.cpp | 5 +-- solc/CommandLineInterface.cpp | 7 ++-- test/libsolidity/GasMeter.cpp | 41 ++++++++++++++----- 9 files changed, 112 insertions(+), 37 deletions(-) rename libsolidity/{StructuralGasEstimator.cpp => GasEstimator.cpp} (79%) rename libsolidity/{StructuralGasEstimator.h => GasEstimator.h} (72%) diff --git a/libevmasm/ExpressionClasses.cpp b/libevmasm/ExpressionClasses.cpp index 81adc0dbb..81ba11541 100644 --- a/libevmasm/ExpressionClasses.cpp +++ b/libevmasm/ExpressionClasses.cpp @@ -57,11 +57,11 @@ ExpressionClasses::Id ExpressionClasses::find( exp.arguments = _arguments; exp.sequenceNumber = _sequenceNumber; + if (SemanticInformation::isCommutativeOperation(_item)) + sort(exp.arguments.begin(), exp.arguments.end()); + if (SemanticInformation::isDeterministic(_item)) { - if (SemanticInformation::isCommutativeOperation(_item)) - sort(exp.arguments.begin(), exp.arguments.end()); - auto it = m_expressions.find(exp); if (it != m_expressions.end()) return it->id; @@ -82,6 +82,27 @@ ExpressionClasses::Id ExpressionClasses::find( return exp.id; } +void ExpressionClasses::forceEqual( + ExpressionClasses::Id _id, + AssemblyItem const& _item, + ExpressionClasses::Ids const& _arguments, + bool _copyItem +) +{ + Expression exp; + exp.id = _id; + exp.item = &_item; + exp.arguments = _arguments; + + if (SemanticInformation::isCommutativeOperation(_item)) + sort(exp.arguments.begin(), exp.arguments.end()); + + if (_copyItem) + exp.item = storeItem(_item); + + m_expressions.insert(exp); +} + ExpressionClasses::Id ExpressionClasses::newClass(SourceLocation const& _location) { Expression exp; diff --git a/libevmasm/ExpressionClasses.h b/libevmasm/ExpressionClasses.h index dd94092e8..4bfd7d24a 100644 --- a/libevmasm/ExpressionClasses.h +++ b/libevmasm/ExpressionClasses.h @@ -74,6 +74,11 @@ public: /// @returns the number of classes. Id size() const { return m_representatives.size(); } + /// Forces the given @a _item with @a _arguments to the class @a _id. This can be used to + /// add prior knowledge e.g. about CALLDATA, but has to be used with caution. Will not work as + /// expected if @a _item applied to @a _arguments already exists. + void forceEqual(Id _id, AssemblyItem const& _item, Ids const& _arguments, bool _copyItem = true); + /// @returns the id of a new class which is different to all other classes. Id newClass(SourceLocation const& _location); diff --git a/libsolidity/ASTPrinter.cpp b/libsolidity/ASTPrinter.cpp index 0a170f8e1..d29ace178 100644 --- a/libsolidity/ASTPrinter.cpp +++ b/libsolidity/ASTPrinter.cpp @@ -33,7 +33,7 @@ namespace solidity ASTPrinter::ASTPrinter( ASTNode const& _ast, string const& _source, - StructuralGasEstimator::ASTGasConsumption const& _gasCosts + GasEstimator::ASTGasConsumption const& _gasCosts ): m_indentation(0), m_source(_source), m_ast(&_ast), m_gasCosts(_gasCosts) { } diff --git a/libsolidity/ASTPrinter.h b/libsolidity/ASTPrinter.h index 25678c176..cdf651f3d 100644 --- a/libsolidity/ASTPrinter.h +++ b/libsolidity/ASTPrinter.h @@ -24,7 +24,7 @@ #include #include -#include +#include namespace dev { @@ -42,7 +42,7 @@ public: ASTPrinter( ASTNode const& _ast, std::string const& _source = std::string(), - StructuralGasEstimator::ASTGasConsumption const& _gasCosts = StructuralGasEstimator::ASTGasConsumption() + GasEstimator::ASTGasConsumption const& _gasCosts = GasEstimator::ASTGasConsumption() ); /// Output the string representation of the AST to _stream. void print(std::ostream& _stream); @@ -133,7 +133,7 @@ private: int m_indentation; std::string m_source; ASTNode const* m_ast; - StructuralGasEstimator::ASTGasConsumption m_gasCosts; + GasEstimator::ASTGasConsumption m_gasCosts; std::ostream* m_ostream; }; diff --git a/libsolidity/StructuralGasEstimator.cpp b/libsolidity/GasEstimator.cpp similarity index 79% rename from libsolidity/StructuralGasEstimator.cpp rename to libsolidity/GasEstimator.cpp index 9ce32ca54..18e3a5ca3 100644 --- a/libsolidity/StructuralGasEstimator.cpp +++ b/libsolidity/GasEstimator.cpp @@ -20,12 +20,14 @@ * Gas consumption estimator working alongside the AST. */ -#include "StructuralGasEstimator.h" +#include "GasEstimator.h" #include #include #include +#include #include #include +#include #include #include @@ -34,13 +36,13 @@ using namespace dev; using namespace dev::eth; using namespace dev::solidity; -StructuralGasEstimator::ASTGasConsumptionSelfAccumulated StructuralGasEstimator::performEstimation( +GasEstimator::ASTGasConsumptionSelfAccumulated GasEstimator::structuralEstimation( AssemblyItems const& _items, vector const& _ast ) { solAssert(std::count(_ast.begin(), _ast.end(), nullptr) == 0, ""); - map particularCosts; + map particularCosts; ControlFlowGraph cfg(_items); for (BasicBlock const& block: cfg.optimisedBlocks()) @@ -72,7 +74,7 @@ StructuralGasEstimator::ASTGasConsumptionSelfAccumulated StructuralGasEstimator: return gasCosts; } -map StructuralGasEstimator::breakToStatementLevel( +map GasEstimator::breakToStatementLevel( ASTGasConsumptionSelfAccumulated const& _gasCosts, vector const& _roots ) @@ -99,7 +101,7 @@ map StructuralGasEstimator::breakToSta // we use the location of a node if // - its statement depth is 0 or // - its statement depth is undefined but the parent's statement depth is at least 1 - map gasCosts; + map gasCosts; auto onNodeSecondPass = [&](ASTNode const& _node) { return statementDepth.count(&_node); @@ -121,7 +123,28 @@ map StructuralGasEstimator::breakToSta return gasCosts; } -set StructuralGasEstimator::finestNodesAtLocation( +GasEstimator::GasConsumption GasEstimator::functionalEstimation( + AssemblyItems const& _items, + string const& _signature +) +{ + auto state = make_shared(); + + ExpressionClasses& classes = state->expressionClasses(); + using Id = ExpressionClasses::Id; + using Ids = vector; + Id hashValue = classes.find(u256(FixedHash<4>::Arith(FixedHash<4>(dev::sha3(_signature))))); + Id calldata = classes.find(eth::Instruction::CALLDATALOAD, Ids{classes.find(u256(0))}); + classes.forceEqual(hashValue, eth::Instruction::DIV, Ids{ + calldata, + classes.find(u256(1) << (8 * 28)) + }); + + PathGasMeter meter(_items); + return meter.estimateMax(0, state); +} + +set GasEstimator::finestNodesAtLocation( vector const& _roots ) { @@ -140,4 +163,3 @@ set StructuralGasEstimator::finestNodesAtLocation( root->accept(visitor); return nodes; } - diff --git a/libsolidity/StructuralGasEstimator.h b/libsolidity/GasEstimator.h similarity index 72% rename from libsolidity/StructuralGasEstimator.h rename to libsolidity/GasEstimator.h index ddc7c186c..32e95fac4 100644 --- a/libsolidity/StructuralGasEstimator.h +++ b/libsolidity/GasEstimator.h @@ -34,17 +34,18 @@ namespace dev namespace solidity { -class StructuralGasEstimator +struct GasEstimator { public: - using ASTGasConsumption = std::map; + using GasConsumption = eth::GasMeter::GasConsumption; + using ASTGasConsumption = std::map; using ASTGasConsumptionSelfAccumulated = - std::map>; + std::map>; /// Estimates the gas consumption for every assembly item in the given assembly and stores /// it by source location. /// @returns a mapping from each AST node to a pair of its particular and syntactically accumulated gas costs. - ASTGasConsumptionSelfAccumulated performEstimation( + static ASTGasConsumptionSelfAccumulated structuralEstimation( eth::AssemblyItems const& _items, std::vector const& _ast ); @@ -52,14 +53,21 @@ public: /// the following source locations are part of the mapping: /// 1. source locations of statements that do not contain other statements /// 2. maximal source locations that do not overlap locations coming from the first rule - ASTGasConsumption breakToStatementLevel( + static ASTGasConsumption breakToStatementLevel( ASTGasConsumptionSelfAccumulated const& _gasCosts, std::vector const& _roots ); + /// @returns the estimated gas consumption by the (public or external) function with the + /// given signature. If no signature is given, estimates the maximum gas usage. + static GasConsumption functionalEstimation( + eth::AssemblyItems const& _items, + std::string const& _signature = "" + ); + private: /// @returns the set of AST nodes which are the finest nodes at their location. - std::set finestNodesAtLocation(std::vector const& _roots); + static std::set finestNodesAtLocation(std::vector const& _roots); }; } diff --git a/mix/CodeModel.cpp b/mix/CodeModel.cpp index a73dc920e..8d22227ce 100644 --- a/mix/CodeModel.cpp +++ b/mix/CodeModel.cpp @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include #include #include @@ -371,8 +371,7 @@ void CodeModel::gasEstimation(solidity::CompilerStack const& _cs) continue; dev::solidity::SourceUnit const& sourceUnit = _cs.getAST(*contractDefinition.getLocation().sourceName); AssemblyItems const* items = _cs.getRuntimeAssemblyItems(n); - StructuralGasEstimator estimator; - std::map gasCosts = estimator.breakToStatementLevel(estimator.performEstimation(*items, std::vector({&sourceUnit})), {&sourceUnit}); + std::map gasCosts = GasEstimator::breakToStatementLevel(GasEstimator::structuralEstimation(*items, std::vector({&sourceUnit})), {&sourceUnit}); for (auto gasItem = gasCosts.begin(); gasItem != gasCosts.end(); ++gasItem) { SourceLocation const& location = gasItem->first->getLocation(); diff --git a/solc/CommandLineInterface.cpp b/solc/CommandLineInterface.cpp index 944c8f68a..b81fcad1c 100644 --- a/solc/CommandLineInterface.cpp +++ b/solc/CommandLineInterface.cpp @@ -42,7 +42,7 @@ #include #include #include -#include +#include using namespace std; namespace po = boost::program_options; @@ -465,14 +465,13 @@ void CommandLineInterface::handleAst(string const& _argStr) // do we need AST output? if (m_args.count(_argStr)) { - StructuralGasEstimator gasEstimator; vector asts; for (auto const& sourceCode: m_sourceCodes) asts.push_back(&m_compiler->getAST(sourceCode.first)); map gasCosts; if (m_compiler->getRuntimeAssemblyItems()) - gasCosts = gasEstimator.breakToStatementLevel( - gasEstimator.performEstimation(*m_compiler->getRuntimeAssemblyItems(), asts), + gasCosts = GasEstimator::breakToStatementLevel( + GasEstimator::structuralEstimation(*m_compiler->getRuntimeAssemblyItems(), asts), asts ); diff --git a/test/libsolidity/GasMeter.cpp b/test/libsolidity/GasMeter.cpp index 2508399ff..c09849c00 100644 --- a/test/libsolidity/GasMeter.cpp +++ b/test/libsolidity/GasMeter.cpp @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include using namespace std; @@ -48,12 +48,11 @@ public: m_compiler.setSource(_sourceCode); ETH_TEST_REQUIRE_NO_THROW(m_compiler.compile(), "Compiling contract failed"); - StructuralGasEstimator estimator; AssemblyItems const* items = m_compiler.getRuntimeAssemblyItems(""); ASTNode const& sourceUnit = m_compiler.getAST(); BOOST_REQUIRE(items != nullptr); - m_gasCosts = estimator.breakToStatementLevel( - estimator.performEstimation(*items, vector({&sourceUnit})), + m_gasCosts = GasEstimator::breakToStatementLevel( + GasEstimator::structuralEstimation(*items, vector({&sourceUnit})), {&sourceUnit} ); } @@ -70,6 +69,8 @@ public: BOOST_CHECK(gas.value == m_gasUsed); } + /// Compares the gas computed by PathGasMeter for the given signature (but unknown arguments) + /// against the actual gas usage computed by the VM on the given set of argument variants. void testRunTimeGas(std::string const& _sig, vector _argumentVariants) { u256 gasUsed = 0; @@ -80,12 +81,10 @@ public: gasUsed = max(gasUsed, m_gasUsed); } - auto state = make_shared(); - //TODO modify state to include function hash in calldata - PathGasMeter meter(*m_compiler.getRuntimeAssemblyItems()); - GasMeter::GasConsumption gas = meter.estimateMax(0, state); - cout << "VM: " << gasUsed << endl; - cout << "est: " << gas << endl; + GasMeter::GasConsumption gas = GasEstimator::functionalEstimation( + *m_compiler.getRuntimeAssemblyItems(), + _sig + ); BOOST_REQUIRE(!gas.isInfinite); BOOST_CHECK(gas.value == m_gasUsed); } @@ -207,6 +206,28 @@ BOOST_AUTO_TEST_CASE(function_calls) testRunTimeGas("f(uint256)", vector{encodeArgs(2), encodeArgs(8)}); } +BOOST_AUTO_TEST_CASE(multiple_external_functions) +{ + char const* sourceCode = R"( + contract test { + uint data; + uint data2; + function f(uint x) { + if (x > 7) + data2 = g(x**8) + 1; + else + data = 1; + } + function g(uint x) returns (uint) { + return data2; + } + } + )"; + testCreationTimeGas(sourceCode); + testRunTimeGas("f(uint256)", vector{encodeArgs(2), encodeArgs(8)}); + testRunTimeGas("g(uint256)", vector{encodeArgs(2)}); +} + BOOST_AUTO_TEST_SUITE_END() } From 1ccb9312fdb960d857f5a9ddffbff31b1375eab0 Mon Sep 17 00:00:00 2001 From: chriseth Date: Fri, 22 May 2015 16:11:57 +0200 Subject: [PATCH 331/461] Tighter estimation for EXP. --- libevmasm/GasMeter.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libevmasm/GasMeter.cpp b/libevmasm/GasMeter.cpp index 3749e635d..650bd6e28 100644 --- a/libevmasm/GasMeter.cpp +++ b/libevmasm/GasMeter.cpp @@ -148,7 +148,7 @@ GasMeter::GasConsumption GasMeter::estimateMax(AssemblyItem const& _item) if (u256 const* value = classes.knownConstant(m_state->relativeStackElement(-1))) gas += c_expByteGas * (32 - (h256(*value).firstBitSet() / 8)); else - gas = GasConsumption::infinite(); + gas += c_expByteGas * 32; break; default: break; From a09bb999cba3428e7ef7aa33301f4a55eef74fe4 Mon Sep 17 00:00:00 2001 From: chriseth Date: Fri, 22 May 2015 14:19:58 +0200 Subject: [PATCH 332/461] Commandline interface for gas estimation. --- libevmasm/GasMeter.h | 2 +- solc/CommandLineInterface.cpp | 32 ++++++++++++++++++++++++++++++++ solc/CommandLineInterface.h | 1 + 3 files changed, 34 insertions(+), 1 deletion(-) diff --git a/libevmasm/GasMeter.h b/libevmasm/GasMeter.h index 95593b565..6949c193e 100644 --- a/libevmasm/GasMeter.h +++ b/libevmasm/GasMeter.h @@ -86,7 +86,7 @@ private: inline std::ostream& operator<<(std::ostream& _str, GasMeter::GasConsumption const& _consumption) { if (_consumption.isInfinite) - return _str << "inf"; + return _str << "[???]"; else return _str << std::dec << _consumption.value; } diff --git a/solc/CommandLineInterface.cpp b/solc/CommandLineInterface.cpp index b81fcad1c..c86938f81 100644 --- a/solc/CommandLineInterface.cpp +++ b/solc/CommandLineInterface.cpp @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -55,6 +56,7 @@ namespace solidity static string const g_argAbiStr = "json-abi"; static string const g_argSolAbiStr = "sol-abi"; static string const g_argSignatureHashes = "hashes"; +static string const g_argGas = "gas"; static string const g_argAsmStr = "asm"; static string const g_argAsmJsonStr = "asm-json"; static string const g_argAstStr = "ast"; @@ -94,6 +96,7 @@ static bool needsHumanTargetedStdout(po::variables_map const& _args) { return + _args.count(g_argGas) || humanTargetedStdout(_args, g_argAbiStr) || humanTargetedStdout(_args, g_argSolAbiStr) || humanTargetedStdout(_args, g_argSignatureHashes) || @@ -245,6 +248,30 @@ void CommandLineInterface::handleMeta(DocumentationType _type, string const& _co } } +void CommandLineInterface::handleGasEstimation(string const& _contract) +{ + using Gas = GasEstimator::GasConsumption; + if (!m_compiler->getAssemblyItems(_contract) && !m_compiler->getRuntimeAssemblyItems(_contract)) + return; + cout << "Gas estimation:" << endl; + if (eth::AssemblyItems const* items = m_compiler->getAssemblyItems(_contract)) + { + Gas gas = GasEstimator::functionalEstimation(*items); + u256 bytecodeSize(m_compiler->getRuntimeBytecode(_contract).size()); + cout << "[construction]:\t"; + cout << gas << " + " << (bytecodeSize * eth::c_createDataGas) << " = "; + gas += bytecodeSize * eth::c_createDataGas; + cout << gas << endl; + } + if (eth::AssemblyItems const* items = m_compiler->getRuntimeAssemblyItems(_contract)) + for (auto it: m_compiler->getContractDefinition(_contract).getInterfaceFunctions()) + { + string sig = it.second->externalSignature(); + GasEstimator::GasConsumption gas = GasEstimator::functionalEstimation(*items, sig); + cout << sig << ":\t" << gas << endl; + } +} + bool CommandLineInterface::parseArguments(int argc, char** argv) { // Declare the supported options. @@ -278,6 +305,8 @@ bool CommandLineInterface::parseArguments(int argc, char** argv) "Request to output the contract's Solidity ABI interface.") (g_argSignatureHashes.c_str(), po::value()->value_name("stdout|file|both"), "Request to output the contract's functions' signature hashes.") + (g_argGas.c_str(), + "Request to output an estimate for each function's maximal gas usage.") (g_argNatspecUserStr.c_str(), po::value()->value_name("stdout|file|both"), "Request to output the contract's Natspec user documentation.") (g_argNatspecDevStr.c_str(), po::value()->value_name("stdout|file|both"), @@ -553,6 +582,9 @@ void CommandLineInterface::actOnInput() } } + if (m_args.count(g_argGas)) + handleGasEstimation(contract); + handleBytecode(contract); handleSignatureHashes(contract); handleMeta(DocumentationType::ABIInterface, contract); diff --git a/solc/CommandLineInterface.h b/solc/CommandLineInterface.h index 7d3a067cd..46b9b1e22 100644 --- a/solc/CommandLineInterface.h +++ b/solc/CommandLineInterface.h @@ -61,6 +61,7 @@ private: void handleSignatureHashes(std::string const& _contract); void handleMeta(DocumentationType _type, std::string const& _contract); + void handleGasEstimation(std::string const& _contract); /// Compiler arguments variable map boost::program_options::variables_map m_args; From 32e16bfa70b21371c46b1ad0a1dfdca38f63fa33 Mon Sep 17 00:00:00 2001 From: yann300 Date: Fri, 22 May 2015 16:33:12 +0200 Subject: [PATCH 333/461] small changes --- mix/CodeModel.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mix/CodeModel.cpp b/mix/CodeModel.cpp index 424732c2b..d0f70683d 100644 --- a/mix/CodeModel.cpp +++ b/mix/CodeModel.cpp @@ -198,7 +198,7 @@ CodeModel::~CodeModel() disconnect(this); releaseContracts(); if (m_gasCostsMaps) - m_gasCostsMaps->deleteLater(); + delete m_gasCostsMaps; } void CodeModel::stop() From fcb629acdabf017b537ff873512abafdb6b8ccb7 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Fri, 22 May 2015 18:14:13 +0200 Subject: [PATCH 334/461] ethkey utility with bare key tools. --- CMakeLists.txt | 19 +- alethzero/MainWin.h | 2 +- alethzero/Transact.cpp | 3 +- eth/main.cpp | 3 +- ethkey/CMakeLists.txt | 33 ++ ethkey/KeyAux.h | 351 +++++++++++++++++++++ ethkey/main.cpp | 84 +++++ ethminer/MinerAux.h | 4 +- exp/main.cpp | 3 +- libdevcore/CommonData.h | 9 + libdevcrypto/SecretStore.cpp | 2 +- libdevcrypto/SecretStore.h | 14 +- {libethereum => libethcore}/KeyManager.cpp | 7 +- {libethereum => libethcore}/KeyManager.h | 8 +- libweb3jsonrpc/AccountHolder.cpp | 3 +- 15 files changed, 528 insertions(+), 17 deletions(-) create mode 100644 ethkey/CMakeLists.txt create mode 100644 ethkey/KeyAux.h create mode 100644 ethkey/main.cpp rename {libethereum => libethcore}/KeyManager.cpp (96%) rename {libethereum => libethcore}/KeyManager.h (96%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8239e20a4..e7461eb1c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -251,6 +251,17 @@ elseif (BUNDLE STREQUAL "user") set(NCURSES ${DECENT_PLATFORM}) set(TOOLS ON) set(TESTS OFF) +elseif (BUNDLE STREQUAL "wallet") + set(SERPENT OFF) + set(SOLIDITY OFF) + set(USENPM OFF) + set(GUI OFF) + set(NCURSES OFF) + set(TOOLS OFF) + set(TESTS OFF) + set(ETHKEY ON) + set(MINER OFF) + set(ETHASHCL ON) elseif (BUNDLE STREQUAL "miner") set(SERPENT OFF) set(SOLIDITY OFF) @@ -259,6 +270,7 @@ elseif (BUNDLE STREQUAL "miner") set(NCURSES OFF) set(TOOLS OFF) set(TESTS OFF) + set(ETHKEY OFF) set(MINER ON) set(ETHASHCL ON) endif () @@ -296,6 +308,7 @@ message("-- JSONRPC JSON-RPC support ${JSONRPC} message("-- USENPM Javascript source building ${USENPM}") message("------------------------------------------------------------- components") message("-- MINER Build miner ${MINER}") +message("-- ETHKEY Build wallet tools ${ETHKEY}") message("-- TOOLS Build basic tools ${TOOLS}") message("-- SOLIDITY Build Solidity language components ${SOLIDITY}") message("-- SERPENT Build Serpent language components ${SERPENT}") @@ -387,10 +400,14 @@ if (GENERAL) add_subdirectory(libwebthree) endif () -if (MINER) +if (MINER OR TOOLS) add_subdirectory(ethminer) endif () +if (ETHKEY OR TOOLS) + add_subdirectory(ethkey) +endif () + if (TESTS) add_subdirectory(libtestutils) add_subdirectory(test) diff --git a/alethzero/MainWin.h b/alethzero/MainWin.h index 0e74d8f69..29cd0dbf3 100644 --- a/alethzero/MainWin.h +++ b/alethzero/MainWin.h @@ -33,9 +33,9 @@ #include #include #include +#include #include #include -#include #include #include #include "Context.h" diff --git a/alethzero/Transact.cpp b/alethzero/Transact.cpp index fcca822fe..b485091d9 100644 --- a/alethzero/Transact.cpp +++ b/alethzero/Transact.cpp @@ -39,7 +39,8 @@ #include #include #include -#include +#include + #if ETH_SERPENT #include #include diff --git a/eth/main.cpp b/eth/main.cpp index 33d049843..a57928e72 100644 --- a/eth/main.cpp +++ b/eth/main.cpp @@ -37,7 +37,8 @@ #include #include #include -#include +#include + #include #if ETH_JSCONSOLE || !ETH_TRUE #include diff --git a/ethkey/CMakeLists.txt b/ethkey/CMakeLists.txt new file mode 100644 index 000000000..5575acbd0 --- /dev/null +++ b/ethkey/CMakeLists.txt @@ -0,0 +1,33 @@ +cmake_policy(SET CMP0015 NEW) +set(CMAKE_AUTOMOC OFF) + +aux_source_directory(. SRC_LIST) + +include_directories(BEFORE ..) +include_directories(${Boost_INCLUDE_DIRS}) +include_directories(${JSON_RPC_CPP_INCLUDE_DIRS}) + +if (JSCONSOLE) + include_directories(${V8_INCLUDE_DIRS}) +endif() + +set(EXECUTABLE ethkey) + +file(GLOB HEADERS "*.h") + +add_executable(${EXECUTABLE} ${SRC_LIST} ${HEADERS}) + +add_dependencies(${EXECUTABLE} BuildInfo.h) + +target_link_libraries(${EXECUTABLE} devcrypto) +target_link_libraries(${EXECUTABLE} ethcore) + +if (DEFINED WIN32 AND NOT DEFINED CMAKE_COMPILER_IS_MINGW) + eth_copy_dlls("${EXECUTABLE}" MHD_DLLS) +endif() + +if (APPLE) + install(TARGETS ${EXECUTABLE} DESTINATION bin) +else() + eth_install_executable(${EXECUTABLE}) +endif() diff --git a/ethkey/KeyAux.h b/ethkey/KeyAux.h new file mode 100644 index 000000000..daac72588 --- /dev/null +++ b/ethkey/KeyAux.h @@ -0,0 +1,351 @@ +#pragma once + +/* + This file is part of cpp-ethereum. + + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file KeyAux.cpp + * @author Gav Wood + * @date 2014 + * CLI module for key management. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "BuildInfo.h" +using namespace std; +using namespace dev; +using namespace dev::eth; +using namespace boost::algorithm; + +#undef RETURN + +class BadArgument: public Exception {}; + +string getAccountPassword(KeyManager& keyManager, Address const& a) +{ + return getPassword("Enter password for address " + keyManager.accountDetails()[a].first + " (" + a.abridged() + "; hint:" + keyManager.accountDetails()[a].second + "): "); +} + +string createPassword(std::string const& _prompt) +{ + string ret; + while (true) + { + ret = getPassword(_prompt); + string confirm = getPassword("Please confirm the password by entering it again: "); + if (ret == confirm) + break; + cout << "Passwords were different. Try again." << endl; + } + return ret; +// cout << "Enter a hint to help you remember this password: " << flush; +// cin >> hint; +// return make_pair(ret, hint); +} + +pair createPassword(KeyManager& _keyManager, std::string const& _prompt) +{ + string pass; + while (true) + { + pass = getPassword(_prompt); + string confirm = getPassword("Please confirm the password by entering it again: "); + if (pass == confirm) + break; + cout << "Passwords were different. Try again." << endl; + } + string hint; + if (!_keyManager.haveHint(pass)) + { + cout << "Enter a hint to help you remember this password: " << flush; + cin >> hint; + } + return make_pair(pass, hint); +} + +class KeyCLI +{ +public: + enum class OperationMode + { + None, + ListBare, + NewBare, + ImportBare, + ExportBare, + RecodeBare, + FirstWallet, + CreateWallet, + List = FirstWallet, + New, + Import, + Export, + Recode, + Kill + }; + + KeyCLI(OperationMode _mode = OperationMode::None): m_mode(_mode) {} + + bool interpretOption(int& i, int argc, char** argv) + { + string arg = argv[i]; + if (arg == "-n" || arg == "--new") + m_mode = OperationMode::New; + else if (arg == "--wallet-path" && i + 1 < argc) + m_walletPath = argv[++i]; + else if (arg == "--secrets-path" && i + 1 < argc) + m_secretsPath = argv[++i]; + else if ((arg == "-m" || arg == "--master") && i + 1 < argc) + m_masterPassword = argv[++i]; + else if (arg == "--unlock" && i + 1 < argc) + m_unlocks.push_back(argv[++i]); + else if (arg == "--lock" && i + 1 < argc) + m_lock = argv[++i]; + else if (arg == "--kdf" && i + 1 < argc) + m_kdf = argv[++i]; + else if (arg == "--kdf-param" && i + 2 < argc) + { + auto n = argv[++i]; + auto v = argv[++i]; + m_kdfParams[n] = v; + } + else if (arg == "--new-bare") + m_mode = OperationMode::NewBare; + else if (arg == "--import-bare") + m_mode = OperationMode::ImportBare; + else if (arg == "--list-bare") + m_mode = OperationMode::ListBare; + else if (arg == "--export-bare") + m_mode = OperationMode::ExportBare; + else if (arg == "--recode-bare") + m_mode = OperationMode::RecodeBare; + else if (arg == "--create-wallet") + m_mode = OperationMode::CreateWallet; + else if (arg == "--list") + m_mode = OperationMode::List; + else if ((arg == "-n" || arg == "--new") && i + 1 < argc) + { + m_mode = OperationMode::New; + m_name = argv[++i]; + } + else if ((arg == "-i" || arg == "--import") && i + 2 < argc) + { + m_mode = OperationMode::Import; + m_inputs = strings(1, argv[++i]); + m_name = argv[++i]; + } + else if (arg == "--export") + m_mode = OperationMode::Export; + else if (arg == "--recode") + m_mode = OperationMode::Recode; + else if (arg == "--no-icap") + m_icap = false; + else if (m_mode == OperationMode::ImportBare || m_mode == OperationMode::Recode || m_mode == OperationMode::Export || m_mode == OperationMode::RecodeBare || m_mode == OperationMode::ExportBare) + m_inputs.push_back(arg); + else + return false; + return true; + } + + KeyPair makeKey() const + { + KeyPair k(Secret::random()); + while (m_icap && k.address()[0]) + k = KeyPair(sha3(k.secret())); + return k; + } + + void execute() + { + if (m_mode == OperationMode::CreateWallet) + { + KeyManager wallet(m_walletPath, m_secretsPath); + if (m_masterPassword.empty()) + m_masterPassword = createPassword("Please enter a MASTER password to protect your key store (make it strong!): "); + if (m_masterPassword.empty()) + cerr << "Aborted (empty password not allowed)." << endl; + else + wallet.create(m_masterPassword); + } + else if (m_mode < OperationMode::FirstWallet) + { + SecretStore store(m_secretsPath); + switch (m_mode) + { + case OperationMode::ListBare: + for (h128 const& u: std::set() + store.keys()) + cout << toUUID(u) << endl; + break; + case OperationMode::NewBare: + { + if (m_lock.empty()) + m_lock = createPassword("Enter a password with which to secure this account: "); + auto k = makeKey(); + store.importSecret(k.secret().asBytes(), m_lock); + cout << "Created key " << k.address().abridged() << endl; + cout << "Address: " << k.address().hex() << endl; + cout << "ICAP: " << ICAP(k.address()).encoded() << endl; + break; + } + case OperationMode::ImportBare: + for (string const& i: m_inputs) + { + h128 u; + bytes b; + b = fromHex(i); + if (b.size() != 32) + { + std::string s = contentsString(i); + b = fromHex(s); + if (b.size() != 32) + u = store.importKey(i); + } + if (!u && b.size() == 32) + u = store.importSecret(b, lockPassword(toAddress(Secret(b)).abridged())); + else + { + cerr << "Cannot import " << i << " not a file or secret." << endl; + continue; + } + cout << "Successfully imported " << i << " as " << toUUID(u); + } + break; + case OperationMode::ExportBare: break; + case OperationMode::RecodeBare: + for (auto const& i: m_inputs) + { + h128 u = fromUUID(i); + if (u) + if (store.recode(u, lockPassword(toUUID(u)), [&](){ return getPassword("Enter password for key " + toUUID(u) + ": "); }, kdf())) + cerr << "Re-encoded " << toUUID(u) << endl; + else + cerr << "Couldn't re-encode " << toUUID(u) << "; key corrupt or incorrect password supplied." << endl; + else + cerr << "Couldn't re-encode " << toUUID(u) << "; not found." << endl; + } + default: break; + } + } + else + { + KeyManager wallet(m_walletPath, m_secretsPath); + if (wallet.exists()) + while (true) + { + if (wallet.load(m_masterPassword)) + break; + if (!m_masterPassword.empty()) + { + cout << "Password invalid. Try again." << endl; + m_masterPassword.clear(); + } + m_masterPassword = getPassword("Please enter your MASTER password: "); + } + else + { + cerr << "Couldn't open wallet. Does it exist?" << endl; + exit(-1); + } + } + } + + std::string lockPassword(std::string const& _accountName) + { + return m_lock.empty() ? createPassword("Enter a password with which to secure account " + _accountName + ": ") : m_lock; + } + + static void streamHelp(ostream& _out) + { + _out + << "Secret-store (\"bare\") operation modes:" << endl + << " --list-bare List all secret available in secret-store." << endl + << " --new-bare Generate and output a key without interacting with wallet and dump the JSON." << endl + << " --import-bare [ | , ... ] Import keys from given sources." << endl + << " --recode-bare [ | , ... ] Decrypt and re-encrypt given keys." << endl +// << " --export-bare [ , ... ] Export given keys." << endl + << "Secret-store configuration:" << endl + << " --secrets-path Specify Web3 secret-store path (default: " << SecretStore::defaultPath() << ")" << endl + << endl + << "Wallet operating modes:" << endl + << " -l,--list List all keys available in wallet." << endl + << " -n,--new Create a new key with given name and add it in the wallet." << endl + << " -i,--import [||] Import keys from given source and place in wallet." << endl + << " -e,--export [
| , ... ] Export given keys." << endl + << " -r,--recode [
|| , ... ] Decrypt and re-encrypt given keys." << endl + << "Wallet configuration:" << endl + << " --create-wallet Create an Ethereum master wallet." << endl + << " --wallet-path Specify Ethereum wallet path (default: " << KeyManager::defaultPath() << ")" << endl + << " -m, --master Specify wallet (master) password." << endl + << endl + << "Encryption configuration:" << endl + << " --kdf Specify KDF to use when encrypting (default: sc rypt)" << endl + << " --kdf-param Specify a parameter for the KDF." << endl +// << " --cipher Specify cipher to use when encrypting (default: aes-128-ctr)" << endl +// << " --cipher-param Specify a parameter for the cipher." << endl + << " --lock Specify password for when encrypting a (the) key." << endl + << endl + << "Decryption configuration:" << endl + << " --unlock Specify password for a (the) key." << endl + << "Key generation configuration:" << endl + << " --no-icap Don't bother to make a direct-ICAP capable key." << endl + ; + } + + static bool isTrue(std::string const& _m) + { + return _m == "on" || _m == "yes" || _m == "true" || _m == "1"; + } + + static bool isFalse(std::string const& _m) + { + return _m == "off" || _m == "no" || _m == "false" || _m == "0"; + } + +private: + KDF kdf() const { return m_kdf == "pbkdf2" ? KDF::PBKDF2_SHA256 : KDF::Scrypt; } + + /// Operating mode. + OperationMode m_mode; + + /// Wallet stuff + string m_secretsPath = SecretStore::defaultPath(); + string m_walletPath = KeyManager::defaultPath(); + + /// Wallet password stuff + string m_masterPassword; + strings m_unlocks; + string m_lock; + bool m_icap = true; + + /// Creating + string m_name; + + /// Importing + strings m_inputs; + + string m_kdf = "scrypt"; + map m_kdfParams; +// string m_cipher; +// map m_cipherParams; +}; diff --git a/ethkey/main.cpp b/ethkey/main.cpp new file mode 100644 index 000000000..53781a38a --- /dev/null +++ b/ethkey/main.cpp @@ -0,0 +1,84 @@ +/* + This file is part of cpp-ethereum. + + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file main.cpp + * @author Gav Wood + * @date 2014 + * Ethereum client. + */ + +#include +#include +#include +#include +#include +#include +#include +#include "BuildInfo.h" +#include "KeyAux.h" +using namespace std; +using namespace dev; +using namespace dev::eth; + +void help() +{ + cout + << "Usage ethkey [OPTIONS]" << endl + << "Options:" << endl << endl; + KeyCLI::streamHelp(cout); + cout + << "General Options:" << endl + << " -v,--verbosity <0 - 9> Set the log verbosity from 0 to 9 (default: 8)." << endl + << " -V,--version Show the version and exit." << endl + << " -h,--help Show this help message and exit." << endl + ; + exit(0); +} + +void version() +{ + cout << "ethkey version " << dev::Version << endl; + cout << "Build: " << DEV_QUOTED(ETH_BUILD_PLATFORM) << "/" << DEV_QUOTED(ETH_BUILD_TYPE) << endl; + exit(0); +} + +int main(int argc, char** argv) +{ + KeyCLI m(KeyCLI::OperationMode::ListBare); + g_logVerbosity = 0; + + for (int i = 1; i < argc; ++i) + { + string arg = argv[i]; + if (m.interpretOption(i, argc, argv)) {} + else if ((arg == "-v" || arg == "--verbosity") && i + 1 < argc) + g_logVerbosity = atoi(argv[++i]); + else if (arg == "-h" || arg == "--help") + help(); + else if (arg == "-V" || arg == "--version") + version(); + else + { + cerr << "Invalid argument: " << arg << endl; + exit(-1); + } + } + + m.execute(); + + return 0; +} + diff --git a/ethminer/MinerAux.h b/ethminer/MinerAux.h index ef0621b7f..47fd2e2ae 100644 --- a/ethminer/MinerAux.h +++ b/ethminer/MinerAux.h @@ -16,10 +16,10 @@ You should have received a copy of the GNU General Public License along with cpp-ethereum. If not, see . */ -/** @file main.cpp +/** @file MinerAux.cpp * @author Gav Wood * @date 2014 - * Ethereum client. + * CLI module for mining. */ #include diff --git a/exp/main.cpp b/exp/main.cpp index 5162d915b..f0574fa7c 100644 --- a/exp/main.cpp +++ b/exp/main.cpp @@ -49,7 +49,8 @@ #include #include #include -#include +#include + #include #include #include diff --git a/libdevcore/CommonData.h b/libdevcore/CommonData.h index 702f1f808..e1d8d7bdb 100644 --- a/libdevcore/CommonData.h +++ b/libdevcore/CommonData.h @@ -323,4 +323,13 @@ std::vector keysOf(std::map const& _m) return ret; } +template +std::vector keysOf(std::unordered_map const& _m) +{ + std::vector ret; + for (auto const& i: _m) + ret.push_back(i.first); + return ret; +} + } diff --git a/libdevcrypto/SecretStore.cpp b/libdevcrypto/SecretStore.cpp index 602ccce8d..c6f9803fa 100644 --- a/libdevcrypto/SecretStore.cpp +++ b/libdevcrypto/SecretStore.cpp @@ -84,7 +84,7 @@ static js::mValue upgraded(std::string const& _s) return js::mValue(); } -SecretStore::SecretStore() +SecretStore::SecretStore(std::string const& _path): m_path(_path) { load(); } diff --git a/libdevcrypto/SecretStore.h b/libdevcrypto/SecretStore.h index 6a62147b8..c4e5d5cf7 100644 --- a/libdevcrypto/SecretStore.h +++ b/libdevcrypto/SecretStore.h @@ -38,7 +38,7 @@ enum class KDF { class SecretStore { public: - SecretStore(); + SecretStore(std::string const& _path = defaultPath()); ~SecretStore(); bytes secret(h128 const& _uuid, std::function const& _pass, bool _useCache = true) const; @@ -47,18 +47,26 @@ public: bool recode(h128 const& _uuid, std::string const& _newPass, std::function const& _pass, KDF _kdf = KDF::Scrypt); void kill(h128 const& _uuid); + std::vector keys() const { return keysOf(m_keys); } + // Clear any cached keys. void clearCache() const; + static std::string defaultPath() { return getDataDir("web3") + "/keys"; } + private: - void save(std::string const& _keysPath = getDataDir("web3") + "/keys"); - void load(std::string const& _keysPath = getDataDir("web3") + "/keys"); + void save(std::string const& _keysPath); + void load(std::string const& _keysPath); + void save() { save(m_path); } + void load() { load(m_path); } static std::string encrypt(bytes const& _v, std::string const& _pass, KDF _kdf = KDF::Scrypt); static bytes decrypt(std::string const& _v, std::string const& _pass); h128 readKey(std::string const& _file, bool _deleteFile); mutable std::unordered_map m_cached; std::unordered_map> m_keys; + + std::string m_path; }; } diff --git a/libethereum/KeyManager.cpp b/libethcore/KeyManager.cpp similarity index 96% rename from libethereum/KeyManager.cpp rename to libethcore/KeyManager.cpp index 1edfe9cff..182201301 100644 --- a/libethereum/KeyManager.cpp +++ b/libethcore/KeyManager.cpp @@ -31,8 +31,8 @@ using namespace dev; using namespace eth; namespace fs = boost::filesystem; -KeyManager::KeyManager(std::string const& _keysFile): - m_keysFile(_keysFile) +KeyManager::KeyManager(std::string const& _keysFile, std::string const& _secretsPath): + m_keysFile(_keysFile), m_store(_secretsPath) {} KeyManager::~KeyManager() @@ -96,8 +96,11 @@ bool KeyManager::load(std::string const& _pass) m_passwordInfo[(h256)i[0]] = (std::string)i[1]; m_password = (string)s[3]; } + cdebug << hashPassword(m_password) << toHex(m_password); m_cachedPasswords[hashPassword(m_password)] = m_password; + cdebug << hashPassword(asString(m_key.ref())) << m_key.hex(); m_cachedPasswords[hashPassword(asString(m_key.ref()))] = asString(m_key.ref()); + cdebug << hashPassword(_pass) << _pass; m_cachedPasswords[m_master = hashPassword(_pass)] = _pass; return true; } diff --git a/libethereum/KeyManager.h b/libethcore/KeyManager.h similarity index 96% rename from libethereum/KeyManager.h rename to libethcore/KeyManager.h index 3fcf83c3e..155805c5d 100644 --- a/libethereum/KeyManager.h +++ b/libethcore/KeyManager.h @@ -61,7 +61,7 @@ enum class SemanticPassword class KeyManager { public: - KeyManager(std::string const& _keysFile = getDataDir("ethereum") + "/keys.info"); + KeyManager(std::string const& _keysFile = defaultPath(), std::string const& _secretsPath = SecretStore::defaultPath()); ~KeyManager(); void setKeysFile(std::string const& _keysFile) { m_keysFile = _keysFile; } @@ -99,6 +99,8 @@ public: void kill(h128 const& _id) { kill(address(_id)); } void kill(Address const& _a); + static std::string defaultPath() { return getDataDir("ethereum") + "/keys.info"; } + private: std::string getPassword(h128 const& _uuid, std::function const& _pass = DontKnowThrow) const; std::string getPassword(h256 const& _passHash, std::function const& _pass = DontKnowThrow) const; @@ -127,10 +129,10 @@ private: // we have an upgrade strategy. std::string m_password; - SecretStore m_store; + mutable std::string m_keysFile; mutable h128 m_key; mutable h256 m_master; - mutable std::string m_keysFile; + SecretStore m_store; }; } diff --git a/libweb3jsonrpc/AccountHolder.cpp b/libweb3jsonrpc/AccountHolder.cpp index a73f20680..abd0a1adf 100644 --- a/libweb3jsonrpc/AccountHolder.cpp +++ b/libweb3jsonrpc/AccountHolder.cpp @@ -26,7 +26,8 @@ #include #include #include -#include +#include + using namespace std; using namespace dev; From d37cca694d5ef79f3087778aacc428b845bca2e0 Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Fri, 22 May 2015 08:30:04 +0200 Subject: [PATCH 335/461] update wallet tests --- .../BlockTestsFiller/bcWalletTestFiller.json | 8 +- .../StateTestsFiller/stWalletTestFiller.json | 128 ++++++++++++------ 2 files changed, 88 insertions(+), 48 deletions(-) diff --git a/test/libethereum/BlockTestsFiller/bcWalletTestFiller.json b/test/libethereum/BlockTestsFiller/bcWalletTestFiller.json index 29ca32134..dd0781383 100644 --- a/test/libethereum/BlockTestsFiller/bcWalletTestFiller.json +++ b/test/libethereum/BlockTestsFiller/bcWalletTestFiller.json @@ -41,8 +41,8 @@ { "transactions" : [ { - "data" : "0x60016000818155818055600380547fffffffffffffffffffffffff0000000000000000000000000000000000000000163390811790915573ffffffffffffffffffffffffffffffffffffffff168152610102602052604080822092909255620151804204610106557f9adeddf84386b336eb7b3e18e7a6099be08fd81ea5d5142f4d2b630f8d20cf0191a1610d4f806100996000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461009f5780632f54bf6e146101155780635c52c2f5146101465780637065cb4814610167578063797af6271461018b578063b20d30a91461019e578063b61d27f6146101c2578063ba51a6df146101ec578063cbf0b0c014610210578063f00d4b5d146102345761025d60003411610263576102a8565b6102aa6004356000604060003680828437820191505060409003604020610582815b73ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054818283838514610af6575b60008681526101036020526040812080549094509092508214610afb57610b07565b6102b06004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6102ba60406000368082843782019150506040900360402061062d816100c1565b6102c0600435604060003680828437820191505060409003604020610472816100c1565b6102c66004355b6000816108c7816100c1565b6102d060043560406000368082843782019150506040900360402061061a816100c1565b6102d6600435602435606460443560006106ce84600061010660005054610d085b62015180420490565b6102e0600435604060003680828437820191505060409003604020610606816100c1565b6102e6600435604060003680828437820191505060409003604020610636816100c1565b6102ec6004356024356000604060003680828437820191505060409003604020610387816100c1565b60006000f35b73ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b60006000f35b8060005260206000f35b60006000f35b60006000f35b8060005260206000f35b60006000f35b8060005260206000f35b60006000f35b60006000f35b60006000f35b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b61039057610380565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082146103c9575b6103cf8361011c565b50610382565b6103e3575b8260028361010085106102f257005b50610382565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b61047b5761046d565b6104848261011c565b61049a575b60015460fa9010156104a0576104cf565b5061046f565b6104cd600060015b600154811015610b43575b60015481108015610b8257506002816101008310610b6557005b505b60015460fa9010156104f6575b60018054810190819055829060029061010081106103e957005b5061046f565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff8316600081815261010260209081526040808320929092559181527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9190a15b505b5050565b61058b5761057c565b73ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082146105cb575b600060028361010085106104fc57005b5061057e565b600082905560408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15b5050565b6105d157610602565b6101058290555b5050565b61060f57610616565b6000610104555b50565b6106235761062a565b61063f575b5050565b8173ffffffffffffffffffffffffffffffffffffffff16ff5b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e08686878984378201915050915050604090036040a15b5b949350505050565b610711575b6040600036808284379091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc00160402091506107ba905081610192565b73ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c08686878984378201915050915050604090036040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f16107ae57005b50600091506106c69050565b1580156107ea57506000818152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b6107f3576106c5565b600081815261010760209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f0191909104810190849086861561087a579182015b8281111561087957823582600050559160200191906001019061085b565b5b5090505b80821115610658576000815560010161087e565b6000838152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff1614156108d0575b5b505b919050565b610892576108c0565b600083815261010760205260408120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff909216939182918391801561093357820191906000526020600020905b81548152906001019060200180831161091f575b5050600084866185025a03f161094557005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101076020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109e357820191906000526020600020905b8154815290600101906020018083116109cf575b5050915050604090036040a1600083815261010760209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f909101048101905b80821115610a5d5760008155600101610a49565b5050505060019150506108c2565b73ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115610b215782547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b5b50505050919050565b610aed565b60008054845560018401555b506001820154600284900a908116600014610a6b57610aec565b6000868152610103602052604081208181556001908101919091559450610aed565b5090565b5b60018054118015610bc857506001546002906101008110610bac57005b015473ffffffffffffffffffffffffffffffffffffffff16600014155b15610b47576001016104b3565b60015481108015610c1757506001546002906101008110610bfa57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b15610b8f57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019055610b48565b015473ffffffffffffffffffffffffffffffffffffffff16600014155b8015610c4857506002816101008310610c2c57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b610c5157610c8c565b6001546002906101008110610c9157005b015473ffffffffffffffffffffffffffffffffffffffff1681526020810191909152604001600020555b6104a8565b015473ffffffffffffffffffffffffffffffffffffffff166002826101008410610cb757005b0180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169190911790558061010260006002846101008610610c6257005b5061010480548201905560015b919050565b11610d1257610d25565b600061010455610d206101e3565b610106555b6101045482810110158015610d4257506101055461010454830111155b610cf6575b506000610d0356", - "gasLimit" : "0x0faf5d", + "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff16600381905581526101026020526040902055620151804204610107557f9adeddf84386b336eb7b3e18e7a6099be08fd81ea5d5142f4d2b630f8d20cf0160006040a1610e39806100716000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b6102976004356000604060003680828437909120905061053b815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610a7557610bd7565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061067781610108565b610297600435604060003680828437909120905061049281610108565b61029d6004355b6000816108b481610108565b610297600435604060003680828437909120905061066b81610108565b61029d6004803590602480359160443591820191013560006106a3846000610dce33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156102a757610329565b610297600435604060003680828437909120905061061a81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061039c81610108565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561032957815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b15610395576103aa83610146565b156103b55750610397565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156103eb5750610397565b61040d5b6101045460005b81811015610d2c57610104805482908110610d7457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061033057005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b1561048d576104a082610146565b156104ab575061048f565b6104b36103ef565b60015460fa901015156104ca576104c86104e1565b505b60015460fa9010151561050b575061048f565b6105d25b600060015b600154811015610c17575b60015481108015610c7357506002816101008110610c6c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061043257005b156103975773ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120549250821415610576575061048d565b6001600160005054036000600050541115610591575061048d565b600060028361010081106105a157005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556104dd6103ef565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b1561048d5760015482101561062f575061048f565b600082905561063c6103ef565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b1561048d575061010655565b1561048f5760006101055550565b1561048d578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b6000868152610103602052604081208054909450909250821415610b00578154835560018381018390556101048054918201808255828015829011610b8c578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610b8a5760008155600101610adf565b6000918252602090912001555b506001820154600284900a90811660001415610bd75773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610ba6576000868152610103602052610104805460409092206002015490918110610be057005b505b5050506002840181905561010480548892908110610af357005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610bd7565b5090565b01546000145b15610c8057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610c2157506001546002906101008110610c1b57005b0154600014155b15610c4f576001016104f1565b60015481108015610ca457506001546002906101008110610c9d57005b0154600014155b8015610cbf57506002816101008110610cb957005b01546000145b15610cd8576001546002906101008110610cdd57005b01555b6104e6565b01546002826101008110610ced57005b01558061010260006002836101008110610d0357005b0154815260208101919091526040016000908120919091556001546002906101008110610cd557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156103955760008155600101610d60565b6000918252602082200154141515610dc65761010480546101039160009184908110610d9c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016103f6565b156108af5761010754610de45b62015180420490565b1115610dfd57600061010555610df8610ddb565b610107555b6101055480830110158015610e1b5750610105546101065490830111155b15610e31575061010580548201905560016108af565b5060006108af56", + "gasLimit" : "0x989680", "gasPrice" : "1", "nonce" : "0", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", @@ -173,8 +173,8 @@ { "transactions" : [ { - "data" : "0x60016000818155818055600380547fffffffffffffffffffffffff0000000000000000000000000000000000000000163390811790915573ffffffffffffffffffffffffffffffffffffffff168152610102602052604080822092909255620151804204610106557f9adeddf84386b336eb7b3e18e7a6099be08fd81ea5d5142f4d2b630f8d20cf0191a1610d4f806100996000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461009f5780632f54bf6e146101155780635c52c2f5146101465780637065cb4814610167578063797af6271461018b578063b20d30a91461019e578063b61d27f6146101c2578063ba51a6df146101ec578063cbf0b0c014610210578063f00d4b5d146102345761025d60003411610263576102a8565b6102aa6004356000604060003680828437820191505060409003604020610582815b73ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054818283838514610af6575b60008681526101036020526040812080549094509092508214610afb57610b07565b6102b06004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6102ba60406000368082843782019150506040900360402061062d816100c1565b6102c0600435604060003680828437820191505060409003604020610472816100c1565b6102c66004355b6000816108c7816100c1565b6102d060043560406000368082843782019150506040900360402061061a816100c1565b6102d6600435602435606460443560006106ce84600061010660005054610d085b62015180420490565b6102e0600435604060003680828437820191505060409003604020610606816100c1565b6102e6600435604060003680828437820191505060409003604020610636816100c1565b6102ec6004356024356000604060003680828437820191505060409003604020610387816100c1565b60006000f35b73ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b60006000f35b8060005260206000f35b60006000f35b60006000f35b8060005260206000f35b60006000f35b8060005260206000f35b60006000f35b60006000f35b60006000f35b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b61039057610380565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082146103c9575b6103cf8361011c565b50610382565b6103e3575b8260028361010085106102f257005b50610382565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b61047b5761046d565b6104848261011c565b61049a575b60015460fa9010156104a0576104cf565b5061046f565b6104cd600060015b600154811015610b43575b60015481108015610b8257506002816101008310610b6557005b505b60015460fa9010156104f6575b60018054810190819055829060029061010081106103e957005b5061046f565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff8316600081815261010260209081526040808320929092559181527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9190a15b505b5050565b61058b5761057c565b73ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082146105cb575b600060028361010085106104fc57005b5061057e565b600082905560408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15b5050565b6105d157610602565b6101058290555b5050565b61060f57610616565b6000610104555b50565b6106235761062a565b61063f575b5050565b8173ffffffffffffffffffffffffffffffffffffffff16ff5b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e08686878984378201915050915050604090036040a15b5b949350505050565b610711575b6040600036808284379091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc00160402091506107ba905081610192565b73ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c08686878984378201915050915050604090036040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f16107ae57005b50600091506106c69050565b1580156107ea57506000818152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b6107f3576106c5565b600081815261010760209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f0191909104810190849086861561087a579182015b8281111561087957823582600050559160200191906001019061085b565b5b5090505b80821115610658576000815560010161087e565b6000838152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff1614156108d0575b5b505b919050565b610892576108c0565b600083815261010760205260408120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff909216939182918391801561093357820191906000526020600020905b81548152906001019060200180831161091f575b5050600084866185025a03f161094557005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101076020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109e357820191906000526020600020905b8154815290600101906020018083116109cf575b5050915050604090036040a1600083815261010760209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f909101048101905b80821115610a5d5760008155600101610a49565b5050505060019150506108c2565b73ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115610b215782547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b5b50505050919050565b610aed565b60008054845560018401555b506001820154600284900a908116600014610a6b57610aec565b6000868152610103602052604081208181556001908101919091559450610aed565b5090565b5b60018054118015610bc857506001546002906101008110610bac57005b015473ffffffffffffffffffffffffffffffffffffffff16600014155b15610b47576001016104b3565b60015481108015610c1757506001546002906101008110610bfa57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b15610b8f57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019055610b48565b015473ffffffffffffffffffffffffffffffffffffffff16600014155b8015610c4857506002816101008310610c2c57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b610c5157610c8c565b6001546002906101008110610c9157005b015473ffffffffffffffffffffffffffffffffffffffff1681526020810191909152604001600020555b6104a8565b015473ffffffffffffffffffffffffffffffffffffffff166002826101008410610cb757005b0180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169190911790558061010260006002846101008610610c6257005b5061010480548201905560015b919050565b11610d1257610d25565b600061010455610d206101e3565b610106555b6101045482810110158015610d4257506101055461010454830111155b610cf6575b506000610d0356", - "gasLimit" : "0x0faf5d", + "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff16600381905581526101026020526040902055620151804204610107557f9adeddf84386b336eb7b3e18e7a6099be08fd81ea5d5142f4d2b630f8d20cf0160006040a1610e39806100716000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b6102976004356000604060003680828437909120905061053b815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610a7557610bd7565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061067781610108565b610297600435604060003680828437909120905061049281610108565b61029d6004355b6000816108b481610108565b610297600435604060003680828437909120905061066b81610108565b61029d6004803590602480359160443591820191013560006106a3846000610dce33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156102a757610329565b610297600435604060003680828437909120905061061a81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061039c81610108565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561032957815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b15610395576103aa83610146565b156103b55750610397565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156103eb5750610397565b61040d5b6101045460005b81811015610d2c57610104805482908110610d7457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061033057005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b1561048d576104a082610146565b156104ab575061048f565b6104b36103ef565b60015460fa901015156104ca576104c86104e1565b505b60015460fa9010151561050b575061048f565b6105d25b600060015b600154811015610c17575b60015481108015610c7357506002816101008110610c6c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061043257005b156103975773ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120549250821415610576575061048d565b6001600160005054036000600050541115610591575061048d565b600060028361010081106105a157005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556104dd6103ef565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b1561048d5760015482101561062f575061048f565b600082905561063c6103ef565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b1561048d575061010655565b1561048f5760006101055550565b1561048d578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b6000868152610103602052604081208054909450909250821415610b00578154835560018381018390556101048054918201808255828015829011610b8c578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610b8a5760008155600101610adf565b6000918252602090912001555b506001820154600284900a90811660001415610bd75773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610ba6576000868152610103602052610104805460409092206002015490918110610be057005b505b5050506002840181905561010480548892908110610af357005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610bd7565b5090565b01546000145b15610c8057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610c2157506001546002906101008110610c1b57005b0154600014155b15610c4f576001016104f1565b60015481108015610ca457506001546002906101008110610c9d57005b0154600014155b8015610cbf57506002816101008110610cb957005b01546000145b15610cd8576001546002906101008110610cdd57005b01555b6104e6565b01546002826101008110610ced57005b01558061010260006002836101008110610d0357005b0154815260208101919091526040016000908120919091556001546002906101008110610cd557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156103955760008155600101610d60565b6000918252602082200154141515610dc65761010480546101039160009184908110610d9c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016103f6565b156108af5761010754610de45b62015180420490565b1115610dfd57600061010555610df8610ddb565b610107555b6101055480830110158015610e1b5750610105546101065490830111155b15610e31575061010580548201905560016108af565b5060006108af56", + "gasLimit" : "0x989680", "gasPrice" : "1", "nonce" : "0", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", diff --git a/test/libethereum/StateTestsFiller/stWalletTestFiller.json b/test/libethereum/StateTestsFiller/stWalletTestFiller.json index f651c40e6..386731c7f 100644 --- a/test/libethereum/StateTestsFiller/stWalletTestFiller.json +++ b/test/libethereum/StateTestsFiller/stWalletTestFiller.json @@ -18,8 +18,8 @@ } }, "transaction" : { - "data" : "0x60016000818155818055600380547fffffffffffffffffffffffff0000000000000000000000000000000000000000163390811790915573ffffffffffffffffffffffffffffffffffffffff168152610102602052604081209190915561073c90819061006c90396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461005a5780632f54bf6e146100d05780637065cb4814610101578063ba51a6df14610125578063f00d4b5d1461014957005b6101726004356000604060003680828437820191505060409003604020610424815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481828383851461053c575b600086815261010360205260408120805490945090925082146105415761054d565b6101786004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6101826004356040600036808284378201915050604090036040206103148161007c565b6101886004356040600036808284378201915050604090036040206104a88161007c565b61018e60043560243560006040600036808284378201915050604090036040206102298161007c565b60006000f35b8060005260206000f35b60006000f35b60006000f35b60006000f35b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b61023257610222565b73ffffffffffffffffffffffffffffffffffffffff8416600090815261010260205260408120549250821461026b575b610271836100d7565b50610224565b610285575b82600283610100851061019457005b50610224565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b61031d5761030f565b610326826100d7565b61033c575b60015460fa90101561034257610371565b50610311565b61036f600060015b600154811015610589575b600154811080156105c8575060028161010083106105ab57005b505b60015460fa901015610398575b600180548101908190558290600290610100811061028b57005b50610311565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff8316600081815261010260209081526040808320929092559181527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9190a15b505b5050565b61042d5761041e565b73ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120549250821461046d575b6000600283610100851061039e57005b50610420565b600082905560408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15b5050565b610473576104a4565b73ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a1825460019011156105675782547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b5b50505050919050565b610533565b60008054845560018401555b506001820154600284900a9081166000146104b157610532565b6000868152610103602052604081208181556001908101919091559450610533565b5090565b5b6001805411801561060e575060015460029061010081106105f257005b015473ffffffffffffffffffffffffffffffffffffffff16600014155b1561058d57600101610355565b6001548110801561065d5750600154600290610100811061064057005b015473ffffffffffffffffffffffffffffffffffffffff166000145b156105d557600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01905561058e565b015473ffffffffffffffffffffffffffffffffffffffff16600014155b801561068e5750600281610100831061067257005b015473ffffffffffffffffffffffffffffffffffffffff166000145b610697576106d2565b60015460029061010081106106d757005b015473ffffffffffffffffffffffffffffffffffffffff1681526020810191909152604001600020555b61034a565b015473ffffffffffffffffffffffffffffffffffffffff1660028261010084106106fd57005b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905580610102600060028461010086106106a85700", - "gasLimit" : "141608", + "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff166003819055815261010260205260408120919091556108ae90819061004590396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548210156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", + "gasLimit" : "169491", "gasPrice" : "1", "nonce" : "0", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", @@ -28,7 +28,7 @@ } }, - "multiOwnedConstructionNotEnoughGas2" : { + "multiOwnedConstructionPartial" : { "env" : { "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", "currentDifficulty" : "256", @@ -47,8 +47,8 @@ } }, "transaction" : { - "data" : "0x60016000818155818055600380547fffffffffffffffffffffffff0000000000000000000000000000000000000000163390811790915573ffffffffffffffffffffffffffffffffffffffff168152610102602052604081209190915561073c90819061006c90396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461005a5780632f54bf6e146100d05780637065cb4814610101578063ba51a6df14610125578063f00d4b5d1461014957005b6101726004356000604060003680828437820191505060409003604020610424815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481828383851461053c575b600086815261010360205260408120805490945090925082146105415761054d565b6101786004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6101826004356040600036808284378201915050604090036040206103148161007c565b6101886004356040600036808284378201915050604090036040206104a88161007c565b61018e60043560243560006040600036808284378201915050604090036040206102298161007c565b60006000f35b8060005260206000f35b60006000f35b60006000f35b60006000f35b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b61023257610222565b73ffffffffffffffffffffffffffffffffffffffff8416600090815261010260205260408120549250821461026b575b610271836100d7565b50610224565b610285575b82600283610100851061019457005b50610224565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b61031d5761030f565b610326826100d7565b61033c575b60015460fa90101561034257610371565b50610311565b61036f600060015b600154811015610589575b600154811080156105c8575060028161010083106105ab57005b505b60015460fa901015610398575b600180548101908190558290600290610100811061028b57005b50610311565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff8316600081815261010260209081526040808320929092559181527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9190a15b505b5050565b61042d5761041e565b73ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120549250821461046d575b6000600283610100851061039e57005b50610420565b600082905560408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15b5050565b610473576104a4565b73ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a1825460019011156105675782547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b5b50505050919050565b610533565b60008054845560018401555b506001820154600284900a9081166000146104b157610532565b6000868152610103602052604081208181556001908101919091559450610533565b5090565b5b6001805411801561060e575060015460029061010081106105f257005b015473ffffffffffffffffffffffffffffffffffffffff16600014155b1561058d57600101610355565b6001548110801561065d5750600154600290610100811061064057005b015473ffffffffffffffffffffffffffffffffffffffff166000145b156105d557600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01905561058e565b015473ffffffffffffffffffffffffffffffffffffffff16600014155b801561068e5750600281610100831061067257005b015473ffffffffffffffffffffffffffffffffffffffff166000145b610697576106d2565b60015460029061010081106106d757005b015473ffffffffffffffffffffffffffffffffffffffff1681526020810191909152604001600020555b61034a565b015473ffffffffffffffffffffffffffffffffffffffff1660028261010084106106fd57005b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905580610102600060028461010086106106a85700", - "gasLimit" : "0x090ab0", + "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff166003819055815261010260205260408120919091556108ae90819061004590396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548210156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", + "gasLimit" : "0x0a98b3", "gasPrice" : "1", "nonce" : "0", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", @@ -76,8 +76,8 @@ } }, "transaction" : { - "data" : "0x60016000818155818055600380547fffffffffffffffffffffffff0000000000000000000000000000000000000000163390811790915573ffffffffffffffffffffffffffffffffffffffff168152610102602052604081209190915561073c90819061006c90396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461005a5780632f54bf6e146100d05780637065cb4814610101578063ba51a6df14610125578063f00d4b5d1461014957005b6101726004356000604060003680828437820191505060409003604020610424815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481828383851461053c575b600086815261010360205260408120805490945090925082146105415761054d565b6101786004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6101826004356040600036808284378201915050604090036040206103148161007c565b6101886004356040600036808284378201915050604090036040206104a88161007c565b61018e60043560243560006040600036808284378201915050604090036040206102298161007c565b60006000f35b8060005260206000f35b60006000f35b60006000f35b60006000f35b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b61023257610222565b73ffffffffffffffffffffffffffffffffffffffff8416600090815261010260205260408120549250821461026b575b610271836100d7565b50610224565b610285575b82600283610100851061019457005b50610224565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b61031d5761030f565b610326826100d7565b61033c575b60015460fa90101561034257610371565b50610311565b61036f600060015b600154811015610589575b600154811080156105c8575060028161010083106105ab57005b505b60015460fa901015610398575b600180548101908190558290600290610100811061028b57005b50610311565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff8316600081815261010260209081526040808320929092559181527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9190a15b505b5050565b61042d5761041e565b73ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120549250821461046d575b6000600283610100851061039e57005b50610420565b600082905560408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15b5050565b610473576104a4565b73ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a1825460019011156105675782547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b5b50505050919050565b610533565b60008054845560018401555b506001820154600284900a9081166000146104b157610532565b6000868152610103602052604081208181556001908101919091559450610533565b5090565b5b6001805411801561060e575060015460029061010081106105f257005b015473ffffffffffffffffffffffffffffffffffffffff16600014155b1561058d57600101610355565b6001548110801561065d5750600154600290610100811061064057005b015473ffffffffffffffffffffffffffffffffffffffff166000145b156105d557600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01905561058e565b015473ffffffffffffffffffffffffffffffffffffffff16600014155b801561068e5750600281610100831061067257005b015473ffffffffffffffffffffffffffffffffffffffff166000145b610697576106d2565b60015460029061010081106106d757005b015473ffffffffffffffffffffffffffffffffffffffff1681526020810191909152604001600020555b61034a565b015473ffffffffffffffffffffffffffffffffffffffff1660028261010084106106fd57005b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905580610102600060028461010086106106a85700", - "gasLimit" : "0x090ab1", + "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff166003819055815261010260205260408120919091556108ae90819061004590396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548210156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", + "gasLimit" : "10000000", "gasPrice" : "1", "nonce" : "0", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", @@ -98,7 +98,7 @@ "pre" : { "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461009f5780632f54bf6e146101155780635c52c2f5146101465780637065cb4814610167578063797af6271461018b578063b20d30a91461019e578063b61d27f6146101c2578063ba51a6df146101ec578063cbf0b0c014610210578063f00d4b5d146102345761025d60003411610263576102a8565b6102aa6004356000604060003680828437820191505060409003604020610582815b73ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054818283838514610af6575b60008681526101036020526040812080549094509092508214610afb57610b07565b6102b06004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6102ba60406000368082843782019150506040900360402061062d816100c1565b6102c0600435604060003680828437820191505060409003604020610472816100c1565b6102c66004355b6000816108c7816100c1565b6102d060043560406000368082843782019150506040900360402061061a816100c1565b6102d6600435602435606460443560006106ce84600061010660005054610d085b62015180420490565b6102e0600435604060003680828437820191505060409003604020610606816100c1565b6102e6600435604060003680828437820191505060409003604020610636816100c1565b6102ec6004356024356000604060003680828437820191505060409003604020610387816100c1565b60006000f35b73ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b60006000f35b8060005260206000f35b60006000f35b60006000f35b8060005260206000f35b60006000f35b8060005260206000f35b60006000f35b60006000f35b60006000f35b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b61039057610380565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082146103c9575b6103cf8361011c565b50610382565b6103e3575b8260028361010085106102f257005b50610382565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b61047b5761046d565b6104848261011c565b61049a575b60015460fa9010156104a0576104cf565b5061046f565b6104cd600060015b600154811015610b43575b60015481108015610b8257506002816101008310610b6557005b505b60015460fa9010156104f6575b60018054810190819055829060029061010081106103e957005b5061046f565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff8316600081815261010260209081526040808320929092559181527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9190a15b505b5050565b61058b5761057c565b73ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082146105cb575b600060028361010085106104fc57005b5061057e565b600082905560408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15b5050565b6105d157610602565b6101058290555b5050565b61060f57610616565b6000610104555b50565b6106235761062a565b61063f575b5050565b8173ffffffffffffffffffffffffffffffffffffffff16ff5b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e08686878984378201915050915050604090036040a15b5b949350505050565b610711575b6040600036808284379091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc00160402091506107ba905081610192565b73ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c08686878984378201915050915050604090036040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f16107ae57005b50600091506106c69050565b1580156107ea57506000818152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b6107f3576106c5565b600081815261010760209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f0191909104810190849086861561087a579182015b8281111561087957823582600050559160200191906001019061085b565b5b5090505b80821115610658576000815560010161087e565b6000838152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff1614156108d0575b5b505b919050565b610892576108c0565b600083815261010760205260408120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff909216939182918391801561093357820191906000526020600020905b81548152906001019060200180831161091f575b5050600084866185025a03f161094557005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101076020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109e357820191906000526020600020905b8154815290600101906020018083116109cf575b5050915050604090036040a1600083815261010760209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f909101048101905b80821115610a5d5760008155600101610a49565b5050505060019150506108c2565b73ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115610b215782547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b5b50505050919050565b610aed565b60008054845560018401555b506001820154600284900a908116600014610a6b57610aec565b6000868152610103602052604081208181556001908101919091559450610aed565b5090565b5b60018054118015610bc857506001546002906101008110610bac57005b015473ffffffffffffffffffffffffffffffffffffffff16600014155b15610b47576001016104b3565b60015481108015610c1757506001546002906101008110610bfa57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b15610b8f57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019055610b48565b015473ffffffffffffffffffffffffffffffffffffffff16600014155b8015610c4857506002816101008310610c2c57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b610c5157610c8c565b6001546002906101008110610c9157005b015473ffffffffffffffffffffffffffffffffffffffff1681526020810191909152604001600020555b6104a8565b015473ffffffffffffffffffffffffffffffffffffffff166002826101008410610cb757005b0180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169190911790558061010260006002846101008610610c6257005b5061010480548201905560015b919050565b11610d1257610d25565b600061010455610d206101e3565b610106555b6101045482810110158015610d4257506101055461010454830111155b610cf6575b506000610d0356", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548210156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -138,7 +138,7 @@ "pre" : { "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461009f5780632f54bf6e146101155780635c52c2f5146101465780637065cb4814610167578063797af6271461018b578063b20d30a91461019e578063b61d27f6146101c2578063ba51a6df146101ec578063cbf0b0c014610210578063f00d4b5d146102345761025d60003411610263576102a8565b6102aa6004356000604060003680828437820191505060409003604020610582815b73ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054818283838514610af6575b60008681526101036020526040812080549094509092508214610afb57610b07565b6102b06004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6102ba60406000368082843782019150506040900360402061062d816100c1565b6102c0600435604060003680828437820191505060409003604020610472816100c1565b6102c66004355b6000816108c7816100c1565b6102d060043560406000368082843782019150506040900360402061061a816100c1565b6102d6600435602435606460443560006106ce84600061010660005054610d085b62015180420490565b6102e0600435604060003680828437820191505060409003604020610606816100c1565b6102e6600435604060003680828437820191505060409003604020610636816100c1565b6102ec6004356024356000604060003680828437820191505060409003604020610387816100c1565b60006000f35b73ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b60006000f35b8060005260206000f35b60006000f35b60006000f35b8060005260206000f35b60006000f35b8060005260206000f35b60006000f35b60006000f35b60006000f35b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b61039057610380565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082146103c9575b6103cf8361011c565b50610382565b6103e3575b8260028361010085106102f257005b50610382565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b61047b5761046d565b6104848261011c565b61049a575b60015460fa9010156104a0576104cf565b5061046f565b6104cd600060015b600154811015610b43575b60015481108015610b8257506002816101008310610b6557005b505b60015460fa9010156104f6575b60018054810190819055829060029061010081106103e957005b5061046f565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff8316600081815261010260209081526040808320929092559181527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9190a15b505b5050565b61058b5761057c565b73ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082146105cb575b600060028361010085106104fc57005b5061057e565b600082905560408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15b5050565b6105d157610602565b6101058290555b5050565b61060f57610616565b6000610104555b50565b6106235761062a565b61063f575b5050565b8173ffffffffffffffffffffffffffffffffffffffff16ff5b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e08686878984378201915050915050604090036040a15b5b949350505050565b610711575b6040600036808284379091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc00160402091506107ba905081610192565b73ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c08686878984378201915050915050604090036040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f16107ae57005b50600091506106c69050565b1580156107ea57506000818152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b6107f3576106c5565b600081815261010760209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f0191909104810190849086861561087a579182015b8281111561087957823582600050559160200191906001019061085b565b5b5090505b80821115610658576000815560010161087e565b6000838152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff1614156108d0575b5b505b919050565b610892576108c0565b600083815261010760205260408120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff909216939182918391801561093357820191906000526020600020905b81548152906001019060200180831161091f575b5050600084866185025a03f161094557005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101076020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109e357820191906000526020600020905b8154815290600101906020018083116109cf575b5050915050604090036040a1600083815261010760209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f909101048101905b80821115610a5d5760008155600101610a49565b5050505060019150506108c2565b73ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115610b215782547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b5b50505050919050565b610aed565b60008054845560018401555b506001820154600284900a908116600014610a6b57610aec565b6000868152610103602052604081208181556001908101919091559450610aed565b5090565b5b60018054118015610bc857506001546002906101008110610bac57005b015473ffffffffffffffffffffffffffffffffffffffff16600014155b15610b47576001016104b3565b60015481108015610c1757506001546002906101008110610bfa57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b15610b8f57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019055610b48565b015473ffffffffffffffffffffffffffffffffffffffff16600014155b8015610c4857506002816101008310610c2c57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b610c5157610c8c565b6001546002906101008110610c9157005b015473ffffffffffffffffffffffffffffffffffffffff1681526020810191909152604001600020555b6104a8565b015473ffffffffffffffffffffffffffffffffffffffff166002826101008410610cb757005b0180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169190911790558061010260006002846101008610610c6257005b5061010480548201905560015b919050565b11610d1257610d25565b600061010455610d206101e3565b610106555b6101045482810110158015610d4257506101055461010454830111155b610cf6575b506000610d0356", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548210156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -178,7 +178,7 @@ "pre" : { "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461009f5780632f54bf6e146101155780635c52c2f5146101465780637065cb4814610167578063797af6271461018b578063b20d30a91461019e578063b61d27f6146101c2578063ba51a6df146101ec578063cbf0b0c014610210578063f00d4b5d146102345761025d60003411610263576102a8565b6102aa6004356000604060003680828437820191505060409003604020610582815b73ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054818283838514610af6575b60008681526101036020526040812080549094509092508214610afb57610b07565b6102b06004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6102ba60406000368082843782019150506040900360402061062d816100c1565b6102c0600435604060003680828437820191505060409003604020610472816100c1565b6102c66004355b6000816108c7816100c1565b6102d060043560406000368082843782019150506040900360402061061a816100c1565b6102d6600435602435606460443560006106ce84600061010660005054610d085b62015180420490565b6102e0600435604060003680828437820191505060409003604020610606816100c1565b6102e6600435604060003680828437820191505060409003604020610636816100c1565b6102ec6004356024356000604060003680828437820191505060409003604020610387816100c1565b60006000f35b73ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b60006000f35b8060005260206000f35b60006000f35b60006000f35b8060005260206000f35b60006000f35b8060005260206000f35b60006000f35b60006000f35b60006000f35b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b61039057610380565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082146103c9575b6103cf8361011c565b50610382565b6103e3575b8260028361010085106102f257005b50610382565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b61047b5761046d565b6104848261011c565b61049a575b60015460fa9010156104a0576104cf565b5061046f565b6104cd600060015b600154811015610b43575b60015481108015610b8257506002816101008310610b6557005b505b60015460fa9010156104f6575b60018054810190819055829060029061010081106103e957005b5061046f565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff8316600081815261010260209081526040808320929092559181527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9190a15b505b5050565b61058b5761057c565b73ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082146105cb575b600060028361010085106104fc57005b5061057e565b600082905560408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15b5050565b6105d157610602565b6101058290555b5050565b61060f57610616565b6000610104555b50565b6106235761062a565b61063f575b5050565b8173ffffffffffffffffffffffffffffffffffffffff16ff5b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e08686878984378201915050915050604090036040a15b5b949350505050565b610711575b6040600036808284379091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc00160402091506107ba905081610192565b73ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c08686878984378201915050915050604090036040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f16107ae57005b50600091506106c69050565b1580156107ea57506000818152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b6107f3576106c5565b600081815261010760209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f0191909104810190849086861561087a579182015b8281111561087957823582600050559160200191906001019061085b565b5b5090505b80821115610658576000815560010161087e565b6000838152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff1614156108d0575b5b505b919050565b610892576108c0565b600083815261010760205260408120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff909216939182918391801561093357820191906000526020600020905b81548152906001019060200180831161091f575b5050600084866185025a03f161094557005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101076020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109e357820191906000526020600020905b8154815290600101906020018083116109cf575b5050915050604090036040a1600083815261010760209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f909101048101905b80821115610a5d5760008155600101610a49565b5050505060019150506108c2565b73ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115610b215782547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b5b50505050919050565b610aed565b60008054845560018401555b506001820154600284900a908116600014610a6b57610aec565b6000868152610103602052604081208181556001908101919091559450610aed565b5090565b5b60018054118015610bc857506001546002906101008110610bac57005b015473ffffffffffffffffffffffffffffffffffffffff16600014155b15610b47576001016104b3565b60015481108015610c1757506001546002906101008110610bfa57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b15610b8f57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019055610b48565b015473ffffffffffffffffffffffffffffffffffffffff16600014155b8015610c4857506002816101008310610c2c57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b610c5157610c8c565b6001546002906101008110610c9157005b015473ffffffffffffffffffffffffffffffffffffffff1681526020810191909152604001600020555b6104a8565b015473ffffffffffffffffffffffffffffffffffffffff166002826101008410610cb757005b0180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169190911790558061010260006002846101008610610c6257005b5061010480548201905560015b919050565b11610d1257610d25565b600061010455610d206101e3565b610106555b6101045482810110158015610d4257506101055461010454830111155b610cf6575b506000610d0356", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548210156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -218,7 +218,7 @@ "pre" : { "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461009f5780632f54bf6e146101155780635c52c2f5146101465780637065cb4814610167578063797af6271461018b578063b20d30a91461019e578063b61d27f6146101c2578063ba51a6df146101ec578063cbf0b0c014610210578063f00d4b5d146102345761025d60003411610263576102a8565b6102aa6004356000604060003680828437820191505060409003604020610582815b73ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054818283838514610af6575b60008681526101036020526040812080549094509092508214610afb57610b07565b6102b06004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6102ba60406000368082843782019150506040900360402061062d816100c1565b6102c0600435604060003680828437820191505060409003604020610472816100c1565b6102c66004355b6000816108c7816100c1565b6102d060043560406000368082843782019150506040900360402061061a816100c1565b6102d6600435602435606460443560006106ce84600061010660005054610d085b62015180420490565b6102e0600435604060003680828437820191505060409003604020610606816100c1565b6102e6600435604060003680828437820191505060409003604020610636816100c1565b6102ec6004356024356000604060003680828437820191505060409003604020610387816100c1565b60006000f35b73ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b60006000f35b8060005260206000f35b60006000f35b60006000f35b8060005260206000f35b60006000f35b8060005260206000f35b60006000f35b60006000f35b60006000f35b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b61039057610380565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082146103c9575b6103cf8361011c565b50610382565b6103e3575b8260028361010085106102f257005b50610382565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b61047b5761046d565b6104848261011c565b61049a575b60015460fa9010156104a0576104cf565b5061046f565b6104cd600060015b600154811015610b43575b60015481108015610b8257506002816101008310610b6557005b505b60015460fa9010156104f6575b60018054810190819055829060029061010081106103e957005b5061046f565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff8316600081815261010260209081526040808320929092559181527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9190a15b505b5050565b61058b5761057c565b73ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082146105cb575b600060028361010085106104fc57005b5061057e565b600082905560408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15b5050565b6105d157610602565b6101058290555b5050565b61060f57610616565b6000610104555b50565b6106235761062a565b61063f575b5050565b8173ffffffffffffffffffffffffffffffffffffffff16ff5b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e08686878984378201915050915050604090036040a15b5b949350505050565b610711575b6040600036808284379091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc00160402091506107ba905081610192565b73ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c08686878984378201915050915050604090036040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f16107ae57005b50600091506106c69050565b1580156107ea57506000818152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b6107f3576106c5565b600081815261010760209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f0191909104810190849086861561087a579182015b8281111561087957823582600050559160200191906001019061085b565b5b5090505b80821115610658576000815560010161087e565b6000838152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff1614156108d0575b5b505b919050565b610892576108c0565b600083815261010760205260408120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff909216939182918391801561093357820191906000526020600020905b81548152906001019060200180831161091f575b5050600084866185025a03f161094557005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101076020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109e357820191906000526020600020905b8154815290600101906020018083116109cf575b5050915050604090036040a1600083815261010760209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f909101048101905b80821115610a5d5760008155600101610a49565b5050505060019150506108c2565b73ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115610b215782547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b5b50505050919050565b610aed565b60008054845560018401555b506001820154600284900a908116600014610a6b57610aec565b6000868152610103602052604081208181556001908101919091559450610aed565b5090565b5b60018054118015610bc857506001546002906101008110610bac57005b015473ffffffffffffffffffffffffffffffffffffffff16600014155b15610b47576001016104b3565b60015481108015610c1757506001546002906101008110610bfa57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b15610b8f57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019055610b48565b015473ffffffffffffffffffffffffffffffffffffffff16600014155b8015610c4857506002816101008310610c2c57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b610c5157610c8c565b6001546002906101008110610c9157005b015473ffffffffffffffffffffffffffffffffffffffff1681526020810191909152604001600020555b6104a8565b015473ffffffffffffffffffffffffffffffffffffffff166002826101008410610cb757005b0180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169190911790558061010260006002846101008610610c6257005b5061010480548201905560015b919050565b11610d1257610d25565b600061010455610d206101e3565b610106555b6101045482810110158015610d4257506101055461010454830111155b610cf6575b506000610d0356", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548210156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -258,7 +258,7 @@ "pre" : { "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461009f5780632f54bf6e146101155780635c52c2f5146101465780637065cb4814610167578063797af6271461018b578063b20d30a91461019e578063b61d27f6146101c2578063ba51a6df146101ec578063cbf0b0c014610210578063f00d4b5d146102345761025d60003411610263576102a8565b6102aa6004356000604060003680828437820191505060409003604020610582815b73ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054818283838514610af6575b60008681526101036020526040812080549094509092508214610afb57610b07565b6102b06004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6102ba60406000368082843782019150506040900360402061062d816100c1565b6102c0600435604060003680828437820191505060409003604020610472816100c1565b6102c66004355b6000816108c7816100c1565b6102d060043560406000368082843782019150506040900360402061061a816100c1565b6102d6600435602435606460443560006106ce84600061010660005054610d085b62015180420490565b6102e0600435604060003680828437820191505060409003604020610606816100c1565b6102e6600435604060003680828437820191505060409003604020610636816100c1565b6102ec6004356024356000604060003680828437820191505060409003604020610387816100c1565b60006000f35b73ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b60006000f35b8060005260206000f35b60006000f35b60006000f35b8060005260206000f35b60006000f35b8060005260206000f35b60006000f35b60006000f35b60006000f35b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b61039057610380565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082146103c9575b6103cf8361011c565b50610382565b6103e3575b8260028361010085106102f257005b50610382565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b61047b5761046d565b6104848261011c565b61049a575b60015460fa9010156104a0576104cf565b5061046f565b6104cd600060015b600154811015610b43575b60015481108015610b8257506002816101008310610b6557005b505b60015460fa9010156104f6575b60018054810190819055829060029061010081106103e957005b5061046f565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff8316600081815261010260209081526040808320929092559181527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9190a15b505b5050565b61058b5761057c565b73ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082146105cb575b600060028361010085106104fc57005b5061057e565b600082905560408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15b5050565b6105d157610602565b6101058290555b5050565b61060f57610616565b6000610104555b50565b6106235761062a565b61063f575b5050565b8173ffffffffffffffffffffffffffffffffffffffff16ff5b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e08686878984378201915050915050604090036040a15b5b949350505050565b610711575b6040600036808284379091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc00160402091506107ba905081610192565b73ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c08686878984378201915050915050604090036040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f16107ae57005b50600091506106c69050565b1580156107ea57506000818152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b6107f3576106c5565b600081815261010760209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f0191909104810190849086861561087a579182015b8281111561087957823582600050559160200191906001019061085b565b5b5090505b80821115610658576000815560010161087e565b6000838152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff1614156108d0575b5b505b919050565b610892576108c0565b600083815261010760205260408120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff909216939182918391801561093357820191906000526020600020905b81548152906001019060200180831161091f575b5050600084866185025a03f161094557005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101076020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109e357820191906000526020600020905b8154815290600101906020018083116109cf575b5050915050604090036040a1600083815261010760209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f909101048101905b80821115610a5d5760008155600101610a49565b5050505060019150506108c2565b73ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115610b215782547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b5b50505050919050565b610aed565b60008054845560018401555b506001820154600284900a908116600014610a6b57610aec565b6000868152610103602052604081208181556001908101919091559450610aed565b5090565b5b60018054118015610bc857506001546002906101008110610bac57005b015473ffffffffffffffffffffffffffffffffffffffff16600014155b15610b47576001016104b3565b60015481108015610c1757506001546002906101008110610bfa57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b15610b8f57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019055610b48565b015473ffffffffffffffffffffffffffffffffffffffff16600014155b8015610c4857506002816101008310610c2c57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b610c5157610c8c565b6001546002906101008110610c9157005b015473ffffffffffffffffffffffffffffffffffffffff1681526020810191909152604001600020555b6104a8565b015473ffffffffffffffffffffffffffffffffffffffff166002826101008410610cb757005b0180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169190911790558061010260006002846101008610610c6257005b5061010480548201905560015b919050565b11610d1257610d25565b600061010455610d206101e3565b610106555b6101045482810110158015610d4257506101055461010454830111155b610cf6575b506000610d0356", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548210156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -298,7 +298,7 @@ "pre" : { "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461009f5780632f54bf6e146101155780635c52c2f5146101465780637065cb4814610167578063797af6271461018b578063b20d30a91461019e578063b61d27f6146101c2578063ba51a6df146101ec578063cbf0b0c014610210578063f00d4b5d146102345761025d60003411610263576102a8565b6102aa6004356000604060003680828437820191505060409003604020610582815b73ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054818283838514610af6575b60008681526101036020526040812080549094509092508214610afb57610b07565b6102b06004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6102ba60406000368082843782019150506040900360402061062d816100c1565b6102c0600435604060003680828437820191505060409003604020610472816100c1565b6102c66004355b6000816108c7816100c1565b6102d060043560406000368082843782019150506040900360402061061a816100c1565b6102d6600435602435606460443560006106ce84600061010660005054610d085b62015180420490565b6102e0600435604060003680828437820191505060409003604020610606816100c1565b6102e6600435604060003680828437820191505060409003604020610636816100c1565b6102ec6004356024356000604060003680828437820191505060409003604020610387816100c1565b60006000f35b73ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b60006000f35b8060005260206000f35b60006000f35b60006000f35b8060005260206000f35b60006000f35b8060005260206000f35b60006000f35b60006000f35b60006000f35b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b61039057610380565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082146103c9575b6103cf8361011c565b50610382565b6103e3575b8260028361010085106102f257005b50610382565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b61047b5761046d565b6104848261011c565b61049a575b60015460fa9010156104a0576104cf565b5061046f565b6104cd600060015b600154811015610b43575b60015481108015610b8257506002816101008310610b6557005b505b60015460fa9010156104f6575b60018054810190819055829060029061010081106103e957005b5061046f565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff8316600081815261010260209081526040808320929092559181527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9190a15b505b5050565b61058b5761057c565b73ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082146105cb575b600060028361010085106104fc57005b5061057e565b600082905560408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15b5050565b6105d157610602565b6101058290555b5050565b61060f57610616565b6000610104555b50565b6106235761062a565b61063f575b5050565b8173ffffffffffffffffffffffffffffffffffffffff16ff5b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e08686878984378201915050915050604090036040a15b5b949350505050565b610711575b6040600036808284379091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc00160402091506107ba905081610192565b73ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c08686878984378201915050915050604090036040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f16107ae57005b50600091506106c69050565b1580156107ea57506000818152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b6107f3576106c5565b600081815261010760209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f0191909104810190849086861561087a579182015b8281111561087957823582600050559160200191906001019061085b565b5b5090505b80821115610658576000815560010161087e565b6000838152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff1614156108d0575b5b505b919050565b610892576108c0565b600083815261010760205260408120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff909216939182918391801561093357820191906000526020600020905b81548152906001019060200180831161091f575b5050600084866185025a03f161094557005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101076020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109e357820191906000526020600020905b8154815290600101906020018083116109cf575b5050915050604090036040a1600083815261010760209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f909101048101905b80821115610a5d5760008155600101610a49565b5050505060019150506108c2565b73ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115610b215782547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b5b50505050919050565b610aed565b60008054845560018401555b506001820154600284900a908116600014610a6b57610aec565b6000868152610103602052604081208181556001908101919091559450610aed565b5090565b5b60018054118015610bc857506001546002906101008110610bac57005b015473ffffffffffffffffffffffffffffffffffffffff16600014155b15610b47576001016104b3565b60015481108015610c1757506001546002906101008110610bfa57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b15610b8f57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019055610b48565b015473ffffffffffffffffffffffffffffffffffffffff16600014155b8015610c4857506002816101008310610c2c57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b610c5157610c8c565b6001546002906101008110610c9157005b015473ffffffffffffffffffffffffffffffffffffffff1681526020810191909152604001600020555b6104a8565b015473ffffffffffffffffffffffffffffffffffffffff166002826101008410610cb757005b0180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169190911790558061010260006002846101008610610c6257005b5061010480548201905560015b919050565b11610d1257610d25565b600061010455610d206101e3565b610106555b6101045482810110158015610d4257506101055461010454830111155b610cf6575b506000610d0356", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548210156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -338,7 +338,7 @@ "pre" : { "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461009f5780632f54bf6e146101155780635c52c2f5146101465780637065cb4814610167578063797af6271461018b578063b20d30a91461019e578063b61d27f6146101c2578063ba51a6df146101ec578063cbf0b0c014610210578063f00d4b5d146102345761025d60003411610263576102a8565b6102aa6004356000604060003680828437820191505060409003604020610582815b73ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054818283838514610af6575b60008681526101036020526040812080549094509092508214610afb57610b07565b6102b06004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6102ba60406000368082843782019150506040900360402061062d816100c1565b6102c0600435604060003680828437820191505060409003604020610472816100c1565b6102c66004355b6000816108c7816100c1565b6102d060043560406000368082843782019150506040900360402061061a816100c1565b6102d6600435602435606460443560006106ce84600061010660005054610d085b62015180420490565b6102e0600435604060003680828437820191505060409003604020610606816100c1565b6102e6600435604060003680828437820191505060409003604020610636816100c1565b6102ec6004356024356000604060003680828437820191505060409003604020610387816100c1565b60006000f35b73ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b60006000f35b8060005260206000f35b60006000f35b60006000f35b8060005260206000f35b60006000f35b8060005260206000f35b60006000f35b60006000f35b60006000f35b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b61039057610380565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082146103c9575b6103cf8361011c565b50610382565b6103e3575b8260028361010085106102f257005b50610382565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b61047b5761046d565b6104848261011c565b61049a575b60015460fa9010156104a0576104cf565b5061046f565b6104cd600060015b600154811015610b43575b60015481108015610b8257506002816101008310610b6557005b505b60015460fa9010156104f6575b60018054810190819055829060029061010081106103e957005b5061046f565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff8316600081815261010260209081526040808320929092559181527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9190a15b505b5050565b61058b5761057c565b73ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082146105cb575b600060028361010085106104fc57005b5061057e565b600082905560408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15b5050565b6105d157610602565b6101058290555b5050565b61060f57610616565b6000610104555b50565b6106235761062a565b61063f575b5050565b8173ffffffffffffffffffffffffffffffffffffffff16ff5b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e08686878984378201915050915050604090036040a15b5b949350505050565b610711575b6040600036808284379091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc00160402091506107ba905081610192565b73ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c08686878984378201915050915050604090036040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f16107ae57005b50600091506106c69050565b1580156107ea57506000818152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b6107f3576106c5565b600081815261010760209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f0191909104810190849086861561087a579182015b8281111561087957823582600050559160200191906001019061085b565b5b5090505b80821115610658576000815560010161087e565b6000838152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff1614156108d0575b5b505b919050565b610892576108c0565b600083815261010760205260408120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff909216939182918391801561093357820191906000526020600020905b81548152906001019060200180831161091f575b5050600084866185025a03f161094557005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101076020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109e357820191906000526020600020905b8154815290600101906020018083116109cf575b5050915050604090036040a1600083815261010760209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f909101048101905b80821115610a5d5760008155600101610a49565b5050505060019150506108c2565b73ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115610b215782547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b5b50505050919050565b610aed565b60008054845560018401555b506001820154600284900a908116600014610a6b57610aec565b6000868152610103602052604081208181556001908101919091559450610aed565b5090565b5b60018054118015610bc857506001546002906101008110610bac57005b015473ffffffffffffffffffffffffffffffffffffffff16600014155b15610b47576001016104b3565b60015481108015610c1757506001546002906101008110610bfa57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b15610b8f57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019055610b48565b015473ffffffffffffffffffffffffffffffffffffffff16600014155b8015610c4857506002816101008310610c2c57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b610c5157610c8c565b6001546002906101008110610c9157005b015473ffffffffffffffffffffffffffffffffffffffff1681526020810191909152604001600020555b6104a8565b015473ffffffffffffffffffffffffffffffffffffffff166002826101008410610cb757005b0180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169190911790558061010260006002846101008610610c6257005b5061010480548201905560015b919050565b11610d1257610d25565b600061010455610d206101e3565b610106555b6101045482810110158015610d4257506101055461010454830111155b610cf6575b506000610d0356", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548210156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -378,7 +378,7 @@ "pre" : { "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461009f5780632f54bf6e146101155780635c52c2f5146101465780637065cb4814610167578063797af6271461018b578063b20d30a91461019e578063b61d27f6146101c2578063ba51a6df146101ec578063cbf0b0c014610210578063f00d4b5d146102345761025d60003411610263576102a8565b6102aa6004356000604060003680828437820191505060409003604020610582815b73ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054818283838514610af6575b60008681526101036020526040812080549094509092508214610afb57610b07565b6102b06004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6102ba60406000368082843782019150506040900360402061062d816100c1565b6102c0600435604060003680828437820191505060409003604020610472816100c1565b6102c66004355b6000816108c7816100c1565b6102d060043560406000368082843782019150506040900360402061061a816100c1565b6102d6600435602435606460443560006106ce84600061010660005054610d085b62015180420490565b6102e0600435604060003680828437820191505060409003604020610606816100c1565b6102e6600435604060003680828437820191505060409003604020610636816100c1565b6102ec6004356024356000604060003680828437820191505060409003604020610387816100c1565b60006000f35b73ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b60006000f35b8060005260206000f35b60006000f35b60006000f35b8060005260206000f35b60006000f35b8060005260206000f35b60006000f35b60006000f35b60006000f35b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b61039057610380565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082146103c9575b6103cf8361011c565b50610382565b6103e3575b8260028361010085106102f257005b50610382565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b61047b5761046d565b6104848261011c565b61049a575b60015460fa9010156104a0576104cf565b5061046f565b6104cd600060015b600154811015610b43575b60015481108015610b8257506002816101008310610b6557005b505b60015460fa9010156104f6575b60018054810190819055829060029061010081106103e957005b5061046f565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff8316600081815261010260209081526040808320929092559181527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9190a15b505b5050565b61058b5761057c565b73ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082146105cb575b600060028361010085106104fc57005b5061057e565b600082905560408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15b5050565b6105d157610602565b6101058290555b5050565b61060f57610616565b6000610104555b50565b6106235761062a565b61063f575b5050565b8173ffffffffffffffffffffffffffffffffffffffff16ff5b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e08686878984378201915050915050604090036040a15b5b949350505050565b610711575b6040600036808284379091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc00160402091506107ba905081610192565b73ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c08686878984378201915050915050604090036040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f16107ae57005b50600091506106c69050565b1580156107ea57506000818152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b6107f3576106c5565b600081815261010760209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f0191909104810190849086861561087a579182015b8281111561087957823582600050559160200191906001019061085b565b5b5090505b80821115610658576000815560010161087e565b6000838152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff1614156108d0575b5b505b919050565b610892576108c0565b600083815261010760205260408120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff909216939182918391801561093357820191906000526020600020905b81548152906001019060200180831161091f575b5050600084866185025a03f161094557005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101076020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109e357820191906000526020600020905b8154815290600101906020018083116109cf575b5050915050604090036040a1600083815261010760209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f909101048101905b80821115610a5d5760008155600101610a49565b5050505060019150506108c2565b73ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115610b215782547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b5b50505050919050565b610aed565b60008054845560018401555b506001820154600284900a908116600014610a6b57610aec565b6000868152610103602052604081208181556001908101919091559450610aed565b5090565b5b60018054118015610bc857506001546002906101008110610bac57005b015473ffffffffffffffffffffffffffffffffffffffff16600014155b15610b47576001016104b3565b60015481108015610c1757506001546002906101008110610bfa57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b15610b8f57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019055610b48565b015473ffffffffffffffffffffffffffffffffffffffff16600014155b8015610c4857506002816101008310610c2c57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b610c5157610c8c565b6001546002906101008110610c9157005b015473ffffffffffffffffffffffffffffffffffffffff1681526020810191909152604001600020555b6104a8565b015473ffffffffffffffffffffffffffffffffffffffff166002826101008410610cb757005b0180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169190911790558061010260006002846101008610610c6257005b5061010480548201905560015b919050565b11610d1257610d25565b600061010455610d206101e3565b610106555b6101045482810110158015610d4257506101055461010454830111155b610cf6575b506000610d0356", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548210156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -425,7 +425,7 @@ "pre" : { "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461009f5780632f54bf6e146101155780635c52c2f5146101465780637065cb4814610167578063797af6271461018b578063b20d30a91461019e578063b61d27f6146101c2578063ba51a6df146101ec578063cbf0b0c014610210578063f00d4b5d146102345761025d60003411610263576102a8565b6102aa6004356000604060003680828437820191505060409003604020610582815b73ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054818283838514610af6575b60008681526101036020526040812080549094509092508214610afb57610b07565b6102b06004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6102ba60406000368082843782019150506040900360402061062d816100c1565b6102c0600435604060003680828437820191505060409003604020610472816100c1565b6102c66004355b6000816108c7816100c1565b6102d060043560406000368082843782019150506040900360402061061a816100c1565b6102d6600435602435606460443560006106ce84600061010660005054610d085b62015180420490565b6102e0600435604060003680828437820191505060409003604020610606816100c1565b6102e6600435604060003680828437820191505060409003604020610636816100c1565b6102ec6004356024356000604060003680828437820191505060409003604020610387816100c1565b60006000f35b73ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b60006000f35b8060005260206000f35b60006000f35b60006000f35b8060005260206000f35b60006000f35b8060005260206000f35b60006000f35b60006000f35b60006000f35b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b61039057610380565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082146103c9575b6103cf8361011c565b50610382565b6103e3575b8260028361010085106102f257005b50610382565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b61047b5761046d565b6104848261011c565b61049a575b60015460fa9010156104a0576104cf565b5061046f565b6104cd600060015b600154811015610b43575b60015481108015610b8257506002816101008310610b6557005b505b60015460fa9010156104f6575b60018054810190819055829060029061010081106103e957005b5061046f565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff8316600081815261010260209081526040808320929092559181527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9190a15b505b5050565b61058b5761057c565b73ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082146105cb575b600060028361010085106104fc57005b5061057e565b600082905560408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15b5050565b6105d157610602565b6101058290555b5050565b61060f57610616565b6000610104555b50565b6106235761062a565b61063f575b5050565b8173ffffffffffffffffffffffffffffffffffffffff16ff5b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e08686878984378201915050915050604090036040a15b5b949350505050565b610711575b6040600036808284379091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc00160402091506107ba905081610192565b73ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c08686878984378201915050915050604090036040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f16107ae57005b50600091506106c69050565b1580156107ea57506000818152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b6107f3576106c5565b600081815261010760209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f0191909104810190849086861561087a579182015b8281111561087957823582600050559160200191906001019061085b565b5b5090505b80821115610658576000815560010161087e565b6000838152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff1614156108d0575b5b505b919050565b610892576108c0565b600083815261010760205260408120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff909216939182918391801561093357820191906000526020600020905b81548152906001019060200180831161091f575b5050600084866185025a03f161094557005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101076020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109e357820191906000526020600020905b8154815290600101906020018083116109cf575b5050915050604090036040a1600083815261010760209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f909101048101905b80821115610a5d5760008155600101610a49565b5050505060019150506108c2565b73ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115610b215782547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b5b50505050919050565b610aed565b60008054845560018401555b506001820154600284900a908116600014610a6b57610aec565b6000868152610103602052604081208181556001908101919091559450610aed565b5090565b5b60018054118015610bc857506001546002906101008110610bac57005b015473ffffffffffffffffffffffffffffffffffffffff16600014155b15610b47576001016104b3565b60015481108015610c1757506001546002906101008110610bfa57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b15610b8f57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019055610b48565b015473ffffffffffffffffffffffffffffffffffffffff16600014155b8015610c4857506002816101008310610c2c57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b610c5157610c8c565b6001546002906101008110610c9157005b015473ffffffffffffffffffffffffffffffffffffffff1681526020810191909152604001600020555b6104a8565b015473ffffffffffffffffffffffffffffffffffffffff166002826101008410610cb757005b0180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169190911790558061010260006002846101008610610c6257005b5061010480548201905560015b919050565b11610d1257610d25565b600061010455610d206101e3565b610106555b6101045482810110158015610d4257506101055461010454830111155b610cf6575b506000610d0356", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548210156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -465,7 +465,7 @@ "pre" : { "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461009f5780632f54bf6e146101155780635c52c2f5146101465780637065cb4814610167578063797af6271461018b578063b20d30a91461019e578063b61d27f6146101c2578063ba51a6df146101ec578063cbf0b0c014610210578063f00d4b5d146102345761025d60003411610263576102a8565b6102aa6004356000604060003680828437820191505060409003604020610582815b73ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054818283838514610af6575b60008681526101036020526040812080549094509092508214610afb57610b07565b6102b06004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6102ba60406000368082843782019150506040900360402061062d816100c1565b6102c0600435604060003680828437820191505060409003604020610472816100c1565b6102c66004355b6000816108c7816100c1565b6102d060043560406000368082843782019150506040900360402061061a816100c1565b6102d6600435602435606460443560006106ce84600061010660005054610d085b62015180420490565b6102e0600435604060003680828437820191505060409003604020610606816100c1565b6102e6600435604060003680828437820191505060409003604020610636816100c1565b6102ec6004356024356000604060003680828437820191505060409003604020610387816100c1565b60006000f35b73ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b60006000f35b8060005260206000f35b60006000f35b60006000f35b8060005260206000f35b60006000f35b8060005260206000f35b60006000f35b60006000f35b60006000f35b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b61039057610380565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082146103c9575b6103cf8361011c565b50610382565b6103e3575b8260028361010085106102f257005b50610382565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b61047b5761046d565b6104848261011c565b61049a575b60015460fa9010156104a0576104cf565b5061046f565b6104cd600060015b600154811015610b43575b60015481108015610b8257506002816101008310610b6557005b505b60015460fa9010156104f6575b60018054810190819055829060029061010081106103e957005b5061046f565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff8316600081815261010260209081526040808320929092559181527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9190a15b505b5050565b61058b5761057c565b73ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082146105cb575b600060028361010085106104fc57005b5061057e565b600082905560408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15b5050565b6105d157610602565b6101058290555b5050565b61060f57610616565b6000610104555b50565b6106235761062a565b61063f575b5050565b8173ffffffffffffffffffffffffffffffffffffffff16ff5b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e08686878984378201915050915050604090036040a15b5b949350505050565b610711575b6040600036808284379091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc00160402091506107ba905081610192565b73ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c08686878984378201915050915050604090036040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f16107ae57005b50600091506106c69050565b1580156107ea57506000818152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b6107f3576106c5565b600081815261010760209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f0191909104810190849086861561087a579182015b8281111561087957823582600050559160200191906001019061085b565b5b5090505b80821115610658576000815560010161087e565b6000838152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff1614156108d0575b5b505b919050565b610892576108c0565b600083815261010760205260408120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff909216939182918391801561093357820191906000526020600020905b81548152906001019060200180831161091f575b5050600084866185025a03f161094557005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101076020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109e357820191906000526020600020905b8154815290600101906020018083116109cf575b5050915050604090036040a1600083815261010760209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f909101048101905b80821115610a5d5760008155600101610a49565b5050505060019150506108c2565b73ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115610b215782547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b5b50505050919050565b610aed565b60008054845560018401555b506001820154600284900a908116600014610a6b57610aec565b6000868152610103602052604081208181556001908101919091559450610aed565b5090565b5b60018054118015610bc857506001546002906101008110610bac57005b015473ffffffffffffffffffffffffffffffffffffffff16600014155b15610b47576001016104b3565b60015481108015610c1757506001546002906101008110610bfa57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b15610b8f57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019055610b48565b015473ffffffffffffffffffffffffffffffffffffffff16600014155b8015610c4857506002816101008310610c2c57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b610c5157610c8c565b6001546002906101008110610c9157005b015473ffffffffffffffffffffffffffffffffffffffff1681526020810191909152604001600020555b6104a8565b015473ffffffffffffffffffffffffffffffffffffffff166002826101008410610cb757005b0180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169190911790558061010260006002846101008610610c6257005b5061010480548201905560015b919050565b11610d1257610d25565b600061010455610d206101e3565b610106555b6101045482810110158015610d4257506101055461010454830111155b610cf6575b506000610d0356", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548210156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -505,7 +505,7 @@ "pre" : { "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461009f5780632f54bf6e146101155780635c52c2f5146101465780637065cb4814610167578063797af6271461018b578063b20d30a91461019e578063b61d27f6146101c2578063ba51a6df146101ec578063cbf0b0c014610210578063f00d4b5d146102345761025d60003411610263576102a8565b6102aa6004356000604060003680828437820191505060409003604020610582815b73ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054818283838514610af6575b60008681526101036020526040812080549094509092508214610afb57610b07565b6102b06004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6102ba60406000368082843782019150506040900360402061062d816100c1565b6102c0600435604060003680828437820191505060409003604020610472816100c1565b6102c66004355b6000816108c7816100c1565b6102d060043560406000368082843782019150506040900360402061061a816100c1565b6102d6600435602435606460443560006106ce84600061010660005054610d085b62015180420490565b6102e0600435604060003680828437820191505060409003604020610606816100c1565b6102e6600435604060003680828437820191505060409003604020610636816100c1565b6102ec6004356024356000604060003680828437820191505060409003604020610387816100c1565b60006000f35b73ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b60006000f35b8060005260206000f35b60006000f35b60006000f35b8060005260206000f35b60006000f35b8060005260206000f35b60006000f35b60006000f35b60006000f35b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b61039057610380565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082146103c9575b6103cf8361011c565b50610382565b6103e3575b8260028361010085106102f257005b50610382565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b61047b5761046d565b6104848261011c565b61049a575b60015460fa9010156104a0576104cf565b5061046f565b6104cd600060015b600154811015610b43575b60015481108015610b8257506002816101008310610b6557005b505b60015460fa9010156104f6575b60018054810190819055829060029061010081106103e957005b5061046f565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff8316600081815261010260209081526040808320929092559181527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9190a15b505b5050565b61058b5761057c565b73ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082146105cb575b600060028361010085106104fc57005b5061057e565b600082905560408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15b5050565b6105d157610602565b6101058290555b5050565b61060f57610616565b6000610104555b50565b6106235761062a565b61063f575b5050565b8173ffffffffffffffffffffffffffffffffffffffff16ff5b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e08686878984378201915050915050604090036040a15b5b949350505050565b610711575b6040600036808284379091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc00160402091506107ba905081610192565b73ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c08686878984378201915050915050604090036040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f16107ae57005b50600091506106c69050565b1580156107ea57506000818152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b6107f3576106c5565b600081815261010760209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f0191909104810190849086861561087a579182015b8281111561087957823582600050559160200191906001019061085b565b5b5090505b80821115610658576000815560010161087e565b6000838152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff1614156108d0575b5b505b919050565b610892576108c0565b600083815261010760205260408120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff909216939182918391801561093357820191906000526020600020905b81548152906001019060200180831161091f575b5050600084866185025a03f161094557005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101076020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109e357820191906000526020600020905b8154815290600101906020018083116109cf575b5050915050604090036040a1600083815261010760209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f909101048101905b80821115610a5d5760008155600101610a49565b5050505060019150506108c2565b73ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115610b215782547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b5b50505050919050565b610aed565b60008054845560018401555b506001820154600284900a908116600014610a6b57610aec565b6000868152610103602052604081208181556001908101919091559450610aed565b5090565b5b60018054118015610bc857506001546002906101008110610bac57005b015473ffffffffffffffffffffffffffffffffffffffff16600014155b15610b47576001016104b3565b60015481108015610c1757506001546002906101008110610bfa57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b15610b8f57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019055610b48565b015473ffffffffffffffffffffffffffffffffffffffff16600014155b8015610c4857506002816101008310610c2c57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b610c5157610c8c565b6001546002906101008110610c9157005b015473ffffffffffffffffffffffffffffffffffffffff1681526020810191909152604001600020555b6104a8565b015473ffffffffffffffffffffffffffffffffffffffff166002826101008410610cb757005b0180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169190911790558061010260006002846101008610610c6257005b5061010480548201905560015b919050565b11610d1257610d25565b600061010455610d206101e3565b610106555b6101045482810110158015610d4257506101055461010454830111155b610cf6575b506000610d0356", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548210156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -545,7 +545,7 @@ "pre" : { "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461009f5780632f54bf6e146101155780635c52c2f5146101465780637065cb4814610167578063797af6271461018b578063b20d30a91461019e578063b61d27f6146101c2578063ba51a6df146101ec578063cbf0b0c014610210578063f00d4b5d146102345761025d60003411610263576102a8565b6102aa6004356000604060003680828437820191505060409003604020610582815b73ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054818283838514610af6575b60008681526101036020526040812080549094509092508214610afb57610b07565b6102b06004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6102ba60406000368082843782019150506040900360402061062d816100c1565b6102c0600435604060003680828437820191505060409003604020610472816100c1565b6102c66004355b6000816108c7816100c1565b6102d060043560406000368082843782019150506040900360402061061a816100c1565b6102d6600435602435606460443560006106ce84600061010660005054610d085b62015180420490565b6102e0600435604060003680828437820191505060409003604020610606816100c1565b6102e6600435604060003680828437820191505060409003604020610636816100c1565b6102ec6004356024356000604060003680828437820191505060409003604020610387816100c1565b60006000f35b73ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b60006000f35b8060005260206000f35b60006000f35b60006000f35b8060005260206000f35b60006000f35b8060005260206000f35b60006000f35b60006000f35b60006000f35b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b61039057610380565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082146103c9575b6103cf8361011c565b50610382565b6103e3575b8260028361010085106102f257005b50610382565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b61047b5761046d565b6104848261011c565b61049a575b60015460fa9010156104a0576104cf565b5061046f565b6104cd600060015b600154811015610b43575b60015481108015610b8257506002816101008310610b6557005b505b60015460fa9010156104f6575b60018054810190819055829060029061010081106103e957005b5061046f565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff8316600081815261010260209081526040808320929092559181527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9190a15b505b5050565b61058b5761057c565b73ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082146105cb575b600060028361010085106104fc57005b5061057e565b600082905560408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15b5050565b6105d157610602565b6101058290555b5050565b61060f57610616565b6000610104555b50565b6106235761062a565b61063f575b5050565b8173ffffffffffffffffffffffffffffffffffffffff16ff5b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e08686878984378201915050915050604090036040a15b5b949350505050565b610711575b6040600036808284379091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc00160402091506107ba905081610192565b73ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c08686878984378201915050915050604090036040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f16107ae57005b50600091506106c69050565b1580156107ea57506000818152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b6107f3576106c5565b600081815261010760209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f0191909104810190849086861561087a579182015b8281111561087957823582600050559160200191906001019061085b565b5b5090505b80821115610658576000815560010161087e565b6000838152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff1614156108d0575b5b505b919050565b610892576108c0565b600083815261010760205260408120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff909216939182918391801561093357820191906000526020600020905b81548152906001019060200180831161091f575b5050600084866185025a03f161094557005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101076020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109e357820191906000526020600020905b8154815290600101906020018083116109cf575b5050915050604090036040a1600083815261010760209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f909101048101905b80821115610a5d5760008155600101610a49565b5050505060019150506108c2565b73ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115610b215782547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b5b50505050919050565b610aed565b60008054845560018401555b506001820154600284900a908116600014610a6b57610aec565b6000868152610103602052604081208181556001908101919091559450610aed565b5090565b5b60018054118015610bc857506001546002906101008110610bac57005b015473ffffffffffffffffffffffffffffffffffffffff16600014155b15610b47576001016104b3565b60015481108015610c1757506001546002906101008110610bfa57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b15610b8f57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019055610b48565b015473ffffffffffffffffffffffffffffffffffffffff16600014155b8015610c4857506002816101008310610c2c57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b610c5157610c8c565b6001546002906101008110610c9157005b015473ffffffffffffffffffffffffffffffffffffffff1681526020810191909152604001600020555b6104a8565b015473ffffffffffffffffffffffffffffffffffffffff166002826101008410610cb757005b0180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169190911790558061010260006002846101008610610c6257005b5061010480548201905560015b919050565b11610d1257610d25565b600061010455610d206101e3565b610106555b6101045482810110158015610d4257506101055461010454830111155b610cf6575b506000610d0356", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548210156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -585,7 +585,7 @@ "pre" : { "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461009f5780632f54bf6e146101155780635c52c2f5146101465780637065cb4814610167578063797af6271461018b578063b20d30a91461019e578063b61d27f6146101c2578063ba51a6df146101ec578063cbf0b0c014610210578063f00d4b5d146102345761025d60003411610263576102a8565b6102aa6004356000604060003680828437820191505060409003604020610582815b73ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054818283838514610af6575b60008681526101036020526040812080549094509092508214610afb57610b07565b6102b06004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6102ba60406000368082843782019150506040900360402061062d816100c1565b6102c0600435604060003680828437820191505060409003604020610472816100c1565b6102c66004355b6000816108c7816100c1565b6102d060043560406000368082843782019150506040900360402061061a816100c1565b6102d6600435602435606460443560006106ce84600061010660005054610d085b62015180420490565b6102e0600435604060003680828437820191505060409003604020610606816100c1565b6102e6600435604060003680828437820191505060409003604020610636816100c1565b6102ec6004356024356000604060003680828437820191505060409003604020610387816100c1565b60006000f35b73ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b60006000f35b8060005260206000f35b60006000f35b60006000f35b8060005260206000f35b60006000f35b8060005260206000f35b60006000f35b60006000f35b60006000f35b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b61039057610380565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082146103c9575b6103cf8361011c565b50610382565b6103e3575b8260028361010085106102f257005b50610382565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b61047b5761046d565b6104848261011c565b61049a575b60015460fa9010156104a0576104cf565b5061046f565b6104cd600060015b600154811015610b43575b60015481108015610b8257506002816101008310610b6557005b505b60015460fa9010156104f6575b60018054810190819055829060029061010081106103e957005b5061046f565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff8316600081815261010260209081526040808320929092559181527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9190a15b505b5050565b61058b5761057c565b73ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082146105cb575b600060028361010085106104fc57005b5061057e565b600082905560408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15b5050565b6105d157610602565b6101058290555b5050565b61060f57610616565b6000610104555b50565b6106235761062a565b61063f575b5050565b8173ffffffffffffffffffffffffffffffffffffffff16ff5b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e08686878984378201915050915050604090036040a15b5b949350505050565b610711575b6040600036808284379091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc00160402091506107ba905081610192565b73ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c08686878984378201915050915050604090036040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f16107ae57005b50600091506106c69050565b1580156107ea57506000818152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b6107f3576106c5565b600081815261010760209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f0191909104810190849086861561087a579182015b8281111561087957823582600050559160200191906001019061085b565b5b5090505b80821115610658576000815560010161087e565b6000838152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff1614156108d0575b5b505b919050565b610892576108c0565b600083815261010760205260408120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff909216939182918391801561093357820191906000526020600020905b81548152906001019060200180831161091f575b5050600084866185025a03f161094557005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101076020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109e357820191906000526020600020905b8154815290600101906020018083116109cf575b5050915050604090036040a1600083815261010760209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f909101048101905b80821115610a5d5760008155600101610a49565b5050505060019150506108c2565b73ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115610b215782547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b5b50505050919050565b610aed565b60008054845560018401555b506001820154600284900a908116600014610a6b57610aec565b6000868152610103602052604081208181556001908101919091559450610aed565b5090565b5b60018054118015610bc857506001546002906101008110610bac57005b015473ffffffffffffffffffffffffffffffffffffffff16600014155b15610b47576001016104b3565b60015481108015610c1757506001546002906101008110610bfa57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b15610b8f57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019055610b48565b015473ffffffffffffffffffffffffffffffffffffffff16600014155b8015610c4857506002816101008310610c2c57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b610c5157610c8c565b6001546002906101008110610c9157005b015473ffffffffffffffffffffffffffffffffffffffff1681526020810191909152604001600020555b6104a8565b015473ffffffffffffffffffffffffffffffffffffffff166002826101008410610cb757005b0180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169190911790558061010260006002846101008610610c6257005b5061010480548201905560015b919050565b11610d1257610d25565b600061010455610d206101e3565b610106555b6101045482810110158015610d4257506101055461010454830111155b610cf6575b506000610d0356", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548210156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -625,7 +625,7 @@ "pre" : { "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461009f5780632f54bf6e146101155780635c52c2f5146101465780637065cb4814610167578063797af6271461018b578063b20d30a91461019e578063b61d27f6146101c2578063ba51a6df146101ec578063cbf0b0c014610210578063f00d4b5d146102345761025d60003411610263576102a8565b6102aa6004356000604060003680828437820191505060409003604020610582815b73ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054818283838514610af6575b60008681526101036020526040812080549094509092508214610afb57610b07565b6102b06004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6102ba60406000368082843782019150506040900360402061062d816100c1565b6102c0600435604060003680828437820191505060409003604020610472816100c1565b6102c66004355b6000816108c7816100c1565b6102d060043560406000368082843782019150506040900360402061061a816100c1565b6102d6600435602435606460443560006106ce84600061010660005054610d085b62015180420490565b6102e0600435604060003680828437820191505060409003604020610606816100c1565b6102e6600435604060003680828437820191505060409003604020610636816100c1565b6102ec6004356024356000604060003680828437820191505060409003604020610387816100c1565b60006000f35b73ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b60006000f35b8060005260206000f35b60006000f35b60006000f35b8060005260206000f35b60006000f35b8060005260206000f35b60006000f35b60006000f35b60006000f35b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b61039057610380565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082146103c9575b6103cf8361011c565b50610382565b6103e3575b8260028361010085106102f257005b50610382565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b61047b5761046d565b6104848261011c565b61049a575b60015460fa9010156104a0576104cf565b5061046f565b6104cd600060015b600154811015610b43575b60015481108015610b8257506002816101008310610b6557005b505b60015460fa9010156104f6575b60018054810190819055829060029061010081106103e957005b5061046f565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff8316600081815261010260209081526040808320929092559181527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9190a15b505b5050565b61058b5761057c565b73ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082146105cb575b600060028361010085106104fc57005b5061057e565b600082905560408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15b5050565b6105d157610602565b6101058290555b5050565b61060f57610616565b6000610104555b50565b6106235761062a565b61063f575b5050565b8173ffffffffffffffffffffffffffffffffffffffff16ff5b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e08686878984378201915050915050604090036040a15b5b949350505050565b610711575b6040600036808284379091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc00160402091506107ba905081610192565b73ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c08686878984378201915050915050604090036040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f16107ae57005b50600091506106c69050565b1580156107ea57506000818152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b6107f3576106c5565b600081815261010760209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f0191909104810190849086861561087a579182015b8281111561087957823582600050559160200191906001019061085b565b5b5090505b80821115610658576000815560010161087e565b6000838152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff1614156108d0575b5b505b919050565b610892576108c0565b600083815261010760205260408120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff909216939182918391801561093357820191906000526020600020905b81548152906001019060200180831161091f575b5050600084866185025a03f161094557005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101076020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109e357820191906000526020600020905b8154815290600101906020018083116109cf575b5050915050604090036040a1600083815261010760209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f909101048101905b80821115610a5d5760008155600101610a49565b5050505060019150506108c2565b73ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115610b215782547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b5b50505050919050565b610aed565b60008054845560018401555b506001820154600284900a908116600014610a6b57610aec565b6000868152610103602052604081208181556001908101919091559450610aed565b5090565b5b60018054118015610bc857506001546002906101008110610bac57005b015473ffffffffffffffffffffffffffffffffffffffff16600014155b15610b47576001016104b3565b60015481108015610c1757506001546002906101008110610bfa57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b15610b8f57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019055610b48565b015473ffffffffffffffffffffffffffffffffffffffff16600014155b8015610c4857506002816101008310610c2c57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b610c5157610c8c565b6001546002906101008110610c9157005b015473ffffffffffffffffffffffffffffffffffffffff1681526020810191909152604001600020555b6104a8565b015473ffffffffffffffffffffffffffffffffffffffff166002826101008410610cb757005b0180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169190911790558061010260006002846101008610610c6257005b5061010480548201905560015b919050565b11610d1257610d25565b600061010455610d206101e3565b610106555b6101045482810110158015610d4257506101055461010454830111155b610cf6575b506000610d0356", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548210156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -653,6 +653,46 @@ } }, + "multiOwnedRevokeNothing" : { + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "256", + "currentGasLimit" : "10000000", + "currentNumber" : "0", + "currentTimestamp" : 1, + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "pre" : { + "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : { + "balance" : "0x64", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548210156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x01", + "0x01" : "0x01", + "0x03" : "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", + "0x6e369836487c234b9e553ef3f787c2d8865520739d340c67b3d251a33986e58d" : "0x01" + } + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "0x0de0b6b3a75ef08f", + "code" : "0x", + "nonce" : "0x01", + "storage" : { + } + } + }, + "transaction" : { + "data" : "0xb75c7dc66e369836487c234b9e553ef3f787c2d8865520739d340c67b3d251a33986e58d", + "gasLimit" : "10000000", + "gasPrice" : "1", + "nonce" : "1", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + }, + "dayLimitConstruction" : { "env" : { "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", @@ -672,8 +712,8 @@ } }, "transaction" : { - "data" : "0x60016000818155818055600380547fffffffffffffffffffffffff0000000000000000000000000000000000000000163390811790915573ffffffffffffffffffffffffffffffffffffffff1681526101026020526040812091909155620151804204610106556107ca90819061007690396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100705780632f54bf6e146100e65780635c52c2f5146101175780637065cb4814610138578063b20d30a91461015c578063ba51a6df14610180578063f00d4b5d146101a457005b6101cd600435600060406000368082843782019150506040900360402061048b815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548182838385146105ca575b600086815261010360205260408120805490945090925082146105cf576105db565b6101d36004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6101dd60406000368082843782019150506040900360402061053681610092565b6101e360043560406000368082843782019150506040900360402061037b81610092565b6101e960043560406000368082843782019150506040900360402061052381610092565b6101ef60043560406000368082843782019150506040900360402061050f81610092565b6101f5600435602435600060406000368082843782019150506040900360402061029081610092565b60006000f35b8060005260206000f35b60006000f35b60006000f35b60006000f35b60006000f35b60006000f35b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b61029957610289565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082146102d2575b6102d8836100ed565b5061028b565b6102ec575b8260028361010085106101fb57005b5061028b565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b61038457610376565b61038d826100ed565b6103a3575b60015460fa9010156103a9576103d8565b50610378565b6103d6600060015b600154811015610617575b600154811080156106565750600281610100831061063957005b505b60015460fa9010156103ff575b60018054810190819055829060029061010081106102f257005b50610378565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff8316600081815261010260209081526040808320929092559181527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9190a15b505b5050565b61049457610485565b73ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082146104d4575b6000600283610100851061040557005b50610487565b600082905560408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15b5050565b6104da5761050b565b6101058290555b5050565b6105185761051f565b6000610104555b50565b61052c57610533565b73ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a1825460019011156105f55782547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b5b50505050919050565b6105c1565b60008054845560018401555b506001820154600284900a90811660001461053f576105c0565b60008681526101036020526040812081815560019081019190915594506105c1565b5090565b5b6001805411801561069c5750600154600290610100811061068057005b015473ffffffffffffffffffffffffffffffffffffffff16600014155b1561061b576001016103bc565b600154811080156106eb575060015460029061010081106106ce57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b1561066357600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01905561061c565b015473ffffffffffffffffffffffffffffffffffffffff16600014155b801561071c5750600281610100831061070057005b015473ffffffffffffffffffffffffffffffffffffffff166000145b61072557610760565b600154600290610100811061076557005b015473ffffffffffffffffffffffffffffffffffffffff1681526020810191909152604001600020555b6103b1565b015473ffffffffffffffffffffffffffffffffffffffff16600282610100841061078b57005b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905580610102600060028461010086106107365700", - "gasLimit" : "0x09b335", + "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff16600381905581526101026020526040902055620151804204610107556109158061004b6000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461007b5780632f54bf6e146100cd5780635c52c2f5146100fe5780637065cb4814610118578063b20d30a914610135578063b75c7dc614610152578063ba51a6df1461018f578063f00d4b5d146101ac57005b6101ce60043560006040600036808284379091209050610472815b73ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054818080838114156105bc5761071e565b6101d46004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6101ce60406000368082843790912090506105ae81610096565b6101ce60043560406000368082843790912090506103c981610096565b6101ce60043560406000368082843790912090506105a281610096565b6101ce60043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156101de57610260565b6101ce600435604060003680828437909120905061055181610096565b6101ce600435602435600060406000368082843790912090506102d381610096565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561026057815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b156102cc576102e1836100d4565b156102ec57506102ce565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082141561032257506102ce565b6103445b6101045460005b81811015610873576101048054829081106108bb57005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061026757005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103c4576103d7826100d4565b156103e257506103c6565b6103ea610326565b60015460fa90101515610401576103ff610418565b505b60015460fa9010151561044257506103c6565b6105095b600060015b60015481101561075e575b600154811080156107ba575060028161010081106107b357005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061036957005b156102ce5773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104ad57506103c4565b60016001600050540360006000505411156104c857506103c4565b600060028361010081106104d857005b015573ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812055610414610326565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156103c45760015482101561056657506103c6565b6000829055610573610326565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b156103c4575061010655565b156103c65760006101055550565b60008681526101036020526040812080549094509092508214156106475781548355600183810183905561010480549182018082558280158290116106d3578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106d15760008155600101610626565b6000918252602090912001555b506001820154600284900a9081166000141561071e5773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156106ed57600086815261010360205261010480546040909220600201549091811061072757005b505b505050600284018190556101048054889290811061063a57005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600091825260208083209091018290558782526101039052604081208181556001818101839055600290910191909155945061071e565b5090565b01546000145b156107c757600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b600180541180156107685750600154600290610100811061076257005b0154600014155b1561079657600101610428565b600154811080156107eb575060015460029061010081106107e457005b0154600014155b80156108065750600281610100811061080057005b01546000145b1561081f57600154600290610100811061082457005b01555b61041d565b0154600282610100811061083457005b0155806101026000600283610100811061084a57005b015481526020810191909152604001600090812091909155600154600290610100811061081c57005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156102cc57600081556001016108a7565b600091825260208220015414151561090d57610104805461010391600091849081106108e357005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032d56", + "gasLimit" : "10000000", "gasPrice" : "1", "nonce" : "1", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", @@ -701,8 +741,8 @@ } }, "transaction" : { - "data" : "0x60016000818155818055600380547fffffffffffffffffffffffff0000000000000000000000000000000000000000163390811790915573ffffffffffffffffffffffffffffffffffffffff1681526101026020526040812091909155620151804204610106556107ca90819061007690396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100705780632f54bf6e146100e65780635c52c2f5146101175780637065cb4814610138578063b20d30a91461015c578063ba51a6df14610180578063f00d4b5d146101a457005b6101cd600435600060406000368082843782019150506040900360402061048b815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548182838385146105ca575b600086815261010360205260408120805490945090925082146105cf576105db565b6101d36004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6101dd60406000368082843782019150506040900360402061053681610092565b6101e360043560406000368082843782019150506040900360402061037b81610092565b6101e960043560406000368082843782019150506040900360402061052381610092565b6101ef60043560406000368082843782019150506040900360402061050f81610092565b6101f5600435602435600060406000368082843782019150506040900360402061029081610092565b60006000f35b8060005260206000f35b60006000f35b60006000f35b60006000f35b60006000f35b60006000f35b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b61029957610289565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082146102d2575b6102d8836100ed565b5061028b565b6102ec575b8260028361010085106101fb57005b5061028b565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b61038457610376565b61038d826100ed565b6103a3575b60015460fa9010156103a9576103d8565b50610378565b6103d6600060015b600154811015610617575b600154811080156106565750600281610100831061063957005b505b60015460fa9010156103ff575b60018054810190819055829060029061010081106102f257005b50610378565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff8316600081815261010260209081526040808320929092559181527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9190a15b505b5050565b61049457610485565b73ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082146104d4575b6000600283610100851061040557005b50610487565b600082905560408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15b5050565b6104da5761050b565b6101058290555b5050565b6105185761051f565b6000610104555b50565b61052c57610533565b73ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a1825460019011156105f55782547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b5b50505050919050565b6105c1565b60008054845560018401555b506001820154600284900a90811660001461053f576105c0565b60008681526101036020526040812081815560019081019190915594506105c1565b5090565b5b6001805411801561069c5750600154600290610100811061068057005b015473ffffffffffffffffffffffffffffffffffffffff16600014155b1561061b576001016103bc565b600154811080156106eb575060015460029061010081106106ce57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b1561066357600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01905561061c565b015473ffffffffffffffffffffffffffffffffffffffff16600014155b801561071c5750600281610100831061070057005b015473ffffffffffffffffffffffffffffffffffffffff166000145b61072557610760565b600154600290610100811061076557005b015473ffffffffffffffffffffffffffffffffffffffff1681526020810191909152604001600020555b6103b1565b015473ffffffffffffffffffffffffffffffffffffffff16600282610100841061078b57005b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905580610102600060028461010086106107365700", - "gasLimit" : "0x09b334", + "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff16600381905581526101026020526040902055620151804204610107556109158061004b6000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461007b5780632f54bf6e146100cd5780635c52c2f5146100fe5780637065cb4814610118578063b20d30a914610135578063b75c7dc614610152578063ba51a6df1461018f578063f00d4b5d146101ac57005b6101ce60043560006040600036808284379091209050610472815b73ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054818080838114156105bc5761071e565b6101d46004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6101ce60406000368082843790912090506105ae81610096565b6101ce60043560406000368082843790912090506103c981610096565b6101ce60043560406000368082843790912090506105a281610096565b6101ce60043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156101de57610260565b6101ce600435604060003680828437909120905061055181610096565b6101ce600435602435600060406000368082843790912090506102d381610096565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561026057815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b156102cc576102e1836100d4565b156102ec57506102ce565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082141561032257506102ce565b6103445b6101045460005b81811015610873576101048054829081106108bb57005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061026757005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103c4576103d7826100d4565b156103e257506103c6565b6103ea610326565b60015460fa90101515610401576103ff610418565b505b60015460fa9010151561044257506103c6565b6105095b600060015b60015481101561075e575b600154811080156107ba575060028161010081106107b357005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061036957005b156102ce5773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104ad57506103c4565b60016001600050540360006000505411156104c857506103c4565b600060028361010081106104d857005b015573ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812055610414610326565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156103c45760015482101561056657506103c6565b6000829055610573610326565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b156103c4575061010655565b156103c65760006101055550565b60008681526101036020526040812080549094509092508214156106475781548355600183810183905561010480549182018082558280158290116106d3578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106d15760008155600101610626565b6000918252602090912001555b506001820154600284900a9081166000141561071e5773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156106ed57600086815261010360205261010480546040909220600201549091811061072757005b505b505050600284018190556101048054889290811061063a57005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600091825260208083209091018290558782526101039052604081208181556001818101839055600290910191909155945061071e565b5090565b01546000145b156107c757600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b600180541180156107685750600154600290610100811061076257005b0154600014155b1561079657600101610428565b600154811080156107eb575060015460029061010081106107e457005b0154600014155b80156108065750600281610100811061080057005b01546000145b1561081f57600154600290610100811061082457005b01555b61041d565b0154600282610100811061083457005b0155806101026000600283610100811061084a57005b015481526020810191909152604001600090812091909155600154600290610100811061081c57005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156102cc57600081556001016108a7565b600091825260208220015414151561090d57610104805461010391600091849081106108e357005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032d56", + "gasLimit" : "0x0b5290", "gasPrice" : "1", "nonce" : "1", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", @@ -730,8 +770,8 @@ } }, "transaction" : { - "data" : "0x60016000818155818055600380547fffffffffffffffffffffffff0000000000000000000000000000000000000000163390811790915573ffffffffffffffffffffffffffffffffffffffff1681526101026020526040812091909155620151804204610106556107ca90819061007690396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100705780632f54bf6e146100e65780635c52c2f5146101175780637065cb4814610138578063b20d30a91461015c578063ba51a6df14610180578063f00d4b5d146101a457005b6101cd600435600060406000368082843782019150506040900360402061048b815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548182838385146105ca575b600086815261010360205260408120805490945090925082146105cf576105db565b6101d36004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6101dd60406000368082843782019150506040900360402061053681610092565b6101e360043560406000368082843782019150506040900360402061037b81610092565b6101e960043560406000368082843782019150506040900360402061052381610092565b6101ef60043560406000368082843782019150506040900360402061050f81610092565b6101f5600435602435600060406000368082843782019150506040900360402061029081610092565b60006000f35b8060005260206000f35b60006000f35b60006000f35b60006000f35b60006000f35b60006000f35b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b61029957610289565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082146102d2575b6102d8836100ed565b5061028b565b6102ec575b8260028361010085106101fb57005b5061028b565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b61038457610376565b61038d826100ed565b6103a3575b60015460fa9010156103a9576103d8565b50610378565b6103d6600060015b600154811015610617575b600154811080156106565750600281610100831061063957005b505b60015460fa9010156103ff575b60018054810190819055829060029061010081106102f257005b50610378565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff8316600081815261010260209081526040808320929092559181527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9190a15b505b5050565b61049457610485565b73ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082146104d4575b6000600283610100851061040557005b50610487565b600082905560408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15b5050565b6104da5761050b565b6101058290555b5050565b6105185761051f565b6000610104555b50565b61052c57610533565b73ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a1825460019011156105f55782547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b5b50505050919050565b6105c1565b60008054845560018401555b506001820154600284900a90811660001461053f576105c0565b60008681526101036020526040812081815560019081019190915594506105c1565b5090565b5b6001805411801561069c5750600154600290610100811061068057005b015473ffffffffffffffffffffffffffffffffffffffff16600014155b1561061b576001016103bc565b600154811080156106eb575060015460029061010081106106ce57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b1561066357600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01905561061c565b015473ffffffffffffffffffffffffffffffffffffffff16600014155b801561071c5750600281610100831061070057005b015473ffffffffffffffffffffffffffffffffffffffff166000145b61072557610760565b600154600290610100811061076557005b015473ffffffffffffffffffffffffffffffffffffffff1681526020810191909152604001600020555b6103b1565b015473ffffffffffffffffffffffffffffffffffffffff16600282610100841061078b57005b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905580610102600060028461010086106107365700", - "gasLimit" : "0x03d7fc", + "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff16600381905581526101026020526040902055620151804204610107556109158061004b6000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461007b5780632f54bf6e146100cd5780635c52c2f5146100fe5780637065cb4814610118578063b20d30a914610135578063b75c7dc614610152578063ba51a6df1461018f578063f00d4b5d146101ac57005b6101ce60043560006040600036808284379091209050610472815b73ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054818080838114156105bc5761071e565b6101d46004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6101ce60406000368082843790912090506105ae81610096565b6101ce60043560406000368082843790912090506103c981610096565b6101ce60043560406000368082843790912090506105a281610096565b6101ce60043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156101de57610260565b6101ce600435604060003680828437909120905061055181610096565b6101ce600435602435600060406000368082843790912090506102d381610096565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561026057815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b156102cc576102e1836100d4565b156102ec57506102ce565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082141561032257506102ce565b6103445b6101045460005b81811015610873576101048054829081106108bb57005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061026757005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103c4576103d7826100d4565b156103e257506103c6565b6103ea610326565b60015460fa90101515610401576103ff610418565b505b60015460fa9010151561044257506103c6565b6105095b600060015b60015481101561075e575b600154811080156107ba575060028161010081106107b357005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061036957005b156102ce5773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104ad57506103c4565b60016001600050540360006000505411156104c857506103c4565b600060028361010081106104d857005b015573ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812055610414610326565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156103c45760015482101561056657506103c6565b6000829055610573610326565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b156103c4575061010655565b156103c65760006101055550565b60008681526101036020526040812080549094509092508214156106475781548355600183810183905561010480549182018082558280158290116106d3578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106d15760008155600101610626565b6000918252602090912001555b506001820154600284900a9081166000141561071e5773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156106ed57600086815261010360205261010480546040909220600201549091811061072757005b505b505050600284018190556101048054889290811061063a57005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600091825260208083209091018290558782526101039052604081208181556001818101839055600290910191909155945061071e565b5090565b01546000145b156107c757600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b600180541180156107685750600154600290610100811061076257005b0154600014155b1561079657600101610428565b600154811080156107eb575060015460029061010081106107e457005b0154600014155b80156108065750600281610100811061080057005b01546000145b1561081f57600154600290610100811061082457005b01555b61041d565b0154600282610100811061083457005b0155806101026000600283610100811061084a57005b015481526020810191909152604001600090812091909155600154600290610100811061081c57005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156102cc57600081556001016108a7565b600091825260208220015414151561090d57610104805461010391600091849081106108e357005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032d56", + "gasLimit" : "0x043a28", "gasPrice" : "1", "nonce" : "1", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", @@ -759,7 +799,7 @@ }, "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100705780632f54bf6e146100e65780635c52c2f5146101175780637065cb4814610138578063b20d30a91461015c578063ba51a6df14610180578063f00d4b5d146101a457005b6101cd600435600060406000368082843782019150506040900360402061048b815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548182838385146105ca575b600086815261010360205260408120805490945090925082146105cf576105db565b6101d36004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6101dd60406000368082843782019150506040900360402061053681610092565b6101e360043560406000368082843782019150506040900360402061037b81610092565b6101e960043560406000368082843782019150506040900360402061052381610092565b6101ef60043560406000368082843782019150506040900360402061050f81610092565b6101f5600435602435600060406000368082843782019150506040900360402061029081610092565b60006000f35b8060005260206000f35b60006000f35b60006000f35b60006000f35b60006000f35b60006000f35b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b61029957610289565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082146102d2575b6102d8836100ed565b5061028b565b6102ec575b8260028361010085106101fb57005b5061028b565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b61038457610376565b61038d826100ed565b6103a3575b60015460fa9010156103a9576103d8565b50610378565b6103d6600060015b600154811015610617575b600154811080156106565750600281610100831061063957005b505b60015460fa9010156103ff575b60018054810190819055829060029061010081106102f257005b50610378565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff8316600081815261010260209081526040808320929092559181527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9190a15b505b5050565b61049457610485565b73ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082146104d4575b6000600283610100851061040557005b50610487565b600082905560408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15b5050565b6104da5761050b565b6101058290555b5050565b6105185761051f565b6000610104555b50565b61052c57610533565b73ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a1825460019011156105f55782547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b5b50505050919050565b6105c1565b60008054845560018401555b506001820154600284900a90811660001461053f576105c0565b60008681526101036020526040812081815560019081019190915594506105c1565b5090565b5b6001805411801561069c5750600154600290610100811061068057005b015473ffffffffffffffffffffffffffffffffffffffff16600014155b1561061b576001016103bc565b600154811080156106eb575060015460029061010081106106ce57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b1561066357600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01905561061c565b015473ffffffffffffffffffffffffffffffffffffffff16600014155b801561071c5750600281610100831061070057005b015473ffffffffffffffffffffffffffffffffffffffff166000145b61072557610760565b600154600290610100811061076557005b015473ffffffffffffffffffffffffffffffffffffffff1681526020810191909152604001600020555b6103b1565b015473ffffffffffffffffffffffffffffffffffffffff16600282610100841061078b57005b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905580610102600060028461010086106107365700", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461007b5780632f54bf6e146100cd5780635c52c2f5146100fe5780637065cb4814610118578063b20d30a914610135578063b75c7dc614610152578063ba51a6df1461018f578063f00d4b5d146101ac57005b6101ce60043560006040600036808284379091209050610472815b73ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054818080838114156105bc5761071e565b6101d46004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6101ce60406000368082843790912090506105ae81610096565b6101ce60043560406000368082843790912090506103c981610096565b6101ce60043560406000368082843790912090506105a281610096565b6101ce60043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156101de57610260565b6101ce600435604060003680828437909120905061055181610096565b6101ce600435602435600060406000368082843790912090506102d381610096565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561026057815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b156102cc576102e1836100d4565b156102ec57506102ce565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082141561032257506102ce565b6103445b6101045460005b81811015610873576101048054829081106108bb57005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061026757005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103c4576103d7826100d4565b156103e257506103c6565b6103ea610326565b60015460fa90101515610401576103ff610418565b505b60015460fa9010151561044257506103c6565b6105095b600060015b60015481101561075e575b600154811080156107ba575060028161010081106107b357005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061036957005b156102ce5773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104ad57506103c4565b60016001600050540360006000505411156104c857506103c4565b600060028361010081106104d857005b015573ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812055610414610326565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156103c45760015482101561056657506103c6565b6000829055610573610326565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b156103c4575061010655565b156103c65760006101055550565b60008681526101036020526040812080549094509092508214156106475781548355600183810183905561010480549182018082558280158290116106d3578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106d15760008155600101610626565b6000918252602090912001555b506001820154600284900a9081166000141561071e5773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156106ed57600086815261010360205261010480546040909220600201549091811061072757005b505b505050600284018190556101048054889290811061063a57005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600091825260208083209091018290558782526101039052604081208181556001818101839055600290910191909155945061071e565b5090565b01546000145b156107c757600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b600180541180156107685750600154600290610100811061076257005b0154600014155b1561079657600101610428565b600154811080156107eb575060015460029061010081106107e457005b0154600014155b80156108065750600281610100811061080057005b01546000145b1561081f57600154600290610100811061082457005b01555b61041d565b0154600282610100811061083457005b0155806101026000600283610100811061084a57005b015481526020810191909152604001600090812091909155600154600290610100811061081c57005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156102cc57600081556001016108a7565b600091825260208220015414151561090d57610104805461010391600091849081106108e357005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032d56", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -799,7 +839,7 @@ }, "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100705780632f54bf6e146100e65780635c52c2f5146101175780637065cb4814610138578063b20d30a91461015c578063ba51a6df14610180578063f00d4b5d146101a457005b6101cd600435600060406000368082843782019150506040900360402061048b815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548182838385146105ca575b600086815261010360205260408120805490945090925082146105cf576105db565b6101d36004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6101dd60406000368082843782019150506040900360402061053681610092565b6101e360043560406000368082843782019150506040900360402061037b81610092565b6101e960043560406000368082843782019150506040900360402061052381610092565b6101ef60043560406000368082843782019150506040900360402061050f81610092565b6101f5600435602435600060406000368082843782019150506040900360402061029081610092565b60006000f35b8060005260206000f35b60006000f35b60006000f35b60006000f35b60006000f35b60006000f35b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b61029957610289565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082146102d2575b6102d8836100ed565b5061028b565b6102ec575b8260028361010085106101fb57005b5061028b565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b61038457610376565b61038d826100ed565b6103a3575b60015460fa9010156103a9576103d8565b50610378565b6103d6600060015b600154811015610617575b600154811080156106565750600281610100831061063957005b505b60015460fa9010156103ff575b60018054810190819055829060029061010081106102f257005b50610378565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff8316600081815261010260209081526040808320929092559181527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9190a15b505b5050565b61049457610485565b73ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082146104d4575b6000600283610100851061040557005b50610487565b600082905560408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15b5050565b6104da5761050b565b6101058290555b5050565b6105185761051f565b6000610104555b50565b61052c57610533565b73ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a1825460019011156105f55782547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b5b50505050919050565b6105c1565b60008054845560018401555b506001820154600284900a90811660001461053f576105c0565b60008681526101036020526040812081815560019081019190915594506105c1565b5090565b5b6001805411801561069c5750600154600290610100811061068057005b015473ffffffffffffffffffffffffffffffffffffffff16600014155b1561061b576001016103bc565b600154811080156106eb575060015460029061010081106106ce57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b1561066357600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01905561061c565b015473ffffffffffffffffffffffffffffffffffffffff16600014155b801561071c5750600281610100831061070057005b015473ffffffffffffffffffffffffffffffffffffffff166000145b61072557610760565b600154600290610100811061076557005b015473ffffffffffffffffffffffffffffffffffffffff1681526020810191909152604001600020555b6103b1565b015473ffffffffffffffffffffffffffffffffffffffff16600282610100841061078b57005b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905580610102600060028461010086106107365700", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461007b5780632f54bf6e146100cd5780635c52c2f5146100fe5780637065cb4814610118578063b20d30a914610135578063b75c7dc614610152578063ba51a6df1461018f578063f00d4b5d146101ac57005b6101ce60043560006040600036808284379091209050610472815b73ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054818080838114156105bc5761071e565b6101d46004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6101ce60406000368082843790912090506105ae81610096565b6101ce60043560406000368082843790912090506103c981610096565b6101ce60043560406000368082843790912090506105a281610096565b6101ce60043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156101de57610260565b6101ce600435604060003680828437909120905061055181610096565b6101ce600435602435600060406000368082843790912090506102d381610096565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561026057815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b156102cc576102e1836100d4565b156102ec57506102ce565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082141561032257506102ce565b6103445b6101045460005b81811015610873576101048054829081106108bb57005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061026757005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103c4576103d7826100d4565b156103e257506103c6565b6103ea610326565b60015460fa90101515610401576103ff610418565b505b60015460fa9010151561044257506103c6565b6105095b600060015b60015481101561075e575b600154811080156107ba575060028161010081106107b357005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061036957005b156102ce5773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104ad57506103c4565b60016001600050540360006000505411156104c857506103c4565b600060028361010081106104d857005b015573ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812055610414610326565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156103c45760015482101561056657506103c6565b6000829055610573610326565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b156103c4575061010655565b156103c65760006101055550565b60008681526101036020526040812080549094509092508214156106475781548355600183810183905561010480549182018082558280158290116106d3578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106d15760008155600101610626565b6000918252602090912001555b506001820154600284900a9081166000141561071e5773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156106ed57600086815261010360205261010480546040909220600201549091811061072757005b505b505050600284018190556101048054889290811061063a57005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600091825260208083209091018290558782526101039052604081208181556001818101839055600290910191909155945061071e565b5090565b01546000145b156107c757600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b600180541180156107685750600154600290610100811061076257005b0154600014155b1561079657600101610428565b600154811080156107eb575060015460029061010081106107e457005b0154600014155b80156108065750600281610100811061080057005b01546000145b1561081f57600154600290610100811061082457005b01555b61041d565b0154600282610100811061083457005b0155806101026000600283610100811061084a57005b015481526020810191909152604001600090812091909155600154600290610100811061081c57005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156102cc57600081556001016108a7565b600091825260208220015414151561090d57610104805461010391600091849081106108e357005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032d56", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -839,7 +879,7 @@ }, "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100705780632f54bf6e146100e65780635c52c2f5146101175780637065cb4814610138578063b20d30a91461015c578063ba51a6df14610180578063f00d4b5d146101a457005b6101cd600435600060406000368082843782019150506040900360402061048b815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548182838385146105ca575b600086815261010360205260408120805490945090925082146105cf576105db565b6101d36004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6101dd60406000368082843782019150506040900360402061053681610092565b6101e360043560406000368082843782019150506040900360402061037b81610092565b6101e960043560406000368082843782019150506040900360402061052381610092565b6101ef60043560406000368082843782019150506040900360402061050f81610092565b6101f5600435602435600060406000368082843782019150506040900360402061029081610092565b60006000f35b8060005260206000f35b60006000f35b60006000f35b60006000f35b60006000f35b60006000f35b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b61029957610289565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082146102d2575b6102d8836100ed565b5061028b565b6102ec575b8260028361010085106101fb57005b5061028b565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b61038457610376565b61038d826100ed565b6103a3575b60015460fa9010156103a9576103d8565b50610378565b6103d6600060015b600154811015610617575b600154811080156106565750600281610100831061063957005b505b60015460fa9010156103ff575b60018054810190819055829060029061010081106102f257005b50610378565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff8316600081815261010260209081526040808320929092559181527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9190a15b505b5050565b61049457610485565b73ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082146104d4575b6000600283610100851061040557005b50610487565b600082905560408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15b5050565b6104da5761050b565b6101058290555b5050565b6105185761051f565b6000610104555b50565b61052c57610533565b73ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a1825460019011156105f55782547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b5b50505050919050565b6105c1565b60008054845560018401555b506001820154600284900a90811660001461053f576105c0565b60008681526101036020526040812081815560019081019190915594506105c1565b5090565b5b6001805411801561069c5750600154600290610100811061068057005b015473ffffffffffffffffffffffffffffffffffffffff16600014155b1561061b576001016103bc565b600154811080156106eb575060015460029061010081106106ce57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b1561066357600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff01905561061c565b015473ffffffffffffffffffffffffffffffffffffffff16600014155b801561071c5750600281610100831061070057005b015473ffffffffffffffffffffffffffffffffffffffff166000145b61072557610760565b600154600290610100811061076557005b015473ffffffffffffffffffffffffffffffffffffffff1681526020810191909152604001600020555b6103b1565b015473ffffffffffffffffffffffffffffffffffffffff16600282610100841061078b57005b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905580610102600060028461010086106107365700", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461007b5780632f54bf6e146100cd5780635c52c2f5146100fe5780637065cb4814610118578063b20d30a914610135578063b75c7dc614610152578063ba51a6df1461018f578063f00d4b5d146101ac57005b6101ce60043560006040600036808284379091209050610472815b73ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054818080838114156105bc5761071e565b6101d46004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6101ce60406000368082843790912090506105ae81610096565b6101ce60043560406000368082843790912090506103c981610096565b6101ce60043560406000368082843790912090506105a281610096565b6101ce60043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156101de57610260565b6101ce600435604060003680828437909120905061055181610096565b6101ce600435602435600060406000368082843790912090506102d381610096565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561026057815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b156102cc576102e1836100d4565b156102ec57506102ce565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082141561032257506102ce565b6103445b6101045460005b81811015610873576101048054829081106108bb57005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061026757005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103c4576103d7826100d4565b156103e257506103c6565b6103ea610326565b60015460fa90101515610401576103ff610418565b505b60015460fa9010151561044257506103c6565b6105095b600060015b60015481101561075e575b600154811080156107ba575060028161010081106107b357005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061036957005b156102ce5773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104ad57506103c4565b60016001600050540360006000505411156104c857506103c4565b600060028361010081106104d857005b015573ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812055610414610326565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156103c45760015482101561056657506103c6565b6000829055610573610326565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b156103c4575061010655565b156103c65760006101055550565b60008681526101036020526040812080549094509092508214156106475781548355600183810183905561010480549182018082558280158290116106d3578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106d15760008155600101610626565b6000918252602090912001555b506001820154600284900a9081166000141561071e5773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156106ed57600086815261010360205261010480546040909220600201549091811061072757005b505b505050600284018190556101048054889290811061063a57005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600091825260208083209091018290558782526101039052604081208181556001818101839055600290910191909155945061071e565b5090565b01546000145b156107c757600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b600180541180156107685750600154600290610100811061076257005b0154600014155b1561079657600101610428565b600154811080156107eb575060015460029061010081106107e457005b0154600014155b80156108065750600281610100811061080057005b01546000145b1561081f57600154600290610100811061082457005b01555b61041d565b0154600282610100811061083457005b0155806101026000600283610100811061084a57005b015481526020810191909152604001600090812091909155600154600290610100811061081c57005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156102cc57600081556001016108a7565b600091825260208220015414151561090d57610104805461010391600091849081106108e357005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032d56", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -881,8 +921,8 @@ } }, "transaction" : { - "data" : "0x60016000818155818055600380547fffffffffffffffffffffffff0000000000000000000000000000000000000000163390811790915573ffffffffffffffffffffffffffffffffffffffff168152610102602052604080822092909255620151804204610106557f9adeddf84386b336eb7b3e18e7a6099be08fd81ea5d5142f4d2b630f8d20cf0191a1610d4f806100996000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461009f5780632f54bf6e146101155780635c52c2f5146101465780637065cb4814610167578063797af6271461018b578063b20d30a91461019e578063b61d27f6146101c2578063ba51a6df146101ec578063cbf0b0c014610210578063f00d4b5d146102345761025d60003411610263576102a8565b6102aa6004356000604060003680828437820191505060409003604020610582815b73ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054818283838514610af6575b60008681526101036020526040812080549094509092508214610afb57610b07565b6102b06004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6102ba60406000368082843782019150506040900360402061062d816100c1565b6102c0600435604060003680828437820191505060409003604020610472816100c1565b6102c66004355b6000816108c7816100c1565b6102d060043560406000368082843782019150506040900360402061061a816100c1565b6102d6600435602435606460443560006106ce84600061010660005054610d085b62015180420490565b6102e0600435604060003680828437820191505060409003604020610606816100c1565b6102e6600435604060003680828437820191505060409003604020610636816100c1565b6102ec6004356024356000604060003680828437820191505060409003604020610387816100c1565b60006000f35b73ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b60006000f35b8060005260206000f35b60006000f35b60006000f35b8060005260206000f35b60006000f35b8060005260206000f35b60006000f35b60006000f35b60006000f35b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b61039057610380565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082146103c9575b6103cf8361011c565b50610382565b6103e3575b8260028361010085106102f257005b50610382565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b61047b5761046d565b6104848261011c565b61049a575b60015460fa9010156104a0576104cf565b5061046f565b6104cd600060015b600154811015610b43575b60015481108015610b8257506002816101008310610b6557005b505b60015460fa9010156104f6575b60018054810190819055829060029061010081106103e957005b5061046f565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff8316600081815261010260209081526040808320929092559181527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9190a15b505b5050565b61058b5761057c565b73ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082146105cb575b600060028361010085106104fc57005b5061057e565b600082905560408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15b5050565b6105d157610602565b6101058290555b5050565b61060f57610616565b6000610104555b50565b6106235761062a565b61063f575b5050565b8173ffffffffffffffffffffffffffffffffffffffff16ff5b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e08686878984378201915050915050604090036040a15b5b949350505050565b610711575b6040600036808284379091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc00160402091506107ba905081610192565b73ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c08686878984378201915050915050604090036040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f16107ae57005b50600091506106c69050565b1580156107ea57506000818152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b6107f3576106c5565b600081815261010760209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f0191909104810190849086861561087a579182015b8281111561087957823582600050559160200191906001019061085b565b5b5090505b80821115610658576000815560010161087e565b6000838152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff1614156108d0575b5b505b919050565b610892576108c0565b600083815261010760205260408120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff909216939182918391801561093357820191906000526020600020905b81548152906001019060200180831161091f575b5050600084866185025a03f161094557005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101076020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109e357820191906000526020600020905b8154815290600101906020018083116109cf575b5050915050604090036040a1600083815261010760209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f909101048101905b80821115610a5d5760008155600101610a49565b5050505060019150506108c2565b73ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115610b215782547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b5b50505050919050565b610aed565b60008054845560018401555b506001820154600284900a908116600014610a6b57610aec565b6000868152610103602052604081208181556001908101919091559450610aed565b5090565b5b60018054118015610bc857506001546002906101008110610bac57005b015473ffffffffffffffffffffffffffffffffffffffff16600014155b15610b47576001016104b3565b60015481108015610c1757506001546002906101008110610bfa57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b15610b8f57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019055610b48565b015473ffffffffffffffffffffffffffffffffffffffff16600014155b8015610c4857506002816101008310610c2c57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b610c5157610c8c565b6001546002906101008110610c9157005b015473ffffffffffffffffffffffffffffffffffffffff1681526020810191909152604001600020555b6104a8565b015473ffffffffffffffffffffffffffffffffffffffff166002826101008410610cb757005b0180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169190911790558061010260006002846101008610610c6257005b5061010480548201905560015b919050565b11610d1257610d25565b600061010455610d206101e3565b610106555b6101045482810110158015610d4257506101055461010454830111155b610cf6575b506000610d0356", - "gasLimit" : "0x0faf5d", + "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff16600381905581526101026020526040902055620151804204610107557f9adeddf84386b336eb7b3e18e7a6099be08fd81ea5d5142f4d2b630f8d20cf0160006040a1610e39806100716000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b6102976004356000604060003680828437909120905061053b815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610a7557610bd7565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061067781610108565b610297600435604060003680828437909120905061049281610108565b61029d6004355b6000816108b481610108565b610297600435604060003680828437909120905061066b81610108565b61029d6004803590602480359160443591820191013560006106a3846000610dce33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156102a757610329565b610297600435604060003680828437909120905061061a81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061039c81610108565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561032957815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b15610395576103aa83610146565b156103b55750610397565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156103eb5750610397565b61040d5b6101045460005b81811015610d2c57610104805482908110610d7457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061033057005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b1561048d576104a082610146565b156104ab575061048f565b6104b36103ef565b60015460fa901015156104ca576104c86104e1565b505b60015460fa9010151561050b575061048f565b6105d25b600060015b600154811015610c17575b60015481108015610c7357506002816101008110610c6c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061043257005b156103975773ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120549250821415610576575061048d565b6001600160005054036000600050541115610591575061048d565b600060028361010081106105a157005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556104dd6103ef565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b1561048d5760015482101561062f575061048f565b600082905561063c6103ef565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b1561048d575061010655565b1561048f5760006101055550565b1561048d578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b6000868152610103602052604081208054909450909250821415610b00578154835560018381018390556101048054918201808255828015829011610b8c578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610b8a5760008155600101610adf565b6000918252602090912001555b506001820154600284900a90811660001415610bd75773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610ba6576000868152610103602052610104805460409092206002015490918110610be057005b505b5050506002840181905561010480548892908110610af357005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610bd7565b5090565b01546000145b15610c8057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610c2157506001546002906101008110610c1b57005b0154600014155b15610c4f576001016104f1565b60015481108015610ca457506001546002906101008110610c9d57005b0154600014155b8015610cbf57506002816101008110610cb957005b01546000145b15610cd8576001546002906101008110610cdd57005b01555b6104e6565b01546002826101008110610ced57005b01558061010260006002836101008110610d0357005b0154815260208101919091526040016000908120919091556001546002906101008110610cd557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156103955760008155600101610d60565b6000918252602082200154141515610dc65761010480546101039160009184908110610d9c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016103f6565b156108af5761010754610de45b62015180420490565b1115610dfd57600061010555610df8610ddb565b610107555b6101055480830110158015610e1b5750610105546101065490830111155b15610e31575061010580548201905560016108af565b5060006108af56", + "gasLimit" : "10000000", "gasPrice" : "1", "nonce" : "1", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", @@ -910,8 +950,8 @@ } }, "transaction" : { - "data" : "0x60016000818155818055600380547fffffffffffffffffffffffff0000000000000000000000000000000000000000163390811790915573ffffffffffffffffffffffffffffffffffffffff168152610102602052604080822092909255620151804204610106557f9adeddf84386b336eb7b3e18e7a6099be08fd81ea5d5142f4d2b630f8d20cf0191a1610d4f806100996000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461009f5780632f54bf6e146101155780635c52c2f5146101465780637065cb4814610167578063797af6271461018b578063b20d30a91461019e578063b61d27f6146101c2578063ba51a6df146101ec578063cbf0b0c014610210578063f00d4b5d146102345761025d60003411610263576102a8565b6102aa6004356000604060003680828437820191505060409003604020610582815b73ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054818283838514610af6575b60008681526101036020526040812080549094509092508214610afb57610b07565b6102b06004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6102ba60406000368082843782019150506040900360402061062d816100c1565b6102c0600435604060003680828437820191505060409003604020610472816100c1565b6102c66004355b6000816108c7816100c1565b6102d060043560406000368082843782019150506040900360402061061a816100c1565b6102d6600435602435606460443560006106ce84600061010660005054610d085b62015180420490565b6102e0600435604060003680828437820191505060409003604020610606816100c1565b6102e6600435604060003680828437820191505060409003604020610636816100c1565b6102ec6004356024356000604060003680828437820191505060409003604020610387816100c1565b60006000f35b73ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b60006000f35b8060005260206000f35b60006000f35b60006000f35b8060005260206000f35b60006000f35b8060005260206000f35b60006000f35b60006000f35b60006000f35b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b61039057610380565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082146103c9575b6103cf8361011c565b50610382565b6103e3575b8260028361010085106102f257005b50610382565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b61047b5761046d565b6104848261011c565b61049a575b60015460fa9010156104a0576104cf565b5061046f565b6104cd600060015b600154811015610b43575b60015481108015610b8257506002816101008310610b6557005b505b60015460fa9010156104f6575b60018054810190819055829060029061010081106103e957005b5061046f565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff8316600081815261010260209081526040808320929092559181527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9190a15b505b5050565b61058b5761057c565b73ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082146105cb575b600060028361010085106104fc57005b5061057e565b600082905560408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15b5050565b6105d157610602565b6101058290555b5050565b61060f57610616565b6000610104555b50565b6106235761062a565b61063f575b5050565b8173ffffffffffffffffffffffffffffffffffffffff16ff5b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e08686878984378201915050915050604090036040a15b5b949350505050565b610711575b6040600036808284379091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc00160402091506107ba905081610192565b73ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c08686878984378201915050915050604090036040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f16107ae57005b50600091506106c69050565b1580156107ea57506000818152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b6107f3576106c5565b600081815261010760209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f0191909104810190849086861561087a579182015b8281111561087957823582600050559160200191906001019061085b565b5b5090505b80821115610658576000815560010161087e565b6000838152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff1614156108d0575b5b505b919050565b610892576108c0565b600083815261010760205260408120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff909216939182918391801561093357820191906000526020600020905b81548152906001019060200180831161091f575b5050600084866185025a03f161094557005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101076020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109e357820191906000526020600020905b8154815290600101906020018083116109cf575b5050915050604090036040a1600083815261010760209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f909101048101905b80821115610a5d5760008155600101610a49565b5050505060019150506108c2565b73ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115610b215782547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b5b50505050919050565b610aed565b60008054845560018401555b506001820154600284900a908116600014610a6b57610aec565b6000868152610103602052604081208181556001908101919091559450610aed565b5090565b5b60018054118015610bc857506001546002906101008110610bac57005b015473ffffffffffffffffffffffffffffffffffffffff16600014155b15610b47576001016104b3565b60015481108015610c1757506001546002906101008110610bfa57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b15610b8f57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019055610b48565b015473ffffffffffffffffffffffffffffffffffffffff16600014155b8015610c4857506002816101008310610c2c57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b610c5157610c8c565b6001546002906101008110610c9157005b015473ffffffffffffffffffffffffffffffffffffffff1681526020810191909152604001600020555b6104a8565b015473ffffffffffffffffffffffffffffffffffffffff166002826101008410610cb757005b0180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169190911790558061010260006002846101008610610c6257005b5061010480548201905560015b919050565b11610d1257610d25565b600061010455610d206101e3565b610106555b6101045482810110158015610d4257506101055461010454830111155b610cf6575b506000610d0356", - "gasLimit" : "0x0faf5c", + "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff16600381905581526101026020526040902055620151804204610107557f9adeddf84386b336eb7b3e18e7a6099be08fd81ea5d5142f4d2b630f8d20cf0160006040a1610e39806100716000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b6102976004356000604060003680828437909120905061053b815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610a7557610bd7565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061067781610108565b610297600435604060003680828437909120905061049281610108565b61029d6004355b6000816108b481610108565b610297600435604060003680828437909120905061066b81610108565b61029d6004803590602480359160443591820191013560006106a3846000610dce33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156102a757610329565b610297600435604060003680828437909120905061061a81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061039c81610108565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561032957815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b15610395576103aa83610146565b156103b55750610397565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156103eb5750610397565b61040d5b6101045460005b81811015610d2c57610104805482908110610d7457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061033057005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b1561048d576104a082610146565b156104ab575061048f565b6104b36103ef565b60015460fa901015156104ca576104c86104e1565b505b60015460fa9010151561050b575061048f565b6105d25b600060015b600154811015610c17575b60015481108015610c7357506002816101008110610c6c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061043257005b156103975773ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120549250821415610576575061048d565b6001600160005054036000600050541115610591575061048d565b600060028361010081106105a157005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556104dd6103ef565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b1561048d5760015482101561062f575061048f565b600082905561063c6103ef565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b1561048d575061010655565b1561048f5760006101055550565b1561048d578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b6000868152610103602052604081208054909450909250821415610b00578154835560018381018390556101048054918201808255828015829011610b8c578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610b8a5760008155600101610adf565b6000918252602090912001555b506001820154600284900a90811660001415610bd75773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610ba6576000868152610103602052610104805460409092206002015490918110610be057005b505b5050506002840181905561010480548892908110610af357005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610bd7565b5090565b01546000145b15610c8057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610c2157506001546002906101008110610c1b57005b0154600014155b15610c4f576001016104f1565b60015481108015610ca457506001546002906101008110610c9d57005b0154600014155b8015610cbf57506002816101008110610cb957005b01546000145b15610cd8576001546002906101008110610cdd57005b01555b6104e6565b01546002826101008110610ced57005b01558061010260006002836101008110610d0357005b0154815260208101919091526040016000908120919091556001546002906101008110610cd557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156103955760008155600101610d60565b6000918252602082200154141515610dc65761010480546101039160009184908110610d9c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016103f6565b156108af5761010754610de45b62015180420490565b1115610dfd57600061010555610df8610ddb565b610107555b6101055480830110158015610e1b5750610105546101065490830111155b15610e31575061010580548201905560016108af565b5060006108af56", + "gasLimit" : "0x10b394", "gasPrice" : "1", "nonce" : "1", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", @@ -939,8 +979,8 @@ } }, "transaction" : { - "data" : "0x60016000818155818055600380547fffffffffffffffffffffffff0000000000000000000000000000000000000000163390811790915573ffffffffffffffffffffffffffffffffffffffff168152610102602052604080822092909255620151804204610106557f9adeddf84386b336eb7b3e18e7a6099be08fd81ea5d5142f4d2b630f8d20cf0191a1610d4f806100996000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461009f5780632f54bf6e146101155780635c52c2f5146101465780637065cb4814610167578063797af6271461018b578063b20d30a91461019e578063b61d27f6146101c2578063ba51a6df146101ec578063cbf0b0c014610210578063f00d4b5d146102345761025d60003411610263576102a8565b6102aa6004356000604060003680828437820191505060409003604020610582815b73ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054818283838514610af6575b60008681526101036020526040812080549094509092508214610afb57610b07565b6102b06004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6102ba60406000368082843782019150506040900360402061062d816100c1565b6102c0600435604060003680828437820191505060409003604020610472816100c1565b6102c66004355b6000816108c7816100c1565b6102d060043560406000368082843782019150506040900360402061061a816100c1565b6102d6600435602435606460443560006106ce84600061010660005054610d085b62015180420490565b6102e0600435604060003680828437820191505060409003604020610606816100c1565b6102e6600435604060003680828437820191505060409003604020610636816100c1565b6102ec6004356024356000604060003680828437820191505060409003604020610387816100c1565b60006000f35b73ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b60006000f35b8060005260206000f35b60006000f35b60006000f35b8060005260206000f35b60006000f35b8060005260206000f35b60006000f35b60006000f35b60006000f35b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b61039057610380565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082146103c9575b6103cf8361011c565b50610382565b6103e3575b8260028361010085106102f257005b50610382565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b61047b5761046d565b6104848261011c565b61049a575b60015460fa9010156104a0576104cf565b5061046f565b6104cd600060015b600154811015610b43575b60015481108015610b8257506002816101008310610b6557005b505b60015460fa9010156104f6575b60018054810190819055829060029061010081106103e957005b5061046f565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff8316600081815261010260209081526040808320929092559181527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9190a15b505b5050565b61058b5761057c565b73ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082146105cb575b600060028361010085106104fc57005b5061057e565b600082905560408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15b5050565b6105d157610602565b6101058290555b5050565b61060f57610616565b6000610104555b50565b6106235761062a565b61063f575b5050565b8173ffffffffffffffffffffffffffffffffffffffff16ff5b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e08686878984378201915050915050604090036040a15b5b949350505050565b610711575b6040600036808284379091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc00160402091506107ba905081610192565b73ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c08686878984378201915050915050604090036040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f16107ae57005b50600091506106c69050565b1580156107ea57506000818152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b6107f3576106c5565b600081815261010760209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f0191909104810190849086861561087a579182015b8281111561087957823582600050559160200191906001019061085b565b5b5090505b80821115610658576000815560010161087e565b6000838152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff1614156108d0575b5b505b919050565b610892576108c0565b600083815261010760205260408120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff909216939182918391801561093357820191906000526020600020905b81548152906001019060200180831161091f575b5050600084866185025a03f161094557005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101076020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109e357820191906000526020600020905b8154815290600101906020018083116109cf575b5050915050604090036040a1600083815261010760209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f909101048101905b80821115610a5d5760008155600101610a49565b5050505060019150506108c2565b73ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115610b215782547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b5b50505050919050565b610aed565b60008054845560018401555b506001820154600284900a908116600014610a6b57610aec565b6000868152610103602052604081208181556001908101919091559450610aed565b5090565b5b60018054118015610bc857506001546002906101008110610bac57005b015473ffffffffffffffffffffffffffffffffffffffff16600014155b15610b47576001016104b3565b60015481108015610c1757506001546002906101008110610bfa57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b15610b8f57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019055610b48565b015473ffffffffffffffffffffffffffffffffffffffff16600014155b8015610c4857506002816101008310610c2c57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b610c5157610c8c565b6001546002906101008110610c9157005b015473ffffffffffffffffffffffffffffffffffffffff1681526020810191909152604001600020555b6104a8565b015473ffffffffffffffffffffffffffffffffffffffff166002826101008410610cb757005b0180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169190911790558061010260006002846101008610610c6257005b5061010480548201905560015b919050565b11610d1257610d25565b600061010455610d206101e3565b610106555b6101045482810110158015610d4257506101055461010454830111155b610cf6575b506000610d0356", - "gasLimit" : "0x0549a4", + "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff16600381905581526101026020526040902055620151804204610107557f9adeddf84386b336eb7b3e18e7a6099be08fd81ea5d5142f4d2b630f8d20cf0160006040a1610e39806100716000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b6102976004356000604060003680828437909120905061053b815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610a7557610bd7565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061067781610108565b610297600435604060003680828437909120905061049281610108565b61029d6004355b6000816108b481610108565b610297600435604060003680828437909120905061066b81610108565b61029d6004803590602480359160443591820191013560006106a3846000610dce33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156102a757610329565b610297600435604060003680828437909120905061061a81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061039c81610108565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561032957815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b15610395576103aa83610146565b156103b55750610397565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156103eb5750610397565b61040d5b6101045460005b81811015610d2c57610104805482908110610d7457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061033057005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b1561048d576104a082610146565b156104ab575061048f565b6104b36103ef565b60015460fa901015156104ca576104c86104e1565b505b60015460fa9010151561050b575061048f565b6105d25b600060015b600154811015610c17575b60015481108015610c7357506002816101008110610c6c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061043257005b156103975773ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120549250821415610576575061048d565b6001600160005054036000600050541115610591575061048d565b600060028361010081106105a157005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556104dd6103ef565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b1561048d5760015482101561062f575061048f565b600082905561063c6103ef565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b1561048d575061010655565b1561048f5760006101055550565b1561048d578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b6000868152610103602052604081208054909450909250821415610b00578154835560018381018390556101048054918201808255828015829011610b8c578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610b8a5760008155600101610adf565b6000918252602090912001555b506001820154600284900a90811660001415610bd75773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610ba6576000868152610103602052610104805460409092206002015490918110610be057005b505b5050506002840181905561010480548892908110610af357005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610bd7565b5090565b01546000145b15610c8057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610c2157506001546002906101008110610c1b57005b0154600014155b15610c4f576001016104f1565b60015481108015610ca457506001546002906101008110610c9d57005b0154600014155b8015610cbf57506002816101008110610cb957005b01546000145b15610cd8576001546002906101008110610cdd57005b01555b6104e6565b01546002826101008110610ced57005b01558061010260006002836101008110610d0357005b0154815260208101919091526040016000908120919091556001546002906101008110610cd557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156103955760008155600101610d60565b6000918252602082200154141515610dc65761010480546101039160009184908110610d9c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016103f6565b156108af5761010754610de45b62015180420490565b1115610dfd57600061010555610df8610ddb565b610107555b6101055480830110158015610e1b5750610105546101065490830111155b15610e31575061010580548201905560016108af565b5060006108af56", + "gasLimit" : "0x05970c", "gasPrice" : "1", "nonce" : "1", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", @@ -968,7 +1008,7 @@ }, "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461009f5780632f54bf6e146101155780635c52c2f5146101465780637065cb4814610167578063797af6271461018b578063b20d30a91461019e578063b61d27f6146101c2578063ba51a6df146101ec578063cbf0b0c014610210578063f00d4b5d146102345761025d60003411610263576102a8565b6102aa6004356000604060003680828437820191505060409003604020610582815b73ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054818283838514610af6575b60008681526101036020526040812080549094509092508214610afb57610b07565b6102b06004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6102ba60406000368082843782019150506040900360402061062d816100c1565b6102c0600435604060003680828437820191505060409003604020610472816100c1565b6102c66004355b6000816108c7816100c1565b6102d060043560406000368082843782019150506040900360402061061a816100c1565b6102d6600435602435606460443560006106ce84600061010660005054610d085b62015180420490565b6102e0600435604060003680828437820191505060409003604020610606816100c1565b6102e6600435604060003680828437820191505060409003604020610636816100c1565b6102ec6004356024356000604060003680828437820191505060409003604020610387816100c1565b60006000f35b73ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b60006000f35b8060005260206000f35b60006000f35b60006000f35b8060005260206000f35b60006000f35b8060005260206000f35b60006000f35b60006000f35b60006000f35b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b61039057610380565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082146103c9575b6103cf8361011c565b50610382565b6103e3575b8260028361010085106102f257005b50610382565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b61047b5761046d565b6104848261011c565b61049a575b60015460fa9010156104a0576104cf565b5061046f565b6104cd600060015b600154811015610b43575b60015481108015610b8257506002816101008310610b6557005b505b60015460fa9010156104f6575b60018054810190819055829060029061010081106103e957005b5061046f565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff8316600081815261010260209081526040808320929092559181527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9190a15b505b5050565b61058b5761057c565b73ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082146105cb575b600060028361010085106104fc57005b5061057e565b600082905560408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15b5050565b6105d157610602565b6101058290555b5050565b61060f57610616565b6000610104555b50565b6106235761062a565b61063f575b5050565b8173ffffffffffffffffffffffffffffffffffffffff16ff5b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e08686878984378201915050915050604090036040a15b5b949350505050565b610711575b6040600036808284379091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc00160402091506107ba905081610192565b73ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c08686878984378201915050915050604090036040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f16107ae57005b50600091506106c69050565b1580156107ea57506000818152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b6107f3576106c5565b600081815261010760209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f0191909104810190849086861561087a579182015b8281111561087957823582600050559160200191906001019061085b565b5b5090505b80821115610658576000815560010161087e565b6000838152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff1614156108d0575b5b505b919050565b610892576108c0565b600083815261010760205260408120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff909216939182918391801561093357820191906000526020600020905b81548152906001019060200180831161091f575b5050600084866185025a03f161094557005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101076020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109e357820191906000526020600020905b8154815290600101906020018083116109cf575b5050915050604090036040a1600083815261010760209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f909101048101905b80821115610a5d5760008155600101610a49565b5050505060019150506108c2565b73ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115610b215782547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b5b50505050919050565b610aed565b60008054845560018401555b506001820154600284900a908116600014610a6b57610aec565b6000868152610103602052604081208181556001908101919091559450610aed565b5090565b5b60018054118015610bc857506001546002906101008110610bac57005b015473ffffffffffffffffffffffffffffffffffffffff16600014155b15610b47576001016104b3565b60015481108015610c1757506001546002906101008110610bfa57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b15610b8f57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019055610b48565b015473ffffffffffffffffffffffffffffffffffffffff16600014155b8015610c4857506002816101008310610c2c57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b610c5157610c8c565b6001546002906101008110610c9157005b015473ffffffffffffffffffffffffffffffffffffffff1681526020810191909152604001600020555b6104a8565b015473ffffffffffffffffffffffffffffffffffffffff166002826101008410610cb757005b0180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169190911790558061010260006002846101008610610c6257005b5061010480548201905560015b919050565b11610d1257610d25565b600061010455610d206101e3565b610106555b6101045482810110158015610d4257506101055461010454830111155b610cf6575b506000610d0356", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548210156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -1016,7 +1056,7 @@ }, "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461009f5780632f54bf6e146101155780635c52c2f5146101465780637065cb4814610167578063797af6271461018b578063b20d30a91461019e578063b61d27f6146101c2578063ba51a6df146101ec578063cbf0b0c014610210578063f00d4b5d146102345761025d60003411610263576102a8565b6102aa6004356000604060003680828437820191505060409003604020610582815b73ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054818283838514610af6575b60008681526101036020526040812080549094509092508214610afb57610b07565b6102b06004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6102ba60406000368082843782019150506040900360402061062d816100c1565b6102c0600435604060003680828437820191505060409003604020610472816100c1565b6102c66004355b6000816108c7816100c1565b6102d060043560406000368082843782019150506040900360402061061a816100c1565b6102d6600435602435606460443560006106ce84600061010660005054610d085b62015180420490565b6102e0600435604060003680828437820191505060409003604020610606816100c1565b6102e6600435604060003680828437820191505060409003604020610636816100c1565b6102ec6004356024356000604060003680828437820191505060409003604020610387816100c1565b60006000f35b73ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b60006000f35b8060005260206000f35b60006000f35b60006000f35b8060005260206000f35b60006000f35b8060005260206000f35b60006000f35b60006000f35b60006000f35b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b61039057610380565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082146103c9575b6103cf8361011c565b50610382565b6103e3575b8260028361010085106102f257005b50610382565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b61047b5761046d565b6104848261011c565b61049a575b60015460fa9010156104a0576104cf565b5061046f565b6104cd600060015b600154811015610b43575b60015481108015610b8257506002816101008310610b6557005b505b60015460fa9010156104f6575b60018054810190819055829060029061010081106103e957005b5061046f565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff8316600081815261010260209081526040808320929092559181527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9190a15b505b5050565b61058b5761057c565b73ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082146105cb575b600060028361010085106104fc57005b5061057e565b600082905560408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15b5050565b6105d157610602565b6101058290555b5050565b61060f57610616565b6000610104555b50565b6106235761062a565b61063f575b5050565b8173ffffffffffffffffffffffffffffffffffffffff16ff5b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e08686878984378201915050915050604090036040a15b5b949350505050565b610711575b6040600036808284379091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc00160402091506107ba905081610192565b73ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c08686878984378201915050915050604090036040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f16107ae57005b50600091506106c69050565b1580156107ea57506000818152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b6107f3576106c5565b600081815261010760209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f0191909104810190849086861561087a579182015b8281111561087957823582600050559160200191906001019061085b565b5b5090505b80821115610658576000815560010161087e565b6000838152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff1614156108d0575b5b505b919050565b610892576108c0565b600083815261010760205260408120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff909216939182918391801561093357820191906000526020600020905b81548152906001019060200180831161091f575b5050600084866185025a03f161094557005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101076020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109e357820191906000526020600020905b8154815290600101906020018083116109cf575b5050915050604090036040a1600083815261010760209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f909101048101905b80821115610a5d5760008155600101610a49565b5050505060019150506108c2565b73ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115610b215782547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b5b50505050919050565b610aed565b60008054845560018401555b506001820154600284900a908116600014610a6b57610aec565b6000868152610103602052604081208181556001908101919091559450610aed565b5090565b5b60018054118015610bc857506001546002906101008110610bac57005b015473ffffffffffffffffffffffffffffffffffffffff16600014155b15610b47576001016104b3565b60015481108015610c1757506001546002906101008110610bfa57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b15610b8f57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019055610b48565b015473ffffffffffffffffffffffffffffffffffffffff16600014155b8015610c4857506002816101008310610c2c57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b610c5157610c8c565b6001546002906101008110610c9157005b015473ffffffffffffffffffffffffffffffffffffffff1681526020810191909152604001600020555b6104a8565b015473ffffffffffffffffffffffffffffffffffffffff166002826101008410610cb757005b0180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169190911790558061010260006002846101008610610c6257005b5061010480548201905560015b919050565b11610d1257610d25565b600061010455610d206101e3565b610106555b6101045482810110158015610d4257506101055461010454830111155b610cf6575b506000610d0356", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548210156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -1057,7 +1097,7 @@ }, "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461009f5780632f54bf6e146101155780635c52c2f5146101465780637065cb4814610167578063797af6271461018b578063b20d30a91461019e578063b61d27f6146101c2578063ba51a6df146101ec578063cbf0b0c014610210578063f00d4b5d146102345761025d60003411610263576102a8565b6102aa6004356000604060003680828437820191505060409003604020610582815b73ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054818283838514610af6575b60008681526101036020526040812080549094509092508214610afb57610b07565b6102b06004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6102ba60406000368082843782019150506040900360402061062d816100c1565b6102c0600435604060003680828437820191505060409003604020610472816100c1565b6102c66004355b6000816108c7816100c1565b6102d060043560406000368082843782019150506040900360402061061a816100c1565b6102d6600435602435606460443560006106ce84600061010660005054610d085b62015180420490565b6102e0600435604060003680828437820191505060409003604020610606816100c1565b6102e6600435604060003680828437820191505060409003604020610636816100c1565b6102ec6004356024356000604060003680828437820191505060409003604020610387816100c1565b60006000f35b73ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b60006000f35b8060005260206000f35b60006000f35b60006000f35b8060005260206000f35b60006000f35b8060005260206000f35b60006000f35b60006000f35b60006000f35b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b61039057610380565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082146103c9575b6103cf8361011c565b50610382565b6103e3575b8260028361010085106102f257005b50610382565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b61047b5761046d565b6104848261011c565b61049a575b60015460fa9010156104a0576104cf565b5061046f565b6104cd600060015b600154811015610b43575b60015481108015610b8257506002816101008310610b6557005b505b60015460fa9010156104f6575b60018054810190819055829060029061010081106103e957005b5061046f565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff8316600081815261010260209081526040808320929092559181527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9190a15b505b5050565b61058b5761057c565b73ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082146105cb575b600060028361010085106104fc57005b5061057e565b600082905560408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15b5050565b6105d157610602565b6101058290555b5050565b61060f57610616565b6000610104555b50565b6106235761062a565b61063f575b5050565b8173ffffffffffffffffffffffffffffffffffffffff16ff5b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e08686878984378201915050915050604090036040a15b5b949350505050565b610711575b6040600036808284379091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc00160402091506107ba905081610192565b73ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c08686878984378201915050915050604090036040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f16107ae57005b50600091506106c69050565b1580156107ea57506000818152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b6107f3576106c5565b600081815261010760209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f0191909104810190849086861561087a579182015b8281111561087957823582600050559160200191906001019061085b565b5b5090505b80821115610658576000815560010161087e565b6000838152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff1614156108d0575b5b505b919050565b610892576108c0565b600083815261010760205260408120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff909216939182918391801561093357820191906000526020600020905b81548152906001019060200180831161091f575b5050600084866185025a03f161094557005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101076020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109e357820191906000526020600020905b8154815290600101906020018083116109cf575b5050915050604090036040a1600083815261010760209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f909101048101905b80821115610a5d5760008155600101610a49565b5050505060019150506108c2565b73ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115610b215782547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b5b50505050919050565b610aed565b60008054845560018401555b506001820154600284900a908116600014610a6b57610aec565b6000868152610103602052604081208181556001908101919091559450610aed565b5090565b5b60018054118015610bc857506001546002906101008110610bac57005b015473ffffffffffffffffffffffffffffffffffffffff16600014155b15610b47576001016104b3565b60015481108015610c1757506001546002906101008110610bfa57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b15610b8f57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019055610b48565b015473ffffffffffffffffffffffffffffffffffffffff16600014155b8015610c4857506002816101008310610c2c57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b610c5157610c8c565b6001546002906101008110610c9157005b015473ffffffffffffffffffffffffffffffffffffffff1681526020810191909152604001600020555b6104a8565b015473ffffffffffffffffffffffffffffffffffffffff166002826101008410610cb757005b0180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169190911790558061010260006002846101008610610c6257005b5061010480548201905560015b919050565b11610d1257610d25565b600061010455610d206101e3565b610106555b6101045482810110158015610d4257506101055461010454830111155b610cf6575b506000610d0356", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548210156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -1098,7 +1138,7 @@ }, "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461009f5780632f54bf6e146101155780635c52c2f5146101465780637065cb4814610167578063797af6271461018b578063b20d30a91461019e578063b61d27f6146101c2578063ba51a6df146101ec578063cbf0b0c014610210578063f00d4b5d146102345761025d60003411610263576102a8565b6102aa6004356000604060003680828437820191505060409003604020610582815b73ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054818283838514610af6575b60008681526101036020526040812080549094509092508214610afb57610b07565b6102b06004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6102ba60406000368082843782019150506040900360402061062d816100c1565b6102c0600435604060003680828437820191505060409003604020610472816100c1565b6102c66004355b6000816108c7816100c1565b6102d060043560406000368082843782019150506040900360402061061a816100c1565b6102d6600435602435606460443560006106ce84600061010660005054610d085b62015180420490565b6102e0600435604060003680828437820191505060409003604020610606816100c1565b6102e6600435604060003680828437820191505060409003604020610636816100c1565b6102ec6004356024356000604060003680828437820191505060409003604020610387816100c1565b60006000f35b73ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b60006000f35b8060005260206000f35b60006000f35b60006000f35b8060005260206000f35b60006000f35b8060005260206000f35b60006000f35b60006000f35b60006000f35b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b61039057610380565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082146103c9575b6103cf8361011c565b50610382565b6103e3575b8260028361010085106102f257005b50610382565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b61047b5761046d565b6104848261011c565b61049a575b60015460fa9010156104a0576104cf565b5061046f565b6104cd600060015b600154811015610b43575b60015481108015610b8257506002816101008310610b6557005b505b60015460fa9010156104f6575b60018054810190819055829060029061010081106103e957005b5061046f565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff8316600081815261010260209081526040808320929092559181527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9190a15b505b5050565b61058b5761057c565b73ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082146105cb575b600060028361010085106104fc57005b5061057e565b600082905560408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15b5050565b6105d157610602565b6101058290555b5050565b61060f57610616565b6000610104555b50565b6106235761062a565b61063f575b5050565b8173ffffffffffffffffffffffffffffffffffffffff16ff5b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e08686878984378201915050915050604090036040a15b5b949350505050565b610711575b6040600036808284379091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc00160402091506107ba905081610192565b73ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c08686878984378201915050915050604090036040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f16107ae57005b50600091506106c69050565b1580156107ea57506000818152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b6107f3576106c5565b600081815261010760209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f0191909104810190849086861561087a579182015b8281111561087957823582600050559160200191906001019061085b565b5b5090505b80821115610658576000815560010161087e565b6000838152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff1614156108d0575b5b505b919050565b610892576108c0565b600083815261010760205260408120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff909216939182918391801561093357820191906000526020600020905b81548152906001019060200180831161091f575b5050600084866185025a03f161094557005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101076020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109e357820191906000526020600020905b8154815290600101906020018083116109cf575b5050915050604090036040a1600083815261010760209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f909101048101905b80821115610a5d5760008155600101610a49565b5050505060019150506108c2565b73ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115610b215782547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b5b50505050919050565b610aed565b60008054845560018401555b506001820154600284900a908116600014610a6b57610aec565b6000868152610103602052604081208181556001908101919091559450610aed565b5090565b5b60018054118015610bc857506001546002906101008110610bac57005b015473ffffffffffffffffffffffffffffffffffffffff16600014155b15610b47576001016104b3565b60015481108015610c1757506001546002906101008110610bfa57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b15610b8f57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019055610b48565b015473ffffffffffffffffffffffffffffffffffffffff16600014155b8015610c4857506002816101008310610c2c57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b610c5157610c8c565b6001546002906101008110610c9157005b015473ffffffffffffffffffffffffffffffffffffffff1681526020810191909152604001600020555b6104a8565b015473ffffffffffffffffffffffffffffffffffffffff166002826101008410610cb757005b0180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169190911790558061010260006002846101008610610c6257005b5061010480548201905560015b919050565b11610d1257610d25565b600061010455610d206101e3565b610106555b6101045482810110158015610d4257506101055461010454830111155b610cf6575b506000610d0356", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548210156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -1139,7 +1179,7 @@ }, "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461009f5780632f54bf6e146101155780635c52c2f5146101465780637065cb4814610167578063797af6271461018b578063b20d30a91461019e578063b61d27f6146101c2578063ba51a6df146101ec578063cbf0b0c014610210578063f00d4b5d146102345761025d60003411610263576102a8565b6102aa6004356000604060003680828437820191505060409003604020610582815b73ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054818283838514610af6575b60008681526101036020526040812080549094509092508214610afb57610b07565b6102b06004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6102ba60406000368082843782019150506040900360402061062d816100c1565b6102c0600435604060003680828437820191505060409003604020610472816100c1565b6102c66004355b6000816108c7816100c1565b6102d060043560406000368082843782019150506040900360402061061a816100c1565b6102d6600435602435606460443560006106ce84600061010660005054610d085b62015180420490565b6102e0600435604060003680828437820191505060409003604020610606816100c1565b6102e6600435604060003680828437820191505060409003604020610636816100c1565b6102ec6004356024356000604060003680828437820191505060409003604020610387816100c1565b60006000f35b73ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b60006000f35b8060005260206000f35b60006000f35b60006000f35b8060005260206000f35b60006000f35b8060005260206000f35b60006000f35b60006000f35b60006000f35b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b61039057610380565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082146103c9575b6103cf8361011c565b50610382565b6103e3575b8260028361010085106102f257005b50610382565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b61047b5761046d565b6104848261011c565b61049a575b60015460fa9010156104a0576104cf565b5061046f565b6104cd600060015b600154811015610b43575b60015481108015610b8257506002816101008310610b6557005b505b60015460fa9010156104f6575b60018054810190819055829060029061010081106103e957005b5061046f565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff8316600081815261010260209081526040808320929092559181527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9190a15b505b5050565b61058b5761057c565b73ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082146105cb575b600060028361010085106104fc57005b5061057e565b600082905560408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15b5050565b6105d157610602565b6101058290555b5050565b61060f57610616565b6000610104555b50565b6106235761062a565b61063f575b5050565b8173ffffffffffffffffffffffffffffffffffffffff16ff5b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e08686878984378201915050915050604090036040a15b5b949350505050565b610711575b6040600036808284379091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc00160402091506107ba905081610192565b73ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c08686878984378201915050915050604090036040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f16107ae57005b50600091506106c69050565b1580156107ea57506000818152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b6107f3576106c5565b600081815261010760209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f0191909104810190849086861561087a579182015b8281111561087957823582600050559160200191906001019061085b565b5b5090505b80821115610658576000815560010161087e565b6000838152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff1614156108d0575b5b505b919050565b610892576108c0565b600083815261010760205260408120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff909216939182918391801561093357820191906000526020600020905b81548152906001019060200180831161091f575b5050600084866185025a03f161094557005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101076020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109e357820191906000526020600020905b8154815290600101906020018083116109cf575b5050915050604090036040a1600083815261010760209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f909101048101905b80821115610a5d5760008155600101610a49565b5050505060019150506108c2565b73ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115610b215782547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b5b50505050919050565b610aed565b60008054845560018401555b506001820154600284900a908116600014610a6b57610aec565b6000868152610103602052604081208181556001908101919091559450610aed565b5090565b5b60018054118015610bc857506001546002906101008110610bac57005b015473ffffffffffffffffffffffffffffffffffffffff16600014155b15610b47576001016104b3565b60015481108015610c1757506001546002906101008110610bfa57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b15610b8f57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019055610b48565b015473ffffffffffffffffffffffffffffffffffffffff16600014155b8015610c4857506002816101008310610c2c57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b610c5157610c8c565b6001546002906101008110610c9157005b015473ffffffffffffffffffffffffffffffffffffffff1681526020810191909152604001600020555b6104a8565b015473ffffffffffffffffffffffffffffffffffffffff166002826101008410610cb757005b0180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169190911790558061010260006002846101008610610c6257005b5061010480548201905560015b919050565b11610d1257610d25565b600061010455610d206101e3565b610106555b6101045482810110158015610d4257506101055461010454830111155b610cf6575b506000610d0356", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548210156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -1180,7 +1220,7 @@ }, "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461009f5780632f54bf6e146101155780635c52c2f5146101465780637065cb4814610167578063797af6271461018b578063b20d30a91461019e578063b61d27f6146101c2578063ba51a6df146101ec578063cbf0b0c014610210578063f00d4b5d146102345761025d60003411610263576102a8565b6102aa6004356000604060003680828437820191505060409003604020610582815b73ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054818283838514610af6575b60008681526101036020526040812080549094509092508214610afb57610b07565b6102b06004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6102ba60406000368082843782019150506040900360402061062d816100c1565b6102c0600435604060003680828437820191505060409003604020610472816100c1565b6102c66004355b6000816108c7816100c1565b6102d060043560406000368082843782019150506040900360402061061a816100c1565b6102d6600435602435606460443560006106ce84600061010660005054610d085b62015180420490565b6102e0600435604060003680828437820191505060409003604020610606816100c1565b6102e6600435604060003680828437820191505060409003604020610636816100c1565b6102ec6004356024356000604060003680828437820191505060409003604020610387816100c1565b60006000f35b73ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b60006000f35b8060005260206000f35b60006000f35b60006000f35b8060005260206000f35b60006000f35b8060005260206000f35b60006000f35b60006000f35b60006000f35b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b61039057610380565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082146103c9575b6103cf8361011c565b50610382565b6103e3575b8260028361010085106102f257005b50610382565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b61047b5761046d565b6104848261011c565b61049a575b60015460fa9010156104a0576104cf565b5061046f565b6104cd600060015b600154811015610b43575b60015481108015610b8257506002816101008310610b6557005b505b60015460fa9010156104f6575b60018054810190819055829060029061010081106103e957005b5061046f565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff8316600081815261010260209081526040808320929092559181527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9190a15b505b5050565b61058b5761057c565b73ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082146105cb575b600060028361010085106104fc57005b5061057e565b600082905560408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15b5050565b6105d157610602565b6101058290555b5050565b61060f57610616565b6000610104555b50565b6106235761062a565b61063f575b5050565b8173ffffffffffffffffffffffffffffffffffffffff16ff5b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e08686878984378201915050915050604090036040a15b5b949350505050565b610711575b6040600036808284379091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc00160402091506107ba905081610192565b73ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c08686878984378201915050915050604090036040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f16107ae57005b50600091506106c69050565b1580156107ea57506000818152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b6107f3576106c5565b600081815261010760209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f0191909104810190849086861561087a579182015b8281111561087957823582600050559160200191906001019061085b565b5b5090505b80821115610658576000815560010161087e565b6000838152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff1614156108d0575b5b505b919050565b610892576108c0565b600083815261010760205260408120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff909216939182918391801561093357820191906000526020600020905b81548152906001019060200180831161091f575b5050600084866185025a03f161094557005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101076020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109e357820191906000526020600020905b8154815290600101906020018083116109cf575b5050915050604090036040a1600083815261010760209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f909101048101905b80821115610a5d5760008155600101610a49565b5050505060019150506108c2565b73ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115610b215782547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b5b50505050919050565b610aed565b60008054845560018401555b506001820154600284900a908116600014610a6b57610aec565b6000868152610103602052604081208181556001908101919091559450610aed565b5090565b5b60018054118015610bc857506001546002906101008110610bac57005b015473ffffffffffffffffffffffffffffffffffffffff16600014155b15610b47576001016104b3565b60015481108015610c1757506001546002906101008110610bfa57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b15610b8f57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019055610b48565b015473ffffffffffffffffffffffffffffffffffffffff16600014155b8015610c4857506002816101008310610c2c57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b610c5157610c8c565b6001546002906101008110610c9157005b015473ffffffffffffffffffffffffffffffffffffffff1681526020810191909152604001600020555b6104a8565b015473ffffffffffffffffffffffffffffffffffffffff166002826101008410610cb757005b0180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169190911790558061010260006002846101008610610c6257005b5061010480548201905560015b919050565b11610d1257610d25565b600061010455610d206101e3565b610106555b6101045482810110158015610d4257506101055461010454830111155b610cf6575b506000610d0356", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548210156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -1221,7 +1261,7 @@ }, "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461009f5780632f54bf6e146101155780635c52c2f5146101465780637065cb4814610167578063797af6271461018b578063b20d30a91461019e578063b61d27f6146101c2578063ba51a6df146101ec578063cbf0b0c014610210578063f00d4b5d146102345761025d60003411610263576102a8565b6102aa6004356000604060003680828437820191505060409003604020610582815b73ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054818283838514610af6575b60008681526101036020526040812080549094509092508214610afb57610b07565b6102b06004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6102ba60406000368082843782019150506040900360402061062d816100c1565b6102c0600435604060003680828437820191505060409003604020610472816100c1565b6102c66004355b6000816108c7816100c1565b6102d060043560406000368082843782019150506040900360402061061a816100c1565b6102d6600435602435606460443560006106ce84600061010660005054610d085b62015180420490565b6102e0600435604060003680828437820191505060409003604020610606816100c1565b6102e6600435604060003680828437820191505060409003604020610636816100c1565b6102ec6004356024356000604060003680828437820191505060409003604020610387816100c1565b60006000f35b73ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b60006000f35b8060005260206000f35b60006000f35b60006000f35b8060005260206000f35b60006000f35b8060005260206000f35b60006000f35b60006000f35b60006000f35b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b61039057610380565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082146103c9575b6103cf8361011c565b50610382565b6103e3575b8260028361010085106102f257005b50610382565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b61047b5761046d565b6104848261011c565b61049a575b60015460fa9010156104a0576104cf565b5061046f565b6104cd600060015b600154811015610b43575b60015481108015610b8257506002816101008310610b6557005b505b60015460fa9010156104f6575b60018054810190819055829060029061010081106103e957005b5061046f565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff8316600081815261010260209081526040808320929092559181527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9190a15b505b5050565b61058b5761057c565b73ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082146105cb575b600060028361010085106104fc57005b5061057e565b600082905560408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15b5050565b6105d157610602565b6101058290555b5050565b61060f57610616565b6000610104555b50565b6106235761062a565b61063f575b5050565b8173ffffffffffffffffffffffffffffffffffffffff16ff5b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e08686878984378201915050915050604090036040a15b5b949350505050565b610711575b6040600036808284379091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc00160402091506107ba905081610192565b73ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c08686878984378201915050915050604090036040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f16107ae57005b50600091506106c69050565b1580156107ea57506000818152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b6107f3576106c5565b600081815261010760209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f0191909104810190849086861561087a579182015b8281111561087957823582600050559160200191906001019061085b565b5b5090505b80821115610658576000815560010161087e565b6000838152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff1614156108d0575b5b505b919050565b610892576108c0565b600083815261010760205260408120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff909216939182918391801561093357820191906000526020600020905b81548152906001019060200180831161091f575b5050600084866185025a03f161094557005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101076020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109e357820191906000526020600020905b8154815290600101906020018083116109cf575b5050915050604090036040a1600083815261010760209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f909101048101905b80821115610a5d5760008155600101610a49565b5050505060019150506108c2565b73ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115610b215782547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b5b50505050919050565b610aed565b60008054845560018401555b506001820154600284900a908116600014610a6b57610aec565b6000868152610103602052604081208181556001908101919091559450610aed565b5090565b5b60018054118015610bc857506001546002906101008110610bac57005b015473ffffffffffffffffffffffffffffffffffffffff16600014155b15610b47576001016104b3565b60015481108015610c1757506001546002906101008110610bfa57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b15610b8f57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019055610b48565b015473ffffffffffffffffffffffffffffffffffffffff16600014155b8015610c4857506002816101008310610c2c57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b610c5157610c8c565b6001546002906101008110610c9157005b015473ffffffffffffffffffffffffffffffffffffffff1681526020810191909152604001600020555b6104a8565b015473ffffffffffffffffffffffffffffffffffffffff166002826101008410610cb757005b0180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169190911790558061010260006002846101008610610c6257005b5061010480548201905560015b919050565b11610d1257610d25565b600061010455610d206101e3565b610106555b6101045482810110158015610d4257506101055461010454830111155b610cf6575b506000610d0356", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548210156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -1264,7 +1304,7 @@ }, "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461009f5780632f54bf6e146101155780635c52c2f5146101465780637065cb4814610167578063797af6271461018b578063b20d30a91461019e578063b61d27f6146101c2578063ba51a6df146101ec578063cbf0b0c014610210578063f00d4b5d146102345761025d60003411610263576102a8565b6102aa6004356000604060003680828437820191505060409003604020610582815b73ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054818283838514610af6575b60008681526101036020526040812080549094509092508214610afb57610b07565b6102b06004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6102ba60406000368082843782019150506040900360402061062d816100c1565b6102c0600435604060003680828437820191505060409003604020610472816100c1565b6102c66004355b6000816108c7816100c1565b6102d060043560406000368082843782019150506040900360402061061a816100c1565b6102d6600435602435606460443560006106ce84600061010660005054610d085b62015180420490565b6102e0600435604060003680828437820191505060409003604020610606816100c1565b6102e6600435604060003680828437820191505060409003604020610636816100c1565b6102ec6004356024356000604060003680828437820191505060409003604020610387816100c1565b60006000f35b73ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b60006000f35b8060005260206000f35b60006000f35b60006000f35b8060005260206000f35b60006000f35b8060005260206000f35b60006000f35b60006000f35b60006000f35b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b61039057610380565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082146103c9575b6103cf8361011c565b50610382565b6103e3575b8260028361010085106102f257005b50610382565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b61047b5761046d565b6104848261011c565b61049a575b60015460fa9010156104a0576104cf565b5061046f565b6104cd600060015b600154811015610b43575b60015481108015610b8257506002816101008310610b6557005b505b60015460fa9010156104f6575b60018054810190819055829060029061010081106103e957005b5061046f565b0180547fffffffffffffffffffffffff00000000000000000000000000000000000000001691909117905573ffffffffffffffffffffffffffffffffffffffff8316600081815261010260209081526040808320929092559181527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9190a15b505b5050565b61058b5761057c565b73ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082146105cb575b600060028361010085106104fc57005b5061057e565b600082905560408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15b5050565b6105d157610602565b6101058290555b5050565b61060f57610616565b6000610104555b50565b6106235761062a565b61063f575b5050565b8173ffffffffffffffffffffffffffffffffffffffff16ff5b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e08686878984378201915050915050604090036040a15b5b949350505050565b610711575b6040600036808284379091017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc00160402091506107ba905081610192565b73ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c08686878984378201915050915050604090036040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f16107ae57005b50600091506106c69050565b1580156107ea57506000818152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b6107f3576106c5565b600081815261010760209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f0191909104810190849086861561087a579182015b8281111561087957823582600050559160200191906001019061085b565b5b5090505b80821115610658576000815560010161087e565b6000838152610107602052604081205473ffffffffffffffffffffffffffffffffffffffff1614156108d0575b5b505b919050565b610892576108c0565b600083815261010760205260408120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff909216939182918391801561093357820191906000526020600020905b81548152906001019060200180831161091f575b5050600084866185025a03f161094557005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101076020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109e357820191906000526020600020905b8154815290600101906020018083116109cf575b5050915050604090036040a1600083815261010760209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f909101048101905b80821115610a5d5760008155600101610a49565b5050505060019150506108c2565b73ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115610b215782547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b5b50505050919050565b610aed565b60008054845560018401555b506001820154600284900a908116600014610a6b57610aec565b6000868152610103602052604081208181556001908101919091559450610aed565b5090565b5b60018054118015610bc857506001546002906101008110610bac57005b015473ffffffffffffffffffffffffffffffffffffffff16600014155b15610b47576001016104b3565b60015481108015610c1757506001546002906101008110610bfa57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b15610b8f57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff019055610b48565b015473ffffffffffffffffffffffffffffffffffffffff16600014155b8015610c4857506002816101008310610c2c57005b015473ffffffffffffffffffffffffffffffffffffffff166000145b610c5157610c8c565b6001546002906101008110610c9157005b015473ffffffffffffffffffffffffffffffffffffffff1681526020810191909152604001600020555b6104a8565b015473ffffffffffffffffffffffffffffffffffffffff166002826101008410610cb757005b0180547fffffffffffffffffffffffff0000000000000000000000000000000000000000169190911790558061010260006002846101008610610c6257005b5061010480548201905560015b919050565b11610d1257610d25565b600061010455610d206101e3565b610106555b6101045482810110158015610d4257506101055461010454830111155b610cf6575b506000610d0356", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548210156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", "nonce" : "0x00", "storage" : { "0x00" : "0x01", From e8003daa8bd7957cb2cb789a3c0663e53f335e63 Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Fri, 22 May 2015 18:02:22 +0200 Subject: [PATCH 336/461] update and expand wallet tests --- .../BlockTestsFiller/bcWalletTestFiller.json | 7744 +++++++++-------- .../StateTestsFiller/stWalletTestFiller.json | 165 +- 2 files changed, 4136 insertions(+), 3773 deletions(-) diff --git a/test/libethereum/BlockTestsFiller/bcWalletTestFiller.json b/test/libethereum/BlockTestsFiller/bcWalletTestFiller.json index dd0781383..11fd20196 100644 --- a/test/libethereum/BlockTestsFiller/bcWalletTestFiller.json +++ b/test/libethereum/BlockTestsFiller/bcWalletTestFiller.json @@ -5,7 +5,7 @@ "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1", "difficulty" : "131072", "extraData" : "0x42", - "gasLimit" : "3141592", + "gasLimit" : "30141592", "gasUsed" : "0", "mixHash" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "nonce" : "0x0102030405060708", @@ -24,13 +24,13 @@ }, "pre" : { "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { - "balance" : "10000000000", + "balance" : "100000000000000", "nonce" : "0", "code" : "", "storage": {} }, "3fb1cd2cd96c6d5c0b5eb3322d807b34482481d4" : { - "balance" : "0x0de0b6b3a75ef08f", + "balance" : "100000000000000", "code" : "0x", "nonce" : "0", "storage" : { @@ -41,7 +41,7 @@ { "transactions" : [ { - "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff16600381905581526101026020526040902055620151804204610107557f9adeddf84386b336eb7b3e18e7a6099be08fd81ea5d5142f4d2b630f8d20cf0160006040a1610e39806100716000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b6102976004356000604060003680828437909120905061053b815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610a7557610bd7565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061067781610108565b610297600435604060003680828437909120905061049281610108565b61029d6004355b6000816108b481610108565b610297600435604060003680828437909120905061066b81610108565b61029d6004803590602480359160443591820191013560006106a3846000610dce33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156102a757610329565b610297600435604060003680828437909120905061061a81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061039c81610108565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561032957815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b15610395576103aa83610146565b156103b55750610397565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156103eb5750610397565b61040d5b6101045460005b81811015610d2c57610104805482908110610d7457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061033057005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b1561048d576104a082610146565b156104ab575061048f565b6104b36103ef565b60015460fa901015156104ca576104c86104e1565b505b60015460fa9010151561050b575061048f565b6105d25b600060015b600154811015610c17575b60015481108015610c7357506002816101008110610c6c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061043257005b156103975773ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120549250821415610576575061048d565b6001600160005054036000600050541115610591575061048d565b600060028361010081106105a157005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556104dd6103ef565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b1561048d5760015482101561062f575061048f565b600082905561063c6103ef565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b1561048d575061010655565b1561048f5760006101055550565b1561048d578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b6000868152610103602052604081208054909450909250821415610b00578154835560018381018390556101048054918201808255828015829011610b8c578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610b8a5760008155600101610adf565b6000918252602090912001555b506001820154600284900a90811660001415610bd75773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610ba6576000868152610103602052610104805460409092206002015490918110610be057005b505b5050506002840181905561010480548892908110610af357005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610bd7565b5090565b01546000145b15610c8057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610c2157506001546002906101008110610c1b57005b0154600014155b15610c4f576001016104f1565b60015481108015610ca457506001546002906101008110610c9d57005b0154600014155b8015610cbf57506002816101008110610cb957005b01546000145b15610cd8576001546002906101008110610cdd57005b01555b6104e6565b01546002826101008110610ced57005b01558061010260006002836101008110610d0357005b0154815260208101919091526040016000908120919091556001546002906101008110610cd557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156103955760008155600101610d60565b6000918252602082200154141515610dc65761010480546101039160009184908110610d9c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016103f6565b156108af5761010754610de45b62015180420490565b1115610dfd57600061010555610df8610ddb565b610107555b6101055480830110158015610e1b5750610105546101065490830111155b15610e31575061010580548201905560016108af565b5060006108af56", + "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff16600381905581526101026020526040902055620151804204610107557f9adeddf84386b336eb7b3e18e7a6099be08fd81ea5d5142f4d2b630f8d20cf0160006040a1610e39806100716000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b6102976004356000604060003680828437909120905061053b815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610a7557610bd7565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061067781610108565b610297600435604060003680828437909120905061049281610108565b61029d6004355b6000816108b481610108565b610297600435604060003680828437909120905061066b81610108565b61029d6004803590602480359160443591820191013560006106a3846000610dce33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156102a757610329565b610297600435604060003680828437909120905061061a81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061039c81610108565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561032957815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b15610395576103aa83610146565b156103b55750610397565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156103eb5750610397565b61040d5b6101045460005b81811015610d2c57610104805482908110610d7457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061033057005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b1561048d576104a082610146565b156104ab575061048f565b6104b36103ef565b60015460fa901015156104ca576104c86104e1565b505b60015460fa9010151561050b575061048f565b6105d25b600060015b600154811015610c17575b60015481108015610c7357506002816101008110610c6c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061043257005b156103975773ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120549250821415610576575061048d565b6001600160005054036000600050541115610591575061048d565b600060028361010081106105a157005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556104dd6103ef565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b1561048d5760015482111561062f575061048f565b600082905561063c6103ef565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b1561048d575061010655565b1561048f5760006101055550565b1561048d578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b6000868152610103602052604081208054909450909250821415610b00578154835560018381018390556101048054918201808255828015829011610b8c578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610b8a5760008155600101610adf565b6000918252602090912001555b506001820154600284900a90811660001415610bd75773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610ba6576000868152610103602052610104805460409092206002015490918110610be057005b505b5050506002840181905561010480548892908110610af357005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610bd7565b5090565b01546000145b15610c8057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610c2157506001546002906101008110610c1b57005b0154600014155b15610c4f576001016104f1565b60015481108015610ca457506001546002906101008110610c9d57005b0154600014155b8015610cbf57506002816101008110610cb957005b01546000145b15610cd8576001546002906101008110610cdd57005b01555b6104e6565b01546002826101008110610ced57005b01558061010260006002836101008110610d0357005b0154815260208101919091526040016000908120919091556001546002906101008110610cd557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156103955760008155600101610d60565b6000918252602082200154141515610dc65761010480546101039160009184908110610d9c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016103f6565b156108af5761010754610de45b62015180420490565b1115610dfd57600061010555610df8610ddb565b610107555b6101055480830110158015610e1b5750610105546101065490830111155b15610e31575061010580548201905560016108af565b5060006108af56", "gasLimit" : "0x989680", "gasPrice" : "1", "nonce" : "0", @@ -57,7 +57,7 @@ "transactions" : [ { "data" : "0x7065cb48000000000000000000000000aaaf5374fce5edbc8e2a8697c15331677e6ebaaa", - "gasLimit" : "0x0faf5d", + "gasLimit" : "0x989680", "gasPrice" : "1", "nonce" : "1", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", @@ -72,7 +72,7 @@ "transactions" : [ { "data" : "0x7065cb480000000000000000000000003fb1cd2cd96c6d5c0b5eb3322d807b34482481d4", - "gasLimit" : "0x0faf5d", + "gasLimit" : "0x989680", "gasPrice" : "1", "nonce" : "2", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", @@ -87,7 +87,7 @@ "transactions" : [ { "data" : "0xba51a6df0000000000000000000000000000000000000000000000000000000000000002", - "gasLimit" : "0x0faf5d", + "gasLimit" : "0x989680", "gasPrice" : "1", "nonce" : "3", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", @@ -101,8 +101,8 @@ { "transactions" : [ { - "data" : "0xb61d27f6000000000000000000000000aaaf5374fce5edbc8e2a8697c15331677e6ebaaa0000000000000000000000000000000000000000000000000000000000000009", - "gasLimit" : "0x0faf5d", + "data" : "0xb61d27f6000000000000000000000000aaaf5374fce5edbc8e2a8697c15331677e6ebaaa00000000000000000000000000000000000000000000000000000000000000090000000000000000000000000000000000000000000000000000000000000060", + "gasLimit" : "20141591", "gasPrice" : "1", "nonce" : "4", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", @@ -116,8 +116,8 @@ { "transactions" : [ { - "data" : "0x797af6275fdaa2db933d2913eb85133894a8af175a47872028d01c6369559a15eb76660b", - "gasLimit" : "0x0faf5d", + "data" : "0x797af6276877e4536b661640954061cdbc3a9761fb5245c340fcb1721307cd9d5f285c96", + "gasLimit" : "20141591", "gasPrice" : "1", "nonce" : "0", "secretKey" : "a95defe70ebea7804f9c3be42d20d24375e2a92b9d9666b832069c5f3cd423dd", @@ -131,13 +131,13 @@ ] }, - "walletReorganizeOwners" : { + "wallet2outOf3txsRevoke" : { "genesisBlockHeader" : { "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1", "difficulty" : "131072", "extraData" : "0x42", - "gasLimit" : "3141592", + "gasLimit" : "30141592", "gasUsed" : "0", "mixHash" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", "nonce" : "0x0102030405060708", @@ -150,19 +150,19 @@ "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" }, "expect" : { - "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { - "balance" : "10" + "aaaf5374fce5edbc8e2a8697c15331677e6ebaaa" : { + "balance" : "0x09" } }, "pre" : { "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { - "balance" : "10000000000", + "balance" : "100000000000000", "nonce" : "0", "code" : "", "storage": {} }, "3fb1cd2cd96c6d5c0b5eb3322d807b34482481d4" : { - "balance" : "0x0de0b6b3a75ef08f", + "balance" : "100000000000000", "code" : "0x", "nonce" : "0", "storage" : { @@ -173,7 +173,7 @@ { "transactions" : [ { - "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff16600381905581526101026020526040902055620151804204610107557f9adeddf84386b336eb7b3e18e7a6099be08fd81ea5d5142f4d2b630f8d20cf0160006040a1610e39806100716000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b6102976004356000604060003680828437909120905061053b815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610a7557610bd7565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061067781610108565b610297600435604060003680828437909120905061049281610108565b61029d6004355b6000816108b481610108565b610297600435604060003680828437909120905061066b81610108565b61029d6004803590602480359160443591820191013560006106a3846000610dce33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156102a757610329565b610297600435604060003680828437909120905061061a81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061039c81610108565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561032957815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b15610395576103aa83610146565b156103b55750610397565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156103eb5750610397565b61040d5b6101045460005b81811015610d2c57610104805482908110610d7457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061033057005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b1561048d576104a082610146565b156104ab575061048f565b6104b36103ef565b60015460fa901015156104ca576104c86104e1565b505b60015460fa9010151561050b575061048f565b6105d25b600060015b600154811015610c17575b60015481108015610c7357506002816101008110610c6c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061043257005b156103975773ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120549250821415610576575061048d565b6001600160005054036000600050541115610591575061048d565b600060028361010081106105a157005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556104dd6103ef565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b1561048d5760015482101561062f575061048f565b600082905561063c6103ef565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b1561048d575061010655565b1561048f5760006101055550565b1561048d578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b6000868152610103602052604081208054909450909250821415610b00578154835560018381018390556101048054918201808255828015829011610b8c578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610b8a5760008155600101610adf565b6000918252602090912001555b506001820154600284900a90811660001415610bd75773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610ba6576000868152610103602052610104805460409092206002015490918110610be057005b505b5050506002840181905561010480548892908110610af357005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610bd7565b5090565b01546000145b15610c8057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610c2157506001546002906101008110610c1b57005b0154600014155b15610c4f576001016104f1565b60015481108015610ca457506001546002906101008110610c9d57005b0154600014155b8015610cbf57506002816101008110610cb957005b01546000145b15610cd8576001546002906101008110610cdd57005b01555b6104e6565b01546002826101008110610ced57005b01558061010260006002836101008110610d0357005b0154815260208101919091526040016000908120919091556001546002906101008110610cd557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156103955760008155600101610d60565b6000918252602082200154141515610dc65761010480546101039160009184908110610d9c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016103f6565b156108af5761010754610de45b62015180420490565b1115610dfd57600061010555610df8610ddb565b610107555b6101055480830110158015610e1b5750610105546101065490830111155b15610e31575061010580548201905560016108af565b5060006108af56", + "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff16600381905581526101026020526040902055620151804204610107557f9adeddf84386b336eb7b3e18e7a6099be08fd81ea5d5142f4d2b630f8d20cf0160006040a1610e39806100716000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b6102976004356000604060003680828437909120905061053b815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610a7557610bd7565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061067781610108565b610297600435604060003680828437909120905061049281610108565b61029d6004355b6000816108b481610108565b610297600435604060003680828437909120905061066b81610108565b61029d6004803590602480359160443591820191013560006106a3846000610dce33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156102a757610329565b610297600435604060003680828437909120905061061a81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061039c81610108565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561032957815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b15610395576103aa83610146565b156103b55750610397565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156103eb5750610397565b61040d5b6101045460005b81811015610d2c57610104805482908110610d7457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061033057005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b1561048d576104a082610146565b156104ab575061048f565b6104b36103ef565b60015460fa901015156104ca576104c86104e1565b505b60015460fa9010151561050b575061048f565b6105d25b600060015b600154811015610c17575b60015481108015610c7357506002816101008110610c6c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061043257005b156103975773ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120549250821415610576575061048d565b6001600160005054036000600050541115610591575061048d565b600060028361010081106105a157005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556104dd6103ef565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b1561048d5760015482111561062f575061048f565b600082905561063c6103ef565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b1561048d575061010655565b1561048f5760006101055550565b1561048d578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b6000868152610103602052604081208054909450909250821415610b00578154835560018381018390556101048054918201808255828015829011610b8c578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610b8a5760008155600101610adf565b6000918252602090912001555b506001820154600284900a90811660001415610bd75773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610ba6576000868152610103602052610104805460409092206002015490918110610be057005b505b5050506002840181905561010480548892908110610af357005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610bd7565b5090565b01546000145b15610c8057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610c2157506001546002906101008110610c1b57005b0154600014155b15610c4f576001016104f1565b60015481108015610ca457506001546002906101008110610c9d57005b0154600014155b8015610cbf57506002816101008110610cb957005b01546000145b15610cd8576001546002906101008110610cdd57005b01555b6104e6565b01546002826101008110610ced57005b01558061010260006002836101008110610d0357005b0154815260208101919091526040016000908120919091556001546002906101008110610cd557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156103955760008155600101610d60565b6000918252602082200154141515610dc65761010480546101039160009184908110610d9c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016103f6565b156108af5761010754610de45b62015180420490565b1115610dfd57600061010555610df8610ddb565b610107555b6101055480830110158015610e1b5750610105546101065490830111155b15610e31575061010580548201905560016108af565b5060006108af56", "gasLimit" : "0x989680", "gasPrice" : "1", "nonce" : "0", @@ -188,8 +188,8 @@ { "transactions" : [ { - "data" : "0x7065cb480000000000000000000000001aaaa1", - "gasLimit" : "0x0faf5d", + "data" : "0x7065cb48000000000000000000000000aaaf5374fce5edbc8e2a8697c15331677e6ebaaa", + "gasLimit" : "0x989680", "gasPrice" : "1", "nonce" : "1", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", @@ -203,8 +203,8 @@ { "transactions" : [ { - "data" : "0x7065cb480000000000000000000000002aaaa2", - "gasLimit" : "0x0faf5d", + "data" : "0x7065cb480000000000000000000000003fb1cd2cd96c6d5c0b5eb3322d807b34482481d4", + "gasLimit" : "0x989680", "gasPrice" : "1", "nonce" : "2", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", @@ -218,8 +218,8 @@ { "transactions" : [ { - "data" : "0x7065cb480000000000000000000000003aaaa3", - "gasLimit" : "0x0faf5d", + "data" : "0xba51a6df0000000000000000000000000000000000000000000000000000000000000002", + "gasLimit" : "0x989680", "gasPrice" : "1", "nonce" : "3", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", @@ -233,8 +233,8 @@ { "transactions" : [ { - "data" : "0x7065cb480000000000000000000000004aaaa4", - "gasLimit" : "0x0faf5d", + "data" : "0xb61d27f6000000000000000000000000aaaf5374fce5edbc8e2a8697c15331677e6ebaaa00000000000000000000000000000000000000000000000000000000000000090000000000000000000000000000000000000000000000000000000000000060", + "gasLimit" : "20141591", "gasPrice" : "1", "nonce" : "4", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", @@ -248,8 +248,8 @@ { "transactions" : [ { - "data" : "0x7065cb480000000000000000000000005aaaa5", - "gasLimit" : "0x0faf5d", + "data" : "0xb75c7dc66877e4536b661640954061cdbc3a9761fb5245c340fcb1721307cd9d5f285c96", + "gasLimit" : "20141591", "gasPrice" : "1", "nonce" : "5", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", @@ -263,222 +263,68 @@ { "transactions" : [ { - "data" : "0x7065cb480000000000000000000000006aaaa6", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "6", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb480000000000000000000000007aaaa7", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "7", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb480000000000000000000000008aaaa8", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "8", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb480000000000000000000000009aaaa9", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "9", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000010aaaa10", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "10", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000011aaaa11", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "11", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000012aaaa12", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "12", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000013aaaa13", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "13", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000014aaaa14", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "14", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000015aaaa15", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "15", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000016aaaa16", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "16", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000017aaaa17", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "17", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000018aaaa18", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "18", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000019aaaa19", - "gasLimit" : "0x0faf5d", + "data" : "0x797af6276877e4536b661640954061cdbc3a9761fb5245c340fcb1721307cd9d5f285c96", + "gasLimit" : "20141591", "gasPrice" : "1", - "nonce" : "19", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "nonce" : "0", + "secretKey" : "a95defe70ebea7804f9c3be42d20d24375e2a92b9d9666b832069c5f3cd423dd", "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", "value" : "100" } ], "uncleHeaders" : [ ] + } + ] + }, + "wallet2outOf3txsRevokeAndConfirmAgain" : { + "genesisBlockHeader" : { + "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1", + "difficulty" : "131072", + "extraData" : "0x42", + "gasLimit" : "30141592", + "gasUsed" : "0", + "mixHash" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "nonce" : "0x0102030405060708", + "number" : "0", + "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000", + "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "stateRoot" : "0xf99eb1626cfa6db435c0836235942d7ccaa935f1ae247d3f1c21e495685f903a", + "timestamp" : "0x54c98c81", + "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + }, + "expect" : { + "aaaf5374fce5edbc8e2a8697c15331677e6ebaaa" : { + "balance" : "0x09" + } + }, + "pre" : { + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "100000000000000", + "nonce" : "0", + "code" : "", + "storage": {} }, + "3fb1cd2cd96c6d5c0b5eb3322d807b34482481d4" : { + "balance" : "100000000000000", + "code" : "0x", + "nonce" : "0", + "storage" : { + } + } + }, + "blocks" : [ { "transactions" : [ { - "data" : "0x7065cb4800000000000000000000000020aaaa20", - "gasLimit" : "0x0faf5d", + "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff16600381905581526101026020526040902055620151804204610107557f9adeddf84386b336eb7b3e18e7a6099be08fd81ea5d5142f4d2b630f8d20cf0160006040a1610e39806100716000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b6102976004356000604060003680828437909120905061053b815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610a7557610bd7565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061067781610108565b610297600435604060003680828437909120905061049281610108565b61029d6004355b6000816108b481610108565b610297600435604060003680828437909120905061066b81610108565b61029d6004803590602480359160443591820191013560006106a3846000610dce33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156102a757610329565b610297600435604060003680828437909120905061061a81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061039c81610108565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561032957815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b15610395576103aa83610146565b156103b55750610397565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156103eb5750610397565b61040d5b6101045460005b81811015610d2c57610104805482908110610d7457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061033057005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b1561048d576104a082610146565b156104ab575061048f565b6104b36103ef565b60015460fa901015156104ca576104c86104e1565b505b60015460fa9010151561050b575061048f565b6105d25b600060015b600154811015610c17575b60015481108015610c7357506002816101008110610c6c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061043257005b156103975773ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120549250821415610576575061048d565b6001600160005054036000600050541115610591575061048d565b600060028361010081106105a157005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556104dd6103ef565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b1561048d5760015482111561062f575061048f565b600082905561063c6103ef565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b1561048d575061010655565b1561048f5760006101055550565b1561048d578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b6000868152610103602052604081208054909450909250821415610b00578154835560018381018390556101048054918201808255828015829011610b8c578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610b8a5760008155600101610adf565b6000918252602090912001555b506001820154600284900a90811660001415610bd75773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610ba6576000868152610103602052610104805460409092206002015490918110610be057005b505b5050506002840181905561010480548892908110610af357005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610bd7565b5090565b01546000145b15610c8057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610c2157506001546002906101008110610c1b57005b0154600014155b15610c4f576001016104f1565b60015481108015610ca457506001546002906101008110610c9d57005b0154600014155b8015610cbf57506002816101008110610cb957005b01546000145b15610cd8576001546002906101008110610cdd57005b01555b6104e6565b01546002826101008110610ced57005b01558061010260006002836101008110610d0357005b0154815260208101919091526040016000908120919091556001546002906101008110610cd557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156103955760008155600101610d60565b6000918252602082200154141515610dc65761010480546101039160009184908110610d9c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016103f6565b156108af5761010754610de45b62015180420490565b1115610dfd57600061010555610df8610ddb565b610107555b6101055480830110158015610e1b5750610105546101065490830111155b15610e31575061010580548201905560016108af565b5060006108af56", + "gasLimit" : "0x989680", "gasPrice" : "1", - "nonce" : "20", + "nonce" : "0", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "to" : "", "value" : "100" } ], @@ -488,10 +334,10 @@ { "transactions" : [ { - "data" : "0x7065cb4800000000000000000000000021aaaa21", - "gasLimit" : "0x0faf5d", + "data" : "0x7065cb48000000000000000000000000aaaf5374fce5edbc8e2a8697c15331677e6ebaaa", + "gasLimit" : "0x989680", "gasPrice" : "1", - "nonce" : "21", + "nonce" : "1", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", "value" : "100" @@ -503,10 +349,10 @@ { "transactions" : [ { - "data" : "0x7065cb4800000000000000000000000022aaaa22", - "gasLimit" : "0x0faf5d", + "data" : "0x7065cb480000000000000000000000003fb1cd2cd96c6d5c0b5eb3322d807b34482481d4", + "gasLimit" : "0x989680", "gasPrice" : "1", - "nonce" : "22", + "nonce" : "2", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", "value" : "100" @@ -518,10 +364,10 @@ { "transactions" : [ { - "data" : "0x7065cb4800000000000000000000000023aaaa23", - "gasLimit" : "0x0faf5d", + "data" : "0xba51a6df0000000000000000000000000000000000000000000000000000000000000002", + "gasLimit" : "0x989680", "gasPrice" : "1", - "nonce" : "23", + "nonce" : "3", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", "value" : "100" @@ -533,10 +379,10 @@ { "transactions" : [ { - "data" : "0x7065cb4800000000000000000000000024aaaa24", - "gasLimit" : "0x0faf5d", + "data" : "0xb61d27f6000000000000000000000000aaaf5374fce5edbc8e2a8697c15331677e6ebaaa00000000000000000000000000000000000000000000000000000000000000090000000000000000000000000000000000000000000000000000000000000060", + "gasLimit" : "20141591", "gasPrice" : "1", - "nonce" : "24", + "nonce" : "4", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", "value" : "100" @@ -548,10 +394,10 @@ { "transactions" : [ { - "data" : "0x7065cb4800000000000000000000000025aaaa25", - "gasLimit" : "0x0faf5d", + "data" : "0xb75c7dc66877e4536b661640954061cdbc3a9761fb5245c340fcb1721307cd9d5f285c96", + "gasLimit" : "20141591", "gasPrice" : "1", - "nonce" : "25", + "nonce" : "5", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", "value" : "100" @@ -563,10 +409,10 @@ { "transactions" : [ { - "data" : "0x7065cb4800000000000000000000000026aaaa26", - "gasLimit" : "0x0faf5d", + "data" : "0x797af6276877e4536b661640954061cdbc3a9761fb5245c340fcb1721307cd9d5f285c96", + "gasLimit" : "20141591", "gasPrice" : "1", - "nonce" : "26", + "nonce" : "6", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", "value" : "100" @@ -578,3483 +424,3945 @@ { "transactions" : [ { - "data" : "0x7065cb4800000000000000000000000027aaaa27", - "gasLimit" : "0x0faf5d", + "data" : "0x797af6276877e4536b661640954061cdbc3a9761fb5245c340fcb1721307cd9d5f285c96", + "gasLimit" : "20141591", "gasPrice" : "1", - "nonce" : "27", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "nonce" : "0", + "secretKey" : "a95defe70ebea7804f9c3be42d20d24375e2a92b9d9666b832069c5f3cd423dd", "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", "value" : "100" } ], "uncleHeaders" : [ ] + } + ] + }, + + "walletReorganizeOwners" : { + "genesisBlockHeader" : { + "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1", + "difficulty" : "131072", + "extraData" : "0x42", + "gasLimit" : "31041592", + "gasUsed" : "0", + "mixHash" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "nonce" : "0x0102030405060708", + "number" : "0", + "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000", + "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "stateRoot" : "0xf99eb1626cfa6db435c0836235942d7ccaa935f1ae247d3f1c21e495685f903a", + "timestamp" : "0x54c98c81", + "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + }, + "expect" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "10" + } }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000028aaaa28", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "28", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" + "pre" : { + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "10000000000", + "nonce" : "0", + "code" : "", + "storage": {} + }, + "3fb1cd2cd96c6d5c0b5eb3322d807b34482481d4" : { + "balance" : "0x0de0b6b3a75ef08f", + "code" : "0x", + "nonce" : "0", + "storage" : { } - ], - "uncleHeaders" : [ - ] + } }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000029aaaa29", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "29", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000030aaaa30", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "30", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000031aaaa31", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "31", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000032aaaa32", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "32", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000033aaaa33", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "33", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000034aaaa34", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "34", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000035aaaa35", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "35", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000036aaaa36", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "36", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000037aaaa37", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "37", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000038aaaa38", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "38", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000039aaaa39", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "39", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000040aaaa40", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "40", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000041aaaa41", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "41", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000042aaaa42", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "42", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000043aaaa43", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "43", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000044aaaa44", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "44", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000045aaaa45", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "45", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000046aaaa46", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "46", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000047aaaa47", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "47", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000048aaaa48", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "48", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000049aaaa49", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "49", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000050aaaa50", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "50", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000051aaaa51", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "51", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000052aaaa52", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "52", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000053aaaa53", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "53", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000054aaaa54", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "54", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000055aaaa55", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "55", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000056aaaa56", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "56", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000057aaaa57", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "57", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000058aaaa58", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "58", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000059aaaa59", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "59", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000060aaaa60", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "60", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000061aaaa61", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "61", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000062aaaa62", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "62", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000063aaaa63", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "63", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000064aaaa64", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "64", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000065aaaa65", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "65", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000066aaaa66", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "66", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000067aaaa67", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "67", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000068aaaa68", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "68", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000069aaaa69", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "69", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000070aaaa70", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "70", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000071aaaa71", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "71", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000072aaaa72", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "72", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000073aaaa73", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "73", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000074aaaa74", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "74", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000075aaaa75", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "75", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000076aaaa76", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "76", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000077aaaa77", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "77", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000078aaaa78", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "78", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000079aaaa79", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "79", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000080aaaa80", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "80", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000081aaaa81", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "81", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000082aaaa82", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "82", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000083aaaa83", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "83", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000084aaaa84", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "84", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000085aaaa85", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "85", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000086aaaa86", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "86", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000087aaaa87", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "87", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000088aaaa88", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "88", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000089aaaa89", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "89", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000090aaaa90", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "90", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000091aaaa91", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "91", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000092aaaa92", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "92", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000093aaaa93", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "93", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000094aaaa94", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "94", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000095aaaa95", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "95", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000096aaaa96", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "96", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000097aaaa97", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "97", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000098aaaa98", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "98", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb4800000000000000000000000099aaaa99", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "99", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000100aaaa100", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "100", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000101aaaa101", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "101", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000102aaaa102", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "102", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000103aaaa103", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "103", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000104aaaa104", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "104", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000105aaaa105", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "105", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000106aaaa106", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "106", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000107aaaa107", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "107", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000108aaaa108", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "108", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000109aaaa109", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "109", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000110aaaa110", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "110", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000111aaaa111", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "111", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000112aaaa112", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "112", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000113aaaa113", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "113", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000114aaaa114", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "114", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000115aaaa115", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "115", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000116aaaa116", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "116", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000117aaaa117", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "117", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000118aaaa118", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "118", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000119aaaa119", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "119", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000120aaaa120", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "120", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000121aaaa121", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "121", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000122aaaa122", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "122", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000123aaaa123", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "123", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000124aaaa124", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "124", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000125aaaa125", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "125", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000126aaaa126", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "126", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000127aaaa127", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "127", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000128aaaa128", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "128", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000129aaaa129", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "129", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000130aaaa130", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "130", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000131aaaa131", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "131", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000132aaaa132", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "132", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000133aaaa133", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "133", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000134aaaa134", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "134", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000135aaaa135", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "135", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000136aaaa136", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "136", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000137aaaa137", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "137", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000138aaaa138", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "138", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000139aaaa139", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "139", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000140aaaa140", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "140", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000141aaaa141", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "141", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000142aaaa142", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "142", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000143aaaa143", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "143", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000144aaaa144", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "144", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000145aaaa145", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "145", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000146aaaa146", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "146", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000147aaaa147", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "147", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000148aaaa148", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "148", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000149aaaa149", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "149", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000150aaaa150", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "150", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000151aaaa151", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "151", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000152aaaa152", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "152", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000153aaaa153", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "153", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000154aaaa154", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "154", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000155aaaa155", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "155", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000156aaaa156", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "156", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000157aaaa157", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "157", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000158aaaa158", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "158", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000159aaaa159", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "159", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000160aaaa160", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "160", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000161aaaa161", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "161", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000162aaaa162", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "162", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000163aaaa163", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "163", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000164aaaa164", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "164", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000165aaaa165", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "165", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000166aaaa166", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "166", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000167aaaa167", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "167", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000168aaaa168", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "168", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000169aaaa169", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "169", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000170aaaa170", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "170", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000171aaaa171", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "171", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000172aaaa172", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "172", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000173aaaa173", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "173", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000174aaaa174", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "174", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000175aaaa175", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "175", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000176aaaa176", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "176", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000177aaaa177", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "177", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000178aaaa178", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "178", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000179aaaa179", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "179", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000180aaaa180", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "180", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000181aaaa181", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "181", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000182aaaa182", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "182", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000183aaaa183", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "183", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000184aaaa184", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "184", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000185aaaa185", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "185", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000186aaaa186", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "186", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000187aaaa187", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "187", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000188aaaa188", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "188", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000189aaaa189", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "189", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000190aaaa190", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "190", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000191aaaa191", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "191", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000192aaaa192", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "192", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000193aaaa193", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "193", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000194aaaa194", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "194", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000195aaaa195", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "195", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000196aaaa196", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "196", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000197aaaa197", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "197", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000198aaaa198", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "198", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000199aaaa199", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "199", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000200aaaa200", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "200", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000201aaaa201", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "201", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000202aaaa202", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "202", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000203aaaa203", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "203", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000204aaaa204", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "204", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000205aaaa205", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "205", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000206aaaa206", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "206", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000207aaaa207", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "207", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000208aaaa208", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "208", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000209aaaa209", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "209", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000210aaaa210", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "210", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000211aaaa211", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "211", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000212aaaa212", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "212", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000213aaaa213", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "213", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000214aaaa214", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "214", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000215aaaa215", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "215", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000216aaaa216", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "216", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000217aaaa217", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "217", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000218aaaa218", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "218", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000219aaaa219", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "219", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000220aaaa220", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "220", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000221aaaa221", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "221", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000222aaaa222", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "222", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000223aaaa223", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "223", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000224aaaa224", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "224", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000225aaaa225", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "225", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000226aaaa226", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "226", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000227aaaa227", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "227", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000228aaaa228", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "228", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000229aaaa229", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "229", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000230aaaa230", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "230", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000231aaaa231", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "231", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000232aaaa232", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "232", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000233aaaa233", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "233", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000234aaaa234", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "234", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000235aaaa235", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "235", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000236aaaa236", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "236", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000237aaaa237", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "237", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000238aaaa238", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "238", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000239aaaa239", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "239", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000240aaaa240", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "240", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000241aaaa241", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "241", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000242aaaa242", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "242", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000243aaaa243", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "243", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000244aaaa244", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "244", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000245aaaa245", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "245", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000246aaaa246", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "246", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000247aaaa247", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "247", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000248aaaa248", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "248", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000249aaaa249", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "249", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000250aaaa250", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "250", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000251aaaa251", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "251", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000252aaaa252", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "252", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000253aaaa253", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "253", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000254aaaa254", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "254", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000255aaaa255", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "255", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000256aaaa256", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "256", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x173825d9000000000000000000000000156aaaa156", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "257", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - }, - { - "transactions" : [ - { - "data" : "0x7065cb48000000000000000000000000256aaaa256", - "gasLimit" : "0x0faf5d", - "gasPrice" : "1", - "nonce" : "258", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", - "value" : "100" - } - ], - "uncleHeaders" : [ - ] - } - ] - } + "blocks" : [ + { + "transactions" : [ + { + "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff16600381905581526101026020526040902055620151804204610107557f9adeddf84386b336eb7b3e18e7a6099be08fd81ea5d5142f4d2b630f8d20cf0160006040a1610e39806100716000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b6102976004356000604060003680828437909120905061053b815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610a7557610bd7565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061067781610108565b610297600435604060003680828437909120905061049281610108565b61029d6004355b6000816108b481610108565b610297600435604060003680828437909120905061066b81610108565b61029d6004803590602480359160443591820191013560006106a3846000610dce33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156102a757610329565b610297600435604060003680828437909120905061061a81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061039c81610108565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561032957815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b15610395576103aa83610146565b156103b55750610397565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156103eb5750610397565b61040d5b6101045460005b81811015610d2c57610104805482908110610d7457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061033057005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b1561048d576104a082610146565b156104ab575061048f565b6104b36103ef565b60015460fa901015156104ca576104c86104e1565b505b60015460fa9010151561050b575061048f565b6105d25b600060015b600154811015610c17575b60015481108015610c7357506002816101008110610c6c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061043257005b156103975773ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120549250821415610576575061048d565b6001600160005054036000600050541115610591575061048d565b600060028361010081106105a157005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556104dd6103ef565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b1561048d5760015482101561062f575061048f565b600082905561063c6103ef565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b1561048d575061010655565b1561048f5760006101055550565b1561048d578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b6000868152610103602052604081208054909450909250821415610b00578154835560018381018390556101048054918201808255828015829011610b8c578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610b8a5760008155600101610adf565b6000918252602090912001555b506001820154600284900a90811660001415610bd75773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610ba6576000868152610103602052610104805460409092206002015490918110610be057005b505b5050506002840181905561010480548892908110610af357005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610bd7565b5090565b01546000145b15610c8057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610c2157506001546002906101008110610c1b57005b0154600014155b15610c4f576001016104f1565b60015481108015610ca457506001546002906101008110610c9d57005b0154600014155b8015610cbf57506002816101008110610cb957005b01546000145b15610cd8576001546002906101008110610cdd57005b01555b6104e6565b01546002826101008110610ced57005b01558061010260006002836101008110610d0357005b0154815260208101919091526040016000908120919091556001546002906101008110610cd557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156103955760008155600101610d60565b6000918252602082200154141515610dc65761010480546101039160009184908110610d9c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016103f6565b156108af5761010754610de45b62015180420490565b1115610dfd57600061010555610df8610ddb565b610107555b6101055480830110158015610e1b5750610105546101065490830111155b15610e31575061010580548201905560016108af565b5060006108af56", + "gasLimit" : "0x989680", + "gasPrice" : "1", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb480000000000000000000000001aaaa1", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "1", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb480000000000000000000000002aaaa2", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "2", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb480000000000000000000000003aaaa3", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "3", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb480000000000000000000000004aaaa4", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "4", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb480000000000000000000000005aaaa5", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "5", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb480000000000000000000000006aaaa6", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "6", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb480000000000000000000000007aaaa7", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "7", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb480000000000000000000000008aaaa8", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "8", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb480000000000000000000000009aaaa9", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "9", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000010aaaa10", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "10", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000011aaaa11", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "11", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000012aaaa12", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "12", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000013aaaa13", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "13", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000014aaaa14", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "14", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000015aaaa15", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "15", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000016aaaa16", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "16", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000017aaaa17", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "17", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000018aaaa18", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "18", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000019aaaa19", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "19", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000020aaaa20", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "20", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000021aaaa21", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "21", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000022aaaa22", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "22", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000023aaaa23", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "23", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000024aaaa24", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "24", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000025aaaa25", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "25", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000026aaaa26", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "26", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000027aaaa27", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "27", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000028aaaa28", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "28", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000029aaaa29", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "29", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000030aaaa30", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "30", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000031aaaa31", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "31", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000032aaaa32", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "32", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000033aaaa33", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "33", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000034aaaa34", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "34", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000035aaaa35", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "35", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000036aaaa36", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "36", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000037aaaa37", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "37", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000038aaaa38", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "38", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000039aaaa39", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "39", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000040aaaa40", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "40", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000041aaaa41", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "41", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000042aaaa42", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "42", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000043aaaa43", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "43", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000044aaaa44", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "44", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000045aaaa45", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "45", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000046aaaa46", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "46", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000047aaaa47", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "47", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000048aaaa48", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "48", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000049aaaa49", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "49", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000050aaaa50", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "50", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000051aaaa51", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "51", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000052aaaa52", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "52", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000053aaaa53", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "53", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000054aaaa54", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "54", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000055aaaa55", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "55", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000056aaaa56", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "56", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000057aaaa57", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "57", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000058aaaa58", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "58", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000059aaaa59", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "59", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000060aaaa60", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "60", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000061aaaa61", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "61", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000062aaaa62", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "62", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000063aaaa63", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "63", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000064aaaa64", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "64", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000065aaaa65", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "65", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000066aaaa66", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "66", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000067aaaa67", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "67", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000068aaaa68", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "68", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000069aaaa69", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "69", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000070aaaa70", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "70", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000071aaaa71", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "71", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000072aaaa72", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "72", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000073aaaa73", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "73", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000074aaaa74", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "74", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000075aaaa75", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "75", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000076aaaa76", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "76", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000077aaaa77", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "77", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000078aaaa78", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "78", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000079aaaa79", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "79", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000080aaaa80", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "80", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000081aaaa81", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "81", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000082aaaa82", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "82", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000083aaaa83", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "83", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000084aaaa84", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "84", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000085aaaa85", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "85", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000086aaaa86", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "86", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000087aaaa87", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "87", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000088aaaa88", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "88", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000089aaaa89", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "89", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000090aaaa90", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "90", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000091aaaa91", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "91", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000092aaaa92", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "92", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000093aaaa93", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "93", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000094aaaa94", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "94", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000095aaaa95", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "95", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000096aaaa96", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "96", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000097aaaa97", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "97", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000098aaaa98", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "98", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb4800000000000000000000000099aaaa99", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "99", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000100aaaa100", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "100", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000101aaaa101", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "101", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000102aaaa102", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "102", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000103aaaa103", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "103", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000104aaaa104", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "104", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000105aaaa105", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "105", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000106aaaa106", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "106", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000107aaaa107", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "107", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000108aaaa108", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "108", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000109aaaa109", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "109", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000110aaaa110", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "110", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000111aaaa111", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "111", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000112aaaa112", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "112", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000113aaaa113", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "113", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000114aaaa114", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "114", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000115aaaa115", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "115", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000116aaaa116", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "116", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000117aaaa117", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "117", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000118aaaa118", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "118", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000119aaaa119", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "119", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000120aaaa120", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "120", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000121aaaa121", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "121", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000122aaaa122", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "122", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000123aaaa123", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "123", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000124aaaa124", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "124", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000125aaaa125", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "125", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000126aaaa126", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "126", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000127aaaa127", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "127", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000128aaaa128", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "128", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000129aaaa129", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "129", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000130aaaa130", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "130", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000131aaaa131", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "131", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000132aaaa132", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "132", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000133aaaa133", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "133", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000134aaaa134", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "134", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000135aaaa135", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "135", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000136aaaa136", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "136", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000137aaaa137", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "137", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000138aaaa138", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "138", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000139aaaa139", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "139", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000140aaaa140", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "140", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000141aaaa141", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "141", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000142aaaa142", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "142", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000143aaaa143", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "143", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000144aaaa144", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "144", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000145aaaa145", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "145", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000146aaaa146", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "146", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000147aaaa147", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "147", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000148aaaa148", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "148", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000149aaaa149", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "149", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000150aaaa150", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "150", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000151aaaa151", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "151", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000152aaaa152", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "152", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000153aaaa153", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "153", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000154aaaa154", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "154", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000155aaaa155", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "155", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000156aaaa156", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "156", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000157aaaa157", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "157", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000158aaaa158", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "158", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000159aaaa159", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "159", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000160aaaa160", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "160", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000161aaaa161", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "161", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000162aaaa162", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "162", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000163aaaa163", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "163", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000164aaaa164", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "164", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000165aaaa165", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "165", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000166aaaa166", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "166", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000167aaaa167", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "167", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000168aaaa168", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "168", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000169aaaa169", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "169", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000170aaaa170", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "170", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000171aaaa171", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "171", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000172aaaa172", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "172", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000173aaaa173", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "173", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000174aaaa174", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "174", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000175aaaa175", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "175", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000176aaaa176", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "176", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000177aaaa177", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "177", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000178aaaa178", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "178", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000179aaaa179", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "179", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000180aaaa180", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "180", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000181aaaa181", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "181", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000182aaaa182", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "182", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000183aaaa183", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "183", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000184aaaa184", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "184", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000185aaaa185", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "185", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000186aaaa186", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "186", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000187aaaa187", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "187", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000188aaaa188", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "188", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000189aaaa189", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "189", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000190aaaa190", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "190", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000191aaaa191", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "191", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000192aaaa192", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "192", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000193aaaa193", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "193", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000194aaaa194", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "194", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000195aaaa195", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "195", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000196aaaa196", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "196", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000197aaaa197", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "197", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000198aaaa198", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "198", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000199aaaa199", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "199", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000200aaaa200", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "200", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000201aaaa201", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "201", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000202aaaa202", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "202", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000203aaaa203", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "203", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000204aaaa204", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "204", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000205aaaa205", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "205", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000206aaaa206", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "206", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000207aaaa207", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "207", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000208aaaa208", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "208", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000209aaaa209", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "209", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000210aaaa210", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "210", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000211aaaa211", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "211", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000212aaaa212", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "212", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000213aaaa213", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "213", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000214aaaa214", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "214", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000215aaaa215", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "215", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000216aaaa216", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "216", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000217aaaa217", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "217", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000218aaaa218", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "218", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000219aaaa219", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "219", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000220aaaa220", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "220", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000221aaaa221", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "221", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000222aaaa222", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "222", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000223aaaa223", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "223", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000224aaaa224", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "224", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000225aaaa225", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "225", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000226aaaa226", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "226", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000227aaaa227", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "227", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000228aaaa228", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "228", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000229aaaa229", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "229", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000230aaaa230", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "230", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000231aaaa231", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "231", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000232aaaa232", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "232", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000233aaaa233", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "233", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000234aaaa234", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "234", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000235aaaa235", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "235", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000236aaaa236", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "236", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000237aaaa237", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "237", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000238aaaa238", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "238", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000239aaaa239", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "239", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000240aaaa240", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "240", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000241aaaa241", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "241", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000242aaaa242", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "242", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000243aaaa243", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "243", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000244aaaa244", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "244", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000245aaaa245", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "245", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000246aaaa246", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "246", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000247aaaa247", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "247", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000248aaaa248", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "248", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000249aaaa249", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "249", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000250aaaa250", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "250", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000251aaaa251", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "251", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000252aaaa252", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "252", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000253aaaa253", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "253", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000254aaaa254", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "254", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000255aaaa255", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "255", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000256aaaa256", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "256", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x173825d9000000000000000000000000156aaaa156", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "257", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "0x7065cb48000000000000000000000000256aaaa256", + "gasLimit" : "0x0faf5d", + "gasPrice" : "1", + "nonce" : "258", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "6295ee1b4f6dd65047762f924ecd367c17eabf8f", + "value" : "100" + } + ], + "uncleHeaders" : [ + ] + } + ] + } } diff --git a/test/libethereum/StateTestsFiller/stWalletTestFiller.json b/test/libethereum/StateTestsFiller/stWalletTestFiller.json index 386731c7f..031d1f0c4 100644 --- a/test/libethereum/StateTestsFiller/stWalletTestFiller.json +++ b/test/libethereum/StateTestsFiller/stWalletTestFiller.json @@ -18,7 +18,7 @@ } }, "transaction" : { - "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff166003819055815261010260205260408120919091556108ae90819061004590396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548210156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", + "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff166003819055815261010260205260408120919091556108ae90819061004590396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b610181600435600060406000368082843790912090506102fd815b73ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054818080838114156107465761073d565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b61018160043560406000368082843790912090506101f181610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156103e557610467565b61018160043560406000368082843790912090506103c381610080565b610181600435602435600060406000368082843790912090506104d981610080565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156101ec576101ff826100be565b1561020a57506101ee565b61022c5b6101045460005b8181101561066a576101048054829081106106b257005b60015460fa901015156102435761024161025a565b505b60015460fa9010151561028457506101ee565b6102b45b600060015b600154811015610555575b600154811080156105b1575060028161010081106105aa57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061019157005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b156102f85773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561033857506101ec565b600160016000505403600060005054111561035357506101ec565b6000600283610100811061036357005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561025661020e565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b156101ec576001548211156103d857506101ee565b600082905561039461020e565b5050506000828152610103602052604081206001810154600284900a929083168190111561046757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156104d3576104e7836100be565b156104f257506102f8565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082141561052857506102f8565b61053061020e565b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061046e57005b5090565b01546000145b156105be57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b6001805411801561055f5750600154600290610100811061055957005b0154600014155b1561058d5760010161026a565b600154811080156105e2575060015460029061010081106105db57005b0154600014155b80156105fd575060028161010081106105f757005b01546000145b1561061657600154600290610100811061061b57005b01555b61025f565b0154600282610100811061062b57005b0155806101026000600283610100811061064157005b015481526020810191909152604001600090812091909155600154600290610100811061061357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156104d3576000815560010161069e565b600091825260208220015414151561070457610104805461010391600091849081106106da57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b600101610215565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b60008681526101036020526040812080549094509092508214156107d157815483556001838101839055610104805491820180825582801582901161085d578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b8082111561085b57600081556001016107b0565b6000918252602090912001555b506001820154600284900a9081166000141561073d5773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a1825460019011151561070c57600086815261010360205261010480546040909220600201549091811061087757005b505b50505060028401819055610104805488929081106107c457005b600091825260208083209091018290558782526101039052604081208181556001818101839055600290910191909155945061073d56", "gasLimit" : "169491", "gasPrice" : "1", "nonce" : "0", @@ -28,7 +28,7 @@ } }, - "multiOwnedConstructionPartial" : { + "multiOwnedConstructionNotEnoughGasPartial" : { "env" : { "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", "currentDifficulty" : "256", @@ -47,7 +47,7 @@ } }, "transaction" : { - "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff166003819055815261010260205260408120919091556108ae90819061004590396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548210156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", + "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff166003819055815261010260205260408120919091556108ae90819061004590396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b610181600435600060406000368082843790912090506102fd815b73ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054818080838114156107465761073d565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b61018160043560406000368082843790912090506101f181610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156103e557610467565b61018160043560406000368082843790912090506103c381610080565b610181600435602435600060406000368082843790912090506104d981610080565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156101ec576101ff826100be565b1561020a57506101ee565b61022c5b6101045460005b8181101561066a576101048054829081106106b257005b60015460fa901015156102435761024161025a565b505b60015460fa9010151561028457506101ee565b6102b45b600060015b600154811015610555575b600154811080156105b1575060028161010081106105aa57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061019157005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b156102f85773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561033857506101ec565b600160016000505403600060005054111561035357506101ec565b6000600283610100811061036357005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561025661020e565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b156101ec576001548211156103d857506101ee565b600082905561039461020e565b5050506000828152610103602052604081206001810154600284900a929083168190111561046757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156104d3576104e7836100be565b156104f257506102f8565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082141561052857506102f8565b61053061020e565b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061046e57005b5090565b01546000145b156105be57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b6001805411801561055f5750600154600290610100811061055957005b0154600014155b1561058d5760010161026a565b600154811080156105e2575060015460029061010081106105db57005b0154600014155b80156105fd575060028161010081106105f757005b01546000145b1561061657600154600290610100811061061b57005b01555b61025f565b0154600282610100811061062b57005b0155806101026000600283610100811061064157005b015481526020810191909152604001600090812091909155600154600290610100811061061357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156104d3576000815560010161069e565b600091825260208220015414151561070457610104805461010391600091849081106106da57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b600101610215565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b60008681526101036020526040812080549094509092508214156107d157815483556001838101839055610104805491820180825582801582901161085d578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b8082111561085b57600081556001016107b0565b6000918252602090912001555b506001820154600284900a9081166000141561073d5773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a1825460019011151561070c57600086815261010360205261010480546040909220600201549091811061087757005b505b50505060028401819055610104805488929081106107c457005b600091825260208083209091018290558782526101039052604081208181556001818101839055600290910191909155945061073d56", "gasLimit" : "0x0a98b3", "gasPrice" : "1", "nonce" : "0", @@ -76,8 +76,8 @@ } }, "transaction" : { - "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff166003819055815261010260205260408120919091556108ae90819061004590396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548210156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", - "gasLimit" : "10000000", + "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff166003819055815261010260205260408120919091556108ae90819061004590396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b610181600435600060406000368082843790912090506102fd815b73ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054818080838114156107465761073d565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b61018160043560406000368082843790912090506101f181610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156103e557610467565b61018160043560406000368082843790912090506103c381610080565b610181600435602435600060406000368082843790912090506104d981610080565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156101ec576101ff826100be565b1561020a57506101ee565b61022c5b6101045460005b8181101561066a576101048054829081106106b257005b60015460fa901015156102435761024161025a565b505b60015460fa9010151561028457506101ee565b6102b45b600060015b600154811015610555575b600154811080156105b1575060028161010081106105aa57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061019157005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b156102f85773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561033857506101ec565b600160016000505403600060005054111561035357506101ec565b6000600283610100811061036357005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561025661020e565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b156101ec576001548211156103d857506101ee565b600082905561039461020e565b5050506000828152610103602052604081206001810154600284900a929083168190111561046757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156104d3576104e7836100be565b156104f257506102f8565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082141561052857506102f8565b61053061020e565b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061046e57005b5090565b01546000145b156105be57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b6001805411801561055f5750600154600290610100811061055957005b0154600014155b1561058d5760010161026a565b600154811080156105e2575060015460029061010081106105db57005b0154600014155b80156105fd575060028161010081106105f757005b01546000145b1561061657600154600290610100811061061b57005b01555b61025f565b0154600282610100811061062b57005b0155806101026000600283610100811061064157005b015481526020810191909152604001600090812091909155600154600290610100811061061357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156104d3576000815560010161069e565b600091825260208220015414151561070457610104805461010391600091849081106106da57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b600101610215565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b60008681526101036020526040812080549094509092508214156107d157815483556001838101839055610104805491820180825582801582901161085d578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b8082111561085b57600081556001016107b0565b6000918252602090912001555b506001820154600284900a9081166000141561073d5773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a1825460019011151561070c57600086815261010360205261010480546040909220600201549091811061087757005b505b50505060028401819055610104805488929081106107c457005b600091825260208083209091018290558782526101039052604081208181556001818101839055600290910191909155945061073d56", + "gasLimit" : "0x0a98b4", "gasPrice" : "1", "nonce" : "0", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", @@ -98,7 +98,7 @@ "pre" : { "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548210156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -138,7 +138,7 @@ "pre" : { "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548210156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -178,7 +178,7 @@ "pre" : { "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548210156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -218,7 +218,7 @@ "pre" : { "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548210156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -258,7 +258,7 @@ "pre" : { "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548210156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -276,7 +276,7 @@ } }, "transaction" : { - "data" : "0x7065cb48000000000000000000000000aaaf5374fce5edbc8e2a8697c15331677e6ebaaa", + "data" : "0x7065cb480000000000000000000000003fb1cd2cd96c6d5c0b5eb3322d807b34482481d4", "gasLimit" : "10000000", "gasPrice" : "1", "nonce" : "1", @@ -298,7 +298,7 @@ "pre" : { "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548210156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -338,7 +338,7 @@ "pre" : { "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548210156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -378,7 +378,7 @@ "pre" : { "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548210156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -425,7 +425,7 @@ "pre" : { "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548210156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -465,7 +465,7 @@ "pre" : { "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548210156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -505,7 +505,7 @@ "pre" : { "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548210156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -545,7 +545,7 @@ "pre" : { "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548210156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -585,7 +585,7 @@ "pre" : { "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548210156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -625,7 +625,7 @@ "pre" : { "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548210156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -712,8 +712,8 @@ } }, "transaction" : { - "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff16600381905581526101026020526040902055620151804204610107556109158061004b6000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461007b5780632f54bf6e146100cd5780635c52c2f5146100fe5780637065cb4814610118578063b20d30a914610135578063b75c7dc614610152578063ba51a6df1461018f578063f00d4b5d146101ac57005b6101ce60043560006040600036808284379091209050610472815b73ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054818080838114156105bc5761071e565b6101d46004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6101ce60406000368082843790912090506105ae81610096565b6101ce60043560406000368082843790912090506103c981610096565b6101ce60043560406000368082843790912090506105a281610096565b6101ce60043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156101de57610260565b6101ce600435604060003680828437909120905061055181610096565b6101ce600435602435600060406000368082843790912090506102d381610096565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561026057815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b156102cc576102e1836100d4565b156102ec57506102ce565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082141561032257506102ce565b6103445b6101045460005b81811015610873576101048054829081106108bb57005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061026757005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103c4576103d7826100d4565b156103e257506103c6565b6103ea610326565b60015460fa90101515610401576103ff610418565b505b60015460fa9010151561044257506103c6565b6105095b600060015b60015481101561075e575b600154811080156107ba575060028161010081106107b357005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061036957005b156102ce5773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104ad57506103c4565b60016001600050540360006000505411156104c857506103c4565b600060028361010081106104d857005b015573ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812055610414610326565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156103c45760015482101561056657506103c6565b6000829055610573610326565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b156103c4575061010655565b156103c65760006101055550565b60008681526101036020526040812080549094509092508214156106475781548355600183810183905561010480549182018082558280158290116106d3578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106d15760008155600101610626565b6000918252602090912001555b506001820154600284900a9081166000141561071e5773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156106ed57600086815261010360205261010480546040909220600201549091811061072757005b505b505050600284018190556101048054889290811061063a57005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600091825260208083209091018290558782526101039052604081208181556001818101839055600290910191909155945061071e565b5090565b01546000145b156107c757600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b600180541180156107685750600154600290610100811061076257005b0154600014155b1561079657600101610428565b600154811080156107eb575060015460029061010081106107e457005b0154600014155b80156108065750600281610100811061080057005b01546000145b1561081f57600154600290610100811061082457005b01555b61041d565b0154600282610100811061083457005b0155806101026000600283610100811061084a57005b015481526020810191909152604001600090812091909155600154600290610100811061081c57005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156102cc57600081556001016108a7565b600091825260208220015414151561090d57610104805461010391600091849081106108e357005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032d56", - "gasLimit" : "10000000", + "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff16600381905581526101026020526040902055620151804204610107556109158061004b6000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461007b5780632f54bf6e146100cd5780635c52c2f5146100fe5780637065cb4814610118578063b20d30a914610135578063b75c7dc614610152578063ba51a6df1461018f578063f00d4b5d146101ac57005b6101ce60043560006040600036808284379091209050610301815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610773576108d5565b6101d46004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6101ce604060003680828437909120905061043e81610096565b6101ce600435604060003680828437909120905061023e81610096565b6101ce600435604060003680828437909120905061043281610096565b6101ce60043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561044c576104ce565b6101ce60043560406000368082843790912090506103e181610096565b6101ce600435602435600060406000368082843790912090506104d581610096565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156102395761024c826100d4565b15610257575061023b565b6102795b6101045460005b818110156106d15761010480548290811061071957005b60015460fa901015156102905761028e6102a7565b505b60015460fa901015156102d1575061023b565b61033c5b600060015b6001548110156105bc575b600154811080156106185750600281610100811061061157005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106101de57005b156103805773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156103855750610239565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156103a05750610239565b600060028361010081106103b057005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556102a361025b565b15610239576001548211156103f6575061023b565b600082905561040361025b565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610239575061010655565b1561023b5760006101055550565b5050506000828152610103602052604081206001810154600284900a92908316819011156104ce57815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156105485761054e836100d4565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156105595750610380565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082141561058f5750610380565b61059761025b565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106104e357005b5090565b01546000145b1561062557600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b600180541180156105c6575060015460029061010081106105c057005b0154600014155b156105f4576001016102b7565b600154811080156106495750600154600290610100811061064257005b0154600014155b80156106645750600281610100811061065e57005b01546000145b1561067d57600154600290610100811061068257005b01555b6102ac565b0154600282610100811061069257005b015580610102600060028361010081106106a857005b015481526020810191909152604001600090812091909155600154600290610100811061067a57005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156105485760008155600101610705565b600091825260208220015414151561076b576101048054610103916000918490811061074157005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b600101610262565b60008681526101036020526040812080549094509092508214156107fe57815483556001838101839055610104805491820180825582801582901161088a578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b8082111561088857600081556001016107dd565b6000918252602090912001555b506001820154600284900a908116600014156108d55773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156108a45760008681526101036020526101048054604090922060020154909181106108de57005b505b50505060028401819055610104805488929081106107f157005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b60009182526020808320909101829055878252610103905260408120818155600181810183905560029091019190915594506108d556", + "gasLimit" : "0x0b52d1", "gasPrice" : "1", "nonce" : "1", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", @@ -741,8 +741,8 @@ } }, "transaction" : { - "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff16600381905581526101026020526040902055620151804204610107556109158061004b6000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461007b5780632f54bf6e146100cd5780635c52c2f5146100fe5780637065cb4814610118578063b20d30a914610135578063b75c7dc614610152578063ba51a6df1461018f578063f00d4b5d146101ac57005b6101ce60043560006040600036808284379091209050610472815b73ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054818080838114156105bc5761071e565b6101d46004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6101ce60406000368082843790912090506105ae81610096565b6101ce60043560406000368082843790912090506103c981610096565b6101ce60043560406000368082843790912090506105a281610096565b6101ce60043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156101de57610260565b6101ce600435604060003680828437909120905061055181610096565b6101ce600435602435600060406000368082843790912090506102d381610096565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561026057815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b156102cc576102e1836100d4565b156102ec57506102ce565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082141561032257506102ce565b6103445b6101045460005b81811015610873576101048054829081106108bb57005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061026757005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103c4576103d7826100d4565b156103e257506103c6565b6103ea610326565b60015460fa90101515610401576103ff610418565b505b60015460fa9010151561044257506103c6565b6105095b600060015b60015481101561075e575b600154811080156107ba575060028161010081106107b357005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061036957005b156102ce5773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104ad57506103c4565b60016001600050540360006000505411156104c857506103c4565b600060028361010081106104d857005b015573ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812055610414610326565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156103c45760015482101561056657506103c6565b6000829055610573610326565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b156103c4575061010655565b156103c65760006101055550565b60008681526101036020526040812080549094509092508214156106475781548355600183810183905561010480549182018082558280158290116106d3578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106d15760008155600101610626565b6000918252602090912001555b506001820154600284900a9081166000141561071e5773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156106ed57600086815261010360205261010480546040909220600201549091811061072757005b505b505050600284018190556101048054889290811061063a57005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600091825260208083209091018290558782526101039052604081208181556001818101839055600290910191909155945061071e565b5090565b01546000145b156107c757600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b600180541180156107685750600154600290610100811061076257005b0154600014155b1561079657600101610428565b600154811080156107eb575060015460029061010081106107e457005b0154600014155b80156108065750600281610100811061080057005b01546000145b1561081f57600154600290610100811061082457005b01555b61041d565b0154600282610100811061083457005b0155806101026000600283610100811061084a57005b015481526020810191909152604001600090812091909155600154600290610100811061081c57005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156102cc57600081556001016108a7565b600091825260208220015414151561090d57610104805461010391600091849081106108e357005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032d56", - "gasLimit" : "0x0b5290", + "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff16600381905581526101026020526040902055620151804204610107556109158061004b6000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461007b5780632f54bf6e146100cd5780635c52c2f5146100fe5780637065cb4814610118578063b20d30a914610135578063b75c7dc614610152578063ba51a6df1461018f578063f00d4b5d146101ac57005b6101ce60043560006040600036808284379091209050610301815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610773576108d5565b6101d46004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6101ce604060003680828437909120905061043e81610096565b6101ce600435604060003680828437909120905061023e81610096565b6101ce600435604060003680828437909120905061043281610096565b6101ce60043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561044c576104ce565b6101ce60043560406000368082843790912090506103e181610096565b6101ce600435602435600060406000368082843790912090506104d581610096565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156102395761024c826100d4565b15610257575061023b565b6102795b6101045460005b818110156106d15761010480548290811061071957005b60015460fa901015156102905761028e6102a7565b505b60015460fa901015156102d1575061023b565b61033c5b600060015b6001548110156105bc575b600154811080156106185750600281610100811061061157005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106101de57005b156103805773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156103855750610239565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156103a05750610239565b600060028361010081106103b057005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556102a361025b565b15610239576001548211156103f6575061023b565b600082905561040361025b565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610239575061010655565b1561023b5760006101055550565b5050506000828152610103602052604081206001810154600284900a92908316819011156104ce57815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156105485761054e836100d4565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156105595750610380565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082141561058f5750610380565b61059761025b565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106104e357005b5090565b01546000145b1561062557600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b600180541180156105c6575060015460029061010081106105c057005b0154600014155b156105f4576001016102b7565b600154811080156106495750600154600290610100811061064257005b0154600014155b80156106645750600281610100811061065e57005b01546000145b1561067d57600154600290610100811061068257005b01555b6102ac565b0154600282610100811061069257005b015580610102600060028361010081106106a857005b015481526020810191909152604001600090812091909155600154600290610100811061067a57005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156105485760008155600101610705565b600091825260208220015414151561076b576101048054610103916000918490811061074157005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b600101610262565b60008681526101036020526040812080549094509092508214156107fe57815483556001838101839055610104805491820180825582801582901161088a578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b8082111561088857600081556001016107dd565b6000918252602090912001555b506001820154600284900a908116600014156108d55773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156108a45760008681526101036020526101048054604090922060020154909181106108de57005b505b50505060028401819055610104805488929081106107f157005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b60009182526020808320909101829055878252610103905260408120818155600181810183905560029091019190915594506108d556", + "gasLimit" : "0x0b52d0", "gasPrice" : "1", "nonce" : "1", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", @@ -770,8 +770,8 @@ } }, "transaction" : { - "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff16600381905581526101026020526040902055620151804204610107556109158061004b6000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461007b5780632f54bf6e146100cd5780635c52c2f5146100fe5780637065cb4814610118578063b20d30a914610135578063b75c7dc614610152578063ba51a6df1461018f578063f00d4b5d146101ac57005b6101ce60043560006040600036808284379091209050610472815b73ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054818080838114156105bc5761071e565b6101d46004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6101ce60406000368082843790912090506105ae81610096565b6101ce60043560406000368082843790912090506103c981610096565b6101ce60043560406000368082843790912090506105a281610096565b6101ce60043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156101de57610260565b6101ce600435604060003680828437909120905061055181610096565b6101ce600435602435600060406000368082843790912090506102d381610096565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561026057815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b156102cc576102e1836100d4565b156102ec57506102ce565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082141561032257506102ce565b6103445b6101045460005b81811015610873576101048054829081106108bb57005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061026757005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103c4576103d7826100d4565b156103e257506103c6565b6103ea610326565b60015460fa90101515610401576103ff610418565b505b60015460fa9010151561044257506103c6565b6105095b600060015b60015481101561075e575b600154811080156107ba575060028161010081106107b357005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061036957005b156102ce5773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104ad57506103c4565b60016001600050540360006000505411156104c857506103c4565b600060028361010081106104d857005b015573ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812055610414610326565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156103c45760015482101561056657506103c6565b6000829055610573610326565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b156103c4575061010655565b156103c65760006101055550565b60008681526101036020526040812080549094509092508214156106475781548355600183810183905561010480549182018082558280158290116106d3578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106d15760008155600101610626565b6000918252602090912001555b506001820154600284900a9081166000141561071e5773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156106ed57600086815261010360205261010480546040909220600201549091811061072757005b505b505050600284018190556101048054889290811061063a57005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600091825260208083209091018290558782526101039052604081208181556001818101839055600290910191909155945061071e565b5090565b01546000145b156107c757600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b600180541180156107685750600154600290610100811061076257005b0154600014155b1561079657600101610428565b600154811080156107eb575060015460029061010081106107e457005b0154600014155b80156108065750600281610100811061080057005b01546000145b1561081f57600154600290610100811061082457005b01555b61041d565b0154600282610100811061083457005b0155806101026000600283610100811061084a57005b015481526020810191909152604001600090812091909155600154600290610100811061081c57005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156102cc57600081556001016108a7565b600091825260208220015414151561090d57610104805461010391600091849081106108e357005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032d56", - "gasLimit" : "0x043a28", + "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff16600381905581526101026020526040902055620151804204610107556109158061004b6000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461007b5780632f54bf6e146100cd5780635c52c2f5146100fe5780637065cb4814610118578063b20d30a914610135578063b75c7dc614610152578063ba51a6df1461018f578063f00d4b5d146101ac57005b6101ce60043560006040600036808284379091209050610301815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610773576108d5565b6101d46004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6101ce604060003680828437909120905061043e81610096565b6101ce600435604060003680828437909120905061023e81610096565b6101ce600435604060003680828437909120905061043281610096565b6101ce60043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561044c576104ce565b6101ce60043560406000368082843790912090506103e181610096565b6101ce600435602435600060406000368082843790912090506104d581610096565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156102395761024c826100d4565b15610257575061023b565b6102795b6101045460005b818110156106d15761010480548290811061071957005b60015460fa901015156102905761028e6102a7565b505b60015460fa901015156102d1575061023b565b61033c5b600060015b6001548110156105bc575b600154811080156106185750600281610100811061061157005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106101de57005b156103805773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156103855750610239565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156103a05750610239565b600060028361010081106103b057005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556102a361025b565b15610239576001548211156103f6575061023b565b600082905561040361025b565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610239575061010655565b1561023b5760006101055550565b5050506000828152610103602052604081206001810154600284900a92908316819011156104ce57815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156105485761054e836100d4565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156105595750610380565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082141561058f5750610380565b61059761025b565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106104e357005b5090565b01546000145b1561062557600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b600180541180156105c6575060015460029061010081106105c057005b0154600014155b156105f4576001016102b7565b600154811080156106495750600154600290610100811061064257005b0154600014155b80156106645750600281610100811061065e57005b01546000145b1561067d57600154600290610100811061068257005b01555b6102ac565b0154600282610100811061069257005b015580610102600060028361010081106106a857005b015481526020810191909152604001600090812091909155600154600290610100811061067a57005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156105485760008155600101610705565b600091825260208220015414151561076b576101048054610103916000918490811061074157005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b600101610262565b60008681526101036020526040812080549094509092508214156107fe57815483556001838101839055610104805491820180825582801582901161088a578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b8082111561088857600081556001016107dd565b6000918252602090912001555b506001820154600284900a908116600014156108d55773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156108a45760008681526101036020526101048054604090922060020154909181106108de57005b505b50505060028401819055610104805488929081106107f157005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b60009182526020808320909101829055878252610103905260408120818155600181810183905560029091019190915594506108d556", + "gasLimit" : "0x043a68", "gasPrice" : "1", "nonce" : "1", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", @@ -799,7 +799,7 @@ }, "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461007b5780632f54bf6e146100cd5780635c52c2f5146100fe5780637065cb4814610118578063b20d30a914610135578063b75c7dc614610152578063ba51a6df1461018f578063f00d4b5d146101ac57005b6101ce60043560006040600036808284379091209050610472815b73ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054818080838114156105bc5761071e565b6101d46004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6101ce60406000368082843790912090506105ae81610096565b6101ce60043560406000368082843790912090506103c981610096565b6101ce60043560406000368082843790912090506105a281610096565b6101ce60043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156101de57610260565b6101ce600435604060003680828437909120905061055181610096565b6101ce600435602435600060406000368082843790912090506102d381610096565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561026057815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b156102cc576102e1836100d4565b156102ec57506102ce565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082141561032257506102ce565b6103445b6101045460005b81811015610873576101048054829081106108bb57005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061026757005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103c4576103d7826100d4565b156103e257506103c6565b6103ea610326565b60015460fa90101515610401576103ff610418565b505b60015460fa9010151561044257506103c6565b6105095b600060015b60015481101561075e575b600154811080156107ba575060028161010081106107b357005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061036957005b156102ce5773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104ad57506103c4565b60016001600050540360006000505411156104c857506103c4565b600060028361010081106104d857005b015573ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812055610414610326565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156103c45760015482101561056657506103c6565b6000829055610573610326565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b156103c4575061010655565b156103c65760006101055550565b60008681526101036020526040812080549094509092508214156106475781548355600183810183905561010480549182018082558280158290116106d3578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106d15760008155600101610626565b6000918252602090912001555b506001820154600284900a9081166000141561071e5773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156106ed57600086815261010360205261010480546040909220600201549091811061072757005b505b505050600284018190556101048054889290811061063a57005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600091825260208083209091018290558782526101039052604081208181556001818101839055600290910191909155945061071e565b5090565b01546000145b156107c757600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b600180541180156107685750600154600290610100811061076257005b0154600014155b1561079657600101610428565b600154811080156107eb575060015460029061010081106107e457005b0154600014155b80156108065750600281610100811061080057005b01546000145b1561081f57600154600290610100811061082457005b01555b61041d565b0154600282610100811061083457005b0155806101026000600283610100811061084a57005b015481526020810191909152604001600090812091909155600154600290610100811061081c57005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156102cc57600081556001016108a7565b600091825260208220015414151561090d57610104805461010391600091849081106108e357005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032d56", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461007b5780632f54bf6e146100cd5780635c52c2f5146100fe5780637065cb4814610118578063b20d30a914610135578063b75c7dc614610152578063ba51a6df1461018f578063f00d4b5d146101ac57005b6101ce60043560006040600036808284379091209050610301815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610773576108d5565b6101d46004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6101ce604060003680828437909120905061043e81610096565b6101ce600435604060003680828437909120905061023e81610096565b6101ce600435604060003680828437909120905061043281610096565b6101ce60043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561044c576104ce565b6101ce60043560406000368082843790912090506103e181610096565b6101ce600435602435600060406000368082843790912090506104d581610096565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156102395761024c826100d4565b15610257575061023b565b6102795b6101045460005b818110156106d15761010480548290811061071957005b60015460fa901015156102905761028e6102a7565b505b60015460fa901015156102d1575061023b565b61033c5b600060015b6001548110156105bc575b600154811080156106185750600281610100811061061157005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106101de57005b156103805773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156103855750610239565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156103a05750610239565b600060028361010081106103b057005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556102a361025b565b15610239576001548211156103f6575061023b565b600082905561040361025b565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610239575061010655565b1561023b5760006101055550565b5050506000828152610103602052604081206001810154600284900a92908316819011156104ce57815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156105485761054e836100d4565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156105595750610380565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082141561058f5750610380565b61059761025b565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106104e357005b5090565b01546000145b1561062557600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b600180541180156105c6575060015460029061010081106105c057005b0154600014155b156105f4576001016102b7565b600154811080156106495750600154600290610100811061064257005b0154600014155b80156106645750600281610100811061065e57005b01546000145b1561067d57600154600290610100811061068257005b01555b6102ac565b0154600282610100811061069257005b015580610102600060028361010081106106a857005b015481526020810191909152604001600090812091909155600154600290610100811061067a57005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156105485760008155600101610705565b600091825260208220015414151561076b576101048054610103916000918490811061074157005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b600101610262565b60008681526101036020526040812080549094509092508214156107fe57815483556001838101839055610104805491820180825582801582901161088a578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b8082111561088857600081556001016107dd565b6000918252602090912001555b506001820154600284900a908116600014156108d55773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156108a45760008681526101036020526101048054604090922060020154909181106108de57005b505b50505060028401819055610104805488929081106107f157005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b60009182526020808320909101829055878252610103905260408120818155600181810183905560029091019190915594506108d556", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -839,7 +839,7 @@ }, "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461007b5780632f54bf6e146100cd5780635c52c2f5146100fe5780637065cb4814610118578063b20d30a914610135578063b75c7dc614610152578063ba51a6df1461018f578063f00d4b5d146101ac57005b6101ce60043560006040600036808284379091209050610472815b73ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054818080838114156105bc5761071e565b6101d46004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6101ce60406000368082843790912090506105ae81610096565b6101ce60043560406000368082843790912090506103c981610096565b6101ce60043560406000368082843790912090506105a281610096565b6101ce60043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156101de57610260565b6101ce600435604060003680828437909120905061055181610096565b6101ce600435602435600060406000368082843790912090506102d381610096565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561026057815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b156102cc576102e1836100d4565b156102ec57506102ce565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082141561032257506102ce565b6103445b6101045460005b81811015610873576101048054829081106108bb57005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061026757005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103c4576103d7826100d4565b156103e257506103c6565b6103ea610326565b60015460fa90101515610401576103ff610418565b505b60015460fa9010151561044257506103c6565b6105095b600060015b60015481101561075e575b600154811080156107ba575060028161010081106107b357005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061036957005b156102ce5773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104ad57506103c4565b60016001600050540360006000505411156104c857506103c4565b600060028361010081106104d857005b015573ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812055610414610326565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156103c45760015482101561056657506103c6565b6000829055610573610326565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b156103c4575061010655565b156103c65760006101055550565b60008681526101036020526040812080549094509092508214156106475781548355600183810183905561010480549182018082558280158290116106d3578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106d15760008155600101610626565b6000918252602090912001555b506001820154600284900a9081166000141561071e5773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156106ed57600086815261010360205261010480546040909220600201549091811061072757005b505b505050600284018190556101048054889290811061063a57005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600091825260208083209091018290558782526101039052604081208181556001818101839055600290910191909155945061071e565b5090565b01546000145b156107c757600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b600180541180156107685750600154600290610100811061076257005b0154600014155b1561079657600101610428565b600154811080156107eb575060015460029061010081106107e457005b0154600014155b80156108065750600281610100811061080057005b01546000145b1561081f57600154600290610100811061082457005b01555b61041d565b0154600282610100811061083457005b0155806101026000600283610100811061084a57005b015481526020810191909152604001600090812091909155600154600290610100811061081c57005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156102cc57600081556001016108a7565b600091825260208220015414151561090d57610104805461010391600091849081106108e357005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032d56", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461007b5780632f54bf6e146100cd5780635c52c2f5146100fe5780637065cb4814610118578063b20d30a914610135578063b75c7dc614610152578063ba51a6df1461018f578063f00d4b5d146101ac57005b6101ce60043560006040600036808284379091209050610301815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610773576108d5565b6101d46004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6101ce604060003680828437909120905061043e81610096565b6101ce600435604060003680828437909120905061023e81610096565b6101ce600435604060003680828437909120905061043281610096565b6101ce60043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561044c576104ce565b6101ce60043560406000368082843790912090506103e181610096565b6101ce600435602435600060406000368082843790912090506104d581610096565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156102395761024c826100d4565b15610257575061023b565b6102795b6101045460005b818110156106d15761010480548290811061071957005b60015460fa901015156102905761028e6102a7565b505b60015460fa901015156102d1575061023b565b61033c5b600060015b6001548110156105bc575b600154811080156106185750600281610100811061061157005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106101de57005b156103805773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156103855750610239565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156103a05750610239565b600060028361010081106103b057005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556102a361025b565b15610239576001548211156103f6575061023b565b600082905561040361025b565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610239575061010655565b1561023b5760006101055550565b5050506000828152610103602052604081206001810154600284900a92908316819011156104ce57815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156105485761054e836100d4565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156105595750610380565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082141561058f5750610380565b61059761025b565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106104e357005b5090565b01546000145b1561062557600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b600180541180156105c6575060015460029061010081106105c057005b0154600014155b156105f4576001016102b7565b600154811080156106495750600154600290610100811061064257005b0154600014155b80156106645750600281610100811061065e57005b01546000145b1561067d57600154600290610100811061068257005b01555b6102ac565b0154600282610100811061069257005b015580610102600060028361010081106106a857005b015481526020810191909152604001600090812091909155600154600290610100811061067a57005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156105485760008155600101610705565b600091825260208220015414151561076b576101048054610103916000918490811061074157005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b600101610262565b60008681526101036020526040812080549094509092508214156107fe57815483556001838101839055610104805491820180825582801582901161088a578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b8082111561088857600081556001016107dd565b6000918252602090912001555b506001820154600284900a908116600014156108d55773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156108a45760008681526101036020526101048054604090922060020154909181106108de57005b505b50505060028401819055610104805488929081106107f157005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b60009182526020808320909101829055878252610103905260408120818155600181810183905560029091019190915594506108d556", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -879,7 +879,7 @@ }, "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461007b5780632f54bf6e146100cd5780635c52c2f5146100fe5780637065cb4814610118578063b20d30a914610135578063b75c7dc614610152578063ba51a6df1461018f578063f00d4b5d146101ac57005b6101ce60043560006040600036808284379091209050610472815b73ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054818080838114156105bc5761071e565b6101d46004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6101ce60406000368082843790912090506105ae81610096565b6101ce60043560406000368082843790912090506103c981610096565b6101ce60043560406000368082843790912090506105a281610096565b6101ce60043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156101de57610260565b6101ce600435604060003680828437909120905061055181610096565b6101ce600435602435600060406000368082843790912090506102d381610096565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561026057815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b156102cc576102e1836100d4565b156102ec57506102ce565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082141561032257506102ce565b6103445b6101045460005b81811015610873576101048054829081106108bb57005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061026757005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103c4576103d7826100d4565b156103e257506103c6565b6103ea610326565b60015460fa90101515610401576103ff610418565b505b60015460fa9010151561044257506103c6565b6105095b600060015b60015481101561075e575b600154811080156107ba575060028161010081106107b357005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061036957005b156102ce5773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104ad57506103c4565b60016001600050540360006000505411156104c857506103c4565b600060028361010081106104d857005b015573ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812055610414610326565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156103c45760015482101561056657506103c6565b6000829055610573610326565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b156103c4575061010655565b156103c65760006101055550565b60008681526101036020526040812080549094509092508214156106475781548355600183810183905561010480549182018082558280158290116106d3578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106d15760008155600101610626565b6000918252602090912001555b506001820154600284900a9081166000141561071e5773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156106ed57600086815261010360205261010480546040909220600201549091811061072757005b505b505050600284018190556101048054889290811061063a57005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600091825260208083209091018290558782526101039052604081208181556001818101839055600290910191909155945061071e565b5090565b01546000145b156107c757600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b600180541180156107685750600154600290610100811061076257005b0154600014155b1561079657600101610428565b600154811080156107eb575060015460029061010081106107e457005b0154600014155b80156108065750600281610100811061080057005b01546000145b1561081f57600154600290610100811061082457005b01555b61041d565b0154600282610100811061083457005b0155806101026000600283610100811061084a57005b015481526020810191909152604001600090812091909155600154600290610100811061081c57005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156102cc57600081556001016108a7565b600091825260208220015414151561090d57610104805461010391600091849081106108e357005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032d56", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461007b5780632f54bf6e146100cd5780635c52c2f5146100fe5780637065cb4814610118578063b20d30a914610135578063b75c7dc614610152578063ba51a6df1461018f578063f00d4b5d146101ac57005b6101ce60043560006040600036808284379091209050610301815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610773576108d5565b6101d46004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6101ce604060003680828437909120905061043e81610096565b6101ce600435604060003680828437909120905061023e81610096565b6101ce600435604060003680828437909120905061043281610096565b6101ce60043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561044c576104ce565b6101ce60043560406000368082843790912090506103e181610096565b6101ce600435602435600060406000368082843790912090506104d581610096565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156102395761024c826100d4565b15610257575061023b565b6102795b6101045460005b818110156106d15761010480548290811061071957005b60015460fa901015156102905761028e6102a7565b505b60015460fa901015156102d1575061023b565b61033c5b600060015b6001548110156105bc575b600154811080156106185750600281610100811061061157005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106101de57005b156103805773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156103855750610239565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156103a05750610239565b600060028361010081106103b057005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556102a361025b565b15610239576001548211156103f6575061023b565b600082905561040361025b565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610239575061010655565b1561023b5760006101055550565b5050506000828152610103602052604081206001810154600284900a92908316819011156104ce57815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156105485761054e836100d4565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156105595750610380565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082141561058f5750610380565b61059761025b565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106104e357005b5090565b01546000145b1561062557600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b600180541180156105c6575060015460029061010081106105c057005b0154600014155b156105f4576001016102b7565b600154811080156106495750600154600290610100811061064257005b0154600014155b80156106645750600281610100811061065e57005b01546000145b1561067d57600154600290610100811061068257005b01555b6102ac565b0154600282610100811061069257005b015580610102600060028361010081106106a857005b015481526020810191909152604001600090812091909155600154600290610100811061067a57005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156105485760008155600101610705565b600091825260208220015414151561076b576101048054610103916000918490811061074157005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b600101610262565b60008681526101036020526040812080549094509092508214156107fe57815483556001838101839055610104805491820180825582801582901161088a578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b8082111561088857600081556001016107dd565b6000918252602090912001555b506001820154600284900a908116600014156108d55773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156108a45760008681526101036020526101048054604090922060020154909181106108de57005b505b50505060028401819055610104805488929081106107f157005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b60009182526020808320909101829055878252610103905260408120818155600181810183905560029091019190915594506108d556", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -921,8 +921,8 @@ } }, "transaction" : { - "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff16600381905581526101026020526040902055620151804204610107557f9adeddf84386b336eb7b3e18e7a6099be08fd81ea5d5142f4d2b630f8d20cf0160006040a1610e39806100716000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b6102976004356000604060003680828437909120905061053b815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610a7557610bd7565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061067781610108565b610297600435604060003680828437909120905061049281610108565b61029d6004355b6000816108b481610108565b610297600435604060003680828437909120905061066b81610108565b61029d6004803590602480359160443591820191013560006106a3846000610dce33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156102a757610329565b610297600435604060003680828437909120905061061a81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061039c81610108565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561032957815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b15610395576103aa83610146565b156103b55750610397565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156103eb5750610397565b61040d5b6101045460005b81811015610d2c57610104805482908110610d7457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061033057005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b1561048d576104a082610146565b156104ab575061048f565b6104b36103ef565b60015460fa901015156104ca576104c86104e1565b505b60015460fa9010151561050b575061048f565b6105d25b600060015b600154811015610c17575b60015481108015610c7357506002816101008110610c6c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061043257005b156103975773ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120549250821415610576575061048d565b6001600160005054036000600050541115610591575061048d565b600060028361010081106105a157005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556104dd6103ef565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b1561048d5760015482101561062f575061048f565b600082905561063c6103ef565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b1561048d575061010655565b1561048f5760006101055550565b1561048d578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b6000868152610103602052604081208054909450909250821415610b00578154835560018381018390556101048054918201808255828015829011610b8c578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610b8a5760008155600101610adf565b6000918252602090912001555b506001820154600284900a90811660001415610bd75773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610ba6576000868152610103602052610104805460409092206002015490918110610be057005b505b5050506002840181905561010480548892908110610af357005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610bd7565b5090565b01546000145b15610c8057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610c2157506001546002906101008110610c1b57005b0154600014155b15610c4f576001016104f1565b60015481108015610ca457506001546002906101008110610c9d57005b0154600014155b8015610cbf57506002816101008110610cb957005b01546000145b15610cd8576001546002906101008110610cdd57005b01555b6104e6565b01546002826101008110610ced57005b01558061010260006002836101008110610d0357005b0154815260208101919091526040016000908120919091556001546002906101008110610cd557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156103955760008155600101610d60565b6000918252602082200154141515610dc65761010480546101039160009184908110610d9c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016103f6565b156108af5761010754610de45b62015180420490565b1115610dfd57600061010555610df8610ddb565b610107555b6101055480830110158015610e1b5750610105546101065490830111155b15610e31575061010580548201905560016108af565b5060006108af56", - "gasLimit" : "10000000", + "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff16600381905581526101026020526040902055620151804204610107557f9adeddf84386b336eb7b3e18e7a6099be08fd81ea5d5142f4d2b630f8d20cf0160006040a1610e39806100716000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", + "gasLimit" : "0x10b3d5", "gasPrice" : "1", "nonce" : "1", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", @@ -950,8 +950,8 @@ } }, "transaction" : { - "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff16600381905581526101026020526040902055620151804204610107557f9adeddf84386b336eb7b3e18e7a6099be08fd81ea5d5142f4d2b630f8d20cf0160006040a1610e39806100716000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b6102976004356000604060003680828437909120905061053b815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610a7557610bd7565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061067781610108565b610297600435604060003680828437909120905061049281610108565b61029d6004355b6000816108b481610108565b610297600435604060003680828437909120905061066b81610108565b61029d6004803590602480359160443591820191013560006106a3846000610dce33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156102a757610329565b610297600435604060003680828437909120905061061a81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061039c81610108565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561032957815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b15610395576103aa83610146565b156103b55750610397565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156103eb5750610397565b61040d5b6101045460005b81811015610d2c57610104805482908110610d7457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061033057005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b1561048d576104a082610146565b156104ab575061048f565b6104b36103ef565b60015460fa901015156104ca576104c86104e1565b505b60015460fa9010151561050b575061048f565b6105d25b600060015b600154811015610c17575b60015481108015610c7357506002816101008110610c6c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061043257005b156103975773ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120549250821415610576575061048d565b6001600160005054036000600050541115610591575061048d565b600060028361010081106105a157005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556104dd6103ef565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b1561048d5760015482101561062f575061048f565b600082905561063c6103ef565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b1561048d575061010655565b1561048f5760006101055550565b1561048d578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b6000868152610103602052604081208054909450909250821415610b00578154835560018381018390556101048054918201808255828015829011610b8c578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610b8a5760008155600101610adf565b6000918252602090912001555b506001820154600284900a90811660001415610bd75773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610ba6576000868152610103602052610104805460409092206002015490918110610be057005b505b5050506002840181905561010480548892908110610af357005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610bd7565b5090565b01546000145b15610c8057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610c2157506001546002906101008110610c1b57005b0154600014155b15610c4f576001016104f1565b60015481108015610ca457506001546002906101008110610c9d57005b0154600014155b8015610cbf57506002816101008110610cb957005b01546000145b15610cd8576001546002906101008110610cdd57005b01555b6104e6565b01546002826101008110610ced57005b01558061010260006002836101008110610d0357005b0154815260208101919091526040016000908120919091556001546002906101008110610cd557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156103955760008155600101610d60565b6000918252602082200154141515610dc65761010480546101039160009184908110610d9c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016103f6565b156108af5761010754610de45b62015180420490565b1115610dfd57600061010555610df8610ddb565b610107555b6101055480830110158015610e1b5750610105546101065490830111155b15610e31575061010580548201905560016108af565b5060006108af56", - "gasLimit" : "0x10b394", + "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff16600381905581526101026020526040902055620151804204610107557f9adeddf84386b336eb7b3e18e7a6099be08fd81ea5d5142f4d2b630f8d20cf0160006040a1610e39806100716000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", + "gasLimit" : "0x10b3d4", "gasPrice" : "1", "nonce" : "1", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", @@ -979,8 +979,8 @@ } }, "transaction" : { - "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff16600381905581526101026020526040902055620151804204610107557f9adeddf84386b336eb7b3e18e7a6099be08fd81ea5d5142f4d2b630f8d20cf0160006040a1610e39806100716000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b6102976004356000604060003680828437909120905061053b815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610a7557610bd7565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061067781610108565b610297600435604060003680828437909120905061049281610108565b61029d6004355b6000816108b481610108565b610297600435604060003680828437909120905061066b81610108565b61029d6004803590602480359160443591820191013560006106a3846000610dce33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156102a757610329565b610297600435604060003680828437909120905061061a81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061039c81610108565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561032957815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b15610395576103aa83610146565b156103b55750610397565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156103eb5750610397565b61040d5b6101045460005b81811015610d2c57610104805482908110610d7457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061033057005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b1561048d576104a082610146565b156104ab575061048f565b6104b36103ef565b60015460fa901015156104ca576104c86104e1565b505b60015460fa9010151561050b575061048f565b6105d25b600060015b600154811015610c17575b60015481108015610c7357506002816101008110610c6c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061043257005b156103975773ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120549250821415610576575061048d565b6001600160005054036000600050541115610591575061048d565b600060028361010081106105a157005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556104dd6103ef565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b1561048d5760015482101561062f575061048f565b600082905561063c6103ef565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b1561048d575061010655565b1561048f5760006101055550565b1561048d578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b6000868152610103602052604081208054909450909250821415610b00578154835560018381018390556101048054918201808255828015829011610b8c578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610b8a5760008155600101610adf565b6000918252602090912001555b506001820154600284900a90811660001415610bd75773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610ba6576000868152610103602052610104805460409092206002015490918110610be057005b505b5050506002840181905561010480548892908110610af357005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610bd7565b5090565b01546000145b15610c8057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610c2157506001546002906101008110610c1b57005b0154600014155b15610c4f576001016104f1565b60015481108015610ca457506001546002906101008110610c9d57005b0154600014155b8015610cbf57506002816101008110610cb957005b01546000145b15610cd8576001546002906101008110610cdd57005b01555b6104e6565b01546002826101008110610ced57005b01558061010260006002836101008110610d0357005b0154815260208101919091526040016000908120919091556001546002906101008110610cd557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156103955760008155600101610d60565b6000918252602082200154141515610dc65761010480546101039160009184908110610d9c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016103f6565b156108af5761010754610de45b62015180420490565b1115610dfd57600061010555610df8610ddb565b610107555b6101055480830110158015610e1b5750610105546101065490830111155b15610e31575061010580548201905560016108af565b5060006108af56", - "gasLimit" : "0x05970c", + "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff16600381905581526101026020526040902055620151804204610107557f9adeddf84386b336eb7b3e18e7a6099be08fd81ea5d5142f4d2b630f8d20cf0160006040a1610e39806100716000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", + "gasLimit" : "0x05974c", "gasPrice" : "1", "nonce" : "1", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", @@ -1008,7 +1008,7 @@ }, "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548210156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -1020,13 +1020,13 @@ } }, "transaction" : { - "data" : "0xcbf0b0c0000000000000000000000000aaaf5374fce5edbc8e2a8697c15331677e6ebaaa", + "data" : "0xcbf0b0c0000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", "gasLimit" : "10000000", "gasPrice" : "1", "nonce" : "1", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", "to" : "ec0e71ad0a90ffe1909d27dac207f7680abba42d", - "value" : "100" + "value" : "1" } }, @@ -1056,7 +1056,7 @@ }, "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548210156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -1097,7 +1097,7 @@ }, "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548210156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -1138,7 +1138,7 @@ }, "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548210156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -1179,7 +1179,7 @@ }, "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548210156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -1201,7 +1201,7 @@ } }, - "walletExecuteOverDailyLimit" : { + "walletExecuteOverDailyLimitOnlyOneOwner" : { "env" : { "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", "currentDifficulty" : "256", @@ -1220,7 +1220,7 @@ }, "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548210156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -1232,7 +1232,7 @@ } }, "transaction" : { - "data" : "0xb61d27f6000000000000000000000000aaaf5374fce5edbc8e2a8697c15331677e6ebaaa0000000000000000000000000000000000000000000000000000000000000009", + "data" : "0xb61d27f6000000000000000000000000aaaf5374fce5edbc8e2a8697c15331677e6ebaaa00000000000000000000000000000000000000000000000000000000000000090000000000000000000000000000000000000000000000000000000000000060", "gasLimit" : "10000000", "gasPrice" : "1", "nonce" : "1", @@ -1242,7 +1242,7 @@ } }, - "walletConfirm" : { + "walletExecuteOverDailyLimitMultiOwner" : { "env" : { "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", "currentDifficulty" : "256", @@ -1261,21 +1261,20 @@ }, "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548210156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", "nonce" : "0x00", "storage" : { - "0x00" : "0x01", - "0x01" : "0x01", - "0x0106" : "0x0c22e4", + "0x00" : "0x02", + "0x01" : "0x02", "0x03" : "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", + "0x04" : "0x3fb1cd2cd96c6d5c0b5eb3322d807b34482481d4", "0x6e369836487c234b9e553ef3f787c2d8865520739d340c67b3d251a33986e58d" : "0x01", - "0x8b27e3687c602f639012647402e6fb2e9726bba6bdabddb832cdf2462bae7928" : "0xaaaf5374fce5edbc8e2a8697c15331677e6ebaaa", - "0x8b27e3687c602f639012647402e6fb2e9726bba6bdabddb832cdf2462bae7929" : "0x09" + "0xd3e69d8c7f41f7aeaf8130ddc53047aeee8cb46a73d6bae86b7e7d6bf8312e6b" : "0x02" } } }, "transaction" : { - "data" : "0x797af6275fdaa2db933d2913eb85133894a8af175a47872028d01c6369559a15eb76660b", + "data" : "0xb61d27f6000000000000000000000000aaaf5374fce5edbc8e2a8697c15331677e6ebaaa00000000000000000000000000000000000000000000000000000000000000090000000000000000000000000000000000000000000000000000000000000060", "gasLimit" : "10000000", "gasPrice" : "1", "nonce" : "1", @@ -1285,6 +1284,62 @@ } }, + "walletConfirm" : { + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "256", + "currentGasLimit" : "10000000", + "currentNumber" : "0", + "currentTimestamp" : "0xfffffffff", + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "pre" : { + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "0x0de0b6b3a75ef08f", + "code" : "0x", + "nonce" : "0x01", + "storage" : { + } + }, + "3fb1cd2cd96c6d5c0b5eb3322d807b34482481d4" : { + "balance" : "100000000000000", + "code" : "0x", + "nonce" : "0", + "storage" : { + } + }, + "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { + "balance" : "0x64", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x02", + "0x01" : "0x02", + "0x0104" : "0x01", + "0x0107" : "0x0c22e4", + "0x03" : "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", + "0x04" : "0x3fb1cd2cd96c6d5c0b5eb3322d807b34482481d4", + "0x3736dca762b6fcb9a97d5eafda4032fdba21dbfa25f875001d51e03eff955fb2" : "0x01", + "0x3736dca762b6fcb9a97d5eafda4032fdba21dbfa25f875001d51e03eff955fb3" : "0x02", + "0x4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" : "0x6877e4536b661640954061cdbc3a9761fb5245c340fcb1721307cd9d5f285c96", + "0x6e369836487c234b9e553ef3f787c2d8865520739d340c67b3d251a33986e58d" : "0x01", + "0x915023a2112bb78c86fa558abc0217ea6818d13895b90ce6be233397f55eb1d0" : "0xaaaf5374fce5edbc8e2a8697c15331677e6ebaaa", + "0x915023a2112bb78c86fa558abc0217ea6818d13895b90ce6be233397f55eb1d1" : "0x09", + "0xd3e69d8c7f41f7aeaf8130ddc53047aeee8cb46a73d6bae86b7e7d6bf8312e6b" : "0x02" + } + } + }, + "transaction" : { + "data" : "0x797af6276877e4536b661640954061cdbc3a9761fb5245c340fcb1721307cd9d5f285c96", + "gasLimit" : "10000000", + "gasPrice" : "1", + "nonce" : "0", + "secretKey" : "a95defe70ebea7804f9c3be42d20d24375e2a92b9d9666b832069c5f3cd423dd", + "to" : "ec0e71ad0a90ffe1909d27dac207f7680abba42d", + "value" : "0" + } + }, + "walletExecuteUnderDailyLimit" : { "env" : { "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", @@ -1304,7 +1359,7 @@ }, "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548210156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -1317,7 +1372,7 @@ } }, "transaction" : { - "data" : "0xb61d27f6000000000000000000000000aaaf5374fce5edbc8e2a8697c15331677e6ebaaa0000000000000000000000000000000000000000000000000000000000000009", + "data" : "0xb61d27f6000000000000000000000000aaaf5374fce5edbc8e2a8697c15331677e6ebaaa00000000000000000000000000000000000000000000000000000000000000090000000000000000000000000000000000000000000000000000000000000060", "gasLimit" : "10000000", "gasPrice" : "1", "nonce" : "1", From 07c40c0494ef36896369e84b0a738219b29b1e43 Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Fri, 22 May 2015 18:30:21 +0200 Subject: [PATCH 337/461] test clearing pending transactions --- .../StateTestsFiller/stWalletTestFiller.json | 224 ++++++++++++++++++ 1 file changed, 224 insertions(+) diff --git a/test/libethereum/StateTestsFiller/stWalletTestFiller.json b/test/libethereum/StateTestsFiller/stWalletTestFiller.json index 031d1f0c4..c3a0f0bc4 100644 --- a/test/libethereum/StateTestsFiller/stWalletTestFiller.json +++ b/test/libethereum/StateTestsFiller/stWalletTestFiller.json @@ -1380,5 +1380,229 @@ "to" : "ec0e71ad0a90ffe1909d27dac207f7680abba42d", "value" : "0" } + }, + + "walletChangeOwnerRemovePendingTransaction" : { + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "256", + "currentGasLimit" : "10000000", + "currentNumber" : "0", + "currentTimestamp" : "0xfffffffff", + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "pre" : { + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "0x0de0b6b3a75ef08f", + "code" : "0x", + "nonce" : "0x01", + "storage" : { + } + }, + "3fb1cd2cd96c6d5c0b5eb3322d807b34482481d4" : { + "balance" : "100000000000000", + "code" : "0x", + "nonce" : "0", + "storage" : { + } + }, + "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { + "balance" : "0x64", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x01", + "0x01" : "0x02", + "0x0104" : "0x01", + "0x0107" : "0x0c22e4", + "0x03" : "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", + "0x04" : "0x3fb1cd2cd96c6d5c0b5eb3322d807b34482481d4", + "0x3736dca762b6fcb9a97d5eafda4032fdba21dbfa25f875001d51e03eff955fb2" : "0x01", + "0x3736dca762b6fcb9a97d5eafda4032fdba21dbfa25f875001d51e03eff955fb3" : "0x02", + "0x4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" : "0x6877e4536b661640954061cdbc3a9761fb5245c340fcb1721307cd9d5f285c96", + "0x6e369836487c234b9e553ef3f787c2d8865520739d340c67b3d251a33986e58d" : "0x01", + "0x915023a2112bb78c86fa558abc0217ea6818d13895b90ce6be233397f55eb1d0" : "0xaaaf5374fce5edbc8e2a8697c15331677e6ebaaa", + "0x915023a2112bb78c86fa558abc0217ea6818d13895b90ce6be233397f55eb1d1" : "0x09", + "0xd3e69d8c7f41f7aeaf8130ddc53047aeee8cb46a73d6bae86b7e7d6bf8312e6b" : "0x02" + } + } + }, + "transaction" : { + "data" : "0xf00d4b5d000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b000000000000000000000000aaaf5374fce5edbc8e2a8697c15331677e6ebaaa", + "gasLimit" : "10000000", + "gasPrice" : "1", + "nonce" : "0", + "secretKey" : "a95defe70ebea7804f9c3be42d20d24375e2a92b9d9666b832069c5f3cd423dd", + "to" : "ec0e71ad0a90ffe1909d27dac207f7680abba42d", + "value" : "0" + } + }, + + "walletRemoveOwnerRemovePendingTransaction" : { + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "256", + "currentGasLimit" : "10000000", + "currentNumber" : "0", + "currentTimestamp" : "0xfffffffff", + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "pre" : { + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "0x0de0b6b3a75ef08f", + "code" : "0x", + "nonce" : "0x01", + "storage" : { + } + }, + "3fb1cd2cd96c6d5c0b5eb3322d807b34482481d4" : { + "balance" : "100000000000000", + "code" : "0x", + "nonce" : "0", + "storage" : { + } + }, + "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { + "balance" : "0x64", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x01", + "0x01" : "0x02", + "0x0104" : "0x01", + "0x0107" : "0x0c22e4", + "0x03" : "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", + "0x04" : "0x3fb1cd2cd96c6d5c0b5eb3322d807b34482481d4", + "0x3736dca762b6fcb9a97d5eafda4032fdba21dbfa25f875001d51e03eff955fb2" : "0x01", + "0x3736dca762b6fcb9a97d5eafda4032fdba21dbfa25f875001d51e03eff955fb3" : "0x02", + "0x4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" : "0x6877e4536b661640954061cdbc3a9761fb5245c340fcb1721307cd9d5f285c96", + "0x6e369836487c234b9e553ef3f787c2d8865520739d340c67b3d251a33986e58d" : "0x01", + "0x915023a2112bb78c86fa558abc0217ea6818d13895b90ce6be233397f55eb1d0" : "0xaaaf5374fce5edbc8e2a8697c15331677e6ebaaa", + "0x915023a2112bb78c86fa558abc0217ea6818d13895b90ce6be233397f55eb1d1" : "0x09", + "0xd3e69d8c7f41f7aeaf8130ddc53047aeee8cb46a73d6bae86b7e7d6bf8312e6b" : "0x02" + } + } + }, + "transaction" : { + "data" : "0x173825d9000000000000000000000000a94f5374fce5edbc8e2a8697c15331677e6ebf0b", + "gasLimit" : "10000000", + "gasPrice" : "1", + "nonce" : "0", + "secretKey" : "a95defe70ebea7804f9c3be42d20d24375e2a92b9d9666b832069c5f3cd423dd", + "to" : "ec0e71ad0a90ffe1909d27dac207f7680abba42d", + "value" : "0" + } + }, + + "walletAddOwnerRemovePendingTransaction" : { + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "256", + "currentGasLimit" : "10000000", + "currentNumber" : "0", + "currentTimestamp" : "0xfffffffff", + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "pre" : { + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "0x0de0b6b3a75ef08f", + "code" : "0x", + "nonce" : "0x01", + "storage" : { + } + }, + "3fb1cd2cd96c6d5c0b5eb3322d807b34482481d4" : { + "balance" : "100000000000000", + "code" : "0x", + "nonce" : "0", + "storage" : { + } + }, + "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { + "balance" : "0x64", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x01", + "0x01" : "0x02", + "0x0104" : "0x01", + "0x0107" : "0x0c22e4", + "0x03" : "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", + "0x04" : "0x3fb1cd2cd96c6d5c0b5eb3322d807b34482481d4", + "0x3736dca762b6fcb9a97d5eafda4032fdba21dbfa25f875001d51e03eff955fb2" : "0x01", + "0x3736dca762b6fcb9a97d5eafda4032fdba21dbfa25f875001d51e03eff955fb3" : "0x02", + "0x4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" : "0x6877e4536b661640954061cdbc3a9761fb5245c340fcb1721307cd9d5f285c96", + "0x6e369836487c234b9e553ef3f787c2d8865520739d340c67b3d251a33986e58d" : "0x01", + "0x915023a2112bb78c86fa558abc0217ea6818d13895b90ce6be233397f55eb1d0" : "0xaaaf5374fce5edbc8e2a8697c15331677e6ebaaa", + "0x915023a2112bb78c86fa558abc0217ea6818d13895b90ce6be233397f55eb1d1" : "0x09", + "0xd3e69d8c7f41f7aeaf8130ddc53047aeee8cb46a73d6bae86b7e7d6bf8312e6b" : "0x02" + } + } + }, + "transaction" : { + "data" : "0x7065cb48000000000000000000000000bbb1cd2cd96c6d5c0b5eb3322d807b34482481d4", + "gasLimit" : "10000000", + "gasPrice" : "1", + "nonce" : "0", + "secretKey" : "a95defe70ebea7804f9c3be42d20d24375e2a92b9d9666b832069c5f3cd423dd", + "to" : "ec0e71ad0a90ffe1909d27dac207f7680abba42d", + "value" : "0" + } + }, + + "walletChangeRequirementRemovePendingTransaction" : { + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "256", + "currentGasLimit" : "10000000", + "currentNumber" : "0", + "currentTimestamp" : "0xfffffffff", + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "pre" : { + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "0x0de0b6b3a75ef08f", + "code" : "0x", + "nonce" : "0x01", + "storage" : { + } + }, + "3fb1cd2cd96c6d5c0b5eb3322d807b34482481d4" : { + "balance" : "100000000000000", + "code" : "0x", + "nonce" : "0", + "storage" : { + } + }, + "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { + "balance" : "0x64", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", + "nonce" : "0x00", + "storage" : { + "0x00" : "0x01", + "0x01" : "0x02", + "0x0104" : "0x01", + "0x0107" : "0x0c22e4", + "0x03" : "0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b", + "0x04" : "0x3fb1cd2cd96c6d5c0b5eb3322d807b34482481d4", + "0x3736dca762b6fcb9a97d5eafda4032fdba21dbfa25f875001d51e03eff955fb2" : "0x01", + "0x3736dca762b6fcb9a97d5eafda4032fdba21dbfa25f875001d51e03eff955fb3" : "0x02", + "0x4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe" : "0x6877e4536b661640954061cdbc3a9761fb5245c340fcb1721307cd9d5f285c96", + "0x6e369836487c234b9e553ef3f787c2d8865520739d340c67b3d251a33986e58d" : "0x01", + "0x915023a2112bb78c86fa558abc0217ea6818d13895b90ce6be233397f55eb1d0" : "0xaaaf5374fce5edbc8e2a8697c15331677e6ebaaa", + "0x915023a2112bb78c86fa558abc0217ea6818d13895b90ce6be233397f55eb1d1" : "0x09", + "0xd3e69d8c7f41f7aeaf8130ddc53047aeee8cb46a73d6bae86b7e7d6bf8312e6b" : "0x02" + } + } + }, + "transaction" : { + "data" : "0xba51a6df0000000000000000000000000000000000000000000000000000000000000002", + "gasLimit" : "10000000", + "gasPrice" : "1", + "nonce" : "0", + "secretKey" : "a95defe70ebea7804f9c3be42d20d24375e2a92b9d9666b832069c5f3cd423dd", + "to" : "ec0e71ad0a90ffe1909d27dac207f7680abba42d", + "value" : "0" + } } } From a7490d16cca1005fc5c371aa18e229f6d62cd99d Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Fri, 22 May 2015 22:07:31 +0200 Subject: [PATCH 338/461] List and add wallet keys. --- ethkey/KeyAux.h | 90 ++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 78 insertions(+), 12 deletions(-) diff --git a/ethkey/KeyAux.h b/ethkey/KeyAux.h index daac72588..3c4a625a4 100644 --- a/ethkey/KeyAux.h +++ b/ethkey/KeyAux.h @@ -64,22 +64,23 @@ string createPassword(std::string const& _prompt) // return make_pair(ret, hint); } -pair createPassword(KeyManager& _keyManager, std::string const& _prompt) +pair createPassword(KeyManager& _keyManager, std::string const& _prompt, std::string const& _pass = std::string(), std::string const& _hint = std::string()) { - string pass; - while (true) + string pass = _pass; + while (pass.empty()) { pass = getPassword(_prompt); string confirm = getPassword("Please confirm the password by entering it again: "); if (pass == confirm) break; cout << "Passwords were different. Try again." << endl; + pass.clear(); } - string hint; - if (!_keyManager.haveHint(pass)) + string hint = _hint; + if (hint.empty() && !_keyManager.haveHint(pass)) { cout << "Enter a hint to help you remember this password: " << flush; - cin >> hint; + getline(cin, hint); } return make_pair(pass, hint); } @@ -95,6 +96,7 @@ public: ImportBare, ExportBare, RecodeBare, + KillBare, FirstWallet, CreateWallet, List = FirstWallet, @@ -140,6 +142,8 @@ public: m_mode = OperationMode::ExportBare; else if (arg == "--recode-bare") m_mode = OperationMode::RecodeBare; + else if (arg == "--kill-bare") + m_mode = OperationMode::KillBare; else if (arg == "--create-wallet") m_mode = OperationMode::CreateWallet; else if (arg == "--list") @@ -161,7 +165,7 @@ public: m_mode = OperationMode::Recode; else if (arg == "--no-icap") m_icap = false; - else if (m_mode == OperationMode::ImportBare || m_mode == OperationMode::Recode || m_mode == OperationMode::Export || m_mode == OperationMode::RecodeBare || m_mode == OperationMode::ExportBare) + else if (m_mode == OperationMode::ImportBare || m_mode == OperationMode::KillBare || m_mode == OperationMode::Recode || m_mode == OperationMode::Export || m_mode == OperationMode::RecodeBare || m_mode == OperationMode::ExportBare) m_inputs.push_back(arg); else return false; @@ -202,10 +206,10 @@ public: if (m_lock.empty()) m_lock = createPassword("Enter a password with which to secure this account: "); auto k = makeKey(); - store.importSecret(k.secret().asBytes(), m_lock); - cout << "Created key " << k.address().abridged() << endl; - cout << "Address: " << k.address().hex() << endl; - cout << "ICAP: " << ICAP(k.address()).encoded() << endl; + h128 u = store.importSecret(k.secret().asBytes(), m_lock); + cout << "Created key " << toUUID(u) << endl; + cout << " Address: " << k.address().hex() << endl; + cout << " ICAP: " << ICAP(k.address()).encoded() << endl; break; } case OperationMode::ImportBare: @@ -244,6 +248,16 @@ public: else cerr << "Couldn't re-encode " << toUUID(u) << "; not found." << endl; } + case OperationMode::KillBare: + for (auto const& i: m_inputs) + { + h128 u = fromUUID(i); + if (u) + store.kill(u); + else + cerr << "Couldn't kill " << toUUID(u) << "; not found." << endl; + } + break; default: break; } } @@ -267,6 +281,55 @@ public: cerr << "Couldn't open wallet. Does it exist?" << endl; exit(-1); } + switch (m_mode) + { + case OperationMode::New: + { + cout << "Enter a description of this key: " << flush; + string info; + getline(cin, info); + + tie(m_lock, m_lockHint) = createPassword(wallet, "Enter a password with which to secure this account (or nothing to use the master password): ", m_lock, m_lockHint); + auto k = makeKey(); + h128 u = m_lock.empty() ? wallet.import(k.secret(), m_name) : wallet.import(k.secret(), m_name, m_lock, m_lockHint); + cout << "Created key " << toUUID(u) << endl; + cout << " Name: " << m_name; + if (!m_lockHint.empty()) + cout << " Password hint: " << m_lockHint; + cout << " Address: " << k.address().hex() << endl; + cout << " ICAP: " << ICAP(k.address()).encoded() << endl; + break; + } + case OperationMode::List: + { + vector bare; + vector nonIcap; + for (auto const& u: wallet.store().keys()) + if (Address a = wallet.address(u)) + if (a[0]) + nonIcap.push_back(u); + else + { + std::pair info = wallet.accountDetails()[a]; + cout << toUUID(u) << " " << a.abridged(); + cout << " " << ICAP(a).encoded(); + cout << " " << info.first << endl; + } + else + bare.push_back(u); + for (auto const& u: nonIcap) + if (Address a = wallet.address(u)) + { + std::pair info = wallet.accountDetails()[a]; + cout << toUUID(u) << " " << a.abridged(); + cout << " (Not ICAP) "; + cout << " " << info.first << endl; + } + for (auto const& u: bare) + cout << toUUID(u) << " (Bare)" << endl; + } + default: break; + } } } @@ -284,6 +347,7 @@ public: << " --import-bare [ | , ... ] Import keys from given sources." << endl << " --recode-bare [ | , ... ] Decrypt and re-encrypt given keys." << endl // << " --export-bare [ , ... ] Export given keys." << endl + << " --kill-bare [ , ... ] Delete given keys." << endl << "Secret-store configuration:" << endl << " --secrets-path Specify Web3 secret-store path (default: " << SecretStore::defaultPath() << ")" << endl << endl @@ -303,7 +367,8 @@ public: << " --kdf-param Specify a parameter for the KDF." << endl // << " --cipher Specify cipher to use when encrypting (default: aes-128-ctr)" << endl // << " --cipher-param Specify a parameter for the cipher." << endl - << " --lock Specify password for when encrypting a (the) key." << endl + << " --lock Specify password for when encrypting a (the) key." << endl + << " --hint Specify hint for the --lock password." << endl << endl << "Decryption configuration:" << endl << " --unlock Specify password for a (the) key." << endl @@ -336,6 +401,7 @@ private: string m_masterPassword; strings m_unlocks; string m_lock; + string m_lockHint; bool m_icap = true; /// Creating From db48be76699957f28ddff4be92456f05c1bfc82a Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Sat, 23 May 2015 10:58:46 +0200 Subject: [PATCH 339/461] Adding and listing wallet keys. --- ethkey/KeyAux.h | 44 ++++++++++++++++++++------------------------ 1 file changed, 20 insertions(+), 24 deletions(-) diff --git a/ethkey/KeyAux.h b/ethkey/KeyAux.h index 3c4a625a4..df2ba5a5a 100644 --- a/ethkey/KeyAux.h +++ b/ethkey/KeyAux.h @@ -67,17 +67,17 @@ string createPassword(std::string const& _prompt) pair createPassword(KeyManager& _keyManager, std::string const& _prompt, std::string const& _pass = std::string(), std::string const& _hint = std::string()) { string pass = _pass; - while (pass.empty()) - { - pass = getPassword(_prompt); - string confirm = getPassword("Please confirm the password by entering it again: "); - if (pass == confirm) - break; - cout << "Passwords were different. Try again." << endl; - pass.clear(); - } + if (pass.empty()) + while (true) + { + pass = getPassword(_prompt); + string confirm = getPassword("Please confirm the password by entering it again: "); + if (pass == confirm) + break; + cout << "Passwords were different. Try again." << endl; + } string hint = _hint; - if (hint.empty() && !_keyManager.haveHint(pass)) + if (hint.empty() && !pass.empty() && !_keyManager.haveHint(pass)) { cout << "Enter a hint to help you remember this password: " << flush; getline(cin, hint); @@ -97,9 +97,8 @@ public: ExportBare, RecodeBare, KillBare, - FirstWallet, CreateWallet, - List = FirstWallet, + List, New, Import, Export, @@ -112,9 +111,7 @@ public: bool interpretOption(int& i, int argc, char** argv) { string arg = argv[i]; - if (arg == "-n" || arg == "--new") - m_mode = OperationMode::New; - else if (arg == "--wallet-path" && i + 1 < argc) + if (arg == "--wallet-path" && i + 1 < argc) m_walletPath = argv[++i]; else if (arg == "--secrets-path" && i + 1 < argc) m_secretsPath = argv[++i]; @@ -192,7 +189,7 @@ public: else wallet.create(m_masterPassword); } - else if (m_mode < OperationMode::FirstWallet) + else if (m_mode < OperationMode::CreateWallet) { SecretStore store(m_secretsPath); switch (m_mode) @@ -285,17 +282,16 @@ public: { case OperationMode::New: { - cout << "Enter a description of this key: " << flush; - string info; - getline(cin, info); - tie(m_lock, m_lockHint) = createPassword(wallet, "Enter a password with which to secure this account (or nothing to use the master password): ", m_lock, m_lockHint); auto k = makeKey(); - h128 u = m_lock.empty() ? wallet.import(k.secret(), m_name) : wallet.import(k.secret(), m_name, m_lock, m_lockHint); + bool usesMaster = m_lock.empty(); + h128 u = usesMaster ? wallet.import(k.secret(), m_name) : wallet.import(k.secret(), m_name, m_lock, m_lockHint); cout << "Created key " << toUUID(u) << endl; - cout << " Name: " << m_name; - if (!m_lockHint.empty()) - cout << " Password hint: " << m_lockHint; + cout << " Name: " << m_name << endl; + if (usesMaster) + cout << " Uses master password." << endl; + else + cout << " Password hint: " << m_lockHint << endl; cout << " Address: " << k.address().hex() << endl; cout << " ICAP: " << ICAP(k.address()).encoded() << endl; break; From 3fcbab1423af5d5dd13bdb94d6c9b760f4fcb98a Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Sat, 23 May 2015 11:09:39 +0200 Subject: [PATCH 340/461] Fixed #2007 --- alethzero/MainWin.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index 1dcdcb67f..6a11736a4 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -2048,12 +2048,11 @@ void Main::on_killAccount_triggered() auto hba = ui->ourAccounts->currentItem()->data(Qt::UserRole).toByteArray(); Address h((byte const*)hba.data(), Address::ConstructFromPointer); auto k = m_keyManager.accountDetails()[h]; - if ( - ethereum()->balanceAt(h) != 0 && - QMessageBox::critical(this, QString::fromStdString("Kill Account " + k.first + "?!"), - QString::fromStdString("Account " + k.first + " (" + render(h) + ") has " + formatBalance(ethereum()->balanceAt(h)) + " in it. It, and any contract that this account can access, will be lost forever if you continue. Do NOT continue unless you know what you are doing.\n" - "Are you sure you want to continue?"), - QMessageBox::Yes, QMessageBox::No) == QMessageBox::No) + QString s = QInputDialog::getText(this, QString::fromStdString("Kill Account " + k.first + "?!"), + QString::fromStdString("Account " + k.first + " (" + render(h) + ") has " + formatBalance(ethereum()->balanceAt(h)) + " in it.\r\nIt, and any contract that this account can access, will be lost forever if you continue. Do NOT continue unless you know what you are doing.\n" + "Are you sure you want to continue? \r\n If so, type 'YES' to confirm."), + QLineEdit::Normal, "NO"); + if (s != "YES") return; m_keyManager.kill(h); if (m_keyManager.accounts().empty()) From e8b582f3cfb42cd8a09b8cf2620d1583f071be76 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Mon, 25 May 2015 09:28:06 +0100 Subject: [PATCH 341/461] Add secret store test. Remove unneccessary components of scrypt. --- CMakeLists.txt | 3 +- libdevcrypto/SecretStore.cpp | 9 ++++- libdevcrypto/SecretStore.h | 11 ++++-- libscrypt/crypto-scrypt-saltgen.c | 50 ------------------------ libscrypt/crypto_scrypt-hash.c | 44 --------------------- libscrypt/libscrypt.h | 11 ------ test/libdevcrypto/SecretStore.cpp | 64 +++++++++++++++++++++++++++++++ 7 files changed, 81 insertions(+), 111 deletions(-) create mode 100644 test/libdevcrypto/SecretStore.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index e7461eb1c..a5c4fe930 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,7 +32,8 @@ option(USENPM "Use npm to recompile ethereum.js if it was changed" OFF) option(PROFILING "Build in support for profiling" OFF) set(BUNDLE "none" CACHE STRING "Predefined bundle of software to build (none, full, user, tests, minimal).") -option(MINER "Build the miner component" ON) +option(MINER "Build the CLI miner component" ON) +option(ETHKEY "Build the CLI key manager component" ON) option(SOLIDITY "Build the Solidity language components" ON) option(SERPENT "Build the Serpent language components" ON) option(TOOLS "Build the tools components" ON) diff --git a/libdevcrypto/SecretStore.cpp b/libdevcrypto/SecretStore.cpp index c6f9803fa..11ff98bf6 100644 --- a/libdevcrypto/SecretStore.cpp +++ b/libdevcrypto/SecretStore.cpp @@ -165,12 +165,17 @@ void SecretStore::load(std::string const& _keysPath) h128 SecretStore::readKey(std::string const& _file, bool _deleteFile) { cdebug << "Reading" << _file; - js::mValue u = upgraded(contentsString(_file)); + return readKeyContent(contentsString(_file), _deleteFile ? _file : string()); +} + +h128 SecretStore::readKeyContent(std::string const& _content, std::string const& _file) +{ + js::mValue u = upgraded(_content); if (u.type() == js::obj_type) { js::mObject& o = u.get_obj(); auto uuid = fromUUID(o["id"].get_str()); - m_keys[uuid] = make_pair(js::write_string(o["crypto"], false), _deleteFile ? _file : string()); + m_keys[uuid] = make_pair(js::write_string(o["crypto"], false), _file); return uuid; } else diff --git a/libdevcrypto/SecretStore.h b/libdevcrypto/SecretStore.h index c4e5d5cf7..4474212b1 100644 --- a/libdevcrypto/SecretStore.h +++ b/libdevcrypto/SecretStore.h @@ -43,6 +43,7 @@ public: bytes secret(h128 const& _uuid, std::function const& _pass, bool _useCache = true) const; h128 importKey(std::string const& _file) { auto ret = readKey(_file, false); if (ret) save(); return ret; } + h128 importKeyContent(std::string const& _content) { auto ret = readKeyContent(_content, std::string()); if (ret) save(); return ret; } h128 importSecret(bytes const& _s, std::string const& _pass); bool recode(h128 const& _uuid, std::string const& _newPass, std::function const& _pass, KDF _kdf = KDF::Scrypt); void kill(h128 const& _uuid); @@ -52,16 +53,20 @@ public: // Clear any cached keys. void clearCache() const; + // Doesn't save(). + h128 readKey(std::string const& _file, bool _deleteFile); + h128 readKeyContent(std::string const& _content, std::string const& _file = std::string()); + + void save(std::string const& _keysPath); + void save() { save(m_path); } + static std::string defaultPath() { return getDataDir("web3") + "/keys"; } private: - void save(std::string const& _keysPath); void load(std::string const& _keysPath); - void save() { save(m_path); } void load() { load(m_path); } static std::string encrypt(bytes const& _v, std::string const& _pass, KDF _kdf = KDF::Scrypt); static bytes decrypt(std::string const& _v, std::string const& _pass); - h128 readKey(std::string const& _file, bool _deleteFile); mutable std::unordered_map m_cached; std::unordered_map> m_keys; diff --git a/libscrypt/crypto-scrypt-saltgen.c b/libscrypt/crypto-scrypt-saltgen.c index 998a1abcb..e69de29bb 100644 --- a/libscrypt/crypto-scrypt-saltgen.c +++ b/libscrypt/crypto-scrypt-saltgen.c @@ -1,50 +0,0 @@ -#ifndef _MSC_VER -#include -#include -#include -#include -#include - -#ifndef S_SPLINT_S /* Including this here triggers a known bug in splint */ -//#include -#endif - -#define RNGDEV "/dev/urandom" - -int libscrypt_salt_gen(uint8_t *salt, size_t len) -{ - unsigned char buf[len]; - size_t data_read = 0; - int urandom = open(RNGDEV, O_RDONLY); - - if (urandom < 0) - { - return -1; - } - - while (data_read < len) { - ssize_t result = read(urandom, buf + data_read, len - data_read); - - if (result < 0) - { - if (errno == EINTR || errno == EAGAIN) { - continue; - } - - else { - (void)close(urandom); - return -1; - } - } - - data_read += result; - } - - /* Failures on close() shouldn't occur with O_RDONLY */ - (void)close(urandom); - - memcpy(salt, buf, len); - - return 0; -} -#endif diff --git a/libscrypt/crypto_scrypt-hash.c b/libscrypt/crypto_scrypt-hash.c index 4b41007db..e69de29bb 100644 --- a/libscrypt/crypto_scrypt-hash.c +++ b/libscrypt/crypto_scrypt-hash.c @@ -1,44 +0,0 @@ -#include -#include -#include -#include - -#include "b64.h" -#include "libscrypt.h" - -int libscrypt_hash(char *dst, const char *passphrase, uint32_t N, uint8_t r, - uint8_t p) -{ - - int retval; - uint8_t salt[SCRYPT_SALT_LEN]; - uint8_t hashbuf[SCRYPT_HASH_LEN]; - char outbuf[256]; - char saltbuf[256]; - - if(libscrypt_salt_gen(salt, SCRYPT_SALT_LEN) == -1) - { - return 0; - } - - retval = libscrypt_scrypt((const uint8_t*)passphrase, strlen(passphrase), - (uint8_t*)salt, SCRYPT_SALT_LEN, N, r, p, hashbuf, sizeof(hashbuf)); - if(retval == -1) - return 0; - - retval = libscrypt_b64_encode((unsigned char*)hashbuf, sizeof(hashbuf), - outbuf, sizeof(outbuf)); - if(retval == -1) - return 0; - - retval = libscrypt_b64_encode((unsigned char *)salt, sizeof(salt), - saltbuf, sizeof(saltbuf)); - if(retval == -1) - return 0; - - retval = libscrypt_mcf(N, r, p, saltbuf, outbuf, dst); - if(retval != 1) - return 0; - - return 1; -} diff --git a/libscrypt/libscrypt.h b/libscrypt/libscrypt.h index b7141f5f5..889ba13aa 100644 --- a/libscrypt/libscrypt.h +++ b/libscrypt/libscrypt.h @@ -33,17 +33,6 @@ int libscrypt_scrypt(const uint8_t *, size_t, const uint8_t *, size_t, uint64_t, int libscrypt_mcf(uint32_t N, uint32_t r, uint32_t p, const char *salt, const char *hash, char *mcf); -#ifndef _MSC_VER -/* Generates a salt. Uses /dev/urandom/ - */ -int libscrypt_salt_gen(/*@out@*/ uint8_t *rand, size_t len); - -/* Creates a hash of a passphrase using a randomly generated salt */ -/* Returns >0 on success, or 0 for fail */ -int libscrypt_hash(char *dst, const char* passphrase, uint32_t N, uint8_t r, - uint8_t p); -#endif - /* Checks a given MCF against a password */ int libscrypt_check(char *mcf, const char *password); diff --git a/test/libdevcrypto/SecretStore.cpp b/test/libdevcrypto/SecretStore.cpp new file mode 100644 index 000000000..1f927db5d --- /dev/null +++ b/test/libdevcrypto/SecretStore.cpp @@ -0,0 +1,64 @@ +/* + This file is part of cpp-ethereum. + + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file SecretStore.cpp + * @author Gav Wood + * @date 2015 + * Secret store test functions. + */ + +#include +#include +#include +#include "../JsonSpiritHeaders.h" +#include +#include +#include +#include +#include "MemTrie.h" +#include "../TestHelper.h" +using namespace std; +using namespace dev; + +namespace js = json_spirit; + +BOOST_AUTO_TEST_SUITE(KeyStore) + +BOOST_AUTO_TEST_CASE(basic_tests) +{ + string testPath = test::getTestPath(); + + testPath += "/KeyStoreTests"; + + cnote << "Testing Key Store..."; + js::mValue v; + string s = asString(contents(testPath + "/basic_tests.json")); + BOOST_REQUIRE_MESSAGE(s.length() > 0, "Contents of 'KeyStoreTests/basic_tests.json' is empty. Have you cloned the 'tests' repo branch develop?"); + js::read_string(s, v); + for (auto& i: v.get_obj()) + { + cnote << i.first; + js::mObject& o = i.second.get_obj(); + SecretStore store("."); + h128 u = store.readKeyContent(js::write_string(o["json"], false)); + cdebug << "read uuid" << u; + bytes s = store.secret(u, [&](){ return o["password"].get_str(); }); + cdebug << "got secret" << toHex(s); + BOOST_REQUIRE_EQUAL(toHex(s), o["priv"].get_str()); + } +} + +BOOST_AUTO_TEST_SUITE_END() From 6281c11534c97e719ff228ee810d9c710b79a882 Mon Sep 17 00:00:00 2001 From: chriseth Date: Mon, 25 May 2015 11:49:38 +0200 Subject: [PATCH 342/461] Sort keywords and add some reserved keywords. --- libsolidity/Token.h | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/libsolidity/Token.h b/libsolidity/Token.h index 1435dcc57..8a373da34 100644 --- a/libsolidity/Token.h +++ b/libsolidity/Token.h @@ -142,34 +142,34 @@ namespace solidity K(Delete, "delete", 0) \ \ /* Keywords */ \ + K(Anonymous, "anonymous", 0) \ K(Break, "break", 0) \ K(Const, "constant", 0) \ - K(Anonymous, "anonymous", 0) \ K(Continue, "continue", 0) \ K(Contract, "contract", 0) \ K(Default, "default", 0) \ K(Do, "do", 0) \ K(Else, "else", 0) \ + K(Enum, "enum", 0) \ K(Event, "event", 0) \ K(External, "external", 0) \ - K(Is, "is", 0) \ - K(Indexed, "indexed", 0) \ K(For, "for", 0) \ K(Function, "function", 0) \ K(If, "if", 0) \ + K(Indexed, "indexed", 0) \ + K(Internal, "internal", 0) \ K(Import, "import", 0) \ + K(Is, "is", 0) \ K(Mapping, "mapping", 0) \ K(Modifier, "modifier", 0) \ K(New, "new", 0) \ K(Public, "public", 0) \ K(Private, "private", 0) \ - K(Internal, "internal", 0) \ K(Return, "return", 0) \ K(Returns, "returns", 0) \ K(Struct, "struct", 0) \ K(Var, "var", 0) \ K(While, "while", 0) \ - K(Enum, "enum", 0) \ \ /* Ether subdenominations */ \ K(SubWei, "wei", 0) \ @@ -304,15 +304,21 @@ namespace solidity T(Identifier, NULL, 0) \ \ /* Keywords reserved for future. use*/ \ - T(String, "string", 0) \ + K(As, "as", 0) \ K(Case, "case", 0) \ + K(Catch, "catch", 0) \ + K(Final, "final", 0) \ + K(Let, "let", 0) \ + K(Match, "match", 0) \ + K(Of, "of", 0) \ + K(Relocatable, "relocatable", 0) \ + T(String, "string", 0) \ K(Switch, "switch", 0) \ K(Throw, "throw", 0) \ K(Try, "try", 0) \ - K(Catch, "catch", 0) \ - K(Using, "using", 0) \ K(Type, "type", 0) \ K(TypeOf, "typeof", 0) \ + K(Using, "using", 0) \ /* Illegal token - not able to scan. */ \ T(Illegal, "ILLEGAL", 0) \ \ From 4251276cb304c178235691a3815836231adda795 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Mon, 25 May 2015 19:10:50 +0100 Subject: [PATCH 343/461] Fix mining. Again. --- libethash/internal.c | 2 +- libethcore/Ethash.cpp | 8 ++++++-- libethcore/EthashAux.cpp | 6 ++++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/libethash/internal.c b/libethash/internal.c index e881e0c7b..2a12163f7 100644 --- a/libethash/internal.c +++ b/libethash/internal.c @@ -368,7 +368,7 @@ static bool ethash_mmap(struct ethash_full* ret, FILE* f) if ((fd = ethash_fileno(ret->file)) == -1) { return false; } - mmapped_data= mmap( + mmapped_data = mmap( NULL, (size_t)ret->file_size + ETHASH_DAG_MAGIC_NUM_SIZE, PROT_READ | PROT_WRITE, diff --git a/libethcore/Ethash.cpp b/libethcore/Ethash.cpp index 24a6ab41e..60585a162 100644 --- a/libethcore/Ethash.cpp +++ b/libethcore/Ethash.cpp @@ -142,8 +142,12 @@ void Ethash::CPUMiner::workLoop() WorkPackage w = work(); EthashAux::FullType dag; - while (!shouldStop() && !(dag = EthashAux::full(w.seedHash, true))) - this_thread::sleep_for(chrono::milliseconds(500)); + while (!shouldStop() && !dag) + { + while (!shouldStop() && EthashAux::computeFull(w.seedHash, true) != 100) + this_thread::sleep_for(chrono::milliseconds(500)); + dag = EthashAux::full(w.seedHash, false); + } h256 boundary = w.boundary; unsigned hashCount = 1; diff --git a/libethcore/EthashAux.cpp b/libethcore/EthashAux.cpp index a94c1237d..06da22f98 100644 --- a/libethcore/EthashAux.cpp +++ b/libethcore/EthashAux.cpp @@ -133,7 +133,9 @@ bytesConstRef EthashAux::LightAllocation::data() const EthashAux::FullAllocation::FullAllocation(ethash_light_t _light, ethash_callback_t _cb) { +// cdebug << "About to call ethash_full_new..."; full = ethash_full_new(_light, _cb); +// cdebug << "Called OK."; if (!full) BOOST_THROW_EXCEPTION(ExternalFunctionFailure("ethash_full_new()")); } @@ -170,9 +172,9 @@ EthashAux::FullType EthashAux::full(h256 const& _seedHash, bool _createIfMissing if (_createIfMissing || computeFull(_seedHash, false) == 100) { s_dagCallback = _f; - cnote << "Loading from libethash..."; +// cnote << "Loading from libethash..."; ret = make_shared(l->light, dagCallbackShim); - cnote << "Done loading."; +// cnote << "Done loading."; DEV_GUARDED(get()->x_fulls) get()->m_fulls[_seedHash] = get()->m_lastUsedFull = ret; From 62751488514b3bc09a824c7b1abb48c96a61976e Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Tue, 26 May 2015 03:07:26 +0200 Subject: [PATCH 344/461] fix output memory for CALL --- libethereum/ExtVM.cpp | 4 + .../stCallCreateCallCodeTestFiller.json | 344 ++++++++++++++++++ 2 files changed, 348 insertions(+) diff --git a/libethereum/ExtVM.cpp b/libethereum/ExtVM.cpp index c0591cef5..2beb11cf0 100644 --- a/libethereum/ExtVM.cpp +++ b/libethereum/ExtVM.cpp @@ -28,6 +28,10 @@ using namespace dev::eth; bool ExtVM::call(CallParameters& _p) { + // clear output memory + for (auto& i: _p.out) + i = 0; + Executive e(m_s, lastHashes, depth + 1); if (!e.call(_p, gasPrice, origin)) { diff --git a/test/libethereum/StateTestsFiller/stCallCreateCallCodeTestFiller.json b/test/libethereum/StateTestsFiller/stCallCreateCallCodeTestFiller.json index 682b0cb3e..2c016c28f 100644 --- a/test/libethereum/StateTestsFiller/stCallCreateCallCodeTestFiller.json +++ b/test/libethereum/StateTestsFiller/stCallCreateCallCodeTestFiller.json @@ -1025,5 +1025,349 @@ "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", "data" : "" } + }, + + "callOutput1" : { + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "256", + "currentGasLimit" : "1000000", + "currentNumber" : "0", + "currentTimestamp" : 1, + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000000", + "code" : "{ (MSTORE 0 0x5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6) (CALL 50000 0xaaae7baea6a6c7c4c2dfeb977efac326af552d87 0 0 0 0 0) [[ 0 ]] (MLOAD 0) }", + "nonce" : "0", + "storage" : { + } + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1000000000000000000", + "code" : "0x", + "nonce" : "0", + "storage" : { + } + }, + "aaae7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000000", + "code" : "0x6001600101600055", + "nonce" : "0", + "storage" : { + } + } + }, + "transaction" : { + "data" : "", + "gasLimit" : "1000000", + "gasPrice" : "0", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "100000" + } + }, + + "callOutput2" : { + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "256", + "currentGasLimit" : "1000000", + "currentNumber" : "0", + "currentTimestamp" : 1, + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000000", + "code" : "{ (MSTORE 0 0x5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6) (CALL 50000 0xaaae7baea6a6c7c4c2dfeb977efac326af552d87 0 0 32 0 0) [[ 0 ]] (MLOAD 0)}", + "nonce" : "0", + "storage" : { + } + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1000000000000000000", + "code" : "0x", + "nonce" : "0", + "storage" : { + } + }, + "aaae7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000000", + "code" : "0x6001600101600055", + "nonce" : "0", + "storage" : { + } + } + }, + "transaction" : { + "data" : "", + "gasLimit" : "1000000", + "gasPrice" : "0", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "100000" + } + }, + + "callOutput3" : { + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "256", + "currentGasLimit" : "1000000", + "currentNumber" : "0", + "currentTimestamp" : 1, + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000000", + "code" : "{ (MSTORE 0 0x5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6) (CALL 50000 0xaaae7baea6a6c7c4c2dfeb977efac326af552d87 0 0 0 0 32) [[ 0 ]] (MLOAD 0)}", + "nonce" : "0", + "storage" : { + } + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1000000000000000000", + "code" : "0x", + "nonce" : "0", + "storage" : { + } + }, + "aaae7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000000", + "code" : "0x6001600101600055", + "nonce" : "0", + "storage" : { + } + } + }, + "transaction" : { + "data" : "", + "gasLimit" : "1000000", + "gasPrice" : "0", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "100000" + } + }, + + "callOutput3partial" : { + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "256", + "currentGasLimit" : "1000000", + "currentNumber" : "0", + "currentTimestamp" : 1, + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000000", + "code" : "{ (MSTORE 0 0x5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6) (CALL 50000 0xaaae7baea6a6c7c4c2dfeb977efac326af552d87 0 0 0 0 10) [[ 0 ]] (MLOAD 0)}", + "nonce" : "0", + "storage" : { + } + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1000000000000000000", + "code" : "0x", + "nonce" : "0", + "storage" : { + } + }, + "aaae7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000000", + "code" : "0x6001600101600055", + "nonce" : "0", + "storage" : { + } + } + }, + "transaction" : { + "data" : "", + "gasLimit" : "1000000", + "gasPrice" : "0", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "100000" + } + }, + + "callcodeOutput1" : { + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "256", + "currentGasLimit" : "1000000", + "currentNumber" : "0", + "currentTimestamp" : 1, + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000000", + "code" : "{ (MSTORE 0 0x5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6) (CALLCODE 50000 0xaaae7baea6a6c7c4c2dfeb977efac326af552d87 0 0 0 0 0) [[ 0 ]] (MLOAD 0) }", + "nonce" : "0", + "storage" : { + } + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1000000000000000000", + "code" : "0x", + "nonce" : "0", + "storage" : { + } + }, + "aaae7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000000", + "code" : "0x6001600101600055", + "nonce" : "0", + "storage" : { + } + } + }, + "transaction" : { + "data" : "", + "gasLimit" : "1000000", + "gasPrice" : "0", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "100000" + } + }, + + "callcodeOutput2" : { + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "256", + "currentGasLimit" : "1000000", + "currentNumber" : "0", + "currentTimestamp" : 1, + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000000", + "code" : "{ (MSTORE 0 0x5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6) (CALLCODE 50000 0xaaae7baea6a6c7c4c2dfeb977efac326af552d87 0 0 32 0 0) [[ 0 ]] (MLOAD 0)}", + "nonce" : "0", + "storage" : { + } + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1000000000000000000", + "code" : "0x", + "nonce" : "0", + "storage" : { + } + }, + "aaae7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000000", + "code" : "0x6001600101600055", + "nonce" : "0", + "storage" : { + } + } + }, + "transaction" : { + "data" : "", + "gasLimit" : "1000000", + "gasPrice" : "0", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "100000" + } + }, + + "callcodeOutput3" : { + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "256", + "currentGasLimit" : "1000000", + "currentNumber" : "0", + "currentTimestamp" : 1, + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000000", + "code" : "{ (MSTORE 0 0x5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6) (CALLCODE 50000 0xaaae7baea6a6c7c4c2dfeb977efac326af552d87 0 0 0 0 32) [[ 0 ]] (MLOAD 0)}", + "nonce" : "0", + "storage" : { + } + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1000000000000000000", + "code" : "0x", + "nonce" : "0", + "storage" : { + } + }, + "aaae7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000000", + "code" : "0x6001600101600055", + "nonce" : "0", + "storage" : { + } + } + }, + "transaction" : { + "data" : "", + "gasLimit" : "1000000", + "gasPrice" : "0", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "100000" + } + }, + + "callcodeOutput3partial" : { + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "256", + "currentGasLimit" : "1000000", + "currentNumber" : "0", + "currentTimestamp" : 1, + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000000", + "code" : "{ (MSTORE 0 0x5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6) (CALLCODE 50000 0xaaae7baea6a6c7c4c2dfeb977efac326af552d87 0 0 0 0 10) [[ 0 ]] (MLOAD 0)}", + "nonce" : "0", + "storage" : { + } + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1000000000000000000", + "code" : "0x", + "nonce" : "0", + "storage" : { + } + }, + "aaae7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000000", + "code" : "0x6001600101600055", + "nonce" : "0", + "storage" : { + } + } + }, + "transaction" : { + "data" : "", + "gasLimit" : "1000000", + "gasPrice" : "0", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "100000" + } } } From 5c2b10eef4d223a19527f44bfbd43b10adac5f41 Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Tue, 26 May 2015 03:14:39 +0200 Subject: [PATCH 345/461] more tests --- .../stCallCreateCallCodeTestFiller.json | 174 ++++++++++++++++++ 1 file changed, 174 insertions(+) diff --git a/test/libethereum/StateTestsFiller/stCallCreateCallCodeTestFiller.json b/test/libethereum/StateTestsFiller/stCallCreateCallCodeTestFiller.json index 2c016c28f..f2d930756 100644 --- a/test/libethereum/StateTestsFiller/stCallCreateCallCodeTestFiller.json +++ b/test/libethereum/StateTestsFiller/stCallCreateCallCodeTestFiller.json @@ -1156,6 +1156,49 @@ } }, + "callOutput3Fail" : { + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "256", + "currentGasLimit" : "1000000", + "currentNumber" : "0", + "currentTimestamp" : 1, + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000000", + "code" : "{ (MSTORE 0 0x5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6) (CALL 50000 0xaaae7baea6a6c7c4c2dfeb977efac326af552d87 0 0 0 0 32) [[ 0 ]] (MLOAD 0)}", + "nonce" : "0", + "storage" : { + } + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1000000000000000000", + "code" : "0x", + "nonce" : "0", + "storage" : { + } + }, + "aaae7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000000", + "code" : "0x016001600101600055", + "nonce" : "0", + "storage" : { + } + } + }, + "transaction" : { + "data" : "", + "gasLimit" : "1000000", + "gasPrice" : "0", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "100000" + } + }, + "callOutput3partial" : { "env" : { "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", @@ -1199,6 +1242,49 @@ } }, + "callOutput3partialFail" : { + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "256", + "currentGasLimit" : "1000000", + "currentNumber" : "0", + "currentTimestamp" : 1, + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000000", + "code" : "{ (MSTORE 0 0x5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6) (CALL 50000 0xaaae7baea6a6c7c4c2dfeb977efac326af552d87 0 0 0 0 10) [[ 0 ]] (MLOAD 0)}", + "nonce" : "0", + "storage" : { + } + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1000000000000000000", + "code" : "0x", + "nonce" : "0", + "storage" : { + } + }, + "aaae7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000000", + "code" : "0x016001600101600055", + "nonce" : "0", + "storage" : { + } + } + }, + "transaction" : { + "data" : "", + "gasLimit" : "1000000", + "gasPrice" : "0", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "100000" + } + }, + "callcodeOutput1" : { "env" : { "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", @@ -1328,6 +1414,49 @@ } }, + "callcodeOutput3Fail" : { + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "256", + "currentGasLimit" : "1000000", + "currentNumber" : "0", + "currentTimestamp" : 1, + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000000", + "code" : "{ (MSTORE 0 0x5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6) (CALLCODE 50000 0xaaae7baea6a6c7c4c2dfeb977efac326af552d87 0 0 0 0 32) [[ 0 ]] (MLOAD 0)}", + "nonce" : "0", + "storage" : { + } + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1000000000000000000", + "code" : "0x", + "nonce" : "0", + "storage" : { + } + }, + "aaae7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000000", + "code" : "0x016001600101600055", + "nonce" : "0", + "storage" : { + } + } + }, + "transaction" : { + "data" : "", + "gasLimit" : "1000000", + "gasPrice" : "0", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "100000" + } + }, + "callcodeOutput3partial" : { "env" : { "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", @@ -1369,5 +1498,50 @@ "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", "value" : "100000" } + }, + + "callcodeOutput3partialFail" : { + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "256", + "currentGasLimit" : "1000000", + "currentNumber" : "0", + "currentTimestamp" : 1, + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000000", + "code" : "{ (MSTORE 0 0x5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6) (CALLCODE 50000 0xaaae7baea6a6c7c4c2dfeb977efac326af552d87 0 0 0 0 10) [[ 0 ]] (MLOAD 0)}", + "nonce" : "0", + "storage" : { + } + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1000000000000000000", + "code" : "0x", + "nonce" : "0", + "storage" : { + } + }, + "aaae7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000000", + "code" : "0x016001600101600055", + "nonce" : "0", + "storage" : { + } + } + }, + "transaction" : { + "data" : "", + "gasLimit" : "1000000", + "gasPrice" : "0", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "100000" + } } + + } From dadac26d0eff896056f1b3bfc18a09df512bb9e4 Mon Sep 17 00:00:00 2001 From: lotrf3 Date: Tue, 26 May 2015 02:18:19 -0500 Subject: [PATCH 346/461] Added upnp support to Windows --- alethzero/CMakeLists.txt | 1 + eth/CMakeLists.txt | 1 + extdep/getstuff.bat | 1 + test/CMakeLists.txt | 1 + 4 files changed, 4 insertions(+) diff --git a/alethzero/CMakeLists.txt b/alethzero/CMakeLists.txt index 595668cd1..9738ec765 100644 --- a/alethzero/CMakeLists.txt +++ b/alethzero/CMakeLists.txt @@ -42,6 +42,7 @@ eth_add_executable(${EXECUTABLE} add_dependencies(${EXECUTABLE} BuildInfo.h) +target_link_libraries(${EXECUTABLE} Iphlpapi) target_link_libraries(${EXECUTABLE} Qt5::Core) target_link_libraries(${EXECUTABLE} Qt5::Widgets) target_link_libraries(${EXECUTABLE} Qt5::WebEngine) diff --git a/eth/CMakeLists.txt b/eth/CMakeLists.txt index d317be28a..7246ea54e 100644 --- a/eth/CMakeLists.txt +++ b/eth/CMakeLists.txt @@ -19,6 +19,7 @@ add_executable(${EXECUTABLE} ${SRC_LIST} ${HEADERS}) add_dependencies(${EXECUTABLE} BuildInfo.h) +target_link_libraries(${EXECUTABLE} Iphlpapi) target_link_libraries(${EXECUTABLE} ${Boost_REGEX_LIBRARIES}) if (READLINE_FOUND) diff --git a/extdep/getstuff.bat b/extdep/getstuff.bat index b9bd6ab19..3b41f9e96 100644 --- a/extdep/getstuff.bat +++ b/extdep/getstuff.bat @@ -13,6 +13,7 @@ call :download json-rpc-cpp 0.5.0 call :download leveldb 1.2 call :download microhttpd 0.9.2 call :download qt 5.4.1 +call :download miniupnpc 1.9 goto :EOF diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 39a235c58..be24ea115 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -69,6 +69,7 @@ endforeach(file) file(GLOB HEADERS "*.h") add_executable(testeth ${SRC_LIST} ${HEADERS}) +target_link_libraries(testeth Iphlpapi) target_link_libraries(testeth ${Boost_UNIT_TEST_FRAMEWORK_LIBRARIES}) target_link_libraries(testeth ${CURL_LIBRARIES}) target_link_libraries(testeth ethereum) From 5d68013af26261436c03708db64f87b3373afd32 Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Tue, 26 May 2015 10:48:02 +0200 Subject: [PATCH 347/461] undo mem output change --- libethereum/ExtVM.cpp | 4 ---- 1 file changed, 4 deletions(-) diff --git a/libethereum/ExtVM.cpp b/libethereum/ExtVM.cpp index 2beb11cf0..c0591cef5 100644 --- a/libethereum/ExtVM.cpp +++ b/libethereum/ExtVM.cpp @@ -28,10 +28,6 @@ using namespace dev::eth; bool ExtVM::call(CallParameters& _p) { - // clear output memory - for (auto& i: _p.out) - i = 0; - Executive e(m_s, lastHashes, depth + 1); if (!e.call(_p, gasPrice, origin)) { From fea96e7b07d9eded8066412652b1b05fd0255b62 Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Tue, 26 May 2015 10:53:49 +0200 Subject: [PATCH 348/461] style --- .../StateTestsFiller/stCallCreateCallCodeTestFiller.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/test/libethereum/StateTestsFiller/stCallCreateCallCodeTestFiller.json b/test/libethereum/StateTestsFiller/stCallCreateCallCodeTestFiller.json index f2d930756..696541c80 100644 --- a/test/libethereum/StateTestsFiller/stCallCreateCallCodeTestFiller.json +++ b/test/libethereum/StateTestsFiller/stCallCreateCallCodeTestFiller.json @@ -1542,6 +1542,4 @@ "value" : "100000" } } - - } From 1a3d6904d70eaf40a97ac50cfe0db6cc5acc944f Mon Sep 17 00:00:00 2001 From: chriseth Date: Tue, 26 May 2015 11:27:59 +0200 Subject: [PATCH 349/461] Gas estimation for internal functions. --- libsolidity/Compiler.cpp | 5 ++++ libsolidity/Compiler.h | 4 +++ libsolidity/CompilerContext.cpp | 6 +++++ libsolidity/CompilerContext.h | 4 +++ libsolidity/CompilerStack.cpp | 18 ++++++++++++++ libsolidity/CompilerStack.h | 8 ++++++ libsolidity/GasEstimator.cpp | 44 ++++++++++++++++++++++++++------- libsolidity/GasEstimator.h | 9 +++++++ solc/CommandLineInterface.cpp | 28 ++++++++++++++++++--- 9 files changed, 113 insertions(+), 13 deletions(-) diff --git a/libsolidity/Compiler.cpp b/libsolidity/Compiler.cpp index 66c503172..5e24aaaa2 100644 --- a/libsolidity/Compiler.cpp +++ b/libsolidity/Compiler.cpp @@ -71,6 +71,11 @@ void Compiler::compileContract(ContractDefinition const& _contract, packIntoContractCreator(_contract, m_runtimeContext); } +eth::AssemblyItem Compiler::getFunctionEntryLabel(FunctionDefinition const& _function) const +{ + return m_runtimeContext.getFunctionEntryLabelIfExists(_function); +} + void Compiler::initializeContext(ContractDefinition const& _contract, map const& _contracts) { diff --git a/libsolidity/Compiler.h b/libsolidity/Compiler.h index 106038d1c..13b8639dd 100644 --- a/libsolidity/Compiler.h +++ b/libsolidity/Compiler.h @@ -52,6 +52,10 @@ public: /// @returns Assembly items of the runtime compiler context eth::AssemblyItems const& getRuntimeAssemblyItems() const { return m_runtimeContext.getAssembly().getItems(); } + /// @returns the entry label of the given function. Might return an AssemblyItem of type + /// UndefinedItem if it does not exist yet. + eth::AssemblyItem getFunctionEntryLabel(FunctionDefinition const& _function) const; + private: /// Registers the non-function objects inside the contract with the context. void initializeContext(ContractDefinition const& _contract, diff --git a/libsolidity/CompilerContext.cpp b/libsolidity/CompilerContext.cpp index f373fdfb0..2edff82e1 100644 --- a/libsolidity/CompilerContext.cpp +++ b/libsolidity/CompilerContext.cpp @@ -99,6 +99,12 @@ eth::AssemblyItem CompilerContext::getFunctionEntryLabel(Declaration const& _dec return res->second.tag(); } +eth::AssemblyItem CompilerContext::getFunctionEntryLabelIfExists(Declaration const& _declaration) const +{ + auto res = m_functionEntryLabels.find(&_declaration); + return res == m_functionEntryLabels.end() ? eth::AssemblyItem(eth::UndefinedItem) : res->second.tag(); +} + eth::AssemblyItem CompilerContext::getVirtualFunctionEntryLabel(FunctionDefinition const& _function) { solAssert(!m_inheritanceHierarchy.empty(), "No inheritance hierarchy set."); diff --git a/libsolidity/CompilerContext.h b/libsolidity/CompilerContext.h index 933912455..7bc29de1a 100644 --- a/libsolidity/CompilerContext.h +++ b/libsolidity/CompilerContext.h @@ -59,7 +59,11 @@ public: bool isLocalVariable(Declaration const* _declaration) const; bool isStateVariable(Declaration const* _declaration) const { return m_stateVariables.count(_declaration) != 0; } + /// @returns the entry label of the given function and creates it if it does not exist yet. eth::AssemblyItem getFunctionEntryLabel(Declaration const& _declaration); + /// @returns the entry label of the given function. Might return an AssemblyItem of type + /// UndefinedItem if it does not exist yet. + eth::AssemblyItem getFunctionEntryLabelIfExists(Declaration const& _declaration) const; void setInheritanceHierarchy(std::vector const& _hierarchy) { m_inheritanceHierarchy = _hierarchy; } /// @returns the entry label of the given function and takes overrides into account. eth::AssemblyItem getVirtualFunctionEntryLabel(FunctionDefinition const& _function); diff --git a/libsolidity/CompilerStack.cpp b/libsolidity/CompilerStack.cpp index 4f9764075..ebb988768 100644 --- a/libsolidity/CompilerStack.cpp +++ b/libsolidity/CompilerStack.cpp @@ -268,6 +268,24 @@ ContractDefinition const& CompilerStack::getContractDefinition(string const& _co return *getContract(_contractName).contract; } +size_t CompilerStack::getFunctionEntryPoint( + std::string const& _contractName, + FunctionDefinition const& _function +) const +{ + shared_ptr const& compiler = getContract(_contractName).compiler; + if (!compiler) + return 0; + eth::AssemblyItem tag = compiler->getFunctionEntryLabel(_function); + if (tag.type() == eth::UndefinedItem) + return 0; + eth::AssemblyItems const& items = compiler->getRuntimeAssemblyItems(); + for (size_t i = 0; i < items.size(); ++i) + if (items.at(i).type() == eth::Tag && items.at(i).data() == tag.data()) + return i; + return 0; +} + bytes CompilerStack::staticCompile(std::string const& _sourceCode, bool _optimize) { CompilerStack stack; diff --git a/libsolidity/CompilerStack.h b/libsolidity/CompilerStack.h index 0bc109a26..6be45aec1 100644 --- a/libsolidity/CompilerStack.h +++ b/libsolidity/CompilerStack.h @@ -48,6 +48,7 @@ namespace solidity // forward declarations class Scanner; class ContractDefinition; +class FunctionDefinition; class SourceUnit; class Compiler; class GlobalContext; @@ -131,6 +132,13 @@ public: /// does not exist. ContractDefinition const& getContractDefinition(std::string const& _contractName) const; + /// @returns the offset of the entry point of the given function into the list of assembly items + /// or zero if it is not found or does not exist. + size_t getFunctionEntryPoint( + std::string const& _contractName, + FunctionDefinition const& _function + ) const; + /// Compile the given @a _sourceCode to bytecode. If a scanner is provided, it is used for /// scanning the source code - this is useful for printing exception information. static bytes staticCompile(std::string const& _sourceCode, bool _optimize = false); diff --git a/libsolidity/GasEstimator.cpp b/libsolidity/GasEstimator.cpp index 18e3a5ca3..01219a65b 100644 --- a/libsolidity/GasEstimator.cpp +++ b/libsolidity/GasEstimator.cpp @@ -30,6 +30,7 @@ #include #include #include +#include using namespace std; using namespace dev; @@ -130,20 +131,45 @@ GasEstimator::GasConsumption GasEstimator::functionalEstimation( { auto state = make_shared(); - ExpressionClasses& classes = state->expressionClasses(); - using Id = ExpressionClasses::Id; - using Ids = vector; - Id hashValue = classes.find(u256(FixedHash<4>::Arith(FixedHash<4>(dev::sha3(_signature))))); - Id calldata = classes.find(eth::Instruction::CALLDATALOAD, Ids{classes.find(u256(0))}); - classes.forceEqual(hashValue, eth::Instruction::DIV, Ids{ - calldata, - classes.find(u256(1) << (8 * 28)) - }); + if (!_signature.empty()) + { + ExpressionClasses& classes = state->expressionClasses(); + using Id = ExpressionClasses::Id; + using Ids = vector; + Id hashValue = classes.find(u256(FixedHash<4>::Arith(FixedHash<4>(dev::sha3(_signature))))); + Id calldata = classes.find(eth::Instruction::CALLDATALOAD, Ids{classes.find(u256(0))}); + classes.forceEqual(hashValue, eth::Instruction::DIV, Ids{ + calldata, + classes.find(u256(1) << (8 * 28)) + }); + } PathGasMeter meter(_items); return meter.estimateMax(0, state); } +GasEstimator::GasConsumption GasEstimator::functionalEstimation( + AssemblyItems const& _items, + size_t const& _offset, + FunctionDefinition const& _function +) +{ + auto state = make_shared(); + + unsigned parametersSize = CompilerUtils::getSizeOnStack(_function.getParameters()); + if (parametersSize > 16) + return GasConsumption::infinite(); + + // Store an invalid return value on the stack, so that the path estimator breaks upon reaching + // the return jump. + AssemblyItem invalidTag(PushTag, u256(-0x10)); + state->feedItem(invalidTag, true); + if (parametersSize > 0) + state->feedItem(eth::swapInstruction(parametersSize)); + + return PathGasMeter(_items).estimateMax(_offset, state); +} + set GasEstimator::finestNodesAtLocation( vector const& _roots ) diff --git a/libsolidity/GasEstimator.h b/libsolidity/GasEstimator.h index 32e95fac4..4020d60b3 100644 --- a/libsolidity/GasEstimator.h +++ b/libsolidity/GasEstimator.h @@ -65,6 +65,15 @@ public: std::string const& _signature = "" ); + /// @returns the estimated gas consumption by the given function which starts at the given + /// offset into the list of assembly items. + /// @note this does not work correctly for recursive functions. + static GasConsumption functionalEstimation( + eth::AssemblyItems const& _items, + size_t const& _offset, + FunctionDefinition const& _function + ); + private: /// @returns the set of AST nodes which are the finest nodes at their location. static std::set finestNodesAtLocation(std::vector const& _roots); diff --git a/solc/CommandLineInterface.cpp b/solc/CommandLineInterface.cpp index c86938f81..8129f60c5 100644 --- a/solc/CommandLineInterface.cpp +++ b/solc/CommandLineInterface.cpp @@ -258,18 +258,38 @@ void CommandLineInterface::handleGasEstimation(string const& _contract) { Gas gas = GasEstimator::functionalEstimation(*items); u256 bytecodeSize(m_compiler->getRuntimeBytecode(_contract).size()); - cout << "[construction]:\t"; - cout << gas << " + " << (bytecodeSize * eth::c_createDataGas) << " = "; + cout << "construction:" << endl; + cout << " " << gas << " + " << (bytecodeSize * eth::c_createDataGas) << " = "; gas += bytecodeSize * eth::c_createDataGas; cout << gas << endl; } if (eth::AssemblyItems const* items = m_compiler->getRuntimeAssemblyItems(_contract)) - for (auto it: m_compiler->getContractDefinition(_contract).getInterfaceFunctions()) + { + ContractDefinition const& contract = m_compiler->getContractDefinition(_contract); + cout << "external:" << endl; + for (auto it: contract.getInterfaceFunctions()) { string sig = it.second->externalSignature(); GasEstimator::GasConsumption gas = GasEstimator::functionalEstimation(*items, sig); - cout << sig << ":\t" << gas << endl; + cout << " " << sig << ":\t" << gas << endl; } + cout << "internal:" << endl; + for (auto const& it: contract.getDefinedFunctions()) + { + if (it->isPartOfExternalInterface() || it->isConstructor()) + continue; + size_t entry = m_compiler->getFunctionEntryPoint(_contract, *it); + GasEstimator::GasConsumption gas = GasEstimator::GasConsumption::infinite(); + if (entry > 0) + gas = GasEstimator::functionalEstimation(*items, entry, *it); + FunctionType type(*it); + cout << " " << it->getName() << "("; + auto end = type.getParameterTypes().end(); + for (auto it = type.getParameterTypes().begin(); it != end; ++it) + cout << (*it)->toString() << (it + 1 == end ? "" : ","); + cout << "):\t" << gas << endl; + } + } } bool CommandLineInterface::parseArguments(int argc, char** argv) From c58d5bb7dd6aa5ef6f9a165ffa8cd204106accac Mon Sep 17 00:00:00 2001 From: chriseth Date: Tue, 26 May 2015 11:29:41 +0200 Subject: [PATCH 350/461] Removed redundant std. --- libevmasm/GasMeter.cpp | 2 +- test/libsolidity/GasMeter.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libevmasm/GasMeter.cpp b/libevmasm/GasMeter.cpp index 650bd6e28..4e5289e38 100644 --- a/libevmasm/GasMeter.cpp +++ b/libevmasm/GasMeter.cpp @@ -34,7 +34,7 @@ GasMeter::GasConsumption& GasMeter::GasConsumption::operator+=(GasConsumption co if (isInfinite) return *this; bigint v = bigint(value) + _other.value; - if (v > std::numeric_limits::max()) + if (v > numeric_limits::max()) *this = infinite(); else value = u256(v); diff --git a/test/libsolidity/GasMeter.cpp b/test/libsolidity/GasMeter.cpp index c09849c00..5f4426548 100644 --- a/test/libsolidity/GasMeter.cpp +++ b/test/libsolidity/GasMeter.cpp @@ -71,7 +71,7 @@ public: /// Compares the gas computed by PathGasMeter for the given signature (but unknown arguments) /// against the actual gas usage computed by the VM on the given set of argument variants. - void testRunTimeGas(std::string const& _sig, vector _argumentVariants) + void testRunTimeGas(string const& _sig, vector _argumentVariants) { u256 gasUsed = 0; FixedHash<4> hash(dev::sha3(_sig)); From 035cc0c3c1657820cc3bf99b916d960760dc4a95 Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Tue, 26 May 2015 12:51:33 +0200 Subject: [PATCH 351/461] update wallet tests --- .../StateTestsFiller/stWalletTestFiller.json | 94 +++++++++---------- 1 file changed, 47 insertions(+), 47 deletions(-) diff --git a/test/libethereum/StateTestsFiller/stWalletTestFiller.json b/test/libethereum/StateTestsFiller/stWalletTestFiller.json index c3a0f0bc4..02f09be95 100644 --- a/test/libethereum/StateTestsFiller/stWalletTestFiller.json +++ b/test/libethereum/StateTestsFiller/stWalletTestFiller.json @@ -18,8 +18,8 @@ } }, "transaction" : { - "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff166003819055815261010260205260408120919091556108ae90819061004590396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b610181600435600060406000368082843790912090506102fd815b73ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054818080838114156107465761073d565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b61018160043560406000368082843790912090506101f181610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156103e557610467565b61018160043560406000368082843790912090506103c381610080565b610181600435602435600060406000368082843790912090506104d981610080565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156101ec576101ff826100be565b1561020a57506101ee565b61022c5b6101045460005b8181101561066a576101048054829081106106b257005b60015460fa901015156102435761024161025a565b505b60015460fa9010151561028457506101ee565b6102b45b600060015b600154811015610555575b600154811080156105b1575060028161010081106105aa57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061019157005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b156102f85773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561033857506101ec565b600160016000505403600060005054111561035357506101ec565b6000600283610100811061036357005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561025661020e565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b156101ec576001548211156103d857506101ee565b600082905561039461020e565b5050506000828152610103602052604081206001810154600284900a929083168190111561046757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156104d3576104e7836100be565b156104f257506102f8565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082141561052857506102f8565b61053061020e565b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061046e57005b5090565b01546000145b156105be57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b6001805411801561055f5750600154600290610100811061055957005b0154600014155b1561058d5760010161026a565b600154811080156105e2575060015460029061010081106105db57005b0154600014155b80156105fd575060028161010081106105f757005b01546000145b1561061657600154600290610100811061061b57005b01555b61025f565b0154600282610100811061062b57005b0155806101026000600283610100811061064157005b015481526020810191909152604001600090812091909155600154600290610100811061061357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156104d3576000815560010161069e565b600091825260208220015414151561070457610104805461010391600091849081106106da57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b600101610215565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b60008681526101036020526040812080549094509092508214156107d157815483556001838101839055610104805491820180825582801582901161085d578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b8082111561085b57600081556001016107b0565b6000918252602090912001555b506001820154600284900a9081166000141561073d5773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a1825460019011151561070c57600086815261010360205261010480546040909220600201549091811061087757005b505b50505060028401819055610104805488929081106107c457005b600091825260208083209091018290558782526101039052604081208181556001818101839055600290910191909155945061073d56", - "gasLimit" : "169491", + "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff166003819055815261010260205260408120919091556108ae90819061004590396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548211156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", + "gasLimit" : "0x03d0c3", "gasPrice" : "1", "nonce" : "0", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", @@ -47,7 +47,7 @@ } }, "transaction" : { - "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff166003819055815261010260205260408120919091556108ae90819061004590396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b610181600435600060406000368082843790912090506102fd815b73ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054818080838114156107465761073d565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b61018160043560406000368082843790912090506101f181610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156103e557610467565b61018160043560406000368082843790912090506103c381610080565b610181600435602435600060406000368082843790912090506104d981610080565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156101ec576101ff826100be565b1561020a57506101ee565b61022c5b6101045460005b8181101561066a576101048054829081106106b257005b60015460fa901015156102435761024161025a565b505b60015460fa9010151561028457506101ee565b6102b45b600060015b600154811015610555575b600154811080156105b1575060028161010081106105aa57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061019157005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b156102f85773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561033857506101ec565b600160016000505403600060005054111561035357506101ec565b6000600283610100811061036357005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561025661020e565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b156101ec576001548211156103d857506101ee565b600082905561039461020e565b5050506000828152610103602052604081206001810154600284900a929083168190111561046757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156104d3576104e7836100be565b156104f257506102f8565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082141561052857506102f8565b61053061020e565b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061046e57005b5090565b01546000145b156105be57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b6001805411801561055f5750600154600290610100811061055957005b0154600014155b1561058d5760010161026a565b600154811080156105e2575060015460029061010081106105db57005b0154600014155b80156105fd575060028161010081106105f757005b01546000145b1561061657600154600290610100811061061b57005b01555b61025f565b0154600282610100811061062b57005b0155806101026000600283610100811061064157005b015481526020810191909152604001600090812091909155600154600290610100811061061357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156104d3576000815560010161069e565b600091825260208220015414151561070457610104805461010391600091849081106106da57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b600101610215565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b60008681526101036020526040812080549094509092508214156107d157815483556001838101839055610104805491820180825582801582901161085d578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b8082111561085b57600081556001016107b0565b6000918252602090912001555b506001820154600284900a9081166000141561073d5773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a1825460019011151561070c57600086815261010360205261010480546040909220600201549091811061087757005b505b50505060028401819055610104805488929081106107c457005b600091825260208083209091018290558782526101039052604081208181556001818101839055600290910191909155945061073d56", + "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff166003819055815261010260205260408120919091556108ae90819061004590396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548211156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", "gasLimit" : "0x0a98b3", "gasPrice" : "1", "nonce" : "0", @@ -76,7 +76,7 @@ } }, "transaction" : { - "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff166003819055815261010260205260408120919091556108ae90819061004590396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b610181600435600060406000368082843790912090506102fd815b73ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054818080838114156107465761073d565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b61018160043560406000368082843790912090506101f181610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156103e557610467565b61018160043560406000368082843790912090506103c381610080565b610181600435602435600060406000368082843790912090506104d981610080565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156101ec576101ff826100be565b1561020a57506101ee565b61022c5b6101045460005b8181101561066a576101048054829081106106b257005b60015460fa901015156102435761024161025a565b505b60015460fa9010151561028457506101ee565b6102b45b600060015b600154811015610555575b600154811080156105b1575060028161010081106105aa57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061019157005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b156102f85773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561033857506101ec565b600160016000505403600060005054111561035357506101ec565b6000600283610100811061036357005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561025661020e565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b156101ec576001548211156103d857506101ee565b600082905561039461020e565b5050506000828152610103602052604081206001810154600284900a929083168190111561046757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156104d3576104e7836100be565b156104f257506102f8565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082141561052857506102f8565b61053061020e565b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061046e57005b5090565b01546000145b156105be57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b6001805411801561055f5750600154600290610100811061055957005b0154600014155b1561058d5760010161026a565b600154811080156105e2575060015460029061010081106105db57005b0154600014155b80156105fd575060028161010081106105f757005b01546000145b1561061657600154600290610100811061061b57005b01555b61025f565b0154600282610100811061062b57005b0155806101026000600283610100811061064157005b015481526020810191909152604001600090812091909155600154600290610100811061061357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156104d3576000815560010161069e565b600091825260208220015414151561070457610104805461010391600091849081106106da57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b600101610215565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b60008681526101036020526040812080549094509092508214156107d157815483556001838101839055610104805491820180825582801582901161085d578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b8082111561085b57600081556001016107b0565b6000918252602090912001555b506001820154600284900a9081166000141561073d5773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a1825460019011151561070c57600086815261010360205261010480546040909220600201549091811061087757005b505b50505060028401819055610104805488929081106107c457005b600091825260208083209091018290558782526101039052604081208181556001818101839055600290910191909155945061073d56", + "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff166003819055815261010260205260408120919091556108ae90819061004590396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548211156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", "gasLimit" : "0x0a98b4", "gasPrice" : "1", "nonce" : "0", @@ -98,7 +98,7 @@ "pre" : { "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548211156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -138,7 +138,7 @@ "pre" : { "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548211156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -178,7 +178,7 @@ "pre" : { "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548211156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -218,7 +218,7 @@ "pre" : { "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548211156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -258,7 +258,7 @@ "pre" : { "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548211156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -298,7 +298,7 @@ "pre" : { "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548211156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -338,7 +338,7 @@ "pre" : { "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548211156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -378,7 +378,7 @@ "pre" : { "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548211156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -425,7 +425,7 @@ "pre" : { "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548211156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -465,7 +465,7 @@ "pre" : { "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548211156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -505,7 +505,7 @@ "pre" : { "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548211156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -545,7 +545,7 @@ "pre" : { "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548211156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -585,7 +585,7 @@ "pre" : { "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548211156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -625,7 +625,7 @@ "pre" : { "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548211156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -665,7 +665,7 @@ "pre" : { "6295ee1b4f6dd65047762f924ecd367c17eabf8f" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548210156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548211156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -712,8 +712,8 @@ } }, "transaction" : { - "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff16600381905581526101026020526040902055620151804204610107556109158061004b6000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461007b5780632f54bf6e146100cd5780635c52c2f5146100fe5780637065cb4814610118578063b20d30a914610135578063b75c7dc614610152578063ba51a6df1461018f578063f00d4b5d146101ac57005b6101ce60043560006040600036808284379091209050610301815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610773576108d5565b6101d46004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6101ce604060003680828437909120905061043e81610096565b6101ce600435604060003680828437909120905061023e81610096565b6101ce600435604060003680828437909120905061043281610096565b6101ce60043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561044c576104ce565b6101ce60043560406000368082843790912090506103e181610096565b6101ce600435602435600060406000368082843790912090506104d581610096565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156102395761024c826100d4565b15610257575061023b565b6102795b6101045460005b818110156106d15761010480548290811061071957005b60015460fa901015156102905761028e6102a7565b505b60015460fa901015156102d1575061023b565b61033c5b600060015b6001548110156105bc575b600154811080156106185750600281610100811061061157005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106101de57005b156103805773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156103855750610239565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156103a05750610239565b600060028361010081106103b057005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556102a361025b565b15610239576001548211156103f6575061023b565b600082905561040361025b565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610239575061010655565b1561023b5760006101055550565b5050506000828152610103602052604081206001810154600284900a92908316819011156104ce57815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156105485761054e836100d4565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156105595750610380565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082141561058f5750610380565b61059761025b565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106104e357005b5090565b01546000145b1561062557600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b600180541180156105c6575060015460029061010081106105c057005b0154600014155b156105f4576001016102b7565b600154811080156106495750600154600290610100811061064257005b0154600014155b80156106645750600281610100811061065e57005b01546000145b1561067d57600154600290610100811061068257005b01555b6102ac565b0154600282610100811061069257005b015580610102600060028361010081106106a857005b015481526020810191909152604001600090812091909155600154600290610100811061067a57005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156105485760008155600101610705565b600091825260208220015414151561076b576101048054610103916000918490811061074157005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b600101610262565b60008681526101036020526040812080549094509092508214156107fe57815483556001838101839055610104805491820180825582801582901161088a578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b8082111561088857600081556001016107dd565b6000918252602090912001555b506001820154600284900a908116600014156108d55773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156108a45760008681526101036020526101048054604090922060020154909181106108de57005b505b50505060028401819055610104805488929081106107f157005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b60009182526020808320909101829055878252610103905260408120818155600181810183905560029091019190915594506108d556", - "gasLimit" : "0x0b52d1", + "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff16600381905581526101026020526040902055620151804204610107556109158061004b6000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461007b5780632f54bf6e146100cd5780635c52c2f5146100fe5780637065cb4814610118578063b20d30a914610135578063b75c7dc614610152578063ba51a6df1461018f578063f00d4b5d146101ac57005b6101ce60043560006040600036808284379091209050610472815b73ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054818080838114156105bc5761071e565b6101d46004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6101ce60406000368082843790912090506105ae81610096565b6101ce60043560406000368082843790912090506103c981610096565b6101ce60043560406000368082843790912090506105a281610096565b6101ce60043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156101de57610260565b6101ce600435604060003680828437909120905061055181610096565b6101ce600435602435600060406000368082843790912090506102d381610096565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561026057815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b156102cc576102e1836100d4565b156102ec57506102ce565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082141561032257506102ce565b6103445b6101045460005b81811015610873576101048054829081106108bb57005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061026757005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103c4576103d7826100d4565b156103e257506103c6565b6103ea610326565b60015460fa90101515610401576103ff610418565b505b60015460fa9010151561044257506103c6565b6105095b600060015b60015481101561075e575b600154811080156107ba575060028161010081106107b357005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061036957005b156102ce5773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104ad57506103c4565b60016001600050540360006000505411156104c857506103c4565b600060028361010081106104d857005b015573ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812055610414610326565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156103c45760015482111561056657506103c6565b6000829055610573610326565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b156103c4575061010655565b156103c65760006101055550565b60008681526101036020526040812080549094509092508214156106475781548355600183810183905561010480549182018082558280158290116106d3578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106d15760008155600101610626565b6000918252602090912001555b506001820154600284900a9081166000141561071e5773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156106ed57600086815261010360205261010480546040909220600201549091811061072757005b505b505050600284018190556101048054889290811061063a57005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600091825260208083209091018290558782526101039052604081208181556001818101839055600290910191909155945061071e565b5090565b01546000145b156107c757600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b600180541180156107685750600154600290610100811061076257005b0154600014155b1561079657600101610428565b600154811080156107eb575060015460029061010081106107e457005b0154600014155b80156108065750600281610100811061080057005b01546000145b1561081f57600154600290610100811061082457005b01555b61041d565b0154600282610100811061083457005b0155806101026000600283610100811061084a57005b015481526020810191909152604001600090812091909155600154600290610100811061081c57005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156102cc57600081556001016108a7565b600091825260208220015414151561090d57610104805461010391600091849081106108e357005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032d56", + "gasLimit" : "0x0b5291", "gasPrice" : "1", "nonce" : "1", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", @@ -741,8 +741,8 @@ } }, "transaction" : { - "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff16600381905581526101026020526040902055620151804204610107556109158061004b6000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461007b5780632f54bf6e146100cd5780635c52c2f5146100fe5780637065cb4814610118578063b20d30a914610135578063b75c7dc614610152578063ba51a6df1461018f578063f00d4b5d146101ac57005b6101ce60043560006040600036808284379091209050610301815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610773576108d5565b6101d46004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6101ce604060003680828437909120905061043e81610096565b6101ce600435604060003680828437909120905061023e81610096565b6101ce600435604060003680828437909120905061043281610096565b6101ce60043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561044c576104ce565b6101ce60043560406000368082843790912090506103e181610096565b6101ce600435602435600060406000368082843790912090506104d581610096565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156102395761024c826100d4565b15610257575061023b565b6102795b6101045460005b818110156106d15761010480548290811061071957005b60015460fa901015156102905761028e6102a7565b505b60015460fa901015156102d1575061023b565b61033c5b600060015b6001548110156105bc575b600154811080156106185750600281610100811061061157005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106101de57005b156103805773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156103855750610239565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156103a05750610239565b600060028361010081106103b057005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556102a361025b565b15610239576001548211156103f6575061023b565b600082905561040361025b565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610239575061010655565b1561023b5760006101055550565b5050506000828152610103602052604081206001810154600284900a92908316819011156104ce57815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156105485761054e836100d4565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156105595750610380565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082141561058f5750610380565b61059761025b565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106104e357005b5090565b01546000145b1561062557600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b600180541180156105c6575060015460029061010081106105c057005b0154600014155b156105f4576001016102b7565b600154811080156106495750600154600290610100811061064257005b0154600014155b80156106645750600281610100811061065e57005b01546000145b1561067d57600154600290610100811061068257005b01555b6102ac565b0154600282610100811061069257005b015580610102600060028361010081106106a857005b015481526020810191909152604001600090812091909155600154600290610100811061067a57005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156105485760008155600101610705565b600091825260208220015414151561076b576101048054610103916000918490811061074157005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b600101610262565b60008681526101036020526040812080549094509092508214156107fe57815483556001838101839055610104805491820180825582801582901161088a578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b8082111561088857600081556001016107dd565b6000918252602090912001555b506001820154600284900a908116600014156108d55773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156108a45760008681526101036020526101048054604090922060020154909181106108de57005b505b50505060028401819055610104805488929081106107f157005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b60009182526020808320909101829055878252610103905260408120818155600181810183905560029091019190915594506108d556", - "gasLimit" : "0x0b52d0", + "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff16600381905581526101026020526040902055620151804204610107556109158061004b6000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461007b5780632f54bf6e146100cd5780635c52c2f5146100fe5780637065cb4814610118578063b20d30a914610135578063b75c7dc614610152578063ba51a6df1461018f578063f00d4b5d146101ac57005b6101ce60043560006040600036808284379091209050610472815b73ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054818080838114156105bc5761071e565b6101d46004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6101ce60406000368082843790912090506105ae81610096565b6101ce60043560406000368082843790912090506103c981610096565b6101ce60043560406000368082843790912090506105a281610096565b6101ce60043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156101de57610260565b6101ce600435604060003680828437909120905061055181610096565b6101ce600435602435600060406000368082843790912090506102d381610096565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561026057815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b156102cc576102e1836100d4565b156102ec57506102ce565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082141561032257506102ce565b6103445b6101045460005b81811015610873576101048054829081106108bb57005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061026757005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103c4576103d7826100d4565b156103e257506103c6565b6103ea610326565b60015460fa90101515610401576103ff610418565b505b60015460fa9010151561044257506103c6565b6105095b600060015b60015481101561075e575b600154811080156107ba575060028161010081106107b357005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061036957005b156102ce5773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104ad57506103c4565b60016001600050540360006000505411156104c857506103c4565b600060028361010081106104d857005b015573ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812055610414610326565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156103c45760015482111561056657506103c6565b6000829055610573610326565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b156103c4575061010655565b156103c65760006101055550565b60008681526101036020526040812080549094509092508214156106475781548355600183810183905561010480549182018082558280158290116106d3578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106d15760008155600101610626565b6000918252602090912001555b506001820154600284900a9081166000141561071e5773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156106ed57600086815261010360205261010480546040909220600201549091811061072757005b505b505050600284018190556101048054889290811061063a57005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600091825260208083209091018290558782526101039052604081208181556001818101839055600290910191909155945061071e565b5090565b01546000145b156107c757600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b600180541180156107685750600154600290610100811061076257005b0154600014155b1561079657600101610428565b600154811080156107eb575060015460029061010081106107e457005b0154600014155b80156108065750600281610100811061080057005b01546000145b1561081f57600154600290610100811061082457005b01555b61041d565b0154600282610100811061083457005b0155806101026000600283610100811061084a57005b015481526020810191909152604001600090812091909155600154600290610100811061081c57005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156102cc57600081556001016108a7565b600091825260208220015414151561090d57610104805461010391600091849081106108e357005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032d56", + "gasLimit" : "0x0b5290", "gasPrice" : "1", "nonce" : "1", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", @@ -770,8 +770,8 @@ } }, "transaction" : { - "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff16600381905581526101026020526040902055620151804204610107556109158061004b6000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461007b5780632f54bf6e146100cd5780635c52c2f5146100fe5780637065cb4814610118578063b20d30a914610135578063b75c7dc614610152578063ba51a6df1461018f578063f00d4b5d146101ac57005b6101ce60043560006040600036808284379091209050610301815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610773576108d5565b6101d46004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6101ce604060003680828437909120905061043e81610096565b6101ce600435604060003680828437909120905061023e81610096565b6101ce600435604060003680828437909120905061043281610096565b6101ce60043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561044c576104ce565b6101ce60043560406000368082843790912090506103e181610096565b6101ce600435602435600060406000368082843790912090506104d581610096565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156102395761024c826100d4565b15610257575061023b565b6102795b6101045460005b818110156106d15761010480548290811061071957005b60015460fa901015156102905761028e6102a7565b505b60015460fa901015156102d1575061023b565b61033c5b600060015b6001548110156105bc575b600154811080156106185750600281610100811061061157005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106101de57005b156103805773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156103855750610239565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156103a05750610239565b600060028361010081106103b057005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556102a361025b565b15610239576001548211156103f6575061023b565b600082905561040361025b565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610239575061010655565b1561023b5760006101055550565b5050506000828152610103602052604081206001810154600284900a92908316819011156104ce57815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156105485761054e836100d4565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156105595750610380565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082141561058f5750610380565b61059761025b565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106104e357005b5090565b01546000145b1561062557600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b600180541180156105c6575060015460029061010081106105c057005b0154600014155b156105f4576001016102b7565b600154811080156106495750600154600290610100811061064257005b0154600014155b80156106645750600281610100811061065e57005b01546000145b1561067d57600154600290610100811061068257005b01555b6102ac565b0154600282610100811061069257005b015580610102600060028361010081106106a857005b015481526020810191909152604001600090812091909155600154600290610100811061067a57005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156105485760008155600101610705565b600091825260208220015414151561076b576101048054610103916000918490811061074157005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b600101610262565b60008681526101036020526040812080549094509092508214156107fe57815483556001838101839055610104805491820180825582801582901161088a578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b8082111561088857600081556001016107dd565b6000918252602090912001555b506001820154600284900a908116600014156108d55773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156108a45760008681526101036020526101048054604090922060020154909181106108de57005b505b50505060028401819055610104805488929081106107f157005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b60009182526020808320909101829055878252610103905260408120818155600181810183905560029091019190915594506108d556", - "gasLimit" : "0x043a68", + "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff16600381905581526101026020526040902055620151804204610107556109158061004b6000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461007b5780632f54bf6e146100cd5780635c52c2f5146100fe5780637065cb4814610118578063b20d30a914610135578063b75c7dc614610152578063ba51a6df1461018f578063f00d4b5d146101ac57005b6101ce60043560006040600036808284379091209050610472815b73ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054818080838114156105bc5761071e565b6101d46004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6101ce60406000368082843790912090506105ae81610096565b6101ce60043560406000368082843790912090506103c981610096565b6101ce60043560406000368082843790912090506105a281610096565b6101ce60043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156101de57610260565b6101ce600435604060003680828437909120905061055181610096565b6101ce600435602435600060406000368082843790912090506102d381610096565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561026057815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b156102cc576102e1836100d4565b156102ec57506102ce565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082141561032257506102ce565b6103445b6101045460005b81811015610873576101048054829081106108bb57005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061026757005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103c4576103d7826100d4565b156103e257506103c6565b6103ea610326565b60015460fa90101515610401576103ff610418565b505b60015460fa9010151561044257506103c6565b6105095b600060015b60015481101561075e575b600154811080156107ba575060028161010081106107b357005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061036957005b156102ce5773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104ad57506103c4565b60016001600050540360006000505411156104c857506103c4565b600060028361010081106104d857005b015573ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812055610414610326565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156103c45760015482111561056657506103c6565b6000829055610573610326565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b156103c4575061010655565b156103c65760006101055550565b60008681526101036020526040812080549094509092508214156106475781548355600183810183905561010480549182018082558280158290116106d3578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106d15760008155600101610626565b6000918252602090912001555b506001820154600284900a9081166000141561071e5773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156106ed57600086815261010360205261010480546040909220600201549091811061072757005b505b505050600284018190556101048054889290811061063a57005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600091825260208083209091018290558782526101039052604081208181556001818101839055600290910191909155945061071e565b5090565b01546000145b156107c757600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b600180541180156107685750600154600290610100811061076257005b0154600014155b1561079657600101610428565b600154811080156107eb575060015460029061010081106107e457005b0154600014155b80156108065750600281610100811061080057005b01546000145b1561081f57600154600290610100811061082457005b01555b61041d565b0154600282610100811061083457005b0155806101026000600283610100811061084a57005b015481526020810191909152604001600090812091909155600154600290610100811061081c57005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156102cc57600081556001016108a7565b600091825260208220015414151561090d57610104805461010391600091849081106108e357005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032d56", + "gasLimit" : "0x043a28", "gasPrice" : "1", "nonce" : "1", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", @@ -799,7 +799,7 @@ }, "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461007b5780632f54bf6e146100cd5780635c52c2f5146100fe5780637065cb4814610118578063b20d30a914610135578063b75c7dc614610152578063ba51a6df1461018f578063f00d4b5d146101ac57005b6101ce60043560006040600036808284379091209050610301815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610773576108d5565b6101d46004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6101ce604060003680828437909120905061043e81610096565b6101ce600435604060003680828437909120905061023e81610096565b6101ce600435604060003680828437909120905061043281610096565b6101ce60043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561044c576104ce565b6101ce60043560406000368082843790912090506103e181610096565b6101ce600435602435600060406000368082843790912090506104d581610096565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156102395761024c826100d4565b15610257575061023b565b6102795b6101045460005b818110156106d15761010480548290811061071957005b60015460fa901015156102905761028e6102a7565b505b60015460fa901015156102d1575061023b565b61033c5b600060015b6001548110156105bc575b600154811080156106185750600281610100811061061157005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106101de57005b156103805773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156103855750610239565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156103a05750610239565b600060028361010081106103b057005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556102a361025b565b15610239576001548211156103f6575061023b565b600082905561040361025b565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610239575061010655565b1561023b5760006101055550565b5050506000828152610103602052604081206001810154600284900a92908316819011156104ce57815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156105485761054e836100d4565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156105595750610380565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082141561058f5750610380565b61059761025b565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106104e357005b5090565b01546000145b1561062557600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b600180541180156105c6575060015460029061010081106105c057005b0154600014155b156105f4576001016102b7565b600154811080156106495750600154600290610100811061064257005b0154600014155b80156106645750600281610100811061065e57005b01546000145b1561067d57600154600290610100811061068257005b01555b6102ac565b0154600282610100811061069257005b015580610102600060028361010081106106a857005b015481526020810191909152604001600090812091909155600154600290610100811061067a57005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156105485760008155600101610705565b600091825260208220015414151561076b576101048054610103916000918490811061074157005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b600101610262565b60008681526101036020526040812080549094509092508214156107fe57815483556001838101839055610104805491820180825582801582901161088a578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b8082111561088857600081556001016107dd565b6000918252602090912001555b506001820154600284900a908116600014156108d55773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156108a45760008681526101036020526101048054604090922060020154909181106108de57005b505b50505060028401819055610104805488929081106107f157005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b60009182526020808320909101829055878252610103905260408120818155600181810183905560029091019190915594506108d556", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461007b5780632f54bf6e146100cd5780635c52c2f5146100fe5780637065cb4814610118578063b20d30a914610135578063b75c7dc614610152578063ba51a6df1461018f578063f00d4b5d146101ac57005b6101ce60043560006040600036808284379091209050610472815b73ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054818080838114156105bc5761071e565b6101d46004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6101ce60406000368082843790912090506105ae81610096565b6101ce60043560406000368082843790912090506103c981610096565b6101ce60043560406000368082843790912090506105a281610096565b6101ce60043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156101de57610260565b6101ce600435604060003680828437909120905061055181610096565b6101ce600435602435600060406000368082843790912090506102d381610096565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561026057815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b156102cc576102e1836100d4565b156102ec57506102ce565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082141561032257506102ce565b6103445b6101045460005b81811015610873576101048054829081106108bb57005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061026757005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103c4576103d7826100d4565b156103e257506103c6565b6103ea610326565b60015460fa90101515610401576103ff610418565b505b60015460fa9010151561044257506103c6565b6105095b600060015b60015481101561075e575b600154811080156107ba575060028161010081106107b357005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061036957005b156102ce5773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104ad57506103c4565b60016001600050540360006000505411156104c857506103c4565b600060028361010081106104d857005b015573ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812055610414610326565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156103c45760015482111561056657506103c6565b6000829055610573610326565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b156103c4575061010655565b156103c65760006101055550565b60008681526101036020526040812080549094509092508214156106475781548355600183810183905561010480549182018082558280158290116106d3578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106d15760008155600101610626565b6000918252602090912001555b506001820154600284900a9081166000141561071e5773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156106ed57600086815261010360205261010480546040909220600201549091811061072757005b505b505050600284018190556101048054889290811061063a57005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600091825260208083209091018290558782526101039052604081208181556001818101839055600290910191909155945061071e565b5090565b01546000145b156107c757600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b600180541180156107685750600154600290610100811061076257005b0154600014155b1561079657600101610428565b600154811080156107eb575060015460029061010081106107e457005b0154600014155b80156108065750600281610100811061080057005b01546000145b1561081f57600154600290610100811061082457005b01555b61041d565b0154600282610100811061083457005b0155806101026000600283610100811061084a57005b015481526020810191909152604001600090812091909155600154600290610100811061081c57005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156102cc57600081556001016108a7565b600091825260208220015414151561090d57610104805461010391600091849081106108e357005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032d56", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -839,7 +839,7 @@ }, "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461007b5780632f54bf6e146100cd5780635c52c2f5146100fe5780637065cb4814610118578063b20d30a914610135578063b75c7dc614610152578063ba51a6df1461018f578063f00d4b5d146101ac57005b6101ce60043560006040600036808284379091209050610301815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610773576108d5565b6101d46004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6101ce604060003680828437909120905061043e81610096565b6101ce600435604060003680828437909120905061023e81610096565b6101ce600435604060003680828437909120905061043281610096565b6101ce60043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561044c576104ce565b6101ce60043560406000368082843790912090506103e181610096565b6101ce600435602435600060406000368082843790912090506104d581610096565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156102395761024c826100d4565b15610257575061023b565b6102795b6101045460005b818110156106d15761010480548290811061071957005b60015460fa901015156102905761028e6102a7565b505b60015460fa901015156102d1575061023b565b61033c5b600060015b6001548110156105bc575b600154811080156106185750600281610100811061061157005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106101de57005b156103805773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156103855750610239565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156103a05750610239565b600060028361010081106103b057005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556102a361025b565b15610239576001548211156103f6575061023b565b600082905561040361025b565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610239575061010655565b1561023b5760006101055550565b5050506000828152610103602052604081206001810154600284900a92908316819011156104ce57815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156105485761054e836100d4565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156105595750610380565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082141561058f5750610380565b61059761025b565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106104e357005b5090565b01546000145b1561062557600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b600180541180156105c6575060015460029061010081106105c057005b0154600014155b156105f4576001016102b7565b600154811080156106495750600154600290610100811061064257005b0154600014155b80156106645750600281610100811061065e57005b01546000145b1561067d57600154600290610100811061068257005b01555b6102ac565b0154600282610100811061069257005b015580610102600060028361010081106106a857005b015481526020810191909152604001600090812091909155600154600290610100811061067a57005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156105485760008155600101610705565b600091825260208220015414151561076b576101048054610103916000918490811061074157005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b600101610262565b60008681526101036020526040812080549094509092508214156107fe57815483556001838101839055610104805491820180825582801582901161088a578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b8082111561088857600081556001016107dd565b6000918252602090912001555b506001820154600284900a908116600014156108d55773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156108a45760008681526101036020526101048054604090922060020154909181106108de57005b505b50505060028401819055610104805488929081106107f157005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b60009182526020808320909101829055878252610103905260408120818155600181810183905560029091019190915594506108d556", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461007b5780632f54bf6e146100cd5780635c52c2f5146100fe5780637065cb4814610118578063b20d30a914610135578063b75c7dc614610152578063ba51a6df1461018f578063f00d4b5d146101ac57005b6101ce60043560006040600036808284379091209050610472815b73ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054818080838114156105bc5761071e565b6101d46004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6101ce60406000368082843790912090506105ae81610096565b6101ce60043560406000368082843790912090506103c981610096565b6101ce60043560406000368082843790912090506105a281610096565b6101ce60043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156101de57610260565b6101ce600435604060003680828437909120905061055181610096565b6101ce600435602435600060406000368082843790912090506102d381610096565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561026057815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b156102cc576102e1836100d4565b156102ec57506102ce565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082141561032257506102ce565b6103445b6101045460005b81811015610873576101048054829081106108bb57005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061026757005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103c4576103d7826100d4565b156103e257506103c6565b6103ea610326565b60015460fa90101515610401576103ff610418565b505b60015460fa9010151561044257506103c6565b6105095b600060015b60015481101561075e575b600154811080156107ba575060028161010081106107b357005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061036957005b156102ce5773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104ad57506103c4565b60016001600050540360006000505411156104c857506103c4565b600060028361010081106104d857005b015573ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812055610414610326565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156103c45760015482111561056657506103c6565b6000829055610573610326565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b156103c4575061010655565b156103c65760006101055550565b60008681526101036020526040812080549094509092508214156106475781548355600183810183905561010480549182018082558280158290116106d3578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106d15760008155600101610626565b6000918252602090912001555b506001820154600284900a9081166000141561071e5773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156106ed57600086815261010360205261010480546040909220600201549091811061072757005b505b505050600284018190556101048054889290811061063a57005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600091825260208083209091018290558782526101039052604081208181556001818101839055600290910191909155945061071e565b5090565b01546000145b156107c757600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b600180541180156107685750600154600290610100811061076257005b0154600014155b1561079657600101610428565b600154811080156107eb575060015460029061010081106107e457005b0154600014155b80156108065750600281610100811061080057005b01546000145b1561081f57600154600290610100811061082457005b01555b61041d565b0154600282610100811061083457005b0155806101026000600283610100811061084a57005b015481526020810191909152604001600090812091909155600154600290610100811061081c57005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156102cc57600081556001016108a7565b600091825260208220015414151561090d57610104805461010391600091849081106108e357005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032d56", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -879,7 +879,7 @@ }, "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461007b5780632f54bf6e146100cd5780635c52c2f5146100fe5780637065cb4814610118578063b20d30a914610135578063b75c7dc614610152578063ba51a6df1461018f578063f00d4b5d146101ac57005b6101ce60043560006040600036808284379091209050610301815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610773576108d5565b6101d46004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6101ce604060003680828437909120905061043e81610096565b6101ce600435604060003680828437909120905061023e81610096565b6101ce600435604060003680828437909120905061043281610096565b6101ce60043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561044c576104ce565b6101ce60043560406000368082843790912090506103e181610096565b6101ce600435602435600060406000368082843790912090506104d581610096565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156102395761024c826100d4565b15610257575061023b565b6102795b6101045460005b818110156106d15761010480548290811061071957005b60015460fa901015156102905761028e6102a7565b505b60015460fa901015156102d1575061023b565b61033c5b600060015b6001548110156105bc575b600154811080156106185750600281610100811061061157005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106101de57005b156103805773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156103855750610239565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156103a05750610239565b600060028361010081106103b057005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556102a361025b565b15610239576001548211156103f6575061023b565b600082905561040361025b565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610239575061010655565b1561023b5760006101055550565b5050506000828152610103602052604081206001810154600284900a92908316819011156104ce57815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156105485761054e836100d4565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156105595750610380565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082141561058f5750610380565b61059761025b565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106104e357005b5090565b01546000145b1561062557600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b600180541180156105c6575060015460029061010081106105c057005b0154600014155b156105f4576001016102b7565b600154811080156106495750600154600290610100811061064257005b0154600014155b80156106645750600281610100811061065e57005b01546000145b1561067d57600154600290610100811061068257005b01555b6102ac565b0154600282610100811061069257005b015580610102600060028361010081106106a857005b015481526020810191909152604001600090812091909155600154600290610100811061067a57005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156105485760008155600101610705565b600091825260208220015414151561076b576101048054610103916000918490811061074157005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b600101610262565b60008681526101036020526040812080549094509092508214156107fe57815483556001838101839055610104805491820180825582801582901161088a578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b8082111561088857600081556001016107dd565b6000918252602090912001555b506001820154600284900a908116600014156108d55773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156108a45760008681526101036020526101048054604090922060020154909181106108de57005b505b50505060028401819055610104805488929081106107f157005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b60009182526020808320909101829055878252610103905260408120818155600181810183905560029091019190915594506108d556", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d9811461007b5780632f54bf6e146100cd5780635c52c2f5146100fe5780637065cb4814610118578063b20d30a914610135578063b75c7dc614610152578063ba51a6df1461018f578063f00d4b5d146101ac57005b6101ce60043560006040600036808284379091209050610472815b73ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054818080838114156105bc5761071e565b6101d46004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b6101ce60406000368082843790912090506105ae81610096565b6101ce60043560406000368082843790912090506103c981610096565b6101ce60043560406000368082843790912090506105a281610096565b6101ce60043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156101de57610260565b6101ce600435604060003680828437909120905061055181610096565b6101ce600435602435600060406000368082843790912090506102d381610096565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561026057815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b156102cc576102e1836100d4565b156102ec57506102ce565b73ffffffffffffffffffffffffffffffffffffffff841660009081526101026020526040812054925082141561032257506102ce565b6103445b6101045460005b81811015610873576101048054829081106108bb57005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061026757005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103c4576103d7826100d4565b156103e257506103c6565b6103ea610326565b60015460fa90101515610401576103ff610418565b505b60015460fa9010151561044257506103c6565b6105095b600060015b60015481101561075e575b600154811080156107ba575060028161010081106107b357005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061036957005b156102ce5773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104ad57506103c4565b60016001600050540360006000505411156104c857506103c4565b600060028361010081106104d857005b015573ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812055610414610326565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156103c45760015482111561056657506103c6565b6000829055610573610326565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b156103c4575061010655565b156103c65760006101055550565b60008681526101036020526040812080549094509092508214156106475781548355600183810183905561010480549182018082558280158290116106d3578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106d15760008155600101610626565b6000918252602090912001555b506001820154600284900a9081166000141561071e5773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156106ed57600086815261010360205261010480546040909220600201549091811061072757005b505b505050600284018190556101048054889290811061063a57005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600091825260208083209091018290558782526101039052604081208181556001818101839055600290910191909155945061071e565b5090565b01546000145b156107c757600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b600180541180156107685750600154600290610100811061076257005b0154600014155b1561079657600101610428565b600154811080156107eb575060015460029061010081106107e457005b0154600014155b80156108065750600281610100811061080057005b01546000145b1561081f57600154600290610100811061082457005b01555b61041d565b0154600282610100811061083457005b0155806101026000600283610100811061084a57005b015481526020810191909152604001600090812091909155600154600290610100811061081c57005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156102cc57600081556001016108a7565b600091825260208220015414151561090d57610104805461010391600091849081106108e357005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032d56", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -921,8 +921,8 @@ } }, "transaction" : { - "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff16600381905581526101026020526040902055620151804204610107557f9adeddf84386b336eb7b3e18e7a6099be08fd81ea5d5142f4d2b630f8d20cf0160006040a1610e39806100716000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", - "gasLimit" : "0x10b3d5", + "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff16600381905581526101026020526040902055620151804204610107557f9adeddf84386b336eb7b3e18e7a6099be08fd81ea5d5142f4d2b630f8d20cf0160006040a1610ee9806100716000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b61029760043560006040600036808284379091209050610542815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610a7c57610bde565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061067e81610108565b610297600435604060003680828437909120905061049981610108565b61029d6004355b6000816108bb81610108565b610297600435604060003680828437909120905061067281610108565b61029d6004803590602480359160443591820191013560006106aa846000610d3333610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156102a757610329565b610297600435604060003680828437909120905061062181610108565b610297600435604060003680828437909120905061068c81610108565b6102976004356024356000604060003680828437909120905061039c81610108565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561032957815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b15610395576103aa83610146565b156103b55750610397565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156103eb5750610397565b6104145b6101045460005b81811015610d9e5761010480546101089160009184908110610dbf57005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061033057005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b15610494576104a782610146565b156104b25750610496565b6104ba6103ef565b60015460fa901015156104d1576104cf6104e8565b505b60015460fa901015156105125750610496565b6105d95b600060015b600154811015610c1e575b60015481108015610c7a57506002816101008110610c7357005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061043957005b156103975773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561057d5750610494565b60016001600050540360006000505411156105985750610494565b600060028361010081106105a857005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556104e46103ef565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b15610494576001548211156106365750610496565b60008290556106436103ef565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610494575061010655565b156104965760006101055550565b15610494578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107485773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161076157005b604060003680828437909120915061076d9050816101ae565b50600091506108949050565b15801561079d57506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561089457600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f0191909104810190849086821561089c579182015b8281111561089c57823582600050559160200191906001019061080a565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b8082111561082857600081556001016108a0565b505b919050565b156108b4576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108b45760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561094357915260208220825b81548152906001019060200180831161092f575b5050600084866185025a03f161095557005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109f357820191906000526020600020905b8154815290600101906020018083116109df575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a6e5760008155600101610a5a565b5050505060019150506108b6565b6000868152610103602052604081208054909450909250821415610b07578154835560018381018390556101048054918201808255828015829011610b93578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610b915760008155600101610ae6565b6000918252602090912001555b506001820154600284900a90811660001415610bde5773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610bad576000868152610103602052610104805460409092206002015490918110610be757005b505b5050506002840181905561010480548892908110610afa57005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610bde565b5090565b01546000145b15610c8757600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610c2857506001546002906101008110610c2257005b0154600014155b15610c56576001016104f8565b60015481108015610cab57506001546002906101008110610ca457005b0154600014155b8015610cc657506002816101008110610cc057005b01546000145b15610cdf576001546002906101008110610ce457005b01555b6104ed565b01546002826101008110610cf457005b01558061010260006002836101008110610d0a57005b0154815260208101919091526040016000908120919091556001546002906101008110610cdc57005b156108b65761010754610d495b62015180420490565b1115610d6257600061010555610d5d610d40565b610107555b6101055480830110158015610d805750610105546101065490830111155b15610d96575061010580548201905560016108b6565b5060006108b6565b6104946101045460005b81811015610e4757610104805482908110610e8f57005b6000918252602080832090910154835282810193909352604091909101812080547fffffffffffffffffffffffff0000000000000000000000000000000000000000168155600181018290556002810180548382559083528383209193601f91909101048101905b80821115610e3b5760008155600101610e27565b505050506001016103f6565b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156103955760008155600101610e7b565b6000918252602082200154141515610ee15761010480546101039160009184908110610eb757005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b600101610da856", + "gasLimit" : "10000000", "gasPrice" : "1", "nonce" : "1", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", @@ -950,8 +950,8 @@ } }, "transaction" : { - "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff16600381905581526101026020526040902055620151804204610107557f9adeddf84386b336eb7b3e18e7a6099be08fd81ea5d5142f4d2b630f8d20cf0160006040a1610e39806100716000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", - "gasLimit" : "0x10b3d4", + "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff16600381905581526101026020526040902055620151804204610107557f9adeddf84386b336eb7b3e18e7a6099be08fd81ea5d5142f4d2b630f8d20cf0160006040a1610ee9806100716000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b61029760043560006040600036808284379091209050610542815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610a7c57610bde565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061067e81610108565b610297600435604060003680828437909120905061049981610108565b61029d6004355b6000816108bb81610108565b610297600435604060003680828437909120905061067281610108565b61029d6004803590602480359160443591820191013560006106aa846000610d3333610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156102a757610329565b610297600435604060003680828437909120905061062181610108565b610297600435604060003680828437909120905061068c81610108565b6102976004356024356000604060003680828437909120905061039c81610108565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561032957815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b15610395576103aa83610146565b156103b55750610397565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156103eb5750610397565b6104145b6101045460005b81811015610d9e5761010480546101089160009184908110610dbf57005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061033057005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b15610494576104a782610146565b156104b25750610496565b6104ba6103ef565b60015460fa901015156104d1576104cf6104e8565b505b60015460fa901015156105125750610496565b6105d95b600060015b600154811015610c1e575b60015481108015610c7a57506002816101008110610c7357005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061043957005b156103975773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561057d5750610494565b60016001600050540360006000505411156105985750610494565b600060028361010081106105a857005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556104e46103ef565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b15610494576001548211156106365750610496565b60008290556106436103ef565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610494575061010655565b156104965760006101055550565b15610494578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107485773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161076157005b604060003680828437909120915061076d9050816101ae565b50600091506108949050565b15801561079d57506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561089457600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f0191909104810190849086821561089c579182015b8281111561089c57823582600050559160200191906001019061080a565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b8082111561082857600081556001016108a0565b505b919050565b156108b4576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108b45760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561094357915260208220825b81548152906001019060200180831161092f575b5050600084866185025a03f161095557005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109f357820191906000526020600020905b8154815290600101906020018083116109df575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a6e5760008155600101610a5a565b5050505060019150506108b6565b6000868152610103602052604081208054909450909250821415610b07578154835560018381018390556101048054918201808255828015829011610b93578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610b915760008155600101610ae6565b6000918252602090912001555b506001820154600284900a90811660001415610bde5773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610bad576000868152610103602052610104805460409092206002015490918110610be757005b505b5050506002840181905561010480548892908110610afa57005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610bde565b5090565b01546000145b15610c8757600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610c2857506001546002906101008110610c2257005b0154600014155b15610c56576001016104f8565b60015481108015610cab57506001546002906101008110610ca457005b0154600014155b8015610cc657506002816101008110610cc057005b01546000145b15610cdf576001546002906101008110610ce457005b01555b6104ed565b01546002826101008110610cf457005b01558061010260006002836101008110610d0a57005b0154815260208101919091526040016000908120919091556001546002906101008110610cdc57005b156108b65761010754610d495b62015180420490565b1115610d6257600061010555610d5d610d40565b610107555b6101055480830110158015610d805750610105546101065490830111155b15610d96575061010580548201905560016108b6565b5060006108b6565b6104946101045460005b81811015610e4757610104805482908110610e8f57005b6000918252602080832090910154835282810193909352604091909101812080547fffffffffffffffffffffffff0000000000000000000000000000000000000000168155600181018290556002810180548382559083528383209193601f91909101048101905b80821115610e3b5760008155600101610e27565b505050506001016103f6565b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156103955760008155600101610e7b565b6000918252602082200154141515610ee15761010480546101039160009184908110610eb757005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b600101610da856", + "gasLimit" : "0x1165fb", "gasPrice" : "1", "nonce" : "1", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", @@ -979,8 +979,8 @@ } }, "transaction" : { - "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff16600381905581526101026020526040902055620151804204610107557f9adeddf84386b336eb7b3e18e7a6099be08fd81ea5d5142f4d2b630f8d20cf0160006040a1610e39806100716000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", - "gasLimit" : "0x05974c", + "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff16600381905581526101026020526040902055620151804204610107557f9adeddf84386b336eb7b3e18e7a6099be08fd81ea5d5142f4d2b630f8d20cf0160006040a1610ee9806100716000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b61029760043560006040600036808284379091209050610542815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610a7c57610bde565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061067e81610108565b610297600435604060003680828437909120905061049981610108565b61029d6004355b6000816108bb81610108565b610297600435604060003680828437909120905061067281610108565b61029d6004803590602480359160443591820191013560006106aa846000610d3333610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156102a757610329565b610297600435604060003680828437909120905061062181610108565b610297600435604060003680828437909120905061068c81610108565b6102976004356024356000604060003680828437909120905061039c81610108565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561032957815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b15610395576103aa83610146565b156103b55750610397565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156103eb5750610397565b6104145b6101045460005b81811015610d9e5761010480546101089160009184908110610dbf57005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061033057005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b15610494576104a782610146565b156104b25750610496565b6104ba6103ef565b60015460fa901015156104d1576104cf6104e8565b505b60015460fa901015156105125750610496565b6105d95b600060015b600154811015610c1e575b60015481108015610c7a57506002816101008110610c7357005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061043957005b156103975773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561057d5750610494565b60016001600050540360006000505411156105985750610494565b600060028361010081106105a857005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556104e46103ef565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b15610494576001548211156106365750610496565b60008290556106436103ef565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610494575061010655565b156104965760006101055550565b15610494578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107485773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161076157005b604060003680828437909120915061076d9050816101ae565b50600091506108949050565b15801561079d57506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561089457600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f0191909104810190849086821561089c579182015b8281111561089c57823582600050559160200191906001019061080a565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b8082111561082857600081556001016108a0565b505b919050565b156108b4576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108b45760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561094357915260208220825b81548152906001019060200180831161092f575b5050600084866185025a03f161095557005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109f357820191906000526020600020905b8154815290600101906020018083116109df575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a6e5760008155600101610a5a565b5050505060019150506108b6565b6000868152610103602052604081208054909450909250821415610b07578154835560018381018390556101048054918201808255828015829011610b93578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610b915760008155600101610ae6565b6000918252602090912001555b506001820154600284900a90811660001415610bde5773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610bad576000868152610103602052610104805460409092206002015490918110610be757005b505b5050506002840181905561010480548892908110610afa57005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610bde565b5090565b01546000145b15610c8757600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610c2857506001546002906101008110610c2257005b0154600014155b15610c56576001016104f8565b60015481108015610cab57506001546002906101008110610ca457005b0154600014155b8015610cc657506002816101008110610cc057005b01546000145b15610cdf576001546002906101008110610ce457005b01555b6104ed565b01546002826101008110610cf457005b01558061010260006002836101008110610d0a57005b0154815260208101919091526040016000908120919091556001546002906101008110610cdc57005b156108b65761010754610d495b62015180420490565b1115610d6257600061010555610d5d610d40565b610107555b6101055480830110158015610d805750610105546101065490830111155b15610d96575061010580548201905560016108b6565b5060006108b6565b6104946101045460005b81811015610e4757610104805482908110610e8f57005b6000918252602080832090910154835282810193909352604091909101812080547fffffffffffffffffffffffff0000000000000000000000000000000000000000168155600181018290556002810180548382559083528383209193601f91909101048101905b80821115610e3b5760008155600101610e27565b505050506001016103f6565b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156103955760008155600101610e7b565b6000918252602082200154141515610ee15761010480546101039160009184908110610eb757005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b600101610da856", + "gasLimit" : "0x05bff3", "gasPrice" : "1", "nonce" : "1", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", @@ -1008,7 +1008,7 @@ }, "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548211156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -1056,7 +1056,7 @@ }, "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548211156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -1097,7 +1097,7 @@ }, "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548211156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -1138,7 +1138,7 @@ }, "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548211156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -1179,7 +1179,7 @@ }, "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548211156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -1220,7 +1220,7 @@ }, "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548211156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -1261,7 +1261,7 @@ }, "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548211156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", "nonce" : "0x00", "storage" : { "0x00" : "0x02", @@ -1310,7 +1310,7 @@ }, "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548211156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", "nonce" : "0x00", "storage" : { "0x00" : "0x02", @@ -1359,7 +1359,7 @@ }, "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548211156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -1408,7 +1408,7 @@ }, "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548211156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -1464,7 +1464,7 @@ }, "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548211156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -1520,7 +1520,7 @@ }, "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548211156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -1576,7 +1576,7 @@ }, "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b610297600435600060406000368082843790912090506103ca815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610c9757610df9565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061050781610108565b610297600435604060003680828437909120905061030781610108565b61029d6004355b6000816108b481610108565b61029760043560406000368082843790912090506104fb81610108565b61029d6004803590602480359160443591820191013560006106a3846000610c2c33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561051557610597565b61029760043560406000368082843790912090506104aa81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061059e81610108565b60006000f35b8060005260206000f35b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103025761031582610146565b156103205750610304565b6103425b6101045460005b81811015610b8a57610104805482908110610bd257005b60015460fa9010151561035957610357610370565b505b60015460fa9010151561039a5750610304565b6104055b600060015b600154811015610a75575b60015481108015610ad157506002816101008110610aca57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff83169060029061010081106102a757005b156104495773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561044e5750610302565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a15b505050565b60016001600050540360006000505411156104695750610302565b6000600283610100811061047957005b015573ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205561036c610324565b15610302576001548211156104bf5750610304565b60008290556104cc610324565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610302575061010655565b156103045760006101055550565b5050506000828152610103602052604081206001810154600284900a929083168190111561059757815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b156106115761061783610146565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b50505050565b156106225750610449565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156106585750610449565b610660610324565b73ffffffffffffffffffffffffffffffffffffffff831660028361010081106105ac57005b15610302578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b5090565b01546000145b15610ade57600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610a7f57506001546002906101008110610a7957005b0154600014155b15610aad57600101610380565b60015481108015610b0257506001546002906101008110610afb57005b0154600014155b8015610b1d57506002816101008110610b1757005b01546000145b15610b36576001546002906101008110610b3b57005b01555b610375565b01546002826101008110610b4b57005b01558061010260006002836101008110610b6157005b0154815260208101919091526040016000908120919091556001546002906101008110610b3357005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156106115760008155600101610bbe565b6000918252602082200154141515610c245761010480546101039160009184908110610bfa57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b60010161032b565b156108af5761010754610c425b62015180420490565b1115610c5b57600061010555610c56610c39565b610107555b6101055480830110158015610c795750610105546101065490830111155b15610c8f575061010580548201905560016108af565b5060006108af565b6000868152610103602052604081208054909450909250821415610d22578154835560018381018390556101048054918201808255828015829011610dae578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610dac5760008155600101610d01565b6000918252602090912001555b506001820154600284900a90811660001415610df95773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610dc8576000868152610103602052610104805460409092206002015490918110610e0257005b505b5050506002840181905561010480548892908110610d1557005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610df956", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548211156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", "nonce" : "0x00", "storage" : { "0x00" : "0x01", From 1c5fc727359c1db8a0f7d417efe986b306df354a Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Tue, 26 May 2015 13:21:33 +0200 Subject: [PATCH 352/461] update wallet contract to latest changes --- .../BlockTestsFiller/bcWalletTestFiller.json | 14 +++++----- .../StateTestsFiller/stWalletTestFiller.json | 26 +++++++++---------- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/test/libethereum/BlockTestsFiller/bcWalletTestFiller.json b/test/libethereum/BlockTestsFiller/bcWalletTestFiller.json index 11fd20196..a946ed724 100644 --- a/test/libethereum/BlockTestsFiller/bcWalletTestFiller.json +++ b/test/libethereum/BlockTestsFiller/bcWalletTestFiller.json @@ -41,8 +41,8 @@ { "transactions" : [ { - "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff16600381905581526101026020526040902055620151804204610107557f9adeddf84386b336eb7b3e18e7a6099be08fd81ea5d5142f4d2b630f8d20cf0160006040a1610e39806100716000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b6102976004356000604060003680828437909120905061053b815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610a7557610bd7565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061067781610108565b610297600435604060003680828437909120905061049281610108565b61029d6004355b6000816108b481610108565b610297600435604060003680828437909120905061066b81610108565b61029d6004803590602480359160443591820191013560006106a3846000610dce33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156102a757610329565b610297600435604060003680828437909120905061061a81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061039c81610108565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561032957815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b15610395576103aa83610146565b156103b55750610397565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156103eb5750610397565b61040d5b6101045460005b81811015610d2c57610104805482908110610d7457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061033057005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b1561048d576104a082610146565b156104ab575061048f565b6104b36103ef565b60015460fa901015156104ca576104c86104e1565b505b60015460fa9010151561050b575061048f565b6105d25b600060015b600154811015610c17575b60015481108015610c7357506002816101008110610c6c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061043257005b156103975773ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120549250821415610576575061048d565b6001600160005054036000600050541115610591575061048d565b600060028361010081106105a157005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556104dd6103ef565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b1561048d5760015482111561062f575061048f565b600082905561063c6103ef565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b1561048d575061010655565b1561048f5760006101055550565b1561048d578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b6000868152610103602052604081208054909450909250821415610b00578154835560018381018390556101048054918201808255828015829011610b8c578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610b8a5760008155600101610adf565b6000918252602090912001555b506001820154600284900a90811660001415610bd75773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610ba6576000868152610103602052610104805460409092206002015490918110610be057005b505b5050506002840181905561010480548892908110610af357005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610bd7565b5090565b01546000145b15610c8057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610c2157506001546002906101008110610c1b57005b0154600014155b15610c4f576001016104f1565b60015481108015610ca457506001546002906101008110610c9d57005b0154600014155b8015610cbf57506002816101008110610cb957005b01546000145b15610cd8576001546002906101008110610cdd57005b01555b6104e6565b01546002826101008110610ced57005b01558061010260006002836101008110610d0357005b0154815260208101919091526040016000908120919091556001546002906101008110610cd557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156103955760008155600101610d60565b6000918252602082200154141515610dc65761010480546101039160009184908110610d9c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016103f6565b156108af5761010754610de45b62015180420490565b1115610dfd57600061010555610df8610ddb565b610107555b6101055480830110158015610e1b5750610105546101065490830111155b15610e31575061010580548201905560016108af565b5060006108af56", - "gasLimit" : "0x989680", + "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff16600381905581526101026020526040902055620151804204610107557f9adeddf84386b336eb7b3e18e7a6099be08fd81ea5d5142f4d2b630f8d20cf0160006040a1610ee9806100716000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b61029760043560006040600036808284379091209050610542815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610a7c57610bde565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061067e81610108565b610297600435604060003680828437909120905061049981610108565b61029d6004355b6000816108bb81610108565b610297600435604060003680828437909120905061067281610108565b61029d6004803590602480359160443591820191013560006106aa846000610d3333610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156102a757610329565b610297600435604060003680828437909120905061062181610108565b610297600435604060003680828437909120905061068c81610108565b6102976004356024356000604060003680828437909120905061039c81610108565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561032957815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b15610395576103aa83610146565b156103b55750610397565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156103eb5750610397565b6104145b6101045460005b81811015610d9e5761010480546101089160009184908110610dbf57005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061033057005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b15610494576104a782610146565b156104b25750610496565b6104ba6103ef565b60015460fa901015156104d1576104cf6104e8565b505b60015460fa901015156105125750610496565b6105d95b600060015b600154811015610c1e575b60015481108015610c7a57506002816101008110610c7357005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061043957005b156103975773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561057d5750610494565b60016001600050540360006000505411156105985750610494565b600060028361010081106105a857005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556104e46103ef565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b15610494576001548211156106365750610496565b60008290556106436103ef565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610494575061010655565b156104965760006101055550565b15610494578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107485773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161076157005b604060003680828437909120915061076d9050816101ae565b50600091506108949050565b15801561079d57506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561089457600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f0191909104810190849086821561089c579182015b8281111561089c57823582600050559160200191906001019061080a565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b8082111561082857600081556001016108a0565b505b919050565b156108b4576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108b45760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561094357915260208220825b81548152906001019060200180831161092f575b5050600084866185025a03f161095557005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109f357820191906000526020600020905b8154815290600101906020018083116109df575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a6e5760008155600101610a5a565b5050505060019150506108b6565b6000868152610103602052604081208054909450909250821415610b07578154835560018381018390556101048054918201808255828015829011610b93578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610b915760008155600101610ae6565b6000918252602090912001555b506001820154600284900a90811660001415610bde5773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610bad576000868152610103602052610104805460409092206002015490918110610be757005b505b5050506002840181905561010480548892908110610afa57005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610bde565b5090565b01546000145b15610c8757600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610c2857506001546002906101008110610c2257005b0154600014155b15610c56576001016104f8565b60015481108015610cab57506001546002906101008110610ca457005b0154600014155b8015610cc657506002816101008110610cc057005b01546000145b15610cdf576001546002906101008110610ce457005b01555b6104ed565b01546002826101008110610cf457005b01558061010260006002836101008110610d0a57005b0154815260208101919091526040016000908120919091556001546002906101008110610cdc57005b156108b65761010754610d495b62015180420490565b1115610d6257600061010555610d5d610d40565b610107555b6101055480830110158015610d805750610105546101065490830111155b15610d96575061010580548201905560016108b6565b5060006108b6565b6104946101045460005b81811015610e4757610104805482908110610e8f57005b6000918252602080832090910154835282810193909352604091909101812080547fffffffffffffffffffffffff0000000000000000000000000000000000000000168155600181018290556002810180548382559083528383209193601f91909101048101905b80821115610e3b5760008155600101610e27565b505050506001016103f6565b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156103955760008155600101610e7b565b6000918252602082200154141515610ee15761010480546101039160009184908110610eb757005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b600101610da856", + "gasLimit" : "0x116ffc", "gasPrice" : "1", "nonce" : "0", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", @@ -173,8 +173,8 @@ { "transactions" : [ { - "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff16600381905581526101026020526040902055620151804204610107557f9adeddf84386b336eb7b3e18e7a6099be08fd81ea5d5142f4d2b630f8d20cf0160006040a1610e39806100716000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b6102976004356000604060003680828437909120905061053b815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610a7557610bd7565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061067781610108565b610297600435604060003680828437909120905061049281610108565b61029d6004355b6000816108b481610108565b610297600435604060003680828437909120905061066b81610108565b61029d6004803590602480359160443591820191013560006106a3846000610dce33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156102a757610329565b610297600435604060003680828437909120905061061a81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061039c81610108565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561032957815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b15610395576103aa83610146565b156103b55750610397565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156103eb5750610397565b61040d5b6101045460005b81811015610d2c57610104805482908110610d7457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061033057005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b1561048d576104a082610146565b156104ab575061048f565b6104b36103ef565b60015460fa901015156104ca576104c86104e1565b505b60015460fa9010151561050b575061048f565b6105d25b600060015b600154811015610c17575b60015481108015610c7357506002816101008110610c6c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061043257005b156103975773ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120549250821415610576575061048d565b6001600160005054036000600050541115610591575061048d565b600060028361010081106105a157005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556104dd6103ef565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b1561048d5760015482111561062f575061048f565b600082905561063c6103ef565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b1561048d575061010655565b1561048f5760006101055550565b1561048d578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b6000868152610103602052604081208054909450909250821415610b00578154835560018381018390556101048054918201808255828015829011610b8c578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610b8a5760008155600101610adf565b6000918252602090912001555b506001820154600284900a90811660001415610bd75773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610ba6576000868152610103602052610104805460409092206002015490918110610be057005b505b5050506002840181905561010480548892908110610af357005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610bd7565b5090565b01546000145b15610c8057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610c2157506001546002906101008110610c1b57005b0154600014155b15610c4f576001016104f1565b60015481108015610ca457506001546002906101008110610c9d57005b0154600014155b8015610cbf57506002816101008110610cb957005b01546000145b15610cd8576001546002906101008110610cdd57005b01555b6104e6565b01546002826101008110610ced57005b01558061010260006002836101008110610d0357005b0154815260208101919091526040016000908120919091556001546002906101008110610cd557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156103955760008155600101610d60565b6000918252602082200154141515610dc65761010480546101039160009184908110610d9c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016103f6565b156108af5761010754610de45b62015180420490565b1115610dfd57600061010555610df8610ddb565b610107555b6101055480830110158015610e1b5750610105546101065490830111155b15610e31575061010580548201905560016108af565b5060006108af56", - "gasLimit" : "0x989680", + "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff16600381905581526101026020526040902055620151804204610107557f9adeddf84386b336eb7b3e18e7a6099be08fd81ea5d5142f4d2b630f8d20cf0160006040a1610ee9806100716000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b61029760043560006040600036808284379091209050610542815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610a7c57610bde565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061067e81610108565b610297600435604060003680828437909120905061049981610108565b61029d6004355b6000816108bb81610108565b610297600435604060003680828437909120905061067281610108565b61029d6004803590602480359160443591820191013560006106aa846000610d3333610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156102a757610329565b610297600435604060003680828437909120905061062181610108565b610297600435604060003680828437909120905061068c81610108565b6102976004356024356000604060003680828437909120905061039c81610108565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561032957815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b15610395576103aa83610146565b156103b55750610397565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156103eb5750610397565b6104145b6101045460005b81811015610d9e5761010480546101089160009184908110610dbf57005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061033057005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b15610494576104a782610146565b156104b25750610496565b6104ba6103ef565b60015460fa901015156104d1576104cf6104e8565b505b60015460fa901015156105125750610496565b6105d95b600060015b600154811015610c1e575b60015481108015610c7a57506002816101008110610c7357005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061043957005b156103975773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561057d5750610494565b60016001600050540360006000505411156105985750610494565b600060028361010081106105a857005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556104e46103ef565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b15610494576001548211156106365750610496565b60008290556106436103ef565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610494575061010655565b156104965760006101055550565b15610494578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107485773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161076157005b604060003680828437909120915061076d9050816101ae565b50600091506108949050565b15801561079d57506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561089457600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f0191909104810190849086821561089c579182015b8281111561089c57823582600050559160200191906001019061080a565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b8082111561082857600081556001016108a0565b505b919050565b156108b4576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108b45760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561094357915260208220825b81548152906001019060200180831161092f575b5050600084866185025a03f161095557005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109f357820191906000526020600020905b8154815290600101906020018083116109df575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a6e5760008155600101610a5a565b5050505060019150506108b6565b6000868152610103602052604081208054909450909250821415610b07578154835560018381018390556101048054918201808255828015829011610b93578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610b915760008155600101610ae6565b6000918252602090912001555b506001820154600284900a90811660001415610bde5773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610bad576000868152610103602052610104805460409092206002015490918110610be757005b505b5050506002840181905561010480548892908110610afa57005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610bde565b5090565b01546000145b15610c8757600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610c2857506001546002906101008110610c2257005b0154600014155b15610c56576001016104f8565b60015481108015610cab57506001546002906101008110610ca457005b0154600014155b8015610cc657506002816101008110610cc057005b01546000145b15610cdf576001546002906101008110610ce457005b01555b6104ed565b01546002826101008110610cf457005b01558061010260006002836101008110610d0a57005b0154815260208101919091526040016000908120919091556001546002906101008110610cdc57005b156108b65761010754610d495b62015180420490565b1115610d6257600061010555610d5d610d40565b610107555b6101055480830110158015610d805750610105546101065490830111155b15610d96575061010580548201905560016108b6565b5060006108b6565b6104946101045460005b81811015610e4757610104805482908110610e8f57005b6000918252602080832090910154835282810193909352604091909101812080547fffffffffffffffffffffffff0000000000000000000000000000000000000000168155600181018290556002810180548382559083528383209193601f91909101048101905b80821115610e3b5760008155600101610e27565b505050506001016103f6565b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156103955760008155600101610e7b565b6000918252602082200154141515610ee15761010480546101039160009184908110610eb757005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b600101610da856", + "gasLimit" : "0x116ffc", "gasPrice" : "1", "nonce" : "0", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", @@ -319,8 +319,8 @@ { "transactions" : [ { - "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff16600381905581526101026020526040902055620151804204610107557f9adeddf84386b336eb7b3e18e7a6099be08fd81ea5d5142f4d2b630f8d20cf0160006040a1610e39806100716000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b6102976004356000604060003680828437909120905061053b815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610a7557610bd7565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061067781610108565b610297600435604060003680828437909120905061049281610108565b61029d6004355b6000816108b481610108565b610297600435604060003680828437909120905061066b81610108565b61029d6004803590602480359160443591820191013560006106a3846000610dce33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156102a757610329565b610297600435604060003680828437909120905061061a81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061039c81610108565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561032957815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b15610395576103aa83610146565b156103b55750610397565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156103eb5750610397565b61040d5b6101045460005b81811015610d2c57610104805482908110610d7457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061033057005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b1561048d576104a082610146565b156104ab575061048f565b6104b36103ef565b60015460fa901015156104ca576104c86104e1565b505b60015460fa9010151561050b575061048f565b6105d25b600060015b600154811015610c17575b60015481108015610c7357506002816101008110610c6c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061043257005b156103975773ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120549250821415610576575061048d565b6001600160005054036000600050541115610591575061048d565b600060028361010081106105a157005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556104dd6103ef565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b1561048d5760015482111561062f575061048f565b600082905561063c6103ef565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b1561048d575061010655565b1561048f5760006101055550565b1561048d578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b6000868152610103602052604081208054909450909250821415610b00578154835560018381018390556101048054918201808255828015829011610b8c578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610b8a5760008155600101610adf565b6000918252602090912001555b506001820154600284900a90811660001415610bd75773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610ba6576000868152610103602052610104805460409092206002015490918110610be057005b505b5050506002840181905561010480548892908110610af357005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610bd7565b5090565b01546000145b15610c8057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610c2157506001546002906101008110610c1b57005b0154600014155b15610c4f576001016104f1565b60015481108015610ca457506001546002906101008110610c9d57005b0154600014155b8015610cbf57506002816101008110610cb957005b01546000145b15610cd8576001546002906101008110610cdd57005b01555b6104e6565b01546002826101008110610ced57005b01558061010260006002836101008110610d0357005b0154815260208101919091526040016000908120919091556001546002906101008110610cd557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156103955760008155600101610d60565b6000918252602082200154141515610dc65761010480546101039160009184908110610d9c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016103f6565b156108af5761010754610de45b62015180420490565b1115610dfd57600061010555610df8610ddb565b610107555b6101055480830110158015610e1b5750610105546101065490830111155b15610e31575061010580548201905560016108af565b5060006108af56", - "gasLimit" : "0x989680", + "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff16600381905581526101026020526040902055620151804204610107557f9adeddf84386b336eb7b3e18e7a6099be08fd81ea5d5142f4d2b630f8d20cf0160006040a1610ee9806100716000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b61029760043560006040600036808284379091209050610542815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610a7c57610bde565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061067e81610108565b610297600435604060003680828437909120905061049981610108565b61029d6004355b6000816108bb81610108565b610297600435604060003680828437909120905061067281610108565b61029d6004803590602480359160443591820191013560006106aa846000610d3333610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156102a757610329565b610297600435604060003680828437909120905061062181610108565b610297600435604060003680828437909120905061068c81610108565b6102976004356024356000604060003680828437909120905061039c81610108565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561032957815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b15610395576103aa83610146565b156103b55750610397565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156103eb5750610397565b6104145b6101045460005b81811015610d9e5761010480546101089160009184908110610dbf57005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061033057005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b15610494576104a782610146565b156104b25750610496565b6104ba6103ef565b60015460fa901015156104d1576104cf6104e8565b505b60015460fa901015156105125750610496565b6105d95b600060015b600154811015610c1e575b60015481108015610c7a57506002816101008110610c7357005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061043957005b156103975773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561057d5750610494565b60016001600050540360006000505411156105985750610494565b600060028361010081106105a857005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556104e46103ef565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b15610494576001548211156106365750610496565b60008290556106436103ef565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610494575061010655565b156104965760006101055550565b15610494578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107485773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161076157005b604060003680828437909120915061076d9050816101ae565b50600091506108949050565b15801561079d57506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561089457600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f0191909104810190849086821561089c579182015b8281111561089c57823582600050559160200191906001019061080a565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b8082111561082857600081556001016108a0565b505b919050565b156108b4576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108b45760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561094357915260208220825b81548152906001019060200180831161092f575b5050600084866185025a03f161095557005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109f357820191906000526020600020905b8154815290600101906020018083116109df575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a6e5760008155600101610a5a565b5050505060019150506108b6565b6000868152610103602052604081208054909450909250821415610b07578154835560018381018390556101048054918201808255828015829011610b93578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610b915760008155600101610ae6565b6000918252602090912001555b506001820154600284900a90811660001415610bde5773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610bad576000868152610103602052610104805460409092206002015490918110610be757005b505b5050506002840181905561010480548892908110610afa57005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610bde565b5090565b01546000145b15610c8757600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610c2857506001546002906101008110610c2257005b0154600014155b15610c56576001016104f8565b60015481108015610cab57506001546002906101008110610ca457005b0154600014155b8015610cc657506002816101008110610cc057005b01546000145b15610cdf576001546002906101008110610ce457005b01555b6104ed565b01546002826101008110610cf457005b01558061010260006002836101008110610d0a57005b0154815260208101919091526040016000908120919091556001546002906101008110610cdc57005b156108b65761010754610d495b62015180420490565b1115610d6257600061010555610d5d610d40565b610107555b6101055480830110158015610d805750610105546101065490830111155b15610d96575061010580548201905560016108b6565b5060006108b6565b6104946101045460005b81811015610e4757610104805482908110610e8f57005b6000918252602080832090910154835282810193909352604091909101812080547fffffffffffffffffffffffff0000000000000000000000000000000000000000168155600181018290556002810180548382559083528383209193601f91909101048101905b80821115610e3b5760008155600101610e27565b505050506001016103f6565b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156103955760008155600101610e7b565b6000918252602082200154141515610ee15761010480546101039160009184908110610eb757005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b600101610da856", + "gasLimit" : "0x116ffc", "gasPrice" : "1", "nonce" : "0", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", @@ -482,7 +482,7 @@ "transactions" : [ { "data" : "600160008181558180553373ffffffffffffffffffffffffffffffffffffffff16600381905581526101026020526040902055620151804204610107557f9adeddf84386b336eb7b3e18e7a6099be08fd81ea5d5142f4d2b630f8d20cf0160006040a1610e39806100716000396000f3007c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b6102976004356000604060003680828437909120905061053b815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610a7557610bd7565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061067781610108565b610297600435604060003680828437909120905061049281610108565b61029d6004355b6000816108b481610108565b610297600435604060003680828437909120905061066b81610108565b61029d6004803590602480359160443591820191013560006106a3846000610dce33610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156102a757610329565b610297600435604060003680828437909120905061061a81610108565b610297600435604060003680828437909120905061068581610108565b6102976004356024356000604060003680828437909120905061039c81610108565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561032957815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b15610395576103aa83610146565b156103b55750610397565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156103eb5750610397565b61040d5b6101045460005b81811015610d2c57610104805482908110610d7457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061033057005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b1561048d576104a082610146565b156104ab575061048f565b6104b36103ef565b60015460fa901015156104ca576104c86104e1565b505b60015460fa9010151561050b575061048f565b6105d25b600060015b600154811015610c17575b60015481108015610c7357506002816101008110610c6c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061043257005b156103975773ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120549250821415610576575061048d565b6001600160005054036000600050541115610591575061048d565b600060028361010081106105a157005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556104dd6103ef565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b1561048d5760015482101561062f575061048f565b600082905561063c6103ef565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b1561048d575061010655565b1561048f5760006101055550565b1561048d578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107415773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161075a57005b60406000368082843790912091506107669050816101ae565b506000915061088d9050565b15801561079657506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561088d57600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f01919091048101908490868215610895579182015b82811115610895578235826000505591602001919060010190610803565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b808211156108215760008155600101610899565b505b919050565b156108ad576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108ad5760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561093c57915260208220825b815481529060010190602001808311610928575b5050600084866185025a03f161094e57005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109ec57820191906000526020600020905b8154815290600101906020018083116109d8575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a675760008155600101610a53565b5050505060019150506108af565b6000868152610103602052604081208054909450909250821415610b00578154835560018381018390556101048054918201808255828015829011610b8c578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610b8a5760008155600101610adf565b6000918252602090912001555b506001820154600284900a90811660001415610bd75773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610ba6576000868152610103602052610104805460409092206002015490918110610be057005b505b5050506002840181905561010480548892908110610af357005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610bd7565b5090565b01546000145b15610c8057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610c2157506001546002906101008110610c1b57005b0154600014155b15610c4f576001016104f1565b60015481108015610ca457506001546002906101008110610c9d57005b0154600014155b8015610cbf57506002816101008110610cb957005b01546000145b15610cd8576001546002906101008110610cdd57005b01555b6104e6565b01546002826101008110610ced57005b01558061010260006002836101008110610d0357005b0154815260208101919091526040016000908120919091556001546002906101008110610cd557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156103955760008155600101610d60565b6000918252602082200154141515610dc65761010480546101039160009184908110610d9c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016103f6565b156108af5761010754610de45b62015180420490565b1115610dfd57600061010555610df8610ddb565b610107555b6101055480830110158015610e1b5750610105546101065490830111155b15610e31575061010580548201905560016108af565b5060006108af56", - "gasLimit" : "0x989680", + "gasLimit" : "0x116ffc", "gasPrice" : "1", "nonce" : "0", "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", diff --git a/test/libethereum/StateTestsFiller/stWalletTestFiller.json b/test/libethereum/StateTestsFiller/stWalletTestFiller.json index 02f09be95..de02277e8 100644 --- a/test/libethereum/StateTestsFiller/stWalletTestFiller.json +++ b/test/libethereum/StateTestsFiller/stWalletTestFiller.json @@ -1008,7 +1008,7 @@ }, "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548211156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b61029760043560006040600036808284379091209050610542815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610a7c57610bde565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061067e81610108565b610297600435604060003680828437909120905061049981610108565b61029d6004355b6000816108bb81610108565b610297600435604060003680828437909120905061067281610108565b61029d6004803590602480359160443591820191013560006106aa846000610d3333610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156102a757610329565b610297600435604060003680828437909120905061062181610108565b610297600435604060003680828437909120905061068c81610108565b6102976004356024356000604060003680828437909120905061039c81610108565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561032957815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b15610395576103aa83610146565b156103b55750610397565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156103eb5750610397565b6104145b6101045460005b81811015610d9e5761010480546101089160009184908110610dbf57005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061033057005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b15610494576104a782610146565b156104b25750610496565b6104ba6103ef565b60015460fa901015156104d1576104cf6104e8565b505b60015460fa901015156105125750610496565b6105d95b600060015b600154811015610c1e575b60015481108015610c7a57506002816101008110610c7357005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061043957005b156103975773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561057d5750610494565b60016001600050540360006000505411156105985750610494565b600060028361010081106105a857005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556104e46103ef565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b15610494576001548211156106365750610496565b60008290556106436103ef565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610494575061010655565b156104965760006101055550565b15610494578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107485773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161076157005b604060003680828437909120915061076d9050816101ae565b50600091506108949050565b15801561079d57506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561089457600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f0191909104810190849086821561089c579182015b8281111561089c57823582600050559160200191906001019061080a565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b8082111561082857600081556001016108a0565b505b919050565b156108b4576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108b45760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561094357915260208220825b81548152906001019060200180831161092f575b5050600084866185025a03f161095557005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109f357820191906000526020600020905b8154815290600101906020018083116109df575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a6e5760008155600101610a5a565b5050505060019150506108b6565b6000868152610103602052604081208054909450909250821415610b07578154835560018381018390556101048054918201808255828015829011610b93578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610b915760008155600101610ae6565b6000918252602090912001555b506001820154600284900a90811660001415610bde5773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610bad576000868152610103602052610104805460409092206002015490918110610be757005b505b5050506002840181905561010480548892908110610afa57005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610bde565b5090565b01546000145b15610c8757600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610c2857506001546002906101008110610c2257005b0154600014155b15610c56576001016104f8565b60015481108015610cab57506001546002906101008110610ca457005b0154600014155b8015610cc657506002816101008110610cc057005b01546000145b15610cdf576001546002906101008110610ce457005b01555b6104ed565b01546002826101008110610cf457005b01558061010260006002836101008110610d0a57005b0154815260208101919091526040016000908120919091556001546002906101008110610cdc57005b156108b65761010754610d495b62015180420490565b1115610d6257600061010555610d5d610d40565b610107555b6101055480830110158015610d805750610105546101065490830111155b15610d96575061010580548201905560016108b6565b5060006108b6565b6104946101045460005b81811015610e4757610104805482908110610e8f57005b6000918252602080832090910154835282810193909352604091909101812080547fffffffffffffffffffffffff0000000000000000000000000000000000000000168155600181018290556002810180548382559083528383209193601f91909101048101905b80821115610e3b5760008155600101610e27565b505050506001016103f6565b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156103955760008155600101610e7b565b6000918252602082200154141515610ee15761010480546101039160009184908110610eb757005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b600101610da856", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -1056,7 +1056,7 @@ }, "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548211156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b61029760043560006040600036808284379091209050610542815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610a7c57610bde565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061067e81610108565b610297600435604060003680828437909120905061049981610108565b61029d6004355b6000816108bb81610108565b610297600435604060003680828437909120905061067281610108565b61029d6004803590602480359160443591820191013560006106aa846000610d3333610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156102a757610329565b610297600435604060003680828437909120905061062181610108565b610297600435604060003680828437909120905061068c81610108565b6102976004356024356000604060003680828437909120905061039c81610108565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561032957815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b15610395576103aa83610146565b156103b55750610397565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156103eb5750610397565b6104145b6101045460005b81811015610d9e5761010480546101089160009184908110610dbf57005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061033057005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b15610494576104a782610146565b156104b25750610496565b6104ba6103ef565b60015460fa901015156104d1576104cf6104e8565b505b60015460fa901015156105125750610496565b6105d95b600060015b600154811015610c1e575b60015481108015610c7a57506002816101008110610c7357005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061043957005b156103975773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561057d5750610494565b60016001600050540360006000505411156105985750610494565b600060028361010081106105a857005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556104e46103ef565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b15610494576001548211156106365750610496565b60008290556106436103ef565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610494575061010655565b156104965760006101055550565b15610494578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107485773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161076157005b604060003680828437909120915061076d9050816101ae565b50600091506108949050565b15801561079d57506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561089457600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f0191909104810190849086821561089c579182015b8281111561089c57823582600050559160200191906001019061080a565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b8082111561082857600081556001016108a0565b505b919050565b156108b4576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108b45760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561094357915260208220825b81548152906001019060200180831161092f575b5050600084866185025a03f161095557005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109f357820191906000526020600020905b8154815290600101906020018083116109df575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a6e5760008155600101610a5a565b5050505060019150506108b6565b6000868152610103602052604081208054909450909250821415610b07578154835560018381018390556101048054918201808255828015829011610b93578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610b915760008155600101610ae6565b6000918252602090912001555b506001820154600284900a90811660001415610bde5773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610bad576000868152610103602052610104805460409092206002015490918110610be757005b505b5050506002840181905561010480548892908110610afa57005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610bde565b5090565b01546000145b15610c8757600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610c2857506001546002906101008110610c2257005b0154600014155b15610c56576001016104f8565b60015481108015610cab57506001546002906101008110610ca457005b0154600014155b8015610cc657506002816101008110610cc057005b01546000145b15610cdf576001546002906101008110610ce457005b01555b6104ed565b01546002826101008110610cf457005b01558061010260006002836101008110610d0a57005b0154815260208101919091526040016000908120919091556001546002906101008110610cdc57005b156108b65761010754610d495b62015180420490565b1115610d6257600061010555610d5d610d40565b610107555b6101055480830110158015610d805750610105546101065490830111155b15610d96575061010580548201905560016108b6565b5060006108b6565b6104946101045460005b81811015610e4757610104805482908110610e8f57005b6000918252602080832090910154835282810193909352604091909101812080547fffffffffffffffffffffffff0000000000000000000000000000000000000000168155600181018290556002810180548382559083528383209193601f91909101048101905b80821115610e3b5760008155600101610e27565b505050506001016103f6565b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156103955760008155600101610e7b565b6000918252602082200154141515610ee15761010480546101039160009184908110610eb757005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b600101610da856", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -1097,7 +1097,7 @@ }, "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548211156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b61029760043560006040600036808284379091209050610542815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610a7c57610bde565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061067e81610108565b610297600435604060003680828437909120905061049981610108565b61029d6004355b6000816108bb81610108565b610297600435604060003680828437909120905061067281610108565b61029d6004803590602480359160443591820191013560006106aa846000610d3333610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156102a757610329565b610297600435604060003680828437909120905061062181610108565b610297600435604060003680828437909120905061068c81610108565b6102976004356024356000604060003680828437909120905061039c81610108565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561032957815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b15610395576103aa83610146565b156103b55750610397565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156103eb5750610397565b6104145b6101045460005b81811015610d9e5761010480546101089160009184908110610dbf57005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061033057005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b15610494576104a782610146565b156104b25750610496565b6104ba6103ef565b60015460fa901015156104d1576104cf6104e8565b505b60015460fa901015156105125750610496565b6105d95b600060015b600154811015610c1e575b60015481108015610c7a57506002816101008110610c7357005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061043957005b156103975773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561057d5750610494565b60016001600050540360006000505411156105985750610494565b600060028361010081106105a857005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556104e46103ef565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b15610494576001548211156106365750610496565b60008290556106436103ef565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610494575061010655565b156104965760006101055550565b15610494578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107485773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161076157005b604060003680828437909120915061076d9050816101ae565b50600091506108949050565b15801561079d57506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561089457600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f0191909104810190849086821561089c579182015b8281111561089c57823582600050559160200191906001019061080a565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b8082111561082857600081556001016108a0565b505b919050565b156108b4576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108b45760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561094357915260208220825b81548152906001019060200180831161092f575b5050600084866185025a03f161095557005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109f357820191906000526020600020905b8154815290600101906020018083116109df575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a6e5760008155600101610a5a565b5050505060019150506108b6565b6000868152610103602052604081208054909450909250821415610b07578154835560018381018390556101048054918201808255828015829011610b93578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610b915760008155600101610ae6565b6000918252602090912001555b506001820154600284900a90811660001415610bde5773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610bad576000868152610103602052610104805460409092206002015490918110610be757005b505b5050506002840181905561010480548892908110610afa57005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610bde565b5090565b01546000145b15610c8757600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610c2857506001546002906101008110610c2257005b0154600014155b15610c56576001016104f8565b60015481108015610cab57506001546002906101008110610ca457005b0154600014155b8015610cc657506002816101008110610cc057005b01546000145b15610cdf576001546002906101008110610ce457005b01555b6104ed565b01546002826101008110610cf457005b01558061010260006002836101008110610d0a57005b0154815260208101919091526040016000908120919091556001546002906101008110610cdc57005b156108b65761010754610d495b62015180420490565b1115610d6257600061010555610d5d610d40565b610107555b6101055480830110158015610d805750610105546101065490830111155b15610d96575061010580548201905560016108b6565b5060006108b6565b6104946101045460005b81811015610e4757610104805482908110610e8f57005b6000918252602080832090910154835282810193909352604091909101812080547fffffffffffffffffffffffff0000000000000000000000000000000000000000168155600181018290556002810180548382559083528383209193601f91909101048101905b80821115610e3b5760008155600101610e27565b505050506001016103f6565b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156103955760008155600101610e7b565b6000918252602082200154141515610ee15761010480546101039160009184908110610eb757005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b600101610da856", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -1138,7 +1138,7 @@ }, "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548211156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b61029760043560006040600036808284379091209050610542815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610a7c57610bde565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061067e81610108565b610297600435604060003680828437909120905061049981610108565b61029d6004355b6000816108bb81610108565b610297600435604060003680828437909120905061067281610108565b61029d6004803590602480359160443591820191013560006106aa846000610d3333610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156102a757610329565b610297600435604060003680828437909120905061062181610108565b610297600435604060003680828437909120905061068c81610108565b6102976004356024356000604060003680828437909120905061039c81610108565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561032957815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b15610395576103aa83610146565b156103b55750610397565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156103eb5750610397565b6104145b6101045460005b81811015610d9e5761010480546101089160009184908110610dbf57005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061033057005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b15610494576104a782610146565b156104b25750610496565b6104ba6103ef565b60015460fa901015156104d1576104cf6104e8565b505b60015460fa901015156105125750610496565b6105d95b600060015b600154811015610c1e575b60015481108015610c7a57506002816101008110610c7357005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061043957005b156103975773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561057d5750610494565b60016001600050540360006000505411156105985750610494565b600060028361010081106105a857005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556104e46103ef565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b15610494576001548211156106365750610496565b60008290556106436103ef565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610494575061010655565b156104965760006101055550565b15610494578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107485773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161076157005b604060003680828437909120915061076d9050816101ae565b50600091506108949050565b15801561079d57506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561089457600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f0191909104810190849086821561089c579182015b8281111561089c57823582600050559160200191906001019061080a565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b8082111561082857600081556001016108a0565b505b919050565b156108b4576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108b45760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561094357915260208220825b81548152906001019060200180831161092f575b5050600084866185025a03f161095557005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109f357820191906000526020600020905b8154815290600101906020018083116109df575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a6e5760008155600101610a5a565b5050505060019150506108b6565b6000868152610103602052604081208054909450909250821415610b07578154835560018381018390556101048054918201808255828015829011610b93578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610b915760008155600101610ae6565b6000918252602090912001555b506001820154600284900a90811660001415610bde5773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610bad576000868152610103602052610104805460409092206002015490918110610be757005b505b5050506002840181905561010480548892908110610afa57005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610bde565b5090565b01546000145b15610c8757600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610c2857506001546002906101008110610c2257005b0154600014155b15610c56576001016104f8565b60015481108015610cab57506001546002906101008110610ca457005b0154600014155b8015610cc657506002816101008110610cc057005b01546000145b15610cdf576001546002906101008110610ce457005b01555b6104ed565b01546002826101008110610cf457005b01558061010260006002836101008110610d0a57005b0154815260208101919091526040016000908120919091556001546002906101008110610cdc57005b156108b65761010754610d495b62015180420490565b1115610d6257600061010555610d5d610d40565b610107555b6101055480830110158015610d805750610105546101065490830111155b15610d96575061010580548201905560016108b6565b5060006108b6565b6104946101045460005b81811015610e4757610104805482908110610e8f57005b6000918252602080832090910154835282810193909352604091909101812080547fffffffffffffffffffffffff0000000000000000000000000000000000000000168155600181018290556002810180548382559083528383209193601f91909101048101905b80821115610e3b5760008155600101610e27565b505050506001016103f6565b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156103955760008155600101610e7b565b6000918252602082200154141515610ee15761010480546101039160009184908110610eb757005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b600101610da856", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -1179,7 +1179,7 @@ }, "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548211156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b61029760043560006040600036808284379091209050610542815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610a7c57610bde565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061067e81610108565b610297600435604060003680828437909120905061049981610108565b61029d6004355b6000816108bb81610108565b610297600435604060003680828437909120905061067281610108565b61029d6004803590602480359160443591820191013560006106aa846000610d3333610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156102a757610329565b610297600435604060003680828437909120905061062181610108565b610297600435604060003680828437909120905061068c81610108565b6102976004356024356000604060003680828437909120905061039c81610108565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561032957815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b15610395576103aa83610146565b156103b55750610397565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156103eb5750610397565b6104145b6101045460005b81811015610d9e5761010480546101089160009184908110610dbf57005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061033057005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b15610494576104a782610146565b156104b25750610496565b6104ba6103ef565b60015460fa901015156104d1576104cf6104e8565b505b60015460fa901015156105125750610496565b6105d95b600060015b600154811015610c1e575b60015481108015610c7a57506002816101008110610c7357005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061043957005b156103975773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561057d5750610494565b60016001600050540360006000505411156105985750610494565b600060028361010081106105a857005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556104e46103ef565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b15610494576001548211156106365750610496565b60008290556106436103ef565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610494575061010655565b156104965760006101055550565b15610494578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107485773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161076157005b604060003680828437909120915061076d9050816101ae565b50600091506108949050565b15801561079d57506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561089457600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f0191909104810190849086821561089c579182015b8281111561089c57823582600050559160200191906001019061080a565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b8082111561082857600081556001016108a0565b505b919050565b156108b4576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108b45760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561094357915260208220825b81548152906001019060200180831161092f575b5050600084866185025a03f161095557005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109f357820191906000526020600020905b8154815290600101906020018083116109df575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a6e5760008155600101610a5a565b5050505060019150506108b6565b6000868152610103602052604081208054909450909250821415610b07578154835560018381018390556101048054918201808255828015829011610b93578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610b915760008155600101610ae6565b6000918252602090912001555b506001820154600284900a90811660001415610bde5773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610bad576000868152610103602052610104805460409092206002015490918110610be757005b505b5050506002840181905561010480548892908110610afa57005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610bde565b5090565b01546000145b15610c8757600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610c2857506001546002906101008110610c2257005b0154600014155b15610c56576001016104f8565b60015481108015610cab57506001546002906101008110610ca457005b0154600014155b8015610cc657506002816101008110610cc057005b01546000145b15610cdf576001546002906101008110610ce457005b01555b6104ed565b01546002826101008110610cf457005b01558061010260006002836101008110610d0a57005b0154815260208101919091526040016000908120919091556001546002906101008110610cdc57005b156108b65761010754610d495b62015180420490565b1115610d6257600061010555610d5d610d40565b610107555b6101055480830110158015610d805750610105546101065490830111155b15610d96575061010580548201905560016108b6565b5060006108b6565b6104946101045460005b81811015610e4757610104805482908110610e8f57005b6000918252602080832090910154835282810193909352604091909101812080547fffffffffffffffffffffffff0000000000000000000000000000000000000000168155600181018290556002810180548382559083528383209193601f91909101048101905b80821115610e3b5760008155600101610e27565b505050506001016103f6565b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156103955760008155600101610e7b565b6000918252602082200154141515610ee15761010480546101039160009184908110610eb757005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b600101610da856", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -1220,7 +1220,7 @@ }, "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548211156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b61029760043560006040600036808284379091209050610542815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610a7c57610bde565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061067e81610108565b610297600435604060003680828437909120905061049981610108565b61029d6004355b6000816108bb81610108565b610297600435604060003680828437909120905061067281610108565b61029d6004803590602480359160443591820191013560006106aa846000610d3333610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156102a757610329565b610297600435604060003680828437909120905061062181610108565b610297600435604060003680828437909120905061068c81610108565b6102976004356024356000604060003680828437909120905061039c81610108565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561032957815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b15610395576103aa83610146565b156103b55750610397565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156103eb5750610397565b6104145b6101045460005b81811015610d9e5761010480546101089160009184908110610dbf57005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061033057005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b15610494576104a782610146565b156104b25750610496565b6104ba6103ef565b60015460fa901015156104d1576104cf6104e8565b505b60015460fa901015156105125750610496565b6105d95b600060015b600154811015610c1e575b60015481108015610c7a57506002816101008110610c7357005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061043957005b156103975773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561057d5750610494565b60016001600050540360006000505411156105985750610494565b600060028361010081106105a857005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556104e46103ef565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b15610494576001548211156106365750610496565b60008290556106436103ef565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610494575061010655565b156104965760006101055550565b15610494578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107485773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161076157005b604060003680828437909120915061076d9050816101ae565b50600091506108949050565b15801561079d57506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561089457600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f0191909104810190849086821561089c579182015b8281111561089c57823582600050559160200191906001019061080a565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b8082111561082857600081556001016108a0565b505b919050565b156108b4576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108b45760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561094357915260208220825b81548152906001019060200180831161092f575b5050600084866185025a03f161095557005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109f357820191906000526020600020905b8154815290600101906020018083116109df575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a6e5760008155600101610a5a565b5050505060019150506108b6565b6000868152610103602052604081208054909450909250821415610b07578154835560018381018390556101048054918201808255828015829011610b93578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610b915760008155600101610ae6565b6000918252602090912001555b506001820154600284900a90811660001415610bde5773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610bad576000868152610103602052610104805460409092206002015490918110610be757005b505b5050506002840181905561010480548892908110610afa57005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610bde565b5090565b01546000145b15610c8757600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610c2857506001546002906101008110610c2257005b0154600014155b15610c56576001016104f8565b60015481108015610cab57506001546002906101008110610ca457005b0154600014155b8015610cc657506002816101008110610cc057005b01546000145b15610cdf576001546002906101008110610ce457005b01555b6104ed565b01546002826101008110610cf457005b01558061010260006002836101008110610d0a57005b0154815260208101919091526040016000908120919091556001546002906101008110610cdc57005b156108b65761010754610d495b62015180420490565b1115610d6257600061010555610d5d610d40565b610107555b6101055480830110158015610d805750610105546101065490830111155b15610d96575061010580548201905560016108b6565b5060006108b6565b6104946101045460005b81811015610e4757610104805482908110610e8f57005b6000918252602080832090910154835282810193909352604091909101812080547fffffffffffffffffffffffff0000000000000000000000000000000000000000168155600181018290556002810180548382559083528383209193601f91909101048101905b80821115610e3b5760008155600101610e27565b505050506001016103f6565b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156103955760008155600101610e7b565b6000918252602082200154141515610ee15761010480546101039160009184908110610eb757005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b600101610da856", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -1261,7 +1261,7 @@ }, "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548211156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b61029760043560006040600036808284379091209050610542815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610a7c57610bde565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061067e81610108565b610297600435604060003680828437909120905061049981610108565b61029d6004355b6000816108bb81610108565b610297600435604060003680828437909120905061067281610108565b61029d6004803590602480359160443591820191013560006106aa846000610d3333610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156102a757610329565b610297600435604060003680828437909120905061062181610108565b610297600435604060003680828437909120905061068c81610108565b6102976004356024356000604060003680828437909120905061039c81610108565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561032957815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b15610395576103aa83610146565b156103b55750610397565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156103eb5750610397565b6104145b6101045460005b81811015610d9e5761010480546101089160009184908110610dbf57005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061033057005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b15610494576104a782610146565b156104b25750610496565b6104ba6103ef565b60015460fa901015156104d1576104cf6104e8565b505b60015460fa901015156105125750610496565b6105d95b600060015b600154811015610c1e575b60015481108015610c7a57506002816101008110610c7357005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061043957005b156103975773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561057d5750610494565b60016001600050540360006000505411156105985750610494565b600060028361010081106105a857005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556104e46103ef565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b15610494576001548211156106365750610496565b60008290556106436103ef565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610494575061010655565b156104965760006101055550565b15610494578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107485773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161076157005b604060003680828437909120915061076d9050816101ae565b50600091506108949050565b15801561079d57506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561089457600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f0191909104810190849086821561089c579182015b8281111561089c57823582600050559160200191906001019061080a565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b8082111561082857600081556001016108a0565b505b919050565b156108b4576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108b45760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561094357915260208220825b81548152906001019060200180831161092f575b5050600084866185025a03f161095557005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109f357820191906000526020600020905b8154815290600101906020018083116109df575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a6e5760008155600101610a5a565b5050505060019150506108b6565b6000868152610103602052604081208054909450909250821415610b07578154835560018381018390556101048054918201808255828015829011610b93578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610b915760008155600101610ae6565b6000918252602090912001555b506001820154600284900a90811660001415610bde5773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610bad576000868152610103602052610104805460409092206002015490918110610be757005b505b5050506002840181905561010480548892908110610afa57005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610bde565b5090565b01546000145b15610c8757600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610c2857506001546002906101008110610c2257005b0154600014155b15610c56576001016104f8565b60015481108015610cab57506001546002906101008110610ca457005b0154600014155b8015610cc657506002816101008110610cc057005b01546000145b15610cdf576001546002906101008110610ce457005b01555b6104ed565b01546002826101008110610cf457005b01558061010260006002836101008110610d0a57005b0154815260208101919091526040016000908120919091556001546002906101008110610cdc57005b156108b65761010754610d495b62015180420490565b1115610d6257600061010555610d5d610d40565b610107555b6101055480830110158015610d805750610105546101065490830111155b15610d96575061010580548201905560016108b6565b5060006108b6565b6104946101045460005b81811015610e4757610104805482908110610e8f57005b6000918252602080832090910154835282810193909352604091909101812080547fffffffffffffffffffffffff0000000000000000000000000000000000000000168155600181018290556002810180548382559083528383209193601f91909101048101905b80821115610e3b5760008155600101610e27565b505050506001016103f6565b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156103955760008155600101610e7b565b6000918252602082200154141515610ee15761010480546101039160009184908110610eb757005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b600101610da856", "nonce" : "0x00", "storage" : { "0x00" : "0x02", @@ -1310,7 +1310,7 @@ }, "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548211156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b61029760043560006040600036808284379091209050610542815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610a7c57610bde565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061067e81610108565b610297600435604060003680828437909120905061049981610108565b61029d6004355b6000816108bb81610108565b610297600435604060003680828437909120905061067281610108565b61029d6004803590602480359160443591820191013560006106aa846000610d3333610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156102a757610329565b610297600435604060003680828437909120905061062181610108565b610297600435604060003680828437909120905061068c81610108565b6102976004356024356000604060003680828437909120905061039c81610108565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561032957815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b15610395576103aa83610146565b156103b55750610397565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156103eb5750610397565b6104145b6101045460005b81811015610d9e5761010480546101089160009184908110610dbf57005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061033057005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b15610494576104a782610146565b156104b25750610496565b6104ba6103ef565b60015460fa901015156104d1576104cf6104e8565b505b60015460fa901015156105125750610496565b6105d95b600060015b600154811015610c1e575b60015481108015610c7a57506002816101008110610c7357005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061043957005b156103975773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561057d5750610494565b60016001600050540360006000505411156105985750610494565b600060028361010081106105a857005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556104e46103ef565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b15610494576001548211156106365750610496565b60008290556106436103ef565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610494575061010655565b156104965760006101055550565b15610494578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107485773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161076157005b604060003680828437909120915061076d9050816101ae565b50600091506108949050565b15801561079d57506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561089457600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f0191909104810190849086821561089c579182015b8281111561089c57823582600050559160200191906001019061080a565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b8082111561082857600081556001016108a0565b505b919050565b156108b4576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108b45760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561094357915260208220825b81548152906001019060200180831161092f575b5050600084866185025a03f161095557005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109f357820191906000526020600020905b8154815290600101906020018083116109df575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a6e5760008155600101610a5a565b5050505060019150506108b6565b6000868152610103602052604081208054909450909250821415610b07578154835560018381018390556101048054918201808255828015829011610b93578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610b915760008155600101610ae6565b6000918252602090912001555b506001820154600284900a90811660001415610bde5773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610bad576000868152610103602052610104805460409092206002015490918110610be757005b505b5050506002840181905561010480548892908110610afa57005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610bde565b5090565b01546000145b15610c8757600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610c2857506001546002906101008110610c2257005b0154600014155b15610c56576001016104f8565b60015481108015610cab57506001546002906101008110610ca457005b0154600014155b8015610cc657506002816101008110610cc057005b01546000145b15610cdf576001546002906101008110610ce457005b01555b6104ed565b01546002826101008110610cf457005b01558061010260006002836101008110610d0a57005b0154815260208101919091526040016000908120919091556001546002906101008110610cdc57005b156108b65761010754610d495b62015180420490565b1115610d6257600061010555610d5d610d40565b610107555b6101055480830110158015610d805750610105546101065490830111155b15610d96575061010580548201905560016108b6565b5060006108b6565b6104946101045460005b81811015610e4757610104805482908110610e8f57005b6000918252602080832090910154835282810193909352604091909101812080547fffffffffffffffffffffffff0000000000000000000000000000000000000000168155600181018290556002810180548382559083528383209193601f91909101048101905b80821115610e3b5760008155600101610e27565b505050506001016103f6565b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156103955760008155600101610e7b565b6000918252602082200154141515610ee15761010480546101039160009184908110610eb757005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b600101610da856", "nonce" : "0x00", "storage" : { "0x00" : "0x02", @@ -1359,7 +1359,7 @@ }, "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548211156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b61029760043560006040600036808284379091209050610542815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610a7c57610bde565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061067e81610108565b610297600435604060003680828437909120905061049981610108565b61029d6004355b6000816108bb81610108565b610297600435604060003680828437909120905061067281610108565b61029d6004803590602480359160443591820191013560006106aa846000610d3333610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156102a757610329565b610297600435604060003680828437909120905061062181610108565b610297600435604060003680828437909120905061068c81610108565b6102976004356024356000604060003680828437909120905061039c81610108565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561032957815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b15610395576103aa83610146565b156103b55750610397565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156103eb5750610397565b6104145b6101045460005b81811015610d9e5761010480546101089160009184908110610dbf57005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061033057005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b15610494576104a782610146565b156104b25750610496565b6104ba6103ef565b60015460fa901015156104d1576104cf6104e8565b505b60015460fa901015156105125750610496565b6105d95b600060015b600154811015610c1e575b60015481108015610c7a57506002816101008110610c7357005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061043957005b156103975773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561057d5750610494565b60016001600050540360006000505411156105985750610494565b600060028361010081106105a857005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556104e46103ef565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b15610494576001548211156106365750610496565b60008290556106436103ef565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610494575061010655565b156104965760006101055550565b15610494578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107485773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161076157005b604060003680828437909120915061076d9050816101ae565b50600091506108949050565b15801561079d57506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561089457600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f0191909104810190849086821561089c579182015b8281111561089c57823582600050559160200191906001019061080a565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b8082111561082857600081556001016108a0565b505b919050565b156108b4576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108b45760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561094357915260208220825b81548152906001019060200180831161092f575b5050600084866185025a03f161095557005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109f357820191906000526020600020905b8154815290600101906020018083116109df575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a6e5760008155600101610a5a565b5050505060019150506108b6565b6000868152610103602052604081208054909450909250821415610b07578154835560018381018390556101048054918201808255828015829011610b93578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610b915760008155600101610ae6565b6000918252602090912001555b506001820154600284900a90811660001415610bde5773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610bad576000868152610103602052610104805460409092206002015490918110610be757005b505b5050506002840181905561010480548892908110610afa57005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610bde565b5090565b01546000145b15610c8757600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610c2857506001546002906101008110610c2257005b0154600014155b15610c56576001016104f8565b60015481108015610cab57506001546002906101008110610ca457005b0154600014155b8015610cc657506002816101008110610cc057005b01546000145b15610cdf576001546002906101008110610ce457005b01555b6104ed565b01546002826101008110610cf457005b01558061010260006002836101008110610d0a57005b0154815260208101919091526040016000908120919091556001546002906101008110610cdc57005b156108b65761010754610d495b62015180420490565b1115610d6257600061010555610d5d610d40565b610107555b6101055480830110158015610d805750610105546101065490830111155b15610d96575061010580548201905560016108b6565b5060006108b6565b6104946101045460005b81811015610e4757610104805482908110610e8f57005b6000918252602080832090910154835282810193909352604091909101812080547fffffffffffffffffffffffff0000000000000000000000000000000000000000168155600181018290556002810180548382559083528383209193601f91909101048101905b80821115610e3b5760008155600101610e27565b505050506001016103f6565b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156103955760008155600101610e7b565b6000918252602082200154141515610ee15761010480546101039160009184908110610eb757005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b600101610da856", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -1408,7 +1408,7 @@ }, "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548211156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b61029760043560006040600036808284379091209050610542815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610a7c57610bde565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061067e81610108565b610297600435604060003680828437909120905061049981610108565b61029d6004355b6000816108bb81610108565b610297600435604060003680828437909120905061067281610108565b61029d6004803590602480359160443591820191013560006106aa846000610d3333610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156102a757610329565b610297600435604060003680828437909120905061062181610108565b610297600435604060003680828437909120905061068c81610108565b6102976004356024356000604060003680828437909120905061039c81610108565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561032957815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b15610395576103aa83610146565b156103b55750610397565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156103eb5750610397565b6104145b6101045460005b81811015610d9e5761010480546101089160009184908110610dbf57005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061033057005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b15610494576104a782610146565b156104b25750610496565b6104ba6103ef565b60015460fa901015156104d1576104cf6104e8565b505b60015460fa901015156105125750610496565b6105d95b600060015b600154811015610c1e575b60015481108015610c7a57506002816101008110610c7357005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061043957005b156103975773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561057d5750610494565b60016001600050540360006000505411156105985750610494565b600060028361010081106105a857005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556104e46103ef565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b15610494576001548211156106365750610496565b60008290556106436103ef565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610494575061010655565b156104965760006101055550565b15610494578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107485773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161076157005b604060003680828437909120915061076d9050816101ae565b50600091506108949050565b15801561079d57506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561089457600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f0191909104810190849086821561089c579182015b8281111561089c57823582600050559160200191906001019061080a565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b8082111561082857600081556001016108a0565b505b919050565b156108b4576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108b45760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561094357915260208220825b81548152906001019060200180831161092f575b5050600084866185025a03f161095557005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109f357820191906000526020600020905b8154815290600101906020018083116109df575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a6e5760008155600101610a5a565b5050505060019150506108b6565b6000868152610103602052604081208054909450909250821415610b07578154835560018381018390556101048054918201808255828015829011610b93578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610b915760008155600101610ae6565b6000918252602090912001555b506001820154600284900a90811660001415610bde5773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610bad576000868152610103602052610104805460409092206002015490918110610be757005b505b5050506002840181905561010480548892908110610afa57005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610bde565b5090565b01546000145b15610c8757600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610c2857506001546002906101008110610c2257005b0154600014155b15610c56576001016104f8565b60015481108015610cab57506001546002906101008110610ca457005b0154600014155b8015610cc657506002816101008110610cc057005b01546000145b15610cdf576001546002906101008110610ce457005b01555b6104ed565b01546002826101008110610cf457005b01558061010260006002836101008110610d0a57005b0154815260208101919091526040016000908120919091556001546002906101008110610cdc57005b156108b65761010754610d495b62015180420490565b1115610d6257600061010555610d5d610d40565b610107555b6101055480830110158015610d805750610105546101065490830111155b15610d96575061010580548201905560016108b6565b5060006108b6565b6104946101045460005b81811015610e4757610104805482908110610e8f57005b6000918252602080832090910154835282810193909352604091909101812080547fffffffffffffffffffffffff0000000000000000000000000000000000000000168155600181018290556002810180548382559083528383209193601f91909101048101905b80821115610e3b5760008155600101610e27565b505050506001016103f6565b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156103955760008155600101610e7b565b6000918252602082200154141515610ee15761010480546101039160009184908110610eb757005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b600101610da856", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -1464,7 +1464,7 @@ }, "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548211156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b61029760043560006040600036808284379091209050610542815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610a7c57610bde565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061067e81610108565b610297600435604060003680828437909120905061049981610108565b61029d6004355b6000816108bb81610108565b610297600435604060003680828437909120905061067281610108565b61029d6004803590602480359160443591820191013560006106aa846000610d3333610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156102a757610329565b610297600435604060003680828437909120905061062181610108565b610297600435604060003680828437909120905061068c81610108565b6102976004356024356000604060003680828437909120905061039c81610108565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561032957815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b15610395576103aa83610146565b156103b55750610397565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156103eb5750610397565b6104145b6101045460005b81811015610d9e5761010480546101089160009184908110610dbf57005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061033057005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b15610494576104a782610146565b156104b25750610496565b6104ba6103ef565b60015460fa901015156104d1576104cf6104e8565b505b60015460fa901015156105125750610496565b6105d95b600060015b600154811015610c1e575b60015481108015610c7a57506002816101008110610c7357005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061043957005b156103975773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561057d5750610494565b60016001600050540360006000505411156105985750610494565b600060028361010081106105a857005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556104e46103ef565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b15610494576001548211156106365750610496565b60008290556106436103ef565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610494575061010655565b156104965760006101055550565b15610494578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107485773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161076157005b604060003680828437909120915061076d9050816101ae565b50600091506108949050565b15801561079d57506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561089457600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f0191909104810190849086821561089c579182015b8281111561089c57823582600050559160200191906001019061080a565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b8082111561082857600081556001016108a0565b505b919050565b156108b4576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108b45760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561094357915260208220825b81548152906001019060200180831161092f575b5050600084866185025a03f161095557005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109f357820191906000526020600020905b8154815290600101906020018083116109df575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a6e5760008155600101610a5a565b5050505060019150506108b6565b6000868152610103602052604081208054909450909250821415610b07578154835560018381018390556101048054918201808255828015829011610b93578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610b915760008155600101610ae6565b6000918252602090912001555b506001820154600284900a90811660001415610bde5773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610bad576000868152610103602052610104805460409092206002015490918110610be757005b505b5050506002840181905561010480548892908110610afa57005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610bde565b5090565b01546000145b15610c8757600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610c2857506001546002906101008110610c2257005b0154600014155b15610c56576001016104f8565b60015481108015610cab57506001546002906101008110610ca457005b0154600014155b8015610cc657506002816101008110610cc057005b01546000145b15610cdf576001546002906101008110610ce457005b01555b6104ed565b01546002826101008110610cf457005b01558061010260006002836101008110610d0a57005b0154815260208101919091526040016000908120919091556001546002906101008110610cdc57005b156108b65761010754610d495b62015180420490565b1115610d6257600061010555610d5d610d40565b610107555b6101055480830110158015610d805750610105546101065490830111155b15610d96575061010580548201905560016108b6565b5060006108b6565b6104946101045460005b81811015610e4757610104805482908110610e8f57005b6000918252602080832090910154835282810193909352604091909101812080547fffffffffffffffffffffffff0000000000000000000000000000000000000000168155600181018290556002810180548382559083528383209193601f91909101048101905b80821115610e3b5760008155600101610e27565b505050506001016103f6565b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156103955760008155600101610e7b565b6000918252602082200154141515610ee15761010480546101039160009184908110610eb757005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b600101610da856", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -1520,7 +1520,7 @@ }, "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548211156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b61029760043560006040600036808284379091209050610542815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610a7c57610bde565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061067e81610108565b610297600435604060003680828437909120905061049981610108565b61029d6004355b6000816108bb81610108565b610297600435604060003680828437909120905061067281610108565b61029d6004803590602480359160443591820191013560006106aa846000610d3333610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156102a757610329565b610297600435604060003680828437909120905061062181610108565b610297600435604060003680828437909120905061068c81610108565b6102976004356024356000604060003680828437909120905061039c81610108565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561032957815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b15610395576103aa83610146565b156103b55750610397565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156103eb5750610397565b6104145b6101045460005b81811015610d9e5761010480546101089160009184908110610dbf57005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061033057005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b15610494576104a782610146565b156104b25750610496565b6104ba6103ef565b60015460fa901015156104d1576104cf6104e8565b505b60015460fa901015156105125750610496565b6105d95b600060015b600154811015610c1e575b60015481108015610c7a57506002816101008110610c7357005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061043957005b156103975773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561057d5750610494565b60016001600050540360006000505411156105985750610494565b600060028361010081106105a857005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556104e46103ef565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b15610494576001548211156106365750610496565b60008290556106436103ef565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610494575061010655565b156104965760006101055550565b15610494578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107485773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161076157005b604060003680828437909120915061076d9050816101ae565b50600091506108949050565b15801561079d57506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561089457600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f0191909104810190849086821561089c579182015b8281111561089c57823582600050559160200191906001019061080a565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b8082111561082857600081556001016108a0565b505b919050565b156108b4576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108b45760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561094357915260208220825b81548152906001019060200180831161092f575b5050600084866185025a03f161095557005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109f357820191906000526020600020905b8154815290600101906020018083116109df575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a6e5760008155600101610a5a565b5050505060019150506108b6565b6000868152610103602052604081208054909450909250821415610b07578154835560018381018390556101048054918201808255828015829011610b93578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610b915760008155600101610ae6565b6000918252602090912001555b506001820154600284900a90811660001415610bde5773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610bad576000868152610103602052610104805460409092206002015490918110610be757005b505b5050506002840181905561010480548892908110610afa57005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610bde565b5090565b01546000145b15610c8757600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610c2857506001546002906101008110610c2257005b0154600014155b15610c56576001016104f8565b60015481108015610cab57506001546002906101008110610ca457005b0154600014155b8015610cc657506002816101008110610cc057005b01546000145b15610cdf576001546002906101008110610ce457005b01555b6104ed565b01546002826101008110610cf457005b01558061010260006002836101008110610d0a57005b0154815260208101919091526040016000908120919091556001546002906101008110610cdc57005b156108b65761010754610d495b62015180420490565b1115610d6257600061010555610d5d610d40565b610107555b6101055480830110158015610d805750610105546101065490830111155b15610d96575061010580548201905560016108b6565b5060006108b6565b6104946101045460005b81811015610e4757610104805482908110610e8f57005b6000918252602080832090910154835282810193909352604091909101812080547fffffffffffffffffffffffff0000000000000000000000000000000000000000168155600181018290556002810180548382559083528383209193601f91909101048101905b80821115610e3b5760008155600101610e27565b505050506001016103f6565b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156103955760008155600101610e7b565b6000918252602082200154141515610ee15761010480546101039160009184908110610eb757005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b600101610da856", "nonce" : "0x00", "storage" : { "0x00" : "0x01", @@ -1576,7 +1576,7 @@ }, "ec0e71ad0a90ffe1909d27dac207f7680abba42d" : { "balance" : "0x64", - "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100655780632f54bf6e146100b75780637065cb48146100e8578063b75c7dc614610105578063ba51a6df14610142578063f00d4b5d1461015f57005b6101816004356000604060003680828437909120905061046d815b73ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120548180808381141561058f57610586565b6101876004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610181600435604060003680828437909120905061037c81610080565b61018160043573ffffffffffffffffffffffffffffffffffffffff3316600090815261010260205260408120549080808381141561019157610213565b610181600435604060003680828437909120905061053381610080565b6101816004356024356000604060003680828437909120905061028681610080565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561021357815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b1561027f57610294836100be565b1561029f5750610281565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156102d55750610281565b6102f75b6101045460005b8181101561080c5761010480548290811061085457005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061021a57005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b156103775761038a826100be565b156103955750610379565b61039d6102d9565b60015460fa901015156103b4576103b26103cb565b505b60015460fa901015156103f55750610379565b6104255b600060015b6001548110156106f7575b600154811080156107535750600281610100811061074c57005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061031c57005b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b156102815773ffffffffffffffffffffffffffffffffffffffff83166000908152610102602052604081205492508214156104a85750610377565b60016001600050540360006000505411156104c35750610377565b600060028361010081106104d357005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556103c76102d9565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610377576001548211156105485750610379565b60008290556105046102d9565b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b600086815261010360205260408120805490945090925082141561061a5781548355600183810183905561010480549182018082558280158290116106a6578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b808211156106a457600081556001016105f9565b6000918252602090912001555b506001820154600284900a908116600014156105865773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a182546001901115156105555760008681526101036020526101048054604090922060020154909181106106c057005b505b505050600284018190556101048054889290811061060d57005b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610586565b5090565b01546000145b1561076057600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610701575060015460029061010081106106fb57005b0154600014155b1561072f576001016103db565b600154811080156107845750600154600290610100811061077d57005b0154600014155b801561079f5750600281610100811061079957005b01546000145b156107b85760015460029061010081106107bd57005b01555b6103d0565b015460028261010081106107cd57005b015580610102600060028361010081106107e357005b01548152602081019190915260400160009081209190915560015460029061010081106107b557005b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b8082111561027f5760008155600101610840565b60009182526020822001541415156108a6576101048054610103916000918490811061087c57005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b6001016102e056", + "code" : "0x7c01000000000000000000000000000000000000000000000000000000006000350463173825d981146100ed5780632f54bf6e1461013f5780635c52c2f5146101705780637065cb481461018a578063797af627146101a7578063b20d30a9146101ba578063b61d27f6146101d7578063b75c7dc6146101fe578063ba51a6df1461023b578063cbf0b0c014610258578063f00d4b5d146102755761029760003411156100eb5773ffffffffffffffffffffffffffffffffffffffff33166040908152346060527fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c9080a15b565b61029760043560006040600036808284379091209050610542815b73ffffffffffffffffffffffffffffffffffffffff33166000908152610102602052604081205481808083811415610a7c57610bde565b61029d6004355b73ffffffffffffffffffffffffffffffffffffffff16600090815261010260205260408120541190565b610297604060003680828437909120905061067e81610108565b610297600435604060003680828437909120905061049981610108565b61029d6004355b6000816108bb81610108565b610297600435604060003680828437909120905061067281610108565b61029d6004803590602480359160443591820191013560006106aa846000610d3333610146565b61029760043573ffffffffffffffffffffffffffffffffffffffff331660009081526101026020526040812054908080838114156102a757610329565b610297600435604060003680828437909120905061062181610108565b610297600435604060003680828437909120905061068c81610108565b6102976004356024356000604060003680828437909120905061039c81610108565b60006000f35b8060005260206000f35b5050506000828152610103602052604081206001810154600284900a929083168190111561032957815460018084018054919092018455849003905573ffffffffffffffffffffffffffffffffffffffff3316604090815260608690527fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b9080a15b5050505050565b015573ffffffffffffffffffffffffffffffffffffffff84811660008181526101026020526040808220829055928616808252908390208590559082526060527fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c9080a15b505b505050565b15610395576103aa83610146565b156103b55750610397565b73ffffffffffffffffffffffffffffffffffffffff84166000908152610102602052604081205492508214156103eb5750610397565b6104145b6101045460005b81811015610d9e5761010480546101089160009184908110610dbf57005b73ffffffffffffffffffffffffffffffffffffffff8316600283610100811061033057005b015560015473ffffffffffffffffffffffffffffffffffffffff831660008181526101026020908152604091829020939093559081527f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c39190a15b505b50565b15610494576104a782610146565b156104b25750610496565b6104ba6103ef565b60015460fa901015156104d1576104cf6104e8565b505b60015460fa901015156105125750610496565b6105d95b600060015b600154811015610c1e575b60015481108015610c7a57506002816101008110610c7357005b6001805481019081905573ffffffffffffffffffffffffffffffffffffffff831690600290610100811061043957005b156103975773ffffffffffffffffffffffffffffffffffffffff831660009081526101026020526040812054925082141561057d5750610494565b60016001600050540360006000505411156105985750610494565b600060028361010081106105a857005b015573ffffffffffffffffffffffffffffffffffffffff8316600090815261010260205260408120556104e46103ef565b5073ffffffffffffffffffffffffffffffffffffffff831660409081527f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da90602090a1505050565b15610494576001548211156106365750610496565b60008290556106436103ef565b60408281527facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da90602090a15050565b15610494575061010655565b156104965760006101055550565b15610494578173ffffffffffffffffffffffffffffffffffffffff16ff5b156107485773ffffffffffffffffffffffffffffffffffffffff3381166040526060859052851660805260a08290527f92ca3a80853e6663fa31fa10b99225f18d4902939b4c53a9caae9043f6efd004838360c082828082843750505060800190506040a18473ffffffffffffffffffffffffffffffffffffffff16846000600060008787808284378201915050600084866185025a03f161076157005b604060003680828437909120915061076d9050816101ae565b50600091506108949050565b15801561079d57506000818152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff16145b1561089457600081815261010860209081526040822080547fffffffffffffffffffffffff00000000000000000000000000000000000000001688178155600181018790556002018054858255818452928290209092601f0191909104810190849086821561089c579182015b8281111561089c57823582600050559160200191906001019061080a565b505050604081905273ffffffffffffffffffffffffffffffffffffffff3381166060526080859052851660a05260c08290527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32838360e0828280828437505060a0909101915060409050a15b949350505050565b5090505b8082111561082857600081556001016108a0565b505b919050565b156108b4576000838152610108602052604081205473ffffffffffffffffffffffffffffffffffffffff161415156108b45760406000908120805460018201546002909201805473ffffffffffffffffffffffffffffffffffffffff92909216939182918291801561094357915260208220825b81548152906001019060200180831161092f575b5050600084866185025a03f161095557005b505073ffffffffffffffffffffffffffffffffffffffff3381166040908152606085905260008581526101086020529081206001810154608052805490921660a0526002909101805460c08190527fe7c957c06e9a662c1a6c77366179f5b702b97651dc28eee7d5bf1dff6e40bb4a929060e090839080156109f357820191906000526020600020905b8154815290600101906020018083116109df575b5050915050604090036040a1600083815261010860209081526040822080547fffffffffffffffffffffffff000000000000000000000000000000000000000016815560018101839055600281018054848255908452828420919392601f91909101048101905b80821115610a6e5760008155600101610a5a565b5050505060019150506108b6565b6000868152610103602052604081208054909450909250821415610b07578154835560018381018390556101048054918201808255828015829011610b93578286527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe9081019082015b80821115610b915760008155600101610ae6565b6000918252602090912001555b506001820154600284900a90811660001415610bde5773ffffffffffffffffffffffffffffffffffffffff3316604090815260608790527fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda9080a18254600190111515610bad576000868152610103602052610104805460409092206002015490918110610be757005b505b5050506002840181905561010480548892908110610afa57005b82547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff018355600183018054821790555b50505050919050565b6000918252602080832090910182905587825261010390526040812081815560018181018390556002909101919091559450610bde565b5090565b01546000145b15610c8757600180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0190555b60018054118015610c2857506001546002906101008110610c2257005b0154600014155b15610c56576001016104f8565b60015481108015610cab57506001546002906101008110610ca457005b0154600014155b8015610cc657506002816101008110610cc057005b01546000145b15610cdf576001546002906101008110610ce457005b01555b6104ed565b01546002826101008110610cf457005b01558061010260006002836101008110610d0a57005b0154815260208101919091526040016000908120919091556001546002906101008110610cdc57005b156108b65761010754610d495b62015180420490565b1115610d6257600061010555610d5d610d40565b610107555b6101055480830110158015610d805750610105546101065490830111155b15610d96575061010580548201905560016108b6565b5060006108b6565b6104946101045460005b81811015610e4757610104805482908110610e8f57005b6000918252602080832090910154835282810193909352604091909101812080547fffffffffffffffffffffffff0000000000000000000000000000000000000000168155600181018290556002810180548382559083528383209193601f91909101048101905b80821115610e3b5760008155600101610e27565b505050506001016103f6565b61010480546000808355919091527f4c0be60200faa20559308cb7b5a1bb3255c16cb1cab91f525b5ae7a03d02fabe908101905b808211156103955760008155600101610e7b565b6000918252602082200154141515610ee15761010480546101039160009184908110610eb757005b60009182526020808320909101548352820192909252604001812081815560018101829055600201555b600101610da856", "nonce" : "0x00", "storage" : { "0x00" : "0x01", From 93c8024ecc5764fd5d3c18106a91ad2205a6ab49 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 26 May 2015 13:57:13 +0200 Subject: [PATCH 353/461] Bug fix: - debug: clear local variables list when getting out of a function. - small ui changes. --- mix/ClientModel.cpp | 3 +++ mix/qml/DebuggerPaneStyle.qml | 2 ++ mix/qml/QIntTypeView.qml | 14 +++++++------- mix/qml/StructView.qml | 15 +++++++++++++++ mix/qml/VariablesView.qml | 2 +- 5 files changed, 28 insertions(+), 8 deletions(-) diff --git a/mix/ClientModel.cpp b/mix/ClientModel.cpp index 6b5242084..238fa5372 100644 --- a/mix/ClientModel.cpp +++ b/mix/ClientModel.cpp @@ -484,7 +484,10 @@ void ClientModel::showDebuggerForTransaction(ExecutionResult const& _t) if (!functionName.isEmpty() && ((prevInstruction.getJumpType() == AssemblyItem::JumpType::IntoFunction) || solCallStack.empty())) solCallStack.push_front(QVariant::fromValue(functionName)); else if (prevInstruction.getJumpType() == AssemblyItem::JumpType::OutOfFunction && !solCallStack.empty()) + { solCallStack.pop_front(); + solLocals.clear(); + } } //format solidity context values diff --git a/mix/qml/DebuggerPaneStyle.qml b/mix/qml/DebuggerPaneStyle.qml index db8bbe253..0087b466f 100644 --- a/mix/qml/DebuggerPaneStyle.qml +++ b/mix/qml/DebuggerPaneStyle.qml @@ -9,6 +9,8 @@ QtObject { property QtObject general: QtObject { property int basicFontSize: absoluteSize(-2) + property string basicColor: "#4a4a4a" + property string basicFont: "monospace" property int dataDumpFontSize: absoluteSize(-3) } } diff --git a/mix/qml/QIntTypeView.qml b/mix/qml/QIntTypeView.qml index eacef74e8..a3c67aafc 100644 --- a/mix/qml/QIntTypeView.qml +++ b/mix/qml/QIntTypeView.qml @@ -5,24 +5,24 @@ Item property alias value: textinput.text property alias readOnly: textinput.readOnly id: editRoot - height: 20 width: readOnly ? textinput.implicitWidth : 150 - SourceSansProBold - { - id: boldFont + DebuggerPaneStyle { + id: dbgStyle } Rectangle { anchors.fill: parent radius: 4 TextInput { + anchors.verticalCenter: parent.verticalCenter id: textinput - text: value - anchors.fill: parent - font.family: boldFont.name + font.family: dbgStyle.general.basicFont clip: true selectByMouse: true + text: value + font.pointSize: dbgStyle.general.basicFontSize + color: dbgStyle.general.basicColor } } } diff --git a/mix/qml/StructView.qml b/mix/qml/StructView.qml index cb38ba5ed..029fd162d 100644 --- a/mix/qml/StructView.qml +++ b/mix/qml/StructView.qml @@ -13,6 +13,11 @@ Column property string context Layout.fillWidth: true spacing: 0 + + DebuggerPaneStyle { + id: dbgStyle + } + Repeater { id: repeater @@ -29,6 +34,9 @@ Column id: typeLabel text: modelData.type.name anchors.verticalCenter: parent.verticalCenter + font.family: dbgStyle.general.basicFont + color: dbgStyle.general.basicColor + font.pointSize: dbgStyle.general.basicFontSize } DefaultLabel { @@ -36,6 +44,9 @@ Column id: nameLabel text: modelData.name anchors.verticalCenter: parent.verticalCenter + font.family: dbgStyle.general.basicFont + color: dbgStyle.general.basicColor + font.pointSize: dbgStyle.general.basicFontSize } DefaultLabel { @@ -43,7 +54,11 @@ Column id: equalLabel text: "=" anchors.verticalCenter: parent.verticalCenter + font.family: dbgStyle.general.basicFont + color: dbgStyle.general.basicColor + font.pointSize: dbgStyle.general.basicFontSize } + Loader { id: typeLoader diff --git a/mix/qml/VariablesView.qml b/mix/qml/VariablesView.qml index 6603bd24e..aec629853 100644 --- a/mix/qml/VariablesView.qml +++ b/mix/qml/VariablesView.qml @@ -18,7 +18,7 @@ DebugInfoList property alias members: typeLoader.members; property alias value: typeLoader.value; anchors.fill: parent - anchors.rightMargin: 8 + anchors.leftMargin: 10 StructView { id: typeLoader From 62282c42042fddf9dea5b0bd86b1ee938129daf7 Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Tue, 26 May 2015 14:44:26 +0200 Subject: [PATCH 354/461] fix blockhashOutOfRange test --- test/libethereum/StateTestsFiller/stBlockHashTestFiller.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/libethereum/StateTestsFiller/stBlockHashTestFiller.json b/test/libethereum/StateTestsFiller/stBlockHashTestFiller.json index 3f32282e0..5c5492e64 100644 --- a/test/libethereum/StateTestsFiller/stBlockHashTestFiller.json +++ b/test/libethereum/StateTestsFiller/stBlockHashTestFiller.json @@ -64,7 +64,7 @@ "storage": {} }, "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { - "balance" : "1000000", + "balance" : "3850000", "nonce" : "0", "code" : "", "storage": {} From 39c5cc45d49b9f23116164164109ed4c45329154 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 26 May 2015 14:56:18 +0200 Subject: [PATCH 355/461] fix #2012 --- eth/main.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/eth/main.cpp b/eth/main.cpp index a57928e72..4ac462d64 100644 --- a/eth/main.cpp +++ b/eth/main.cpp @@ -628,7 +628,7 @@ int main(int argc, char** argv) nodeMode == NodeMode::Full ? set{"eth"/*, "shh"*/} : set(), netPrefs, &nodesState); - + auto toNumber = [&](string const& s) -> unsigned { if (s == "latest") return web3.ethereum()->number(); @@ -693,15 +693,18 @@ int main(int argc, char** argv) } if (keyManager.exists()) - while (masterPassword.empty()) - { - masterPassword = getPassword("Please enter your MASTER password: "); - if (!keyManager.load(masterPassword)) + if (!masterPassword.empty()) + keyManager.load(masterPassword); + else + while (masterPassword.empty()) { - cout << "Password invalid. Try again." << endl; - masterPassword.clear(); + masterPassword = getPassword("Please enter your MASTER password: "); + if (!keyManager.load(masterPassword)) + { + cout << "Password invalid. Try again." << endl; + masterPassword.clear(); + } } - } else { while (masterPassword.empty()) From 65cbeafd583ec9ca664d92a58674b99bdc45dca1 Mon Sep 17 00:00:00 2001 From: lotrf3 Date: Tue, 26 May 2015 14:09:15 -0500 Subject: [PATCH 356/461] Ensure dependencies are conditional on Windows --- alethzero/CMakeLists.txt | 4 +++- eth/CMakeLists.txt | 4 +++- test/CMakeLists.txt | 4 +++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/alethzero/CMakeLists.txt b/alethzero/CMakeLists.txt index 9738ec765..56ab82228 100644 --- a/alethzero/CMakeLists.txt +++ b/alethzero/CMakeLists.txt @@ -42,7 +42,9 @@ eth_add_executable(${EXECUTABLE} add_dependencies(${EXECUTABLE} BuildInfo.h) -target_link_libraries(${EXECUTABLE} Iphlpapi) +if((WIN32) + target_link_libraries(${EXECUTABLE} Iphlpapi) +endif() target_link_libraries(${EXECUTABLE} Qt5::Core) target_link_libraries(${EXECUTABLE} Qt5::Widgets) target_link_libraries(${EXECUTABLE} Qt5::WebEngine) diff --git a/eth/CMakeLists.txt b/eth/CMakeLists.txt index 7246ea54e..416155687 100644 --- a/eth/CMakeLists.txt +++ b/eth/CMakeLists.txt @@ -19,7 +19,9 @@ add_executable(${EXECUTABLE} ${SRC_LIST} ${HEADERS}) add_dependencies(${EXECUTABLE} BuildInfo.h) -target_link_libraries(${EXECUTABLE} Iphlpapi) +if((WIN32) + target_link_libraries(${EXECUTABLE} Iphlpapi) +endif() target_link_libraries(${EXECUTABLE} ${Boost_REGEX_LIBRARIES}) if (READLINE_FOUND) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index be24ea115..a3b3188a9 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -69,7 +69,9 @@ endforeach(file) file(GLOB HEADERS "*.h") add_executable(testeth ${SRC_LIST} ${HEADERS}) -target_link_libraries(testeth Iphlpapi) +if((WIN32) + target_link_libraries(testeth Iphlpapi) +endif() target_link_libraries(testeth ${Boost_UNIT_TEST_FRAMEWORK_LIBRARIES}) target_link_libraries(testeth ${CURL_LIBRARIES}) target_link_libraries(testeth ethereum) From 192e8e19f2023c980a2a4b936a58cd967b768573 Mon Sep 17 00:00:00 2001 From: lotrf3 Date: Tue, 26 May 2015 14:24:58 -0500 Subject: [PATCH 357/461] Fix dumbest syntax error ever --- alethzero/CMakeLists.txt | 2 +- eth/CMakeLists.txt | 2 +- test/CMakeLists.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/alethzero/CMakeLists.txt b/alethzero/CMakeLists.txt index 56ab82228..bda66ede2 100644 --- a/alethzero/CMakeLists.txt +++ b/alethzero/CMakeLists.txt @@ -42,7 +42,7 @@ eth_add_executable(${EXECUTABLE} add_dependencies(${EXECUTABLE} BuildInfo.h) -if((WIN32) +if(WIN32) target_link_libraries(${EXECUTABLE} Iphlpapi) endif() target_link_libraries(${EXECUTABLE} Qt5::Core) diff --git a/eth/CMakeLists.txt b/eth/CMakeLists.txt index 416155687..7396c9ccb 100644 --- a/eth/CMakeLists.txt +++ b/eth/CMakeLists.txt @@ -19,7 +19,7 @@ add_executable(${EXECUTABLE} ${SRC_LIST} ${HEADERS}) add_dependencies(${EXECUTABLE} BuildInfo.h) -if((WIN32) +if(WIN32) target_link_libraries(${EXECUTABLE} Iphlpapi) endif() target_link_libraries(${EXECUTABLE} ${Boost_REGEX_LIBRARIES}) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index a3b3188a9..69a3d51e7 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -69,7 +69,7 @@ endforeach(file) file(GLOB HEADERS "*.h") add_executable(testeth ${SRC_LIST} ${HEADERS}) -if((WIN32) +if(WIN32) target_link_libraries(testeth Iphlpapi) endif() target_link_libraries(testeth ${Boost_UNIT_TEST_FRAMEWORK_LIBRARIES}) From 282a817a2adec8b28c3abf51f845f4fddd3464b7 Mon Sep 17 00:00:00 2001 From: ethdev zug Date: Wed, 27 May 2015 00:46:45 +0100 Subject: [PATCH 358/461] changes required to make miniupnp working on windows --- alethzero/CMakeLists.txt | 3 - cmake/EthCompilerSettings.cmake | 4 +- cmake/EthDependencies.cmake | 7 +- cmake/FindMiniupnpc.cmake | 19 +- cmake/FindWindowsSDK.cmake | 322 ++++++++++++++++++++++++++++++++ eth/CMakeLists.txt | 3 - test/CMakeLists.txt | 3 - 7 files changed, 346 insertions(+), 15 deletions(-) create mode 100644 cmake/FindWindowsSDK.cmake diff --git a/alethzero/CMakeLists.txt b/alethzero/CMakeLists.txt index bda66ede2..595668cd1 100644 --- a/alethzero/CMakeLists.txt +++ b/alethzero/CMakeLists.txt @@ -42,9 +42,6 @@ eth_add_executable(${EXECUTABLE} add_dependencies(${EXECUTABLE} BuildInfo.h) -if(WIN32) - target_link_libraries(${EXECUTABLE} Iphlpapi) -endif() target_link_libraries(${EXECUTABLE} Qt5::Core) target_link_libraries(${EXECUTABLE} Qt5::Widgets) target_link_libraries(${EXECUTABLE} Qt5::WebEngine) diff --git a/cmake/EthCompilerSettings.cmake b/cmake/EthCompilerSettings.cmake index 0d6fd7907..dcf2e19b8 100644 --- a/cmake/EthCompilerSettings.cmake +++ b/cmake/EthCompilerSettings.cmake @@ -37,13 +37,15 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") # disable warning C4535: calling _set_se_translator() requires /EHa (for boost tests) # declare Windows XP requirement # undefine windows.h MAX && MIN macros cause it cause conflicts with std::min && std::max functions - add_compile_options(/MP /EHsc /wd4068 /wd4996 /wd4503 -D_WIN32_WINNT=0x0501 /DNOMINMAX) + # define miniupnp static library + add_compile_options(/MP /EHsc /wd4068 /wd4996 /wd4503 -D_WIN32_WINNT=0x0501 /DNOMINMAX /DMINIUPNP_STATICLIB) # disable empty object file warning set(CMAKE_STATIC_LINKER_FLAGS "${CMAKE_STATIC_LINKER_FLAGS} /ignore:4221") # warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/SAFESEH' specification # warning LNK4099: pdb was not found with lib # stack size 16MB set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /ignore:4099,4075 /STACK:16777216") + # windows likes static if (NOT ETH_STATIC) message("Forcing static linkage for MSVC.") diff --git a/cmake/EthDependencies.cmake b/cmake/EthDependencies.cmake index 7f0578c1f..9a18a98e7 100644 --- a/cmake/EthDependencies.cmake +++ b/cmake/EthDependencies.cmake @@ -23,10 +23,11 @@ set(ETH_SCRIPTS_DIR ${CMAKE_SOURCE_DIR}/cmake/scripts) # TODO use proper version of windows SDK (32 vs 64) # TODO make it possible to use older versions of windows SDK (7.0+ should also work) # TODO it windows SDK is NOT FOUND, throw ERROR +# from https://github.com/rpavlik/cmake-modules/blob/master/FindWindowsSDK.cmake if (WIN32) - set (CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} "C:/Program Files/Windows Kits/8.1/Lib/winv6.3/um/x86") - message(" - Found windows 8.1 SDK") - #set (CMAKE_PREFIX_PATH "C:/Program Files/Windows Kits/8.1/Lib/winv6.3/um/x64") + find_package(WINDOWSSDK REQUIRED) + message(" - WindowsSDK dirs: ${WINDOWSSDK_DIRS}") + set (CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} ${WINDOWSSDK_DIRS}) endif() # homebrew installs qts in opt diff --git a/cmake/FindMiniupnpc.cmake b/cmake/FindMiniupnpc.cmake index 1438a8526..0bf8b5c0f 100644 --- a/cmake/FindMiniupnpc.cmake +++ b/cmake/FindMiniupnpc.cmake @@ -14,17 +14,32 @@ find_path( MINIUPNPC_INCLUDE_DIR NAMES miniupnpc/miniupnpc.h DOC "miniupnpc include dir" - ) +) find_library( MINIUPNPC_LIBRARY NAMES miniupnpc DOC "miniupnpc library" - ) +) set(MINIUPNPC_INCLUDE_DIRS ${MINIUPNPC_INCLUDE_DIR}) set(MINIUPNPC_LIBRARIES ${MINIUPNPC_LIBRARY}) +# debug library on windows +# same naming convention as in QT (appending debug library with d) +# boost is using the same "hack" as us with "optimized" and "debug" +if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") + + find_library( + MINIUPNPC_LIBRARY_DEBUG + NAMES miniupnpcd + DOC "miniupnpc debug library" + ) + + set(MINIUPNPC_LIBRARIES "iphlpapi" optimized ${MINIUPNPC_LIBRARIES} debug ${MINIUPNPC_LIBRARY_DEBUG}) + +endif() + # handle the QUIETLY and REQUIRED arguments and set MINIUPNPC_FOUND to TRUE # if all listed variables are TRUE, hide their existence from configuration view include(FindPackageHandleStandardArgs) diff --git a/cmake/FindWindowsSDK.cmake b/cmake/FindWindowsSDK.cmake new file mode 100644 index 000000000..665a87f04 --- /dev/null +++ b/cmake/FindWindowsSDK.cmake @@ -0,0 +1,322 @@ +# - Find the Windows SDK aka Platform SDK +# +# Relevant Wikipedia article: http://en.wikipedia.org/wiki/Microsoft_Windows_SDK +# +# Variables: +# WINDOWSSDK_FOUND - if any version of the windows or platform SDK was found that is usable with the current version of visual studio +# WINDOWSSDK_LATEST_DIR +# WINDOWSSDK_LATEST_NAME +# WINDOWSSDK_FOUND_PREFERENCE - if we found an entry indicating a "preferred" SDK listed for this visual studio version +# WINDOWSSDK_PREFERRED_DIR +# WINDOWSSDK_PREFERRED_NAME +# +# WINDOWSSDK_DIRS - contains no duplicates, ordered most recent first. +# WINDOWSSDK_PREFERRED_FIRST_DIRS - contains no duplicates, ordered with preferred first, followed by the rest in descending recency +# +# Functions: +# windowssdk_name_lookup( ) - Find the name corresponding with the SDK directory you pass in, or +# NOTFOUND if not recognized. Your directory must be one of WINDOWSSDK_DIRS for this to work. +# +# get_windowssdk_from_component( ) - Given a library or include dir, +# find the Windows SDK root dir corresponding to it, or NOTFOUND if unrecognized. +# +# get_windowssdk_library_dirs( ) - Find the architecture-appropriate +# library directories corresponding to the SDK directory you pass in (or NOTFOUND if none) +# +# get_windowssdk_include_dirs( ) - Find the +# include directories corresponding to the SDK directory you pass in (or NOTFOUND if none) +# +# Requires these CMake modules: +# FindPackageHandleStandardArgs (known included with CMake >=2.6.2) +# +# Original Author: +# 2012 Ryan Pavlik +# http://academic.cleardefinition.com +# Iowa State University HCI Graduate Program/VRAC +# +# Copyright Iowa State University 2012. +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +set(_preferred_sdk_dirs) +set(_win_sdk_dirs) +set(_win_sdk_versanddirs) +if(MSVC_VERSION GREATER 1310) # Newer than VS .NET/VS Toolkit 2003 + + # Environment variable for SDK dir + if(EXISTS "$ENV{WindowsSDKDir}" AND (NOT "$ENV{WindowsSDKDir}" STREQUAL "")) + message(STATUS "Got $ENV{WindowsSDKDir} - Windows/Platform SDK directories: ${_win_sdk_dirs}") + list(APPEND _preferred_sdk_dirs "$ENV{WindowsSDKDir}") + endif() + + if(MSVC_VERSION LESS 1600) + # Per-user current Windows SDK for VS2005/2008 + get_filename_component(_sdkdir + "[HKEY_CURRENT_USER\\Software\\Microsoft\\Microsoft SDKs\\Windows;CurrentInstallFolder]" + ABSOLUTE) + if(EXISTS "${_sdkdir}") + list(APPEND _preferred_sdk_dirs "${_sdkdir}") + endif() + + # System-wide current Windows SDK for VS2005/2008 + get_filename_component(_sdkdir + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows;CurrentInstallFolder]" + ABSOLUTE) + if(EXISTS "${_sdkdir}") + list(APPEND _preferred_sdk_dirs "${_sdkdir}") + endif() + endif() + + if(MSVC_VERSION LESS 1700) + # VC 10 and older has broad target support + set(_winsdk_vistaonly) + else() + # VC 11 by default targets Vista and later only, so we can add a few more SDKs that (might?) only work on vista+ + if("${CMAKE_VS_PLATFORM_TOOLSET}" MATCHES "_xp") + # This is the XP-compatible v110 toolset + elseif("${CMAKE_VS_PLATFORM_TOOLSET}" STREQUAL "v100") + # This is the VS2010 toolset + else() + if(NOT WINDOWSSDK_FOUND AND NOT WindowsSDK_FIND_QUIETLY) + message(STATUS "FindWindowsSDK: Detected Visual Studio 2012 or newer, not using the _xp toolset variant: including SDK versions that drop XP support in search!") + endif() + # These versions have no XP (and possibly Vista pre-SP1) support + set(_winsdk_vistaonly) + if(NOT MSVC_VERSION LESS 1800) + list(APPEND _winsdk_vistaonly + # Windows Software Development Kit (SDK) for Windows 8.1 + # http://msdn.microsoft.com/en-gb/windows/desktop/bg162891 + v8.1) + endif() + list(APPEND _winsdk_vistaonly + # Included in Visual Studio 2012 + v8.0A + + # Microsoft Windows SDK for Windows 8 and .NET Framework 4.5 + # This is the first version to also include the DirectX SDK + # http://msdn.microsoft.com/en-US/windows/desktop/hh852363.aspx + v8.0 + + # Microsoft Windows SDK for Windows 7 and .NET Framework 4 + # http://www.microsoft.com/downloads/en/details.aspx?FamilyID=6b6c21d2-2006-4afa-9702-529fa782d63b + v7.1 + ) + endif() + endif() + foreach(_winsdkver + ${_winsdk_vistaonly} + + # Included in Visual Studio 2013 + # Includes the v120_xp toolset + v8.1A + + # Included with VS 2012 Update 1 or later + # Introduces v110_xp toolset + v7.1A + + # Included with VS 2010 + v7.0A + + # Windows SDK for Windows 7 and .NET Framework 3.5 SP1 + # Works with VC9 + #http://www.microsoft.com/en-us/download/details.aspx?id=18950 + v7.0 + + # Two versions call themselves "v6.1": + # Older: + # Windows Vista Update & .NET 3.0 SDK + # http://www.microsoft.com/en-us/download/details.aspx?id=14477 + + # Newer: + # Windows Server 2008 & .NET 3.5 SDK + # may have broken VS9SP1? they recommend v7.0 instead, or a KB... + # http://www.microsoft.com/en-us/download/details.aspx?id=24826 + v6.1 + + # Included in VS 2008 + v6.0A + + # Microsoft Windows Software Development Kit for Windows Vista and .NET Framework 3.0 Runtime Components + # http://blogs.msdn.com/b/stanley/archive/2006/11/08/microsoft-windows-software-development-kit-for-windows-vista-and-net-framework-3-0-runtime-components.aspx + v6.0) + + get_filename_component(_sdkdir + "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\${_winsdkver};InstallationFolder]" + ABSOLUTE) + if(EXISTS "${_sdkdir}") + list(APPEND _win_sdk_dirs "${_sdkdir}") + list(APPEND + _win_sdk_versanddirs + "Windows SDK ${_winsdkver}" + "${_sdkdir}") + endif() + endforeach() +endif() +if(MSVC_VERSION GREATER 1200) + foreach(_platformsdkinfo + "D2FF9F89-8AA2-4373-8A31-C838BF4DBBE1_Microsoft Platform SDK for Windows Server 2003 R2" + "8F9E5EF3-A9A5-491B-A889-C58EFFECE8B3_Microsoft Platform SDK for Windows Server 2003 SP1") + string(SUBSTRING "${_platformsdkinfo}" 0 36 _platformsdkguid) + string(SUBSTRING "${_platformsdkinfo}" 37 -1 _platformsdkname) + foreach(HIVE HKEY_LOCAL_MACHINE HKEY_CURRENT_USER) + get_filename_component(_sdkdir + "[${HIVE}\\SOFTWARE\\Microsoft\\MicrosoftSDK\\InstalledSDKs\\${_platformsdkguid};Install Dir]" + ABSOLUTE) + if(EXISTS "${_sdkdir}") + list(APPEND _win_sdk_dirs "${_sdkdir}") + list(APPEND _win_sdk_versanddirs "${_platformsdkname}" "${_sdkdir}") + endif() + endforeach() + endforeach() +endif() + +set(_win_sdk_versanddirs + "${_win_sdk_versanddirs}" + CACHE + INTERNAL + "mapping between windows sdk version locations and names" + FORCE) + +function(windowssdk_name_lookup _dir _outvar) + list(FIND _win_sdk_versanddirs "${_dir}" _diridx) + math(EXPR _nameidx "${_diridx} - 1") + if(${_nameidx} GREATER -1) + list(GET _win_sdk_versanddirs ${_nameidx} _sdkname) + else() + set(_sdkname "NOTFOUND") + endif() + set(${_outvar} "${_sdkname}" PARENT_SCOPE) +endfunction() + +if(_win_sdk_dirs) + # Remove duplicates + list(REMOVE_DUPLICATES _win_sdk_dirs) + list(GET _win_sdk_dirs 0 WINDOWSSDK_LATEST_DIR) + windowssdk_name_lookup("${WINDOWSSDK_LATEST_DIR}" + WINDOWSSDK_LATEST_NAME) + set(WINDOWSSDK_DIRS ${_win_sdk_dirs}) +endif() +if(_preferred_sdk_dirs) + list(GET _preferred_sdk_dirs 0 WINDOWSSDK_PREFERRED_DIR) + windowssdk_name_lookup("${WINDOWSSDK_LATEST_DIR}" + WINDOWSSDK_PREFERRED_NAME) + set(WINDOWSSDK_PREFERRED_FIRST_DIRS + ${_preferred_sdk_dirs} + ${_win_sdk_dirs}) + list(REMOVE_DUPLICATES WINDOWSSDK_PREFERRED_FIRST_DIRS) + set(WINDOWSSDK_FOUND_PREFERENCE ON) + + # In case a preferred dir was found that isn't found otherwise + #set(WINDOWSSDK_DIRS ${WINDOWSSDK_DIRS} ${WINDOWSSDK_PREFERRED_FIRST_DIRS}) + #list(REMOVE_DUPLICATES WINDOWSSDK_DIRS) +else() + set(WINDOWSSDK_PREFERRED_DIR "${WINDOWSSDK_LATEST_DIR}") + set(WINDOWSSDK_PREFERRED_NAME "${WINDOWSSDK_LATEST_NAME}") + set(WINDOWSSDK_PREFERRED_FIRST_DIRS ${WINDOWSSDK_DIRS}) + set(WINDOWSSDK_FOUND_PREFERENCE OFF) +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(WindowsSDK + "No compatible version of the Windows SDK or Platform SDK found." + WINDOWSSDK_DIRS) + +if(WINDOWSSDK_FOUND) + if(NOT _winsdk_remembered_dirs STREQUAL WINDOWSSDK_DIRS) + set(_winsdk_remembered_dirs + "${WINDOWSSDK_DIRS}" + CACHE + INTERNAL + "" + FORCE) + if(NOT WindowsSDK_FIND_QUIETLY) + foreach(_sdkdir ${WINDOWSSDK_DIRS}) + windowssdk_name_lookup("${_sdkdir}" _sdkname) + message(STATUS " - Found ${_sdkname} at ${_sdkdir}") + endforeach() + endif() + endif() + + # Internal: Architecture-appropriate library directory names. + if("${CMAKE_VS_PLATFORM_NAME}" STREQUAL "ARM") + set(_winsdk_archbare /arm) # what the architecture used to be called in oldest SDKs + set(_winsdk_arch arm) # what the architecture used to be called + set(_winsdk_arch8 arm) # what the WDK for Win8+ calls this architecture + else() + if(CMAKE_SIZEOF_VOID_P MATCHES "8") + set(_winsdk_archbare /x64) # what the architecture used to be called in oldest SDKs + set(_winsdk_arch amd64) # what the architecture used to be called + set(_winsdk_arch8 x64) # what the WDK for Win8+ calls this architecture + else() + set(_winsdk_archbare ) # what the architecture used to be called in oldest SDKs + set(_winsdk_arch i386) # what the architecture used to be called + set(_winsdk_arch8 x86) # what the WDK for Win8+ calls this architecture + endif() + endif() + + function(get_windowssdk_from_component _component _var) + get_filename_component(_component "${_component}" ABSOLUTE) + file(TO_CMAKE_PATH "${_component}" _component) + foreach(_sdkdir ${WINDOWSSDK_DIRS}) + get_filename_component(_sdkdir "${_sdkdir}" ABSOLUTE) + string(LENGTH "${_sdkdir}" _sdklen) + file(RELATIVE_PATH _rel "${_sdkdir}" "${_component}") + # If we don't have any "parent directory" items... + if(NOT "${_rel}" MATCHES "[.][.]") + set(${_var} "${_sdkdir}" PARENT_SCOPE) + return() + endif() + endforeach() + # Fail. + set(${_var} "NOTFOUND" PARENT_SCOPE) + endfunction() + function(get_windowssdk_library_dirs _winsdk_dir _var) + set(_result) + foreach(_suffix + "lib${_winsdk_archbare}" # SDKs like 7.1A + "lib/w2k/${_winsdk_arch}" # Win2k min requirement + "lib/wxp/${_winsdk_arch}" # WinXP min requirement + "lib/wnet/${_winsdk_arch}" # Win Server 2003 min requirement + "lib/wlh/${_winsdk_arch}" # Win Vista ("Long Horn") min requirement + "lib/wlh/um/${_winsdk_arch8}" # Win Vista ("Long Horn") min requirement + "lib/win7/${_winsdk_arch}" # Win 7 min requirement + "lib/win7/um/${_winsdk_arch8}" # Win 7 min requirement + "lib/win8/um/${_winsdk_arch8}" # Win 8 min requirement + "lib/win8/km/${_winsdk_arch8}" # Win 8 min requirement + "lib/winv6.3/km/${_winsdk_arch8}" # Win 8.1 min requirement + "lib/winv6.3/um/${_winsdk_arch8}" # Win 8.1 min requirement + ) + # Check to see if a library actually exists here. + file(GLOB _libs "${_winsdk_dir}/${_suffix}/*.lib") + if(_libs) + list(APPEND _result "${_winsdk_dir}/${_suffix}") + endif() + endforeach() + if(NOT _result) + set(_result NOTFOUND) + endif() + set(${_var} ${_result} PARENT_SCOPE) + endfunction() + function(get_windowssdk_include_dirs _winsdk_dir _var) + set(_result) + foreach(_suffix + "Include" + "Include/shared" + "Include/um" + "Include/winrt" + "Include/km" + "Include/wdf" + ) + # Check to see if a header file actually exists here. + file(GLOB _headers "${_winsdk_dir}/${_suffix}/*.h") + if(_headers) + list(APPEND _result "${_winsdk_dir}/${_suffix}") + endif() + endforeach() + if(NOT _result) + set(_result NOTFOUND) + endif() + set(${_var} ${_result} PARENT_SCOPE) + endfunction() +endif() diff --git a/eth/CMakeLists.txt b/eth/CMakeLists.txt index 7396c9ccb..d317be28a 100644 --- a/eth/CMakeLists.txt +++ b/eth/CMakeLists.txt @@ -19,9 +19,6 @@ add_executable(${EXECUTABLE} ${SRC_LIST} ${HEADERS}) add_dependencies(${EXECUTABLE} BuildInfo.h) -if(WIN32) - target_link_libraries(${EXECUTABLE} Iphlpapi) -endif() target_link_libraries(${EXECUTABLE} ${Boost_REGEX_LIBRARIES}) if (READLINE_FOUND) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 69a3d51e7..39a235c58 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -69,9 +69,6 @@ endforeach(file) file(GLOB HEADERS "*.h") add_executable(testeth ${SRC_LIST} ${HEADERS}) -if(WIN32) - target_link_libraries(testeth Iphlpapi) -endif() target_link_libraries(testeth ${Boost_UNIT_TEST_FRAMEWORK_LIBRARIES}) target_link_libraries(testeth ${CURL_LIBRARIES}) target_link_libraries(testeth ethereum) From 61cb005e8cc954b6bb8797fd902c153573a63498 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 27 May 2015 13:37:00 +0200 Subject: [PATCH 359/461] - Functional gas estimation - bug fix: misselected address for input parameter --- mix/ClientModel.cpp | 2 +- mix/CodeModel.cpp | 22 +++++++++++++++++++--- mix/CodeModel.h | 6 ++++-- mix/qml/html/cm/inkpot.css | 8 ++++++++ mix/qml/html/codeeditor.js | 32 ++++++++++++++++++++++++++------ 5 files changed, 58 insertions(+), 12 deletions(-) diff --git a/mix/ClientModel.cpp b/mix/ClientModel.cpp index 238fa5372..cad210f1b 100644 --- a/mix/ClientModel.cpp +++ b/mix/ClientModel.cpp @@ -331,7 +331,7 @@ void ClientModel::executeSequence(vector const& _sequence, { QSolidityType const* type = p->type(); QVariant value = transaction.parameterValues.value(p->name()); - if (type->type().type == SolidityType::Type::Address) + if (type->type().type == SolidityType::Type::Address && value.toString().startsWith("<")) { std::pair ctrParamInstance = resolvePair(value.toString()); value = QVariant(resolveToken(ctrParamInstance, deployedContracts)); diff --git a/mix/CodeModel.cpp b/mix/CodeModel.cpp index 2b4e332c0..de1bb8647 100644 --- a/mix/CodeModel.cpp +++ b/mix/CodeModel.cpp @@ -380,7 +380,23 @@ void CodeModel::gasEstimation(solidity::CompilerStack const& _cs) GasMeter::GasConsumption cost = gasItem->second; std::stringstream v; v << cost.value; - m_gasCostsMaps->push(sourceName, location.start, location.end, QString::fromStdString(v.str()), cost.isInfinite); + m_gasCostsMaps->push(sourceName, location.start, location.end, QString::fromStdString(v.str()), cost.isInfinite, "statement"); + } + + if (contractDefinition.getConstructor() != nullptr) + { + GasMeter::GasConsumption cost = GasEstimator::functionalEstimation(*_cs.getRuntimeAssemblyItems(n), contractDefinition.getConstructor()->externalSignature()); + std::stringstream v; + v << cost.value; + m_gasCostsMaps->push(sourceName, contractDefinition.getConstructor()->getLocation().start, contractDefinition.getConstructor()->getLocation().end, QString::fromStdString(v.str()), cost.isInfinite, "constructor"); + } + + for (auto func: contractDefinition.getDefinedFunctions()) + { + GasMeter::GasConsumption cost = GasEstimator::functionalEstimation(*_cs.getRuntimeAssemblyItems(n), func->externalSignature()); + std::stringstream v; + v << cost.value; + m_gasCostsMaps->push(sourceName, func->getLocation().start, func->getLocation().end, QString::fromStdString(v.str()), cost.isInfinite, "function"); } } } @@ -583,9 +599,9 @@ QString CodeModel::resolveFunctionName(dev::SourceLocation const& _location) return QString(); } -void GasMapWrapper::push(QString _source, int _start, int _end, QString _value, bool _isInfinite) +void GasMapWrapper::push(QString _source, int _start, int _end, QString _value, bool _isInfinite, QString _payload) { - GasMap* gas = new GasMap(_start, _end, _value, _isInfinite, this); + GasMap* gas = new GasMap(_start, _end, _value, _isInfinite, _payload, this); m_gasMaps.find(_source).value().push_back(QVariant::fromValue(gas)); } diff --git a/mix/CodeModel.h b/mix/CodeModel.h index dcf3d0c1e..5982982b3 100644 --- a/mix/CodeModel.h +++ b/mix/CodeModel.h @@ -138,7 +138,7 @@ class GasMapWrapper: public QObject public: GasMapWrapper(QObject* _parent = nullptr): QObject(_parent){} - void push(QString _source, int _start, int _end, QString _value, bool _isInfinite); + void push(QString _source, int _start, int _end, QString _value, bool _isInfinite, QString _payload); bool contains(QString _key); void insert(QString _source, QVariantList _variantList); QVariantList gasCostsByDocId(QString _source); @@ -155,14 +155,16 @@ class GasMap: public QObject Q_PROPERTY(int end MEMBER m_end CONSTANT) Q_PROPERTY(QString gas MEMBER m_gas CONSTANT) Q_PROPERTY(bool isInfinite MEMBER m_isInfinite CONSTANT) + Q_PROPERTY(QString payload MEMBER m_payload CONSTANT) public: - GasMap(int _start, int _end, QString _gas, bool _isInfinite, QObject* _parent): QObject(_parent), m_start(_start), m_end(_end), m_gas(_gas), m_isInfinite(_isInfinite) {} + GasMap(int _start, int _end, QString _gas, bool _isInfinite, QString _payload, QObject* _parent): QObject(_parent), m_start(_start), m_end(_end), m_gas(_gas), m_isInfinite(_isInfinite), m_payload(_payload) {} int m_start; int m_end; QString m_gas; bool m_isInfinite; + QString m_payload; }; /// Code compilation model. Compiles contracts in background an provides compiled contract data diff --git a/mix/qml/html/cm/inkpot.css b/mix/qml/html/cm/inkpot.css index 6a2d8d63a..b31e20ad8 100644 --- a/mix/qml/html/cm/inkpot.css +++ b/mix/qml/html/cm/inkpot.css @@ -68,3 +68,11 @@ span.CodeMirror-selectedtext { color: #ffffff !important; } font-size: 12px; } +.CodeMirror-gasCost +{ + font-family: monospace; + font-size: 14px; + color: #409090; + text-shadow: none !important; + margin-left: 5px; +} diff --git a/mix/qml/html/codeeditor.js b/mix/qml/html/codeeditor.js index 6af8ff131..151eb2c29 100644 --- a/mix/qml/html/codeeditor.js +++ b/mix/qml/html/codeeditor.js @@ -210,9 +210,9 @@ setFontSize = function(size) makeGasCostMarker = function(value) { var marker = document.createElement("div"); - marker.style.color = "#822"; + //marker.style.color = "#822"; marker.innerHTML = value; - marker.className = "CodeMirror-errorannotation-context"; + marker.className = "CodeMirror-gasCost"; return marker; }; @@ -252,8 +252,23 @@ displayGasEstimation = function(show) else color = colorGradient[colorIndex]; var className = "CodeMirror-gasCosts" + i; - var line = editor.posFromIndex(gasCosts[i].start) - gasMarkText.push(editor.markText(line, editor.posFromIndex(gasCosts[i].end), { inclusiveLeft: true, inclusiveRight: true, handleMouseEvents: true, className: className, css: "background-color:" + color })); + var line = editor.posFromIndex(gasCosts[i].start); + var endChar; + if (gasCosts[i].payload === "statement") + { + endChar = editor.posFromIndex(gasCosts[i].end); + gasMarkText.push({ line: line, markText: editor.markText(line, endChar, { inclusiveLeft: true, inclusiveRight: true, handleMouseEvents: true, className: className, css: "background-color:" + color })}); + } + else if (gasCosts[i].payload === "function" || gasCosts[i].payload === "constructor") + { + var l = editor.getLine(line.line); + endChar = { line: line.line, ch: line.ch + l.length }; + var marker = document.createElement("div"); + marker.innerHTML = " max execution cost: " + gasCosts[i].gas + " gas"; + marker.className = "CodeMirror-gasCost"; + editor.addWidget(endChar, marker, false, "over"); + gasMarkText.push({ line: line.line, widget: marker }); + } gasMarkRef[className] = { line: line.line, value: gasCosts[i] }; } } @@ -275,7 +290,12 @@ function clearGasMark() { if (gasMarkText) for (var k in gasMarkText) - gasMarkText[k].clear(); + { + if (gasMarkText[k] && gasMarkText[k].markText) + gasMarkText[k].markText.clear(); + if (gasMarkText[k] && gasMarkText[k].widget) + gasMarkText[k].widget.remove(); + } } var gasAnnotation; @@ -290,7 +310,7 @@ function listenMouseOver(e) gasAnnotation.clear(); var cl = getGasCostClass(node); var gasTitle = gasMarkRef[cl].value.isInfinite ? "infinite" : gasMarkRef[cl].value.gas; - gasTitle = gasTitle + " gas"; + gasTitle = " execution cost: " + gasTitle + " gas"; gasAnnotation = editor.addLineWidget(gasMarkRef[cl].line + 1, makeGasCostMarker(gasTitle), { coverGutter: false, above: true }); } else if (gasAnnotation) From 49d5c630e4b8e2f615674e8be63be9cdc23afbbb Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 27 May 2015 13:41:09 +0200 Subject: [PATCH 360/461] small change --- mix/qml/html/codeeditor.js | 1 - 1 file changed, 1 deletion(-) diff --git a/mix/qml/html/codeeditor.js b/mix/qml/html/codeeditor.js index 151eb2c29..cabab107b 100644 --- a/mix/qml/html/codeeditor.js +++ b/mix/qml/html/codeeditor.js @@ -210,7 +210,6 @@ setFontSize = function(size) makeGasCostMarker = function(value) { var marker = document.createElement("div"); - //marker.style.color = "#822"; marker.innerHTML = value; marker.className = "CodeMirror-gasCost"; return marker; From 61318ba3ab7ff3414046261e537dc408284ecc08 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Wed, 27 May 2015 20:21:58 +0800 Subject: [PATCH 361/461] Bad blocks get good treatment. --- alethzero/MainWin.cpp | 2 +- ethkey/KeyAux.h | 42 +++++++++++----- libdevcore/TrieHash.cpp | 2 - libethcore/Common.cpp | 23 +++++++++ libethcore/Common.h | 5 ++ libethcore/Ethash.cpp | 16 +++++-- libethereum/BlockQueue.cpp | 50 +++++++++++++++++-- libethereum/Executive.cpp | 18 +++++++ libethereum/Executive.h | 3 ++ libethereum/State.cpp | 98 ++++++++++++++++++++++++-------------- libethereum/State.h | 5 +- 11 files changed, 204 insertions(+), 60 deletions(-) diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index 6a11736a4..3a67fc3ae 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -1899,7 +1899,7 @@ void Main::on_net_triggered() { web3()->setIdealPeerCount(ui->idealPeers->value()); web3()->setNetworkPreferences(netPrefs(), ui->dropPeers->isChecked()); - ethereum()->setNetworkId(m_privateChain.size() ? sha3(m_privateChain.toStdString()) : h256()); + ethereum()->setNetworkId(m_privateChain.size() ? sha3(m_privateChain.toStdString()) : h256(u256(42))); web3()->startNetwork(); ui->downloadView->setDownloadMan(ethereum()->downloadMan()); ui->enode->setText(QString::fromStdString(web3()->enode())); diff --git a/ethkey/KeyAux.h b/ethkey/KeyAux.h index df2ba5a5a..639e1d4f4 100644 --- a/ethkey/KeyAux.h +++ b/ethkey/KeyAux.h @@ -97,6 +97,7 @@ public: ExportBare, RecodeBare, KillBare, + InspectBare, CreateWallet, List, New, @@ -137,6 +138,8 @@ public: m_mode = OperationMode::ListBare; else if (arg == "--export-bare") m_mode = OperationMode::ExportBare; + else if (arg == "--inspect-bare") + m_mode = OperationMode::InspectBare; else if (arg == "--recode-bare") m_mode = OperationMode::RecodeBare; else if (arg == "--kill-bare") @@ -162,7 +165,7 @@ public: m_mode = OperationMode::Recode; else if (arg == "--no-icap") m_icap = false; - else if (m_mode == OperationMode::ImportBare || m_mode == OperationMode::KillBare || m_mode == OperationMode::Recode || m_mode == OperationMode::Export || m_mode == OperationMode::RecodeBare || m_mode == OperationMode::ExportBare) + else if (m_mode == OperationMode::ImportBare || m_mode == OperationMode::InspectBare || m_mode == OperationMode::KillBare || m_mode == OperationMode::Recode || m_mode == OperationMode::Export || m_mode == OperationMode::RecodeBare || m_mode == OperationMode::ExportBare) m_inputs.push_back(arg); else return false; @@ -224,7 +227,7 @@ public: } if (!u && b.size() == 32) u = store.importSecret(b, lockPassword(toAddress(Secret(b)).abridged())); - else + if (!u) { cerr << "Cannot import " << i << " not a file or secret." << endl; continue; @@ -232,28 +235,43 @@ public: cout << "Successfully imported " << i << " as " << toUUID(u); } break; + case OperationMode::InspectBare: + for (auto const& i: m_inputs) + if (!contents(i).empty()) + { + h128 u = store.readKey(i, false); + bytes s = store.secret(u, [&](){ return getPassword("Enter password for key " + i + ": "); }); + cout << "Key " << i << ":" << endl; + cout << " UUID: " << toUUID(u) << ":" << endl; + cout << " Address: " << toAddress(Secret(s)).hex() << endl; + cout << " Secret: " << Secret(s).abridged() << endl; + } + else if (h128 u = fromUUID(i)) + { + bytes s = store.secret(u, [&](){ return getPassword("Enter password for key " + toUUID(u) + ": "); }); + cout << "Key " << i << ":" << endl; + cout << " Address: " << toAddress(Secret(s)).hex() << endl; + cout << " Secret: " << Secret(s).abridged() << endl; + } + else + cerr << "Couldn't inspect " << i << "; not found." << endl; + break; case OperationMode::ExportBare: break; case OperationMode::RecodeBare: for (auto const& i: m_inputs) - { - h128 u = fromUUID(i); - if (u) + if (h128 u = fromUUID(i)) if (store.recode(u, lockPassword(toUUID(u)), [&](){ return getPassword("Enter password for key " + toUUID(u) + ": "); }, kdf())) cerr << "Re-encoded " << toUUID(u) << endl; else cerr << "Couldn't re-encode " << toUUID(u) << "; key corrupt or incorrect password supplied." << endl; else - cerr << "Couldn't re-encode " << toUUID(u) << "; not found." << endl; - } + cerr << "Couldn't re-encode " << i << "; not found." << endl; case OperationMode::KillBare: for (auto const& i: m_inputs) - { - h128 u = fromUUID(i); - if (u) + if (h128 u = fromUUID(i)) store.kill(u); else - cerr << "Couldn't kill " << toUUID(u) << "; not found." << endl; - } + cerr << "Couldn't kill " << i << "; not found." << endl; break; default: break; } diff --git a/libdevcore/TrieHash.cpp b/libdevcore/TrieHash.cpp index cff3464b5..ec31c3679 100644 --- a/libdevcore/TrieHash.cpp +++ b/libdevcore/TrieHash.cpp @@ -23,10 +23,8 @@ #include #include // @TODO replace ASAP! #include -#include using namespace std; using namespace dev; -using namespace dev::eth; namespace dev { diff --git a/libethcore/Common.cpp b/libethcore/Common.cpp index 56db647f3..11034b0ae 100644 --- a/libethcore/Common.cpp +++ b/libethcore/Common.cpp @@ -104,5 +104,28 @@ std::string formatBalance(bigint const& _b) return ret.str(); } +static void badBlockInfo(BlockInfo const& _bi, string const& _err) +{ + cwarn << EthRedBold << "========================================================================"; + cwarn << EthRedBold << "== Software Failure " + _err + string(max(0, 44 - _err.size()), ' ') + " =="; + string bin = toString(_bi.number); + cwarn << EthRedBold << ("== Guru Meditation #" + string(max(0, 8 - bin.size()), '0') + bin + "." + _bi.hash().abridged() + " =="); + cwarn << EthRedBold << "========================================================================"; +} + +void badBlock(bytesConstRef _block, string const& _err) +{ + badBlockInfo(BlockInfo(_block, CheckNothing), _err); + cwarn << " Block:" << toHex(_block); + cwarn << " Block RLP:" << RLP(_block); +} + +void badBlockHeader(bytesConstRef _header, string const& _err) +{ + badBlockInfo(BlockInfo::fromHeader(_header, CheckNothing), _err); + cwarn << " Header:" << toHex(_header); + cwarn << " Header RLP:" << RLP(_header);; +} + } } diff --git a/libethcore/Common.h b/libethcore/Common.h index 2cb505905..1d48803cb 100644 --- a/libethcore/Common.h +++ b/libethcore/Common.h @@ -148,5 +148,10 @@ struct TransactionSkeleton u256 gasPrice = UndefinedU256; }; +void badBlockHeader(bytesConstRef _header, std::string const& _err); +inline void badBlockHeader(bytes const& _header, std::string const& _err) { badBlockHeader(&_header, _err); } +void badBlock(bytesConstRef _header, std::string const& _err); +inline void badBlock(bytes const& _header, std::string const& _err) { badBlock(&_header, _err); } + } } diff --git a/libethcore/Ethash.cpp b/libethcore/Ethash.cpp index 60585a162..f62c1f9cd 100644 --- a/libethcore/Ethash.cpp +++ b/libethcore/Ethash.cpp @@ -94,11 +94,13 @@ bool Ethash::preVerify(BlockInfo const& _header) h256 boundary = u256((bigint(1) << 256) / _header.difficulty); - return !!ethash_quick_check_difficulty( - (ethash_h256_t const*)_header.headerHash(WithoutNonce).data(), - (uint64_t)(u64)_header.nonce, - (ethash_h256_t const*)_header.mixHash.data(), - (ethash_h256_t const*)boundary.data()); + bool ret = !!ethash_quick_check_difficulty( + (ethash_h256_t const*)_header.headerHash(WithoutNonce).data(), + (uint64_t)(u64)_header.nonce, + (ethash_h256_t const*)_header.mixHash.data(), + (ethash_h256_t const*)boundary.data()); + + return ret; } bool Ethash::verify(BlockInfo const& _header) @@ -112,6 +114,10 @@ bool Ethash::verify(BlockInfo const& _header) auto result = EthashAux::eval(_header); bool slow = result.value <= _header.boundary() && result.mixHash == _header.mixHash; +// cdebug << (slow ? "VERIFY" : "VERYBAD"); +// cdebug << result.value.hex() << _header.boundary().hex(); +// cdebug << result.mixHash.hex() << _header.mixHash.hex(); + #if ETH_DEBUG || !ETH_TRUE if (!pre && slow) { diff --git a/libethereum/BlockQueue.cpp b/libethereum/BlockQueue.cpp index 2af95d00c..4a7a61a31 100644 --- a/libethereum/BlockQueue.cpp +++ b/libethereum/BlockQueue.cpp @@ -22,6 +22,7 @@ #include "BlockQueue.h" #include #include +#include #include #include #include "BlockChain.h" @@ -76,11 +77,54 @@ void BlockQueue::verifierBody() std::pair res; swap(work.second, res.second); try { - res.first.populate(res.second, CheckEverything, work.first); - res.first.verifyInternals(&res.second); + try { + res.first.populate(res.second, CheckEverything, work.first); + res.first.verifyInternals(&res.second); + } + catch (InvalidNonce&) + { + badBlock(res.second, "Invalid block nonce"); + cwarn << " Nonce:" << res.first.nonce.hex(); + cwarn << " PoWHash:" << res.first.headerHash(WithoutNonce).hex(); + cwarn << " SeedHash:" << res.first.seedHash().hex(); + cwarn << " Target:" << res.first.boundary().hex(); + cwarn << " MixHash:" << res.first.mixHash.hex(); + Ethash::Result er = EthashAux::eval(res.first.seedHash(), res.first.headerHash(WithoutNonce), res.first.nonce); + cwarn << " Ethash v:" << er.value.hex(); + cwarn << " Ethash mH:" << er.mixHash.hex(); + throw; + } + catch (Exception& _e) + { + badBlock(res.second, _e.what()); + throw; + } + RLP r(&res.second); for (auto const& uncle: r[2]) - BlockInfo().populateFromHeader(RLP(uncle.data()), CheckEverything); + try + { + BlockInfo().populateFromHeader(RLP(uncle.data()), CheckEverything); + } + catch (InvalidNonce&) + { + badBlockHeader(uncle.data(), "Invalid uncle nonce"); + BlockInfo bi = BlockInfo::fromHeader(uncle.data(), CheckNothing); + cwarn << " Nonce:" << bi.nonce.hex(); + cwarn << " PoWHash:" << bi.headerHash(WithoutNonce).hex(); + cwarn << " SeedHash:" << bi.seedHash().hex(); + cwarn << " Target:" << bi.boundary().hex(); + cwarn << " MixHash:" << bi.mixHash.hex(); + Ethash::Result er = EthashAux::eval(bi.seedHash(), bi.headerHash(WithoutNonce), bi.nonce); + cwarn << " Ethash v:" << er.value.hex(); + cwarn << " Ethash mH:" << er.mixHash.hex(); + throw; + } + catch (Exception& _e) + { + badBlockHeader(uncle.data(), _e.what()); + throw; + } } catch (...) { diff --git a/libethereum/Executive.cpp b/libethereum/Executive.cpp index 4fbf51244..09cdc6b04 100644 --- a/libethereum/Executive.cpp +++ b/libethereum/Executive.cpp @@ -242,6 +242,24 @@ OnOpFunc Executive::simpleTrace() }; } +OnOpFunc Executive::standardTrace(ostream& o_output) +{ + return [&](uint64_t steps, Instruction inst, bigint newMemSize, bigint gasCost, VM* voidVM, ExtVMFace const* voidExt) + { + ExtVM const& ext = *static_cast(voidExt); + VM& vm = *voidVM; + + o_output << endl << " STACK" << endl; + for (auto i: vm.stack()) + o_output << (h256)i << endl; + o_output << " MEMORY" << endl << ((vm.memory().size() > 1000) ? " mem size greater than 1000 bytes " : memDump(vm.memory())); + o_output << " STORAGE" << endl; + for (auto const& i: ext.state().storage(ext.myAddress)) + o_output << showbase << hex << i.first << ": " << i.second << endl; + o_output << " < " << dec << ext.depth << " : " << ext.myAddress << " : #" << steps << " : " << hex << setw(4) << setfill('0') << vm.curPC() << " : " << instructionInfo(inst).name << " : " << dec << vm.gas() << " : -" << dec << gasCost << " : " << newMemSize << "x32" << " >"; + }; +} + bool Executive::go(OnOpFunc const& _onOp) { if (m_vm) diff --git a/libethereum/Executive.h b/libethereum/Executive.h index 8bb0ab771..949e2dc34 100644 --- a/libethereum/Executive.h +++ b/libethereum/Executive.h @@ -106,6 +106,9 @@ public: /// Operation function for providing a simple trace of the VM execution. static OnOpFunc simpleTrace(); + /// Operation function for providing a simple trace of the VM execution. + static OnOpFunc standardTrace(std::ostream& o_output); + /// @returns gas remaining after the transaction/operation. u256 endGas() const { return m_endGas; } /// @returns output data of the transaction/operation. diff --git a/libethereum/State.cpp b/libethereum/State.cpp index c753f57ea..23405912c 100644 --- a/libethereum/State.cpp +++ b/libethereum/State.cpp @@ -564,6 +564,34 @@ pair State::sync(BlockChain const& _bc, TransactionQu return ret; } +string State::vmTrace(bytesConstRef _block, BlockChain const& _bc, ImportRequirements::value _ir) +{ + RLP rlp(_block); + + cleanup(false); + BlockInfo bi(_block, (_ir & ImportRequirements::ValidNonce) ? CheckEverything : IgnoreNonce); + m_currentBlock = bi; + m_currentBlock.verifyInternals(_block); + m_currentBlock.noteDirty(); + + LastHashes lh = _bc.lastHashes((unsigned)m_previousBlock.number); + vector receipts; + + ostringstream ss; + unsigned i = 0; + for (auto const& tr: rlp[1]) + { + ss << " VM Execution of transaction" << i << ":" << endl; + execute(lh, Transaction(tr.data(), CheckTransaction::Everything), Permanence::Committed, Executive::standardTrace(ss)); + RLPStream receiptRLP; + m_receipts.back().streamRLP(receiptRLP); + receipts.push_back(receiptRLP.out()); + ++i; + ss << endl; + } + return ss.str(); +} + u256 State::enact(bytesConstRef _block, BlockChain const& _bc, ImportRequirements::value _ir) { // m_currentBlock is assumed to be prepopulated and reset. @@ -587,14 +615,6 @@ u256 State::enact(bytesConstRef _block, BlockChain const& _bc, ImportRequirement // cnote << "playback begins:" << m_state.root(); // cnote << m_state; - MemoryDB tm; - GenericTrieDB transactionsTrie(&tm); - transactionsTrie.init(); - - MemoryDB rm; - GenericTrieDB receiptsTrie(&rm); - receiptsTrie.init(); - LastHashes lh = _bc.lastHashes((unsigned)m_previousBlock.number); RLP rlp(_block); @@ -612,40 +632,33 @@ u256 State::enact(bytesConstRef _block, BlockChain const& _bc, ImportRequirement } auto receiptsRoot = orderedTrieRoot(receipts); - if (receiptsRoot != m_currentBlock.receiptsRoot) { - cwarn << "Bad receipts state root."; - cwarn << "Expected: " << toString(receiptsRoot) << " received: " << toString(m_currentBlock.receiptsRoot); - cwarn << "Block:" << toHex(_block); - cwarn << "Block RLP:" << rlp; - cwarn << "Calculated: " << receiptsRoot; + badBlock(_block, "Bad receipts state root"); + cwarn << " Received: " << toString(m_currentBlock.receiptsRoot); + cwarn << " Expected: " << toString(receiptsRoot) << " which is:"; for (unsigned j = 0; j < i; ++j) { - RLPStream k; - k << j; auto b = receipts[j]; cwarn << j << ": "; - cwarn << "RLP: " << RLP(b); - cwarn << "Hex: " << toHex(b); - cwarn << TransactionReceipt(&b); - } - cwarn << "Recorded: " << m_currentBlock.receiptsRoot; - auto rs = _bc.receipts(m_currentBlock.hash()); - for (unsigned j = 0; j < rs.receipts.size(); ++j) - { - auto b = rs.receipts[j].rlp(); - cwarn << j << ": "; - cwarn << "RLP: " << RLP(b); - cwarn << "Hex: " << toHex(b); - cwarn << rs.receipts[j]; + cwarn << " RLP: " << RLP(b); + cwarn << " Hex: " << toHex(b); + cwarn << " " << TransactionReceipt(&b); } + cwarn << " VMTrace:\n" << vmTrace(_block, _bc, _ir); BOOST_THROW_EXCEPTION(InvalidReceiptsStateRoot()); } if (m_currentBlock.logBloom != logBloom()) { - cwarn << "Bad log bloom!"; + badBlock(_block, "Bad log bloom"); + cwarn << " Receipt blooms:"; + for (unsigned j = 0; j < i; ++j) + { + auto b = receipts[j]; + cwarn << " " << j << ":" << TransactionReceipt(&b).bloom().hex(); + } + cwarn << " Final bloom:" << m_currentBlock.logBloom.hex(); BOOST_THROW_EXCEPTION(InvalidLogBloom()); } @@ -654,7 +667,10 @@ u256 State::enact(bytesConstRef _block, BlockChain const& _bc, ImportRequirement // Check uncles & apply their rewards to state. if (rlp[2].itemCount() > 2) + { + badBlock(_block, "Too many uncles"); BOOST_THROW_EXCEPTION(TooManyUncles()); + } vector rewarded; h256Hash excluded = _bc.allKinFrom(m_currentBlock.parentHash, 6); @@ -664,13 +680,22 @@ u256 State::enact(bytesConstRef _block, BlockChain const& _bc, ImportRequirement { auto h = sha3(i.data()); if (excluded.count(h)) + { + badBlock(_block, "Invalid uncle included"); BOOST_THROW_EXCEPTION(UncleInChain() << errinfo_comment("Uncle in block already mentioned") << errinfo_data(toString(excluded)) << errinfo_hash256(sha3(i.data()))); + } excluded.insert(h); BlockInfo uncle = BlockInfo::fromHeader(i.data(), (_ir & ImportRequirements::CheckUncles) ? CheckEverything : IgnoreNonce, h); BlockInfo uncleParent(_bc.block(uncle.parentHash)); if ((bigint)uncleParent.number < (bigint)m_currentBlock.number - 7) + { + badBlock(_block, "Uncle too old"); + cwarn << " Uncle number: " << uncle.number; + cwarn << " Uncle parent number: " << uncleParent.number; + cwarn << " Block number: " << m_currentBlock.number; BOOST_THROW_EXCEPTION(UncleTooOld()); + } uncle.verifyParent(uncleParent); // tdIncrease += uncle.difficulty; @@ -685,13 +710,13 @@ u256 State::enact(bytesConstRef _block, BlockChain const& _bc, ImportRequirement // Hash the state trie and check against the state_root hash in m_currentBlock. if (m_currentBlock.stateRoot != m_previousBlock.stateRoot && m_currentBlock.stateRoot != rootHash()) { - cwarn << "Bad state root!"; - cnote << "Given to be:" << m_currentBlock.stateRoot; + badBlock(_block, "Bad state root"); + cnote << " Given to be:" << m_currentBlock.stateRoot; // TODO: Fix // cnote << SecureTrieDB(&m_db, m_currentBlock.stateRoot); - cnote << "Calculated to be:" << rootHash(); + cnote << " Calculated to be:" << rootHash(); + cwarn << " VMTrace:\n" << vmTrace(_block, _bc, _ir); // cnote << m_state; - cnote << *this; // Rollback the trie. m_db.rollback(); BOOST_THROW_EXCEPTION(InvalidStateRoot()); @@ -700,6 +725,7 @@ u256 State::enact(bytesConstRef _block, BlockChain const& _bc, ImportRequirement if (m_currentBlock.gasUsed != gasUsed()) { // Rollback the trie. + badBlock(_block, "Invalid gas used"); m_db.rollback(); BOOST_THROW_EXCEPTION(InvalidGasUsed() << RequirementError(bigint(gasUsed()), bigint(m_currentBlock.gasUsed))); } @@ -1114,7 +1140,7 @@ bool State::isTrieGood(bool _enforceRefs, bool _requireNoLeftOvers) const return true; } -ExecutionResult State::execute(LastHashes const& _lh, Transaction const& _t, Permanence _p) +ExecutionResult State::execute(LastHashes const& _lh, Transaction const& _t, Permanence _p, OnOpFunc const& _onOp) { #if ETH_PARANOIA paranoia("start of execution.", true); @@ -1141,7 +1167,7 @@ ExecutionResult State::execute(LastHashes const& _lh, Transaction const& _t, Per #if ETH_VMTRACE e.go(e.simpleTrace()); #else - e.go(); + e.go(_onOp); #endif e.finalize(); diff --git a/libethereum/State.h b/libethereum/State.h index f46d0e222..afdf41735 100644 --- a/libethereum/State.h +++ b/libethereum/State.h @@ -190,7 +190,7 @@ public: /// Execute a given transaction. /// This will append @a _t to the transaction list and change the state accordingly. - ExecutionResult execute(LastHashes const& _lh, Transaction const& _t, Permanence _p = Permanence::Committed); + ExecutionResult execute(LastHashes const& _lh, Transaction const& _t, Permanence _p = Permanence::Committed, OnOpFunc const& _onOp = OnOpFunc()); /// Get the remaining gas limit in this block. u256 gasLimitRemaining() const { return m_currentBlock.gasLimit - gasUsed(); } @@ -351,6 +351,9 @@ private: /// Debugging only. Good for checking the Trie is in shape. void paranoia(std::string const& _when, bool _enforceRefs = false) const; + /// Provide a standard VM trace for debugging purposes. + std::string vmTrace(bytesConstRef _block, BlockChain const& _bc, ImportRequirements::value _ir); + OverlayDB m_db; ///< Our overlay for the state tree. SecureTrieDB m_state; ///< Our state tree, as an OverlayDB DB. Transactions m_transactions; ///< The current list of transactions that we've included in the state. From 7049251ce982362ace94267d62e9e396e4b12789 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 27 May 2015 14:25:06 +0200 Subject: [PATCH 362/461] - add optimize code action menuitem --- mix/CodeModel.cpp | 8 +++++++- mix/CodeModel.h | 3 +++ mix/qml/Application.qml | 11 +++++++++++ 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/mix/CodeModel.cpp b/mix/CodeModel.cpp index de1bb8647..1dc47185f 100644 --- a/mix/CodeModel.cpp +++ b/mix/CodeModel.cpp @@ -309,7 +309,7 @@ void CodeModel::runCompilationJob(int _jobId) sourceNames.push_back(c.first.toStdString()); } } - cs.compile(false); + cs.compile(m_optimizeCode); gasEstimation(cs); collectContracts(cs, sourceNames); } @@ -599,6 +599,12 @@ QString CodeModel::resolveFunctionName(dev::SourceLocation const& _location) return QString(); } +void CodeModel::setOptimizeCode(bool _value) +{ + m_optimizeCode = _value; + emit scheduleCompilationJob(++m_backgroundJobId); +} + void GasMapWrapper::push(QString _source, int _start, int _end, QString _value, bool _isInfinite, QString _payload) { GasMap* gas = new GasMap(_start, _end, _value, _isInfinite, _payload, this); diff --git a/mix/CodeModel.h b/mix/CodeModel.h index 5982982b3..a51e85cec 100644 --- a/mix/CodeModel.h +++ b/mix/CodeModel.h @@ -179,6 +179,7 @@ public: Q_PROPERTY(QVariantMap contracts READ contracts NOTIFY codeChanged) Q_PROPERTY(bool compiling READ isCompiling NOTIFY stateChanged) Q_PROPERTY(bool hasContract READ hasContract NOTIFY codeChanged) + Q_PROPERTY(bool optimizeCode MEMBER m_optimizeCode WRITE setOptimizeCode) /// @returns latest compilation results for contracts QVariantMap contracts() const; @@ -211,6 +212,7 @@ public: void gasEstimation(solidity::CompilerStack const& _cs); /// Gas cost by doc id Q_INVOKABLE QVariantList gasCostByDocumentId(QString const& _documentId) const; + Q_INVOKABLE void setOptimizeCode(bool _value); signals: /// Emited on compilation state change @@ -255,6 +257,7 @@ private: std::map m_compiledContracts; //by name dev::Mutex x_pendingContracts; std::map m_pendingContracts; //name to source + bool m_optimizeCode; friend class BackgroundWorker; }; diff --git a/mix/qml/Application.qml b/mix/qml/Application.qml index 161f7141a..bb0f215fe 100644 --- a/mix/qml/Application.qml +++ b/mix/qml/Application.qml @@ -119,6 +119,7 @@ ApplicationWindow { Menu { title: qsTr("Tools") MenuItem { action: gasEstimationAction } + MenuItem { action: optimizeCodeAction } } Menu { title: qsTr("Windows") @@ -424,4 +425,14 @@ ApplicationWindow { mainContent.codeEditor.displayGasEstimation(checked); } } + + Action { + id: optimizeCodeAction + text: qsTr("Optimize contract code") + shortcut: "Ctrl+Shift+O" + checkable: true + checked: true + Component.onCompleted: codeModel.setOptimizeCode(true); + onTriggered: codeModel.setOptimizeCode(checked); + } } From 10cfa35c09b99f5375c4c30955f5b89f8f9ddc44 Mon Sep 17 00:00:00 2001 From: arkpar Date: Mon, 25 May 2015 13:17:42 +0200 Subject: [PATCH 363/461] blockchain sync refactoring --- libethcore/Common.cpp | 2 +- libethereum/BlockChain.cpp | 2 +- libethereum/CanonBlockChain.h | 1 - libethereum/Client.cpp | 29 +- libethereum/CommonNet.h | 4 +- libethereum/DownloadMan.cpp | 49 +++ libethereum/DownloadMan.h | 123 ++++++++ libethereum/EthereumHost.cpp | 561 +++++++++++++++++++++++++++------- libethereum/EthereumHost.h | 30 +- libethereum/EthereumPeer.cpp | 462 ++++++++-------------------- libethereum/EthereumPeer.h | 18 +- libp2p/Capability.h | 1 + libp2p/Host.h | 1 + libp2p/HostCapability.cpp | 7 +- libp2p/HostCapability.h | 1 + libp2p/Session.h | 2 + 16 files changed, 819 insertions(+), 474 deletions(-) diff --git a/libethcore/Common.cpp b/libethcore/Common.cpp index 56db647f3..8eca84873 100644 --- a/libethcore/Common.cpp +++ b/libethcore/Common.cpp @@ -35,7 +35,7 @@ namespace dev namespace eth { -const unsigned c_protocolVersion = 60; +const unsigned c_protocolVersion = 61; #if ETH_FATDB const unsigned c_minorProtocolVersion = 3; const unsigned c_databaseBaseVersion = 9; diff --git a/libethereum/BlockChain.cpp b/libethereum/BlockChain.cpp index e23fde6b6..67e42d7c8 100644 --- a/libethereum/BlockChain.cpp +++ b/libethereum/BlockChain.cpp @@ -317,7 +317,7 @@ tuple BlockChain::sync(BlockQueue& _bq, OverlayDB const& _st { try { - // Nonce & uncle nonces already verified thread at this point. + // Nonce & uncle nonces already verified in verification thread at this point. ImportRoute r; DEV_TIMED_ABOVE(Block import, 500) r = import(block.first, block.second, _stateDB, ImportRequirements::Default & ~ImportRequirements::ValidNonce & ~ImportRequirements::CheckUncles); diff --git a/libethereum/CanonBlockChain.h b/libethereum/CanonBlockChain.h index df4ac2d88..d1d47cd14 100644 --- a/libethereum/CanonBlockChain.h +++ b/libethereum/CanonBlockChain.h @@ -34,7 +34,6 @@ #include #include "BlockDetails.h" #include "Account.h" -#include "BlockQueue.h" #include "BlockChain.h" namespace ldb = leveldb; diff --git a/libethereum/Client.cpp b/libethereum/Client.cpp index e372e611a..3ca9a3172 100644 --- a/libethereum/Client.cpp +++ b/libethereum/Client.cpp @@ -164,28 +164,8 @@ const char* ClientDetail::name() { return EthTeal "⧫" EthCoal " ●"; } #endif Client::Client(p2p::Host* _extNet, std::string const& _dbPath, WithExisting _forceAction, u256 _networkId): - Worker("eth", 0), - m_vc(_dbPath), - m_bc(_dbPath, max(m_vc.action(), _forceAction), [](unsigned d, unsigned t){ cerr << "REVISING BLOCKCHAIN: Processed " << d << " of " << t << "...\r"; }), - m_gp(new TrivialGasPricer), - m_stateDB(State::openDB(_dbPath, max(m_vc.action(), _forceAction))), - m_preMine(m_stateDB, BaseState::CanonGenesis), - m_postMine(m_stateDB) + Client(_extNet, make_shared(), _dbPath, _forceAction, _networkId) { - m_lastGetWork = std::chrono::system_clock::now() - chrono::seconds(30); - m_tqReady = m_tq.onReady([=](){ this->onTransactionQueueReady(); }); // TODO: should read m_tq->onReady(thisThread, syncTransactionQueue); - m_bqReady = m_bq.onReady([=](){ this->onBlockQueueReady(); }); // TODO: should read m_bq->onReady(thisThread, syncBlockQueue); - m_farm.onSolutionFound([=](ProofOfWork::Solution const& s){ return this->submitWork(s); }); - - m_gp->update(m_bc); - - m_host = _extNet->registerCapability(new EthereumHost(m_bc, m_tq, m_bq, _networkId)); - - if (_dbPath.size()) - Defaults::setDBPath(_dbPath); - m_vc.setOk(); - doWork(); - startWorking(); } @@ -195,7 +175,7 @@ Client::Client(p2p::Host* _extNet, std::shared_ptr _gp, std::string c m_bc(_dbPath, max(m_vc.action(), _forceAction), [](unsigned d, unsigned t){ cerr << "REVISING BLOCKCHAIN: Processed " << d << " of " << t << "...\r"; }), m_gp(_gp), m_stateDB(State::openDB(_dbPath, max(m_vc.action(), _forceAction))), - m_preMine(m_stateDB), + m_preMine(m_stateDB, BaseState::CanonGenesis), m_postMine(m_stateDB) { m_lastGetWork = std::chrono::system_clock::now() - chrono::seconds(30); @@ -205,7 +185,10 @@ Client::Client(p2p::Host* _extNet, std::shared_ptr _gp, std::string c m_gp->update(m_bc); - m_host = _extNet->registerCapability(new EthereumHost(m_bc, m_tq, m_bq, _networkId)); + + auto host = _extNet->registerCapability(new EthereumHost(m_bc, m_tq, m_bq, _networkId)); + m_host = host; + _extNet->addCapability(host, EthereumHost::staticName(), EthereumHost::staticVersion() - 1); if (_dbPath.size()) Defaults::setDBPath(_dbPath); diff --git a/libethereum/CommonNet.h b/libethereum/CommonNet.h index 0b1469f19..8b810bd10 100644 --- a/libethereum/CommonNet.h +++ b/libethereum/CommonNet.h @@ -38,12 +38,12 @@ namespace eth #if ETH_DEBUG static const unsigned c_maxHashes = 2048; ///< Maximum number of hashes BlockHashes will ever send. -static const unsigned c_maxHashesAsk = 2048; ///< Maximum number of hashes GetBlockHashes will ever ask for. +static const unsigned c_maxHashesAsk = 2048; ///< Maximum number of hashes GetBlockHashes will ever ask for. static const unsigned c_maxBlocks = 128; ///< Maximum number of blocks Blocks will ever send. static const unsigned c_maxBlocksAsk = 128; ///< Maximum number of blocks we ask to receive in Blocks (when using GetChain). #else static const unsigned c_maxHashes = 2048; ///< Maximum number of hashes BlockHashes will ever send. -static const unsigned c_maxHashesAsk = 2048; ///< Maximum number of hashes GetBlockHashes will ever ask for. +static const unsigned c_maxHashesAsk = 2048; ///< Maximum number of hashes GetBlockHashes will ever ask for. static const unsigned c_maxBlocks = 128; ///< Maximum number of blocks Blocks will ever send. static const unsigned c_maxBlocksAsk = 128; ///< Maximum number of blocks we ask to receive in Blocks (when using GetChain). #endif diff --git a/libethereum/DownloadMan.cpp b/libethereum/DownloadMan.cpp index 05d0a533e..838e29078 100644 --- a/libethereum/DownloadMan.cpp +++ b/libethereum/DownloadMan.cpp @@ -75,3 +75,52 @@ bool DownloadSub::noteBlock(h256 _hash) m_remaining.erase(_hash); return ret; } + +HashDownloadSub::HashDownloadSub(HashDownloadMan& _man): m_man(&_man) +{ + WriteGuard l(m_man->x_subs); + m_asked = RangeMask(m_man->m_chainStart, m_man->m_chainStart + m_man->m_chainCount); + m_attempted = RangeMask(m_man->m_chainStart, m_man->m_chainStart + m_man->m_chainCount); + m_man->m_subs.insert(this); +} + +HashDownloadSub::~HashDownloadSub() +{ + if (m_man) + { + WriteGuard l(m_man->x_subs); + m_man->m_subs.erase(this); + } +} + +void HashDownloadSub::resetFetch() +{ + Guard l(m_fetch); + m_remaining = 0; + m_asked = RangeMask(m_man->m_chainStart, m_man->m_chainStart + m_man->m_chainCount); + m_attempted = RangeMask(m_man->m_chainStart, m_man->m_chainStart + m_man->m_chainCount); +} + +unsigned HashDownloadSub::nextFetch(unsigned _n) +{ + Guard l(m_fetch); + + m_asked = RangeMask(m_man->m_chainStart, m_man->m_chainStart + m_man->m_chainCount); + + if (!m_man || m_man->chainEmpty()) + return 0; + + m_asked = (~(m_man->taken() + m_attempted)).lowest(_n); + if (m_asked.empty()) + m_asked = (~(m_man->taken(true) + m_attempted)).lowest(_n); + m_attempted += m_asked; + return *m_asked.begin(); +} + +void HashDownloadSub::noteHash(unsigned _index, unsigned _size) +{ + Guard l(m_fetch); + if (m_man) + for(unsigned i = _index; i < _index + _size; ++i) + m_man->m_got += i; +} diff --git a/libethereum/DownloadMan.h b/libethereum/DownloadMan.h index 2b41e660b..4ff83847c 100644 --- a/libethereum/DownloadMan.h +++ b/libethereum/DownloadMan.h @@ -88,6 +88,13 @@ public: i->m_man = nullptr; } + void appendToChain(h256s const& _hashes) + { + WriteGuard l(m_lock); + m_chain.insert(m_chain.end(), _hashes.cbegin(), _hashes.cend()); + m_blocksGot = RangeMask(0, m_chain.size()); + } + void resetToChain(h256s const& _chain) { { @@ -158,6 +165,122 @@ private: std::unordered_set m_subs; }; + +class HashDownloadMan; + +class HashDownloadSub +{ + friend class HashDownloadMan; + +public: + HashDownloadSub(HashDownloadMan& _man); + ~HashDownloadSub(); + + /// Finished last fetch - grab the next hash index to download + unsigned nextFetch(unsigned _n); + + /// Note that we've received a particular hash range. + void noteHash(unsigned _index, unsigned count); + + /// Nothing doing here. + void doneFetch() { resetFetch(); } + + bool askedContains(unsigned _i) const { Guard l(m_fetch); return m_asked.contains(_i); } + RangeMask const& asked() const { return m_asked; } + RangeMask const& attemped() const { return m_attempted; } + +private: + void resetFetch(); // Called by DownloadMan when we need to reset the download. + + HashDownloadMan* m_man = nullptr; + mutable Mutex m_fetch; + unsigned m_remaining; + RangeMask m_asked; + RangeMask m_attempted; +}; + +class HashDownloadMan +{ + friend class HashDownloadSub; + +public: + ~HashDownloadMan() + { + for (auto i: m_subs) + i->m_man = nullptr; + } + + void resetToRange(unsigned _start, unsigned _count) + { + { + ReadGuard l(x_subs); + for (auto i: m_subs) + i->resetFetch(); + } + WriteGuard l(m_lock); + m_chainStart = _start; + m_chainCount = _count; + m_got += RangeMask(_start, _start + _count); + { + ReadGuard l(x_subs); + for (auto i: m_subs) + i->resetFetch(); + } + } + + void reset(unsigned _start) + { + WriteGuard l(m_lock); + m_chainStart = _start; + m_chainCount = 0; + m_got = RangeMask(_start, _start); + + { + ReadGuard l(x_subs); + for (auto i: m_subs) + i->resetFetch(); + } + } + + RangeMask taken(bool _desperate = false) const + { + ReadGuard l(m_lock); + auto ret = m_got; + if (!_desperate) + { + ReadGuard l(x_subs); + for (auto i: m_subs) + ret += i->m_asked; + } + return ret; + } + + bool isComplete() const + { + ReadGuard l(m_lock); + return m_got.full(); + }\ + + size_t chainSize() const { ReadGuard l(m_lock); return m_chainCount; } + size_t chainEmpty() const { ReadGuard l(m_lock); return m_chainCount == 0; } + void foreachSub(std::function const& _f) const { ReadGuard l(x_subs); for(auto i: m_subs) _f(*i); } + unsigned subCount() const { ReadGuard l(x_subs); return m_subs.size(); } + RangeMask hashesGot() const { ReadGuard l(m_lock); return m_got; } + +private: + mutable SharedMutex m_lock; + unsigned m_chainStart = 0; + unsigned m_chainCount = 0; + RangeMask m_got; + + mutable SharedMutex x_subs; + std::unordered_set m_subs; +}; + + + + + } } diff --git a/libethereum/EthereumHost.cpp b/libethereum/EthereumHost.cpp index d62d6716f..af1caf3d4 100644 --- a/libethereum/EthereumHost.cpp +++ b/libethereum/EthereumHost.cpp @@ -37,6 +37,8 @@ using namespace dev; using namespace dev::eth; using namespace p2p; +const unsigned c_prevProtocolVersion = 60; + EthereumHost::EthereumHost(BlockChain const& _ch, TransactionQueue& _tq, BlockQueue& _bq, u256 _networkId): HostCapability(), Worker ("ethsync"), @@ -46,12 +48,12 @@ EthereumHost::EthereumHost(BlockChain const& _ch, TransactionQueue& _tq, BlockQu m_networkId (_networkId) { m_latestBlockSent = _ch.currentHash(); + m_hashMan.reset(m_chain.number() + 1); } EthereumHost::~EthereumHost() { - for (auto i: peerSessions()) - i.first->cap().get()->abortSync(); + forEachPeer([](EthereumPeer* _p) { _p->abortSync(); }); } bool EthereumHost::ensureInitialised() @@ -71,86 +73,22 @@ bool EthereumHost::ensureInitialised() void EthereumHost::noteNeedsSyncing(EthereumPeer* _who) { - // if already downloading hash-chain, ignore. - if (isSyncing()) - { - clog(NetAllDetail) << "Sync in progress: Just set to help out."; - if (m_syncer->m_asking == Asking::Blocks) - _who->transition(Asking::Blocks); - } - else - // otherwise check to see if we should be downloading... - _who->attemptSync(); -} - -void EthereumHost::changeSyncer(EthereumPeer* _syncer, bool _needHelp) -{ - if (_syncer) - clog(NetAllDetail) << "Changing syncer to" << _syncer->session()->socketId(); - else - clog(NetAllDetail) << "Clearing syncer."; - - m_syncer = _syncer; - if (isSyncing()) - { - if (_needHelp && _syncer->m_asking == Asking::Blocks) - for (auto j: peerSessions()) - { - clog(NetNote) << "Getting help with downloading blocks"; - auto e = j.first->cap().get(); - if (e != _syncer && e->m_asking == Asking::Nothing) - e->transition(Asking::Blocks); - } - } - else - { - // start grabbing next hash chain if there is one. - for (auto j: peerSessions()) - { - j.first->cap()->attemptSync(); - if (isSyncing()) - return; - } - clog(NetNote) << "No more peers to sync with."; - } -} - -void EthereumHost::noteDoneBlocks(EthereumPeer* _who, bool _clemency) -{ - if (m_man.isComplete()) - { - // Done our chain-get. - clog(NetNote) << "Chain download complete."; - // 1/100th for each useful block hash. - _who->addRating(m_man.chainSize() / 100); - m_man.reset(); - } - else if (_who->isSyncing()) - { - if (_clemency) - clog(NetNote) << "Chain download failed. Aborted while incomplete."; - else - { - // Done our chain-get. - clog(NetWarn) << "Chain download failed. Peer with blocks didn't have them all. This peer is bad and should be punished."; - clog(NetWarn) << m_man.remaining(); - clog(NetWarn) << "WOULD BAN."; -// m_banned.insert(_who->session()->id()); // We know who you are! -// _who->disable("Peer sent hashes but was unable to provide the blocks."); - } - m_man.reset(); - } + if (_who->m_asking == Asking::Nothing) + continueSync(_who); } void EthereumHost::reset() { - if (m_syncer) - m_syncer->abortSync(); - + forEachPeer([](EthereumPeer* _p) { _p->abortSync(); }); m_man.resetToChain(h256s()); - + m_hashMan.reset(m_chain.number() + 1); + m_needSyncBlocks = true; + m_needSyncHashes = true; + m_syncingLatestHash = h256(); + m_syncingTotalDifficulty = 0; m_latestBlockSent = h256(); m_transactionsSent.clear(); + m_v60Hashes.clear(); } void EthereumHost::doWork() @@ -172,9 +110,7 @@ void EthereumHost::doWork() } } - for (auto p: peerSessions()) - if (shared_ptr const& ep = p.first->cap()) - ep->tick(); + forEachPeer([](EthereumPeer* _p) { _p->tick(); }); // return netChange; // TODO: Figure out what to do with netChange. @@ -194,43 +130,60 @@ void EthereumHost::maintainTransactions() } for (auto const& t: ts) m_transactionsSent.insert(t.first); - for (auto p: peerSessions()) - if (auto ep = p.first->cap()) + forEachPeer([&](shared_ptr _p) + { + bytes b; + unsigned n = 0; + for (auto const& h: peerTransactions[_p]) { - bytes b; - unsigned n = 0; - for (auto const& h: peerTransactions[ep]) - { - ep->m_knownTransactions.insert(h); - b += ts[h].rlp(); - ++n; - } + _p->m_knownTransactions.insert(h); + b += ts[h].rlp(); + ++n; + } - ep->clearKnownTransactions(); + _p->clearKnownTransactions(); - if (n || ep->m_requireTransactions) - { - RLPStream ts; - ep->prep(ts, TransactionsPacket, n).appendRaw(b, n); - ep->sealAndSend(ts); - } - ep->m_requireTransactions = false; + if (n || _p->m_requireTransactions) + { + RLPStream ts; + _p->prep(ts, TransactionsPacket, n).appendRaw(b, n); + _p->sealAndSend(ts); } + _p->m_requireTransactions = false; + }); +} + +void EthereumHost::forEachPeer(std::function const& _f) +{ + forEachPeer([&](std::shared_ptr _p) + { + if (_p) + _f(_p.get()); + }); +} + +void EthereumHost::forEachPeer(std::function)> const& _f) +{ + for (auto s: peerSessions()) + _f(s.first->cap()); + for (auto s: peerSessions(protocolVersion() - 1)) //TODO: + _f(s.first->cap(protocolVersion() - 1)); + } pair>, vector>> EthereumHost::randomSelection(unsigned _percent, std::function const& _allow) { pair>, vector>> ret; - ret.second.reserve(peerSessions().size()); - for (auto const& j: peerSessions()) + vector> peers; + forEachPeer([&](shared_ptr _p) { - auto pp = j.first->cap(); - if (_allow(pp.get())) - ret.second.push_back(pp); - } + if (_p && _allow(_p.get())) + ret.second.push_back(_p); + }); - ret.second.reserve((peerSessions().size() * _percent + 99) / 100); - for (unsigned i = (peerSessions().size() * _percent + 99) / 100; i-- && ret.second.size();) + size_t size = (ret.second.size() * _percent + 99) / 100; + ret.second.reserve(size); + for (unsigned i = size; i-- && ret.second.size();) { unsigned n = rand() % ret.second.size(); ret.first.push_back(std::move(ret.second[n])); @@ -279,3 +232,403 @@ void EthereumHost::maintainBlocks(h256 const& _currentHash) m_latestBlockSent = _currentHash; } } + +void EthereumHost::onPeerState(EthereumPeer* _peer) +{ + if (!_peer->enabled()) + { + clog(NetNote) << "Ignoring status from disabled peer"; + return; + } + if (_peer->m_genesisHash != m_chain.genesisHash()) + _peer->disable("Invalid genesis hash"); + else if (_peer->m_protocolVersion != protocolVersion())// && _peer->m_protocolVersion != c_prevProtocolVersion) + _peer->disable("Invalid protocol version."); + else if (_peer->m_networkId != networkId()) + _peer->disable("Invalid network identifier."); + else if (_peer->session()->info().clientVersion.find("/v0.7.0/") != string::npos) + _peer->disable("Blacklisted client version."); + else if (isBanned(_peer->session()->id())) + _peer->disable("Peer banned for previous bad behaviour."); + else + { + + _peer->m_expectedHashes = 500000; //TODO: + if (m_hashMan.chainSize() < _peer->m_expectedHashes) + m_hashMan.resetToRange(m_chain.number() + 1, _peer->m_expectedHashes); + continueSync(_peer); + } +} + +void EthereumHost::onPeerHashes(EthereumPeer* _peer, h256s const& _hashes) +{ + unsigned knowns = 0; + unsigned unknowns = 0; + h256s neededBlocks; + for (unsigned i = 0; i < _hashes.size(); ++i) + { + _peer->addRating(1); + auto h = _hashes[i]; + auto status = m_bq.blockStatus(h); + if (status == QueueStatus::Importing || status == QueueStatus::Ready || m_chain.isKnown(h)) + { + clog(NetMessageSummary) << "block hash ready:" << h << ". Start blocks download..."; + m_v60Hashes += neededBlocks; + onPeerDoneHashes(_peer, false); + return; + } + else if (status == QueueStatus::Bad) + { + cwarn << "block hash bad!" << h << ". Bailing..."; + _peer->setIdle(); + return; + } + else if (status == QueueStatus::Unknown) + { + unknowns++; + neededBlocks.push_back(h); + } + else + knowns++; + m_syncingLatestHash = h; + } + m_v60Hashes += neededBlocks; + clog(NetMessageSummary) << knowns << "knowns," << unknowns << "unknowns; now at" << m_syncingLatestHash; + if (_complete) + { + m_needSyncBlocks = true; + continueSync(_peer); + } + else if (m_hashes.size() > _peer->m_expectedHashes) + { + _peer->disable("Too many hashes"); + m_hashes.clear(); + m_syncingLatestHash = h256(); + continueSync(); ///Try with some other peer, keep the chain + } + else + continueSync(_peer); /// Grab next hashes +} + +void EthereumHost::onPeerHashes(EthereumPeer* _peer, unsigned /*_index*/, h256s const& _hashes) +{ + unsigned knowns = 0; + unsigned unknowns = 0; + h256s neededBlocks; + for (unsigned i = 0; i < _hashes.size(); ++i) + { + _peer->addRating(1); + auto h = _hashes[i]; + auto status = m_bq.blockStatus(h); + if (status == QueueStatus::Importing || status == QueueStatus::Ready || m_chain.isKnown(h)) + { + clog(NetWarn) << "block hash alrady known:" << h; + } + else if (status == QueueStatus::Bad) + { + cwarn << "block hash bad!" << h << ". Bailing..."; + _peer->setIdle(); + return; + } + else if (status == QueueStatus::Unknown) + { + unknowns++; + neededBlocks.push_back(h); + } + else + knowns++; + m_syncingLatestHash = h; + } + m_man.appendToChain(neededBlocks); + clog(NetMessageSummary) << knowns << "knowns," << unknowns << "unknowns; now at" << m_syncingLatestHash; + + if (m_hashMan.isComplete()) + { + // Done our chain-get. + m_needSyncHashes = false; + clog(NetNote) << "Hashes download complete."; + // 1/100th for each useful block hash. + _peer->addRating(m_man.chainSize() / 100); //TODO: what about other peers? + m_hashMan.reset(m_chain.number() + 1); + continueSync(); + } + else + continueSync(_peer); +} + +void EthereumHost::onPeerDoneHashes(EthereumPeer* _peer, bool _new) +{ + m_needSyncHashes = false; + if (_peer->m_protocolVersion == protocolVersion() || _new) + { + continueSync(_peer); + } + else + { + m_man.resetToChain(m_v60Hashes); + continueSync(); + } +} + +void EthereumHost::onPeerBlocks(EthereumPeer* _peer, RLP const& _r) +{ + if (!_peer->enabled()) + { + clog(NetNote) << "Ignoring blocks from disabled peer"; + return; + } + unsigned itemCount = _r.itemCount(); + clog(NetMessageSummary) << "Blocks (" << dec << itemCount << "entries)" << (itemCount ? "" : ": NoMoreBlocks"); + + if (itemCount == 0) + { + // Got to this peer's latest block - just give up. + _peer->setIdle(); + return; + } + + unsigned success = 0; + unsigned future = 0; + unsigned unknown = 0; + unsigned got = 0; + unsigned repeated = 0; + + for (unsigned i = 0; i < itemCount; ++i) + { + auto h = BlockInfo::headerHash(_r[i].data()); + if (_peer->m_sub.noteBlock(h)) + { + _peer->addRating(10); + switch (m_bq.import(_r[i].data(), m_chain)) + { + case ImportResult::Success: + success++; + break; + + case ImportResult::Malformed: + case ImportResult::BadChain: + _peer->disable("Malformed block received."); + return; + + case ImportResult::FutureTime: + future++; + break; + + case ImportResult::AlreadyInChain: + case ImportResult::AlreadyKnown: + got++; + break; + + case ImportResult::UnknownParent: + unknown++; + break; + + default:; + } + } + else + { + _peer->addRating(0); // -1? + repeated++; + } + } + + clog(NetMessageSummary) << dec << success << "imported OK," << unknown << "with unknown parents," << future << "with future timestamps," << got << " already known," << repeated << " repeats received."; + + if (m_man.isComplete() && !m_needSyncHashes) + { + // Done our chain-get. + m_needSyncBlocks = false; + clog(NetNote) << "Chain download complete."; + // 1/100th for each useful block hash. + _peer->addRating(m_man.chainSize() / 100); //TODO: what about other peers? + m_man.reset(); + } + continueSync(_peer); +} + +void EthereumHost::onPeerNewHashes(EthereumPeer* _peer, h256s const& _hashes) +{ + Guard l(x_sync); + if (_peer->m_asking != Asking::Nothing) + { + clog(NetMessageSummary) << "Ignoring new hashes since we're already downloading."; + return; + } + clog(NetNote) << "New block hash discovered: syncing without help."; + onPeerHashes(_peer, _hashes, true); +} + +void EthereumHost::onPeerNewBlock(EthereumPeer* _peer, RLP const& _r) +{ + Guard l(x_sync); + if (_peer->m_asking != Asking::Nothing) + { + clog(NetMessageSummary) << "Ignoring new blocks since we're already downloading."; + return; + } + auto h = BlockInfo::headerHash(_r[0].data()); + clog(NetMessageSummary) << "NewBlock: " << h; + + if (_r.itemCount() != 2) + _peer->disable("NewBlock without 2 data fields."); + else + { + bool sync = false; + switch (m_bq.import(_r[0].data(), m_chain)) + { + case ImportResult::Success: + _peer->addRating(100); + break; + case ImportResult::FutureTime: + //TODO: Rating dependent on how far in future it is. + break; + + case ImportResult::Malformed: + case ImportResult::BadChain: + _peer->disable("Malformed block received."); + return; + + case ImportResult::AlreadyInChain: + case ImportResult::AlreadyKnown: + break; + + case ImportResult::UnknownParent: + if (h) + { + u256 difficulty = _r[1].toInt(); + if (m_syncingTotalDifficulty < difficulty) + { + clog(NetMessageSummary) << "Received block with no known parent. Resyncing..."; + _peer->m_latestHash = h; + _peer->m_totalDifficulty = difficulty; + m_needSyncHashes = true; + m_needSyncBlocks = true; + m_syncingLatestHash = _peer->m_latestHash; + sync = true; + } + } + break; + default:; + } + + DEV_GUARDED(_peer->x_knownBlocks) + _peer->m_knownBlocks.insert(h); + + if (sync) + continueSync(_peer); + } +} + +void EthereumHost::onPeerTransactions(EthereumPeer* _peer, RLP const& _r) +{ + unsigned itemCount = _r.itemCount(); + clog(NetAllDetail) << "Transactions (" << dec << itemCount << "entries)"; + Guard l(_peer->x_knownTransactions); + for (unsigned i = 0; i < itemCount; ++i) + { + auto h = sha3(_r[i].data()); + _peer->m_knownTransactions.insert(h); + ImportResult ir = m_tq.import(_r[i].data()); + switch (ir) + { + case ImportResult::Malformed: + _peer->addRating(-100); + break; + case ImportResult::AlreadyKnown: + // if we already had the transaction, then don't bother sending it on. + m_transactionsSent.insert(h); + _peer->addRating(0); + break; + case ImportResult::Success: + _peer->addRating(100); + break; + default:; + } + } +} + +void EthereumHost::continueSync() +{ + forEachPeer([&](EthereumPeer* _p) + { + clog(NetNote) << "Getting help with downloading hashes and blocks"; + if (_p->m_asking == Asking::Nothing) + continueSync(_p); + }); +} + +void EthereumHost::continueSync(EthereumPeer* _peer) +{ + bool otherPeerSync = false; + bool thisPeerSync = false; + if (m_needSyncHashes && peerShouldGrabChain(_peer)) + { + forEachPeer([&](EthereumPeer* _p) + { + if (_p->m_asking == Asking::Hashes && _p->m_protocolVersion != protocolVersion()) + { + // Already have a peer downloading hash chain with old protocol, do nothing + if (_p == _peer) + thisPeerSync = true; + else + otherPeerSync = true; + + } + }); + if (otherPeerSync) + { + _peer->setIdle(); + return; + } + if (_peer->m_protocolVersion == protocolVersion()) + _peer->requestHashes(); + else + { + // Restart/continue sync in single peer mode + if (!m_syncingLatestHash) + { + m_syncingLatestHash =_peer->m_latestHash; + m_syncingTotalDifficulty = _peer->m_totalDifficulty; + } + _peer->requestHashes(m_syncingLatestHash); + } + } + else if (m_needSyncBlocks && peerShouldGrabBlocks(_peer)) // Check if this peer can help with downloading blocks + _peer->requestBlocks(); + else + _peer->setIdle(); +} + +bool EthereumHost::peerShouldGrabBlocks(EthereumPeer* _peer) const +{ + auto td = _peer->m_totalDifficulty; + auto lh = m_syncingLatestHash; + auto ctd = m_chain.details().totalDifficulty; + + clog(NetNote) << "Should grab blocks? " << td << "vs" << ctd; + + if (td < ctd || (td == ctd && m_chain.currentHash() == lh)) + return false; + + return true; +} + +bool EthereumHost::peerShouldGrabChain(EthereumPeer* _peer) const +{ + h256 c = m_chain.currentHash(); + unsigned n = m_chain.number(); + u256 td = m_chain.details().totalDifficulty; + + clog(NetAllDetail) << "Attempt chain-grab? Latest:" << c << ", number:" << n << ", TD:" << td << " versus " << _peer->m_totalDifficulty; + if (td >= _peer->m_totalDifficulty) + { + clog(NetAllDetail) << "No. Our chain is better."; + return false; + } + else + { + clog(NetAllDetail) << "Yes. Their chain is better."; + return true; + } +} diff --git a/libethereum/EthereumHost.h b/libethereum/EthereumHost.h index 95c7f147a..900e515b8 100644 --- a/libethereum/EthereumHost.h +++ b/libethereum/EthereumHost.h @@ -57,7 +57,6 @@ class BlockQueue; class EthereumHost: public p2p::HostCapability, Worker { friend class EthereumPeer; - public: /// Start server, but don't listen. EthereumHost(BlockChain const& _ch, TransactionQueue& _tq, BlockQueue& _bq, u256 _networkId); @@ -72,22 +71,23 @@ public: void reset(); DownloadMan const& downloadMan() const { return m_man; } - bool isSyncing() const { return !!m_syncer; } + bool isSyncing() const { return m_needSyncBlocks || m_needSyncHashes; } bool isBanned(p2p::NodeId _id) const { return !!m_banned.count(_id); } void noteNewTransactions() { m_newTransactions = true; } void noteNewBlocks() { m_newBlocks = true; } + void onPeerState(EthereumPeer* _peer); + private: std::pair>, std::vector>> randomSelection(unsigned _percent = 25, std::function const& _allow = [](EthereumPeer const*){ return true; }); + void forEachPeer(std::function)> const& _f); + void forEachPeer(std::function const& _f); /// Session is tell us that we may need (re-)syncing with the peer. void noteNeedsSyncing(EthereumPeer* _who); - /// Called when the peer can no longer provide us with any needed blocks. - void noteDoneBlocks(EthereumPeer* _who, bool _clemency); - /// Sync with the BlockChain. It might contain one of our mined blocks, we might have new candidates from the network. void doWork(); @@ -109,6 +109,14 @@ private: virtual void onStopping() { stopWorking(); } void changeSyncer(EthereumPeer* _ignore, bool _needHelp = true); + void continueSync(); + void continueSync(EthereumPeer* _peer); + void onPeerBlocks(EthereumPeer* _peer, RLP const& _r); + void onPeerDoneHashes(EthereumPeer* _peer, bool _new); + void onPeerHashes(EthereumPeer* _peer, h256s const& _hashes); + void onPeerHashes(EthereumPeer* _peer, unsigned _index, h256s const& _hashes); + bool peerShouldGrabBlocks(EthereumPeer* _peer) const; + bool peerShouldGrabChain(EthereumPeer* _peer) const; BlockChain const& m_chain; TransactionQueue& m_tq; ///< Maintains a list of incoming transactions not yet in a block on the blockchain. @@ -116,9 +124,10 @@ private: u256 m_networkId; - EthereumPeer* m_syncer = nullptr; // TODO: switch to weak_ptr + std::weak_ptr m_hashSyncer; DownloadMan m_man; + HashDownloadMan m_hashMan; h256 m_latestBlockSent; h256Hash m_transactionsSent; @@ -127,6 +136,15 @@ private: bool m_newTransactions = false; bool m_newBlocks = false; + + unsigned m_maxKnownNumber = 0; + u256 m_maxKnownDifficulty; + bool m_needSyncHashes = true; + bool m_needSyncBlocks = true; + h256 m_syncingLatestHash; ///< Peer's latest block's hash, as of the current sync. + u256 m_syncingTotalDifficulty; ///< Peer's latest block's total difficulty, as of the current sync. + h256s m_v60Hashes; + }; } diff --git a/libethereum/EthereumPeer.cpp b/libethereum/EthereumPeer.cpp index b3846757c..1813bb956 100644 --- a/libethereum/EthereumPeer.cpp +++ b/libethereum/EthereumPeer.cpp @@ -36,9 +36,10 @@ using namespace p2p; EthereumPeer::EthereumPeer(Session* _s, HostCapabilityFace* _h, unsigned _i): Capability(_s, _h, _i), - m_sub(host()->m_man) + m_sub(host()->m_man), + m_hashSub(host()->m_hashMan) { - transition(Asking::State); + requestState(); } EthereumPeer::~EthereumPeer() @@ -50,7 +51,7 @@ EthereumPeer::~EthereumPeer() void EthereumPeer::abortSync() { if (isSyncing()) - transition(Asking::Nothing, true); + setIdle(); } EthereumHost* EthereumPeer::host() const @@ -74,141 +75,87 @@ string toString(Asking _a) return "?"; } -void EthereumPeer::transition(Asking _a, bool _force, bool _needHelp) -{ - clog(NetMessageSummary) << "Transition!" << ::toString(_a) << "from" << ::toString(m_asking) << ", " << (isSyncing() ? "syncing" : "holding") << (needsSyncing() ? "& needed" : ""); - - if (m_asking == Asking::State && _a != Asking::State) - m_requireTransactions = true; - RLPStream s; - - if (_a == Asking::State) - { - if (m_asking == Asking::Nothing) - { - setAsking(Asking::State, false); - prep(s, StatusPacket, 5) - << host()->protocolVersion() - << host()->networkId() - << host()->m_chain.details().totalDifficulty - << host()->m_chain.currentHash() - << host()->m_chain.genesisHash(); - sealAndSend(s); - return; - } - } - else if (_a == Asking::Hashes) +void EthereumPeer::setIdle() +{ + if (m_asking == Asking::Blocks) { - if (m_asking == Asking::State || m_asking == Asking::Nothing) - { - if (isSyncing()) - clog(NetWarn) << "Bad state: not asking for Hashes, yet syncing!"; - - m_syncingLatestHash = m_latestHash; - m_syncingTotalDifficulty = m_totalDifficulty; - resetNeedsSyncing(); + clog(NetNote) << "Finishing blocks fetch..."; + // NOTE: need to notify of giving up on chain-hashes, too, altering state as necessary. + m_sub.doneFetch(); + m_hashSub.doneFetch(); - setAsking(_a, true); - prep(s, GetBlockHashesPacket, 2) << m_syncingLatestHash << c_maxHashesAsk; - m_syncingNeededBlocks = h256s(1, m_syncingLatestHash); - sealAndSend(s); - return; - } - else if (m_asking == Asking::Hashes) - { - if (!isSyncing()) - clog(NetWarn) << "Bad state: asking for Hashes yet not syncing!"; - - setAsking(_a, true); - prep(s, GetBlockHashesPacket, 2) << m_syncingLastReceivedHash << c_maxHashesAsk; - sealAndSend(s); - return; - } + setAsking(Asking::Nothing); } - else if (_a == Asking::Blocks) + else if (m_asking == Asking::Hashes) { - if (m_asking == Asking::Hashes) - { - if (!isSyncing()) - clog(NetWarn) << "Bad state: asking for Hashes yet not syncing!"; - if (shouldGrabBlocks()) - { - clog(NetNote) << "Difficulty of hashchain HIGHER. Grabbing" << m_syncingNeededBlocks.size() << "blocks [latest now" << m_syncingLatestHash << ", was" << host()->m_latestBlockSent << "]"; + clog(NetNote) << "Finishing hashes fetch..."; - host()->m_man.resetToChain(m_syncingNeededBlocks); -// host()->m_latestBlockSent = m_syncingLatestHash; - } - else - { - clog(NetNote) << "Difficulty of hashchain not HIGHER. Ignoring."; - m_syncingLatestHash = h256(); - setAsking(Asking::Nothing, false); - return; - } - } - // run through into... - if (m_asking == Asking::Nothing || m_asking == Asking::Hashes || m_asking == Asking::Blocks) - { - // Looks like it's the best yet for total difficulty. Set to download. - setAsking(Asking::Blocks, isSyncing(), _needHelp); // will kick off other peers to help if available. - auto blocks = m_sub.nextFetch(c_maxBlocksAsk); - if (blocks.size()) - { - prep(s, GetBlocksPacket, blocks.size()); - for (auto const& i: blocks) - s << i; - sealAndSend(s); - } - else - transition(Asking::Nothing); - return; - } + setAsking(Asking::Nothing); } - else if (_a == Asking::Nothing) + else if (m_asking == Asking::State) { - if (m_asking == Asking::Blocks) - { - clog(NetNote) << "Finishing blocks fetch..."; + setAsking(Asking::Nothing); + } +} - // a bit overkill given that the other nodes may yet have the needed blocks, but better to be safe than sorry. - if (isSyncing()) - host()->noteDoneBlocks(this, _force); +void EthereumPeer::requestState() +{ + if (m_asking != Asking::Nothing) + clog(NetWarn) << "Bad state: requesting state should be the first action"; + setAsking(Asking::State); + RLPStream s; + prep(s, StatusPacket, 5) + << host()->protocolVersion() - 1 + << host()->networkId() + << host()->m_chain.details().totalDifficulty + << host()->m_chain.currentHash() + << host()->m_chain.genesisHash(); + sealAndSend(s); +} - // NOTE: need to notify of giving up on chain-hashes, too, altering state as necessary. - m_sub.doneFetch(); +void EthereumPeer::requestHashes() +{ + assert(m_asking != Asking::Blocks); + m_syncHashNumber = m_hashSub.nextFetch(c_maxBlocksAsk); + setAsking(Asking::Hashes); + RLPStream s; + prep(s, GetBlockHashesPacket, 2) << m_syncHashNumber << c_maxHashesAsk; + sealAndSend(s); +} - setAsking(Asking::Nothing, false); - } - else if (m_asking == Asking::Hashes) - { - clog(NetNote) << "Finishing hashes fetch..."; +void EthereumPeer::requestHashes(h256 const& _lastHash) +{ + assert(m_asking != Asking::Blocks); + setAsking(Asking::Hashes); + RLPStream s; + prep(s, GetBlockHashesPacket, 2) << _lastHash << c_maxHashesAsk; + sealAndSend(s); +} - setAsking(Asking::Nothing, false); - } - else if (m_asking == Asking::State) - { - setAsking(Asking::Nothing, false); - // Just got the state - should check to see if we can be of help downloading the chain if any. - // Otherwise, should put ourselves up for sync. - setNeedsSyncing(m_latestHash, m_totalDifficulty); - } - // Otherwise it's fine. We don't care if it's Nothing->Nothing. - return; +void EthereumPeer::requestBlocks() +{ + // Looks like it's the best yet for total difficulty. Set to download. + setAsking(Asking::Blocks); // will kick off other peers to help if available. + auto blocks = m_sub.nextFetch(c_maxBlocksAsk); + if (blocks.size()) + { + RLPStream s; + prep(s, GetBlocksPacket, blocks.size()); + for (auto const& i: blocks) + s << i; + sealAndSend(s); } - - clog(NetWarn) << "Invalid state transition:" << ::toString(_a) << "from" << ::toString(m_asking) << ", " << (isSyncing() ? "syncing" : "holding") << (needsSyncing() ? "& needed" : ""); + else + setIdle(); + return; } -void EthereumPeer::setAsking(Asking _a, bool _isSyncing, bool _needHelp) +void EthereumPeer::setAsking(Asking _a) { - bool changedAsking = (m_asking != _a); m_asking = _a; - if (_isSyncing != (host()->m_syncer == this) || (_isSyncing && changedAsking)) - host()->changeSyncer(_isSyncing ? this : nullptr, _needHelp); - - if (!_isSyncing) + if (!isSyncing()) { m_syncingLatestHash = h256(); m_syncingTotalDifficulty = 0; @@ -241,57 +188,7 @@ void EthereumPeer::tick() bool EthereumPeer::isSyncing() const { - return host()->m_syncer == this; -} - -bool EthereumPeer::shouldGrabBlocks() const -{ - auto td = m_syncingTotalDifficulty; - auto lh = m_syncingLatestHash; - auto ctd = host()->m_chain.details().totalDifficulty; - - if (m_syncingNeededBlocks.empty()) - return false; - - clog(NetNote) << "Should grab blocks? " << td << "vs" << ctd << ";" << m_syncingNeededBlocks.size() << " blocks, ends" << m_syncingNeededBlocks.back(); - - if (td < ctd || (td == ctd && host()->m_chain.currentHash() == lh)) - return false; - - return true; -} - -void EthereumPeer::attemptSync() -{ - if (m_asking != Asking::Nothing) - { - clog(NetAllDetail) << "Can't synced with this peer - outstanding asks."; - return; - } - - // if already done this, then ignore. - if (!needsSyncing()) - { - clog(NetAllDetail) << "Already synced with this peer."; - return; - } - - h256 c = host()->m_chain.currentHash(); - unsigned n = host()->m_chain.number(); - u256 td = host()->m_chain.details().totalDifficulty; - - clog(NetAllDetail) << "Attempt chain-grab? Latest:" << c << ", number:" << n << ", TD:" << td << " versus " << m_totalDifficulty; - if (td >= m_totalDifficulty) - { - clog(NetAllDetail) << "No. Our chain is better."; - resetNeedsSyncing(); - transition(Asking::Nothing); - } - else - { - clog(NetAllDetail) << "Yes. Their chain is better."; - transition(Asking::Hashes); - } + return m_asking != Asking::Nothing; } bool EthereumPeer::interpret(unsigned _id, RLP const& _r) @@ -303,27 +200,16 @@ bool EthereumPeer::interpret(unsigned _id, RLP const& _r) case StatusPacket: { m_protocolVersion = _r[0].toInt(); + if (!!session()->cap(EthereumHost::staticVersion())) + m_protocolVersion = host()->protocolVersion(); m_networkId = _r[1].toInt(); // a bit dirty as we're misusing these to communicate the values to transition, but harmless. m_totalDifficulty = _r[2].toInt(); m_latestHash = _r[3].toHash(); - auto genesisHash = _r[4].toHash(); - - clog(NetMessageSummary) << "Status:" << m_protocolVersion << "/" << m_networkId << "/" << genesisHash << ", TD:" << m_totalDifficulty << "=" << m_latestHash; - - if (genesisHash != host()->m_chain.genesisHash()) - disable("Invalid genesis hash"); - else if (m_protocolVersion != host()->protocolVersion()) - disable("Invalid protocol version."); - else if (m_networkId != host()->networkId()) - disable("Invalid network identifier."); - else if (session()->info().clientVersion.find("/v0.7.0/") != string::npos) - disable("Blacklisted client version."); - else if (host()->isBanned(session()->id())) - disable("Peer banned for previous bad behaviour."); - else - transition(Asking::Nothing); + m_genesisHash = _r[4].toHash(); + clog(NetMessageSummary) << "Status:" << m_protocolVersion << "/" << m_networkId << "/" << m_genesisHash << ", TD:" << m_totalDifficulty << "=" << m_latestHash; + host()->onPeerState(this); break; } case TransactionsPacket: @@ -356,19 +242,45 @@ bool EthereumPeer::interpret(unsigned _id, RLP const& _r) } case GetBlockHashesPacket: { - h256 later = _r[0].toHash(); - unsigned limit = _r[1].toInt(); - clog(NetMessageSummary) << "GetBlockHashes (" << limit << "entries," << later << ")"; - - unsigned c = min(host()->m_chain.number(later), limit); - - RLPStream s; - prep(s, BlockHashesPacket, c); - h256 p = host()->m_chain.details(later).parent; - for (unsigned i = 0; i < c && p; ++i, p = host()->m_chain.details(p).parent) - s << p; - sealAndSend(s); - addRating(0); + if (m_protocolVersion == host()->protocolVersion()) + { + u256 number256 = _r[0].toInt(); + unsigned number = (unsigned) number256; + unsigned limit = _r[1].toInt(); + clog(NetMessageSummary) << "GetBlockHashes (" << number << "-" << number + limit << ")"; + RLPStream s; + if (number <= host()->m_chain.number()) + { + unsigned c = min(host()->m_chain.number() - number + 1, limit); + prep(s, BlockHashesPacket, c); + for (unsigned n = number; n < number + c; n++) + { + h256 p = host()->m_chain.numberHash(n); + s << p; + } + } + else + prep(s, BlockHashesPacket, 0); + sealAndSend(s); + addRating(0); + } + else + { + // Support V60 protocol + h256 later = _r[0].toHash(); + unsigned limit = _r[1].toInt(); + clog(NetMessageSummary) << "GetBlockHashes (" << limit << "entries," << later << ")"; + + unsigned c = min(host()->m_chain.number(later), limit); + + RLPStream s; + prep(s, BlockHashesPacket, c); + h256 p = host()->m_chain.details(later).parent; + for (unsigned i = 0; i < c && p; ++i, p = host()->m_chain.details(p).parent) + s << p; + sealAndSend(s); + addRating(0); + } break; } case BlockHashesPacket: @@ -383,40 +295,24 @@ bool EthereumPeer::interpret(unsigned _id, RLP const& _r) } if (itemCount == 0) { - transition(Asking::Blocks); + host()->onPeerDoneHashes(this, false); return true; } - unsigned knowns = 0; - unsigned unknowns = 0; + h256s hashes(itemCount); for (unsigned i = 0; i < itemCount; ++i) { - addRating(1); - auto h = _r[i].toHash(); - auto status = host()->m_bq.blockStatus(h); - if (status == QueueStatus::Importing || status == QueueStatus::Ready || host()->m_chain.isKnown(h)) - { - clog(NetMessageSummary) << "block hash ready:" << h << ". Start blocks download..."; - transition(Asking::Blocks); - return true; - } - else if (status == QueueStatus::Bad) - { - cwarn << "block hash bad!" << h << ". Bailing..."; - transition(Asking::Nothing); - return true; - } - else if (status == QueueStatus::Unknown) - { - unknowns++; - m_syncingNeededBlocks.push_back(h); - } - else - knowns++; - m_syncingLastReceivedHash = h; + hashes[i] = _r[i].toHash(); + m_hashSub.noteHash(m_syncHashNumber + i, 1); } - clog(NetMessageSummary) << knowns << "knowns," << unknowns << "unknowns; now at" << m_syncingLastReceivedHash; - // run through - ask for more. - transition(Asking::Hashes); + + if (m_protocolVersion == host()->protocolVersion()) + { + //v61, report hashes ordered by number + host()->onPeerHashes(this, m_syncHashNumber, hashes); + } + else + host()->onPeerHashes(this, hashes); + m_syncHashNumber += itemCount; break; } case GetBlocksPacket: @@ -455,74 +351,7 @@ bool EthereumPeer::interpret(unsigned _id, RLP const& _r) } case BlocksPacket: { - unsigned itemCount = _r.itemCount(); - clog(NetMessageSummary) << "Blocks (" << dec << itemCount << "entries)" << (itemCount ? "" : ": NoMoreBlocks"); - - if (m_asking != Asking::Blocks) - clog(NetWarn) << "Unexpected Blocks received!"; - - if (itemCount == 0) - { - // Got to this peer's latest block - just give up. - transition(Asking::Nothing); - break; - } - - unsigned success = 0; - unsigned future = 0; - unsigned unknown = 0; - unsigned got = 0; - unsigned repeated = 0; - - for (unsigned i = 0; i < itemCount; ++i) - { - auto h = BlockInfo::headerHash(_r[i].data()); - if (m_sub.noteBlock(h)) - { - addRating(10); - switch (host()->m_bq.import(_r[i].data(), host()->m_chain)) - { - case ImportResult::Success: - success++; - break; - - case ImportResult::Malformed: - case ImportResult::BadChain: - disable("Malformed block received."); - return true; - - case ImportResult::FutureTime: - future++; - break; - - case ImportResult::AlreadyInChain: - case ImportResult::AlreadyKnown: - got++; - break; - - case ImportResult::UnknownParent: - unknown++; - break; - - default:; - } - } - else - { - addRating(0); // -1? - repeated++; - } - } - - clog(NetMessageSummary) << dec << success << "imported OK," << unknown << "with unknown parents," << future << "with future timestamps," << got << " already known," << repeated << " repeats received."; - - if (m_asking == Asking::Blocks) - { - if (!got) - transition(Asking::Blocks); - else - transition(Asking::Nothing); - } + host()->onPeerBlocks(this, _r); break; } case NewBlockPacket: @@ -571,39 +400,16 @@ bool EthereumPeer::interpret(unsigned _id, RLP const& _r) clog(NetMessageSummary) << "Ignoring since we're already downloading."; else { - unsigned knowns = 0; - unsigned unknowns = 0; unsigned itemCount = _r.itemCount(); + clog(NetMessageSummary) << "BlockHashes (" << dec << itemCount << "entries)" << (itemCount ? "" : ": NoMoreHashes"); + + h256s hashes(itemCount); for (unsigned i = 0; i < itemCount; ++i) - { - addRating(1); - auto h = _r[i].toHash(); - DEV_GUARDED(x_knownBlocks) - m_knownBlocks.insert(h); - auto status = host()->m_bq.blockStatus(h); - if (status == QueueStatus::Importing || status == QueueStatus::Ready || host()->m_chain.isKnown(h)) - knowns++; - else if (status == QueueStatus::Bad) - { - cwarn << "block hash bad!" << h << ". Bailing..."; - return true; - } - else if (status == QueueStatus::Unknown) - { - unknowns++; - m_syncingNeededBlocks.push_back(h); - } - else - knowns++; - } - clog(NetMessageSummary) << knowns << "knowns," << unknowns << "unknowns"; - if (unknowns > 0) - { - clog(NetNote) << "Not syncing and new block hash discovered: syncing without help."; - host()->m_man.resetToChain(m_syncingNeededBlocks); - host()->changeSyncer(this, false); - transition(Asking::Blocks, false, false); // TODO: transaction(Asking::NewBlocks, false) - } + hashes[i] = _r[i].toHash(); + + clog(NetNote) << "Not syncing and new block hash discovered: syncing without help."; + host()->onPeerHashes(this, hashes); + host()->onPeerDoneHashes(this, true); return true; } break; diff --git a/libethereum/EthereumPeer.h b/libethereum/EthereumPeer.h index ae2289102..2dd17d8c3 100644 --- a/libethereum/EthereumPeer.h +++ b/libethereum/EthereumPeer.h @@ -70,18 +70,18 @@ public: /// What is the ethereum subprotocol host object. EthereumHost* host() const; + void setIdle(); + void requestState(); + void requestHashes(); + void requestHashes(h256 const& _lastHash); + void requestBlocks(); + private: using p2p::Capability::sealAndSend; /// Interpret an incoming message. virtual bool interpret(unsigned _id, RLP const& _r); - /// Transition state in a particular direction. - void transition(Asking _wantState, bool _force = false, bool _needHelp = true); - - /// Attempt to begin syncing with this peer; first check the peer has a more difficlult chain to download, then start asking for hashes, then move to blocks. - void attemptSync(); - /// Abort the sync operation. void abortSync(); @@ -89,7 +89,7 @@ private: void clearKnownTransactions() { std::lock_guard l(x_knownTransactions); m_knownTransactions.clear(); } /// Update our asking state. - void setAsking(Asking _g, bool _isSyncing, bool _needHelp = true); + void setAsking(Asking _g); /// Update our syncing requirements state. void setNeedsSyncing(h256 _latestHash, u256 _td); @@ -123,6 +123,7 @@ private: /// These are determined through either a Status message or from NewBlock. h256 m_latestHash; ///< Peer's latest block's hash that we know about or default null value if no need to sync. u256 m_totalDifficulty; ///< Peer's latest block's total difficulty. + h256 m_genesisHash; ///< Peer's genesis hash /// Once a sync is started on this peer, they are cleared and moved into m_syncing*. /// This is built as we ask for hashes. Once no more hashes are given, we present this to the @@ -131,9 +132,12 @@ private: h256 m_syncingLastReceivedHash; ///< Hash most recently received from peer. h256 m_syncingLatestHash; ///< Peer's latest block's hash, as of the current sync. u256 m_syncingTotalDifficulty; ///< Peer's latest block's total difficulty, as of the current sync. + unsigned m_expectedHashes = 0; ///< Estimated Upper bound of hashes to expect from this peer. + unsigned m_syncHashNumber = 0; /// Once we're asking for blocks, this becomes in use. DownloadSub m_sub; + HashDownloadSub m_hashSub; /// Have we received a GetTransactions packet that we haven't yet answered? bool m_requireTransactions = false; diff --git a/libp2p/Capability.h b/libp2p/Capability.h index d09391655..536357b51 100644 --- a/libp2p/Capability.h +++ b/libp2p/Capability.h @@ -44,6 +44,7 @@ public: */ Session* session() const { return m_session; } HostCapabilityFace* hostCapability() const { return m_host; } + bool enabled() { return m_enabled; } protected: virtual bool interpret(unsigned _id, RLP const&) = 0; diff --git a/libp2p/Host.h b/libp2p/Host.h index 78dc50727..3c7ce257a 100644 --- a/libp2p/Host.h +++ b/libp2p/Host.h @@ -99,6 +99,7 @@ public: /// Register a peer-capability; all new peer connections will have this capability. template std::shared_ptr registerCapability(T* _t) { _t->m_host = this; std::shared_ptr ret(_t); m_capabilities[std::make_pair(T::staticName(), T::staticVersion())] = ret; return ret; } + template void addCapability(std::shared_ptr const & _p, std::string const& _name, u256 const& _version) { m_capabilities[std::make_pair(_name, _version)] = _p; } bool haveCapability(CapDesc const& _name) const { return m_capabilities.count(_name) != 0; } CapDescs caps() const { CapDescs ret; for (auto const& i: m_capabilities) ret.push_back(i.first); return ret; } diff --git a/libp2p/HostCapability.cpp b/libp2p/HostCapability.cpp index b2acdcd1b..9502d6b86 100644 --- a/libp2p/HostCapability.cpp +++ b/libp2p/HostCapability.cpp @@ -28,12 +28,17 @@ using namespace dev; using namespace dev::p2p; std::vector,std::shared_ptr>> HostCapabilityFace::peerSessions() const +{ + return peerSessions(version()); +} + +std::vector,std::shared_ptr>> HostCapabilityFace::peerSessions(u256 const& _version) const { RecursiveGuard l(m_host->x_sessions); std::vector,std::shared_ptr>> ret; for (auto const& i: m_host->m_sessions) if (std::shared_ptr s = i.second.lock()) - if (s->m_capabilities.count(capDesc())) + if (s->m_capabilities.count(std::make_pair(name(), _version))) ret.push_back(make_pair(s,s->m_peer)); return ret; } diff --git a/libp2p/HostCapability.h b/libp2p/HostCapability.h index 93086b1c9..a9ce1585b 100644 --- a/libp2p/HostCapability.h +++ b/libp2p/HostCapability.h @@ -46,6 +46,7 @@ public: Host* host() const { return m_host; } std::vector,std::shared_ptr>> peerSessions() const; + std::vector,std::shared_ptr>> peerSessions(u256 const& _version) const; protected: virtual std::string name() const = 0; diff --git a/libp2p/Session.h b/libp2p/Session.h index be8422c82..bcbf8022b 100644 --- a/libp2p/Session.h +++ b/libp2p/Session.h @@ -69,6 +69,8 @@ public: template std::shared_ptr cap() const { try { return std::static_pointer_cast(m_capabilities.at(std::make_pair(PeerCap::name(), PeerCap::version()))); } catch (...) { return nullptr; } } + template + std::shared_ptr cap(u256 const& _version) const { try { return std::static_pointer_cast(m_capabilities.at(std::make_pair(PeerCap::name(), _version))); } catch (...) { return nullptr; } } static RLPStream& prep(RLPStream& _s, PacketType _t, unsigned _args = 0); void sealAndSend(RLPStream& _s); From bd5bf0b8e9d945ba05a487bde464821f6d8a965c Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 27 May 2015 17:26:37 +0200 Subject: [PATCH 364/461] Use enum instead of string. --- mix/CodeModel.cpp | 10 +++--- mix/CodeModel.h | 64 ++++++++++++++++++++++++-------------- mix/qml/html/codeeditor.js | 4 +-- 3 files changed, 48 insertions(+), 30 deletions(-) diff --git a/mix/CodeModel.cpp b/mix/CodeModel.cpp index 1dc47185f..46fc572b3 100644 --- a/mix/CodeModel.cpp +++ b/mix/CodeModel.cpp @@ -380,7 +380,7 @@ void CodeModel::gasEstimation(solidity::CompilerStack const& _cs) GasMeter::GasConsumption cost = gasItem->second; std::stringstream v; v << cost.value; - m_gasCostsMaps->push(sourceName, location.start, location.end, QString::fromStdString(v.str()), cost.isInfinite, "statement"); + m_gasCostsMaps->push(sourceName, location.start, location.end, QString::fromStdString(v.str()), cost.isInfinite, GasMap::type::Statement); } if (contractDefinition.getConstructor() != nullptr) @@ -388,7 +388,7 @@ void CodeModel::gasEstimation(solidity::CompilerStack const& _cs) GasMeter::GasConsumption cost = GasEstimator::functionalEstimation(*_cs.getRuntimeAssemblyItems(n), contractDefinition.getConstructor()->externalSignature()); std::stringstream v; v << cost.value; - m_gasCostsMaps->push(sourceName, contractDefinition.getConstructor()->getLocation().start, contractDefinition.getConstructor()->getLocation().end, QString::fromStdString(v.str()), cost.isInfinite, "constructor"); + m_gasCostsMaps->push(sourceName, contractDefinition.getConstructor()->getLocation().start, contractDefinition.getConstructor()->getLocation().end, QString::fromStdString(v.str()), cost.isInfinite, GasMap::type::Constructor); } for (auto func: contractDefinition.getDefinedFunctions()) @@ -396,7 +396,7 @@ void CodeModel::gasEstimation(solidity::CompilerStack const& _cs) GasMeter::GasConsumption cost = GasEstimator::functionalEstimation(*_cs.getRuntimeAssemblyItems(n), func->externalSignature()); std::stringstream v; v << cost.value; - m_gasCostsMaps->push(sourceName, func->getLocation().start, func->getLocation().end, QString::fromStdString(v.str()), cost.isInfinite, "function"); + m_gasCostsMaps->push(sourceName, func->getLocation().start, func->getLocation().end, QString::fromStdString(v.str()), cost.isInfinite, GasMap::type::Function); } } } @@ -605,9 +605,9 @@ void CodeModel::setOptimizeCode(bool _value) emit scheduleCompilationJob(++m_backgroundJobId); } -void GasMapWrapper::push(QString _source, int _start, int _end, QString _value, bool _isInfinite, QString _payload) +void GasMapWrapper::push(QString _source, int _start, int _end, QString _value, bool _isInfinite, GasMap::type _type) { - GasMap* gas = new GasMap(_start, _end, _value, _isInfinite, _payload, this); + GasMap* gas = new GasMap(_start, _end, _value, _isInfinite, _type, this); m_gasMaps.find(_source).value().push_back(QVariant::fromValue(gas)); } diff --git a/mix/CodeModel.h b/mix/CodeModel.h index a51e85cec..516e8e6d0 100644 --- a/mix/CodeModel.h +++ b/mix/CodeModel.h @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include @@ -130,41 +131,60 @@ struct SourceMap using SourceMaps = QMap; //by source id using GasCostsMaps = QMap; //gas cost by contract name -class GasMapWrapper: public QObject -{ - Q_OBJECT - - Q_PROPERTY(GasCostsMaps gasMaps MEMBER m_gasMaps CONSTANT) - -public: - GasMapWrapper(QObject* _parent = nullptr): QObject(_parent){} - void push(QString _source, int _start, int _end, QString _value, bool _isInfinite, QString _payload); - bool contains(QString _key); - void insert(QString _source, QVariantList _variantList); - QVariantList gasCostsByDocId(QString _source); - -private: - GasCostsMaps m_gasMaps; -}; - class GasMap: public QObject { Q_OBJECT - + Q_ENUMS(type) Q_PROPERTY(int start MEMBER m_start CONSTANT) Q_PROPERTY(int end MEMBER m_end CONSTANT) Q_PROPERTY(QString gas MEMBER m_gas CONSTANT) Q_PROPERTY(bool isInfinite MEMBER m_isInfinite CONSTANT) - Q_PROPERTY(QString payload MEMBER m_payload CONSTANT) + Q_PROPERTY(QString codeBlockType READ codeBlockType CONSTANT) public: - GasMap(int _start, int _end, QString _gas, bool _isInfinite, QString _payload, QObject* _parent): QObject(_parent), m_start(_start), m_end(_end), m_gas(_gas), m_isInfinite(_isInfinite), m_payload(_payload) {} + + enum type + { + Statement, + Function, + Constructor + }; + + GasMap(int _start, int _end, QString _gas, bool _isInfinite, type _type, QObject* _parent): QObject(_parent), m_start(_start), m_end(_end), m_gas(_gas), m_isInfinite(_isInfinite), m_type(_type) {} int m_start; int m_end; QString m_gas; bool m_isInfinite; - QString m_payload; + type m_type; + + QString codeBlockType() const + { + QMetaEnum units = staticMetaObject.enumerator(staticMetaObject.indexOfEnumerator("type")); + if (m_type) + { + const char* key = units.valueToKey(m_type); + return QString(key).toLower(); + } + return QString(""); + } +}; + +class GasMapWrapper: public QObject +{ + Q_OBJECT + + Q_PROPERTY(GasCostsMaps gasMaps MEMBER m_gasMaps CONSTANT) + +public: + GasMapWrapper(QObject* _parent = nullptr): QObject(_parent){} + void push(QString _source, int _start, int _end, QString _value, bool _isInfinite, GasMap::type _type); + bool contains(QString _key); + void insert(QString _source, QVariantList _variantList); + QVariantList gasCostsByDocId(QString _source); + +private: + GasCostsMaps m_gasMaps; }; /// Code compilation model. Compiles contracts in background an provides compiled contract data @@ -264,5 +284,3 @@ private: } } - -//Q_DECLARE_METATYPE(dev::mix::GasMap) diff --git a/mix/qml/html/codeeditor.js b/mix/qml/html/codeeditor.js index cabab107b..108df5952 100644 --- a/mix/qml/html/codeeditor.js +++ b/mix/qml/html/codeeditor.js @@ -253,12 +253,12 @@ displayGasEstimation = function(show) var className = "CodeMirror-gasCosts" + i; var line = editor.posFromIndex(gasCosts[i].start); var endChar; - if (gasCosts[i].payload === "statement") + if (gasCosts[i].codeBlockType === "statement" || gasCosts[i].codeBlockType === "") { endChar = editor.posFromIndex(gasCosts[i].end); gasMarkText.push({ line: line, markText: editor.markText(line, endChar, { inclusiveLeft: true, inclusiveRight: true, handleMouseEvents: true, className: className, css: "background-color:" + color })}); } - else if (gasCosts[i].payload === "function" || gasCosts[i].payload === "constructor") + else if (gasCosts[i].codeBlockType === "function" || gasCosts[i].codeBlockType === "constructor") { var l = editor.getLine(line.line); endChar = { line: line.line, ch: line.ch + l.length }; From ba59d377c049c97a5a74c82fcafb70c8e6eecb95 Mon Sep 17 00:00:00 2001 From: yann300 Date: Wed, 27 May 2015 17:28:31 +0200 Subject: [PATCH 365/461] optimizecode default to true --- mix/CodeModel.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mix/CodeModel.h b/mix/CodeModel.h index 516e8e6d0..9e1fab3f3 100644 --- a/mix/CodeModel.h +++ b/mix/CodeModel.h @@ -277,7 +277,7 @@ private: std::map m_compiledContracts; //by name dev::Mutex x_pendingContracts; std::map m_pendingContracts; //name to source - bool m_optimizeCode; + bool m_optimizeCode = true; friend class BackgroundWorker; }; From 9f5981ad059e18de554ce6c9cc8c6c2e6a0563a5 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 28 May 2015 11:29:28 +0200 Subject: [PATCH 366/461] Optimize Code set to false by default --- mix/CodeModel.h | 2 +- mix/qml/Application.qml | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/mix/CodeModel.h b/mix/CodeModel.h index 9e1fab3f3..b9d06341d 100644 --- a/mix/CodeModel.h +++ b/mix/CodeModel.h @@ -277,7 +277,7 @@ private: std::map m_compiledContracts; //by name dev::Mutex x_pendingContracts; std::map m_pendingContracts; //name to source - bool m_optimizeCode = true; + bool m_optimizeCode = false; friend class BackgroundWorker; }; diff --git a/mix/qml/Application.qml b/mix/qml/Application.qml index bb0f215fe..d041f421e 100644 --- a/mix/qml/Application.qml +++ b/mix/qml/Application.qml @@ -420,19 +420,19 @@ ApplicationWindow { text: qsTr("Display gas estimation") shortcut: "Ctrl+G" checkable: true - onTriggered: - { - mainContent.codeEditor.displayGasEstimation(checked); - } + onTriggered: mainContent.codeEditor.displayGasEstimation(checked); } Action { id: optimizeCodeAction - text: qsTr("Optimize contract code") + text: qsTr("Enable optimized compilation") shortcut: "Ctrl+Shift+O" checkable: true - checked: true - Component.onCompleted: codeModel.setOptimizeCode(true); onTriggered: codeModel.setOptimizeCode(checked); } + + Settings { + property alias gasEstimation: gasEstimationAction.checked + property alias optimizeCode: optimizeCodeAction.checked + } } From ba6efaf40813e8d575adc8624caafdb0488ce63e Mon Sep 17 00:00:00 2001 From: chriseth Date: Thu, 28 May 2015 14:43:46 +0200 Subject: [PATCH 367/461] Allow duplicate code removal for loops. --- libevmasm/Assembly.cpp | 10 ++-- libevmasm/BlockDeduplicator.cpp | 75 +++++++++++++++++++------- libevmasm/BlockDeduplicator.h | 16 ++++-- libsolidity/ArrayUtils.cpp | 14 ++++- test/libsolidity/SolidityOptimizer.cpp | 32 +++++++++++ 5 files changed, 116 insertions(+), 31 deletions(-) diff --git a/libevmasm/Assembly.cpp b/libevmasm/Assembly.cpp index 5cf3b787a..8c6591885 100644 --- a/libevmasm/Assembly.cpp +++ b/libevmasm/Assembly.cpp @@ -307,6 +307,11 @@ Assembly& Assembly::optimise(bool _enable) count = 0; copt << "Performing optimisation..."; + // This only modifies PushTags, we have to run again to actually remove code. + BlockDeduplicator dedup(m_items); + if (dedup.deduplicate()) + count++; + { ControlFlowGraph cfg(m_items); AssemblyItems optimisedItems; @@ -349,11 +354,6 @@ Assembly& Assembly::optimise(bool _enable) m_items = move(optimisedItems); count++; } - - // This only modifies PushTags, we have to run again to actually remove code. - BlockDeduplicator dedup(m_items); - if (dedup.deduplicate()) - count++; } } diff --git a/libevmasm/BlockDeduplicator.cpp b/libevmasm/BlockDeduplicator.cpp index eadbe1b40..d930ea22b 100644 --- a/libevmasm/BlockDeduplicator.cpp +++ b/libevmasm/BlockDeduplicator.cpp @@ -35,13 +35,33 @@ bool BlockDeduplicator::deduplicate() { // Compares indices based on the suffix that starts there, ignoring tags and stopping at // opcodes that stop the control flow. + + // Virtual tag that signifies "the current block" and which is used to optimise loops. + // We abort if this virtual tag actually exists. + AssemblyItem pushSelf(PushTag, u256(-4)); + if ( + std::count(m_items.cbegin(), m_items.cend(), pushSelf.tag()) || + std::count(m_items.cbegin(), m_items.cend(), pushSelf.pushTag()) + ) + return false; + function comparator = [&](size_t _i, size_t _j) { if (_i == _j) return false; - BlockIterator first(m_items.begin() + _i, m_items.end()); - BlockIterator second(m_items.begin() + _j, m_items.end()); + // To compare recursive loops, we have to already unify PushTag opcodes of the + // block's own tag. + AssemblyItem pushFirstTag(pushSelf); + AssemblyItem pushSecondTag(pushSelf); + + if (_i < m_items.size() && m_items.at(_i).type() == Tag) + pushFirstTag = m_items.at(_i).pushTag(); + if (_j < m_items.size() && m_items.at(_j).type() == Tag) + pushSecondTag = m_items.at(_j).pushTag(); + + BlockIterator first(m_items.begin() + _i, m_items.end(), &pushFirstTag, &pushSelf); + BlockIterator second(m_items.begin() + _j, m_items.end(), &pushSecondTag, &pushSelf); BlockIterator end(m_items.end(), m_items.end()); if (first != end && (*first).type() == Tag) @@ -52,27 +72,34 @@ bool BlockDeduplicator::deduplicate() return std::lexicographical_compare(first, end, second, end); }; - set> blocksSeen(comparator); - map tagReplacement; - for (size_t i = 0; i < m_items.size(); ++i) + size_t iterations = 0; + for (; ; ++iterations) { - if (m_items.at(i).type() != Tag) - continue; - auto it = blocksSeen.find(i); - if (it == blocksSeen.end()) - blocksSeen.insert(i); - else - tagReplacement[m_items.at(i).data()] = m_items.at(*it).data(); - } - - bool ret = false; - for (AssemblyItem& item: m_items) - if (item.type() == PushTag && tagReplacement.count(item.data())) + //@todo this should probably be optimized. + set> blocksSeen(comparator); + map tagReplacement; + for (size_t i = 0; i < m_items.size(); ++i) { - ret = true; - item.setData(tagReplacement.at(item.data())); + if (m_items.at(i).type() != Tag) + continue; + auto it = blocksSeen.find(i); + if (it == blocksSeen.end()) + blocksSeen.insert(i); + else + tagReplacement[m_items.at(i).data()] = m_items.at(*it).data(); } - return ret; + + bool changed = false; + for (AssemblyItem& item: m_items) + if (item.type() == PushTag && tagReplacement.count(item.data())) + { + changed = true; + item.setData(tagReplacement.at(item.data())); + } + if (!changed) + break; + } + return iterations > 0; } BlockDeduplicator::BlockIterator& BlockDeduplicator::BlockIterator::operator++() @@ -89,3 +116,11 @@ BlockDeduplicator::BlockIterator& BlockDeduplicator::BlockIterator::operator++() } return *this; } + +AssemblyItem const& BlockDeduplicator::BlockIterator::operator*() const +{ + if (replaceItem && replaceWith && *it == *replaceItem) + return *replaceWith; + else + return *it; +} diff --git a/libevmasm/BlockDeduplicator.h b/libevmasm/BlockDeduplicator.h index 8a82a1ed7..c48835fd4 100644 --- a/libevmasm/BlockDeduplicator.h +++ b/libevmasm/BlockDeduplicator.h @@ -47,19 +47,27 @@ public: bool deduplicate(); private: - /// Iterator that skips tags skips to the end if (all branches of) the control + /// Iterator that skips tags and skips to the end if (all branches of) the control /// flow does not continue to the next instruction. + /// If the arguments are supplied to the constructor, replaces items on the fly. struct BlockIterator: std::iterator { public: - BlockIterator(AssemblyItems::const_iterator _it, AssemblyItems::const_iterator _end): - it(_it), end(_end) { } + BlockIterator( + AssemblyItems::const_iterator _it, + AssemblyItems::const_iterator _end, + AssemblyItem const* _replaceItem = nullptr, + AssemblyItem const* _replaceWith = nullptr + ): + it(_it), end(_end), replaceItem(_replaceItem), replaceWith(_replaceWith) {} BlockIterator& operator++(); bool operator==(BlockIterator const& _other) const { return it == _other.it; } bool operator!=(BlockIterator const& _other) const { return it != _other.it; } - AssemblyItem const& operator*() const { return *it; } + AssemblyItem const& operator*() const; AssemblyItems::const_iterator it; AssemblyItems::const_iterator end; + AssemblyItem const* replaceItem; + AssemblyItem const* replaceWith; }; AssemblyItems& m_items; diff --git a/libsolidity/ArrayUtils.cpp b/libsolidity/ArrayUtils.cpp index 448e4da2a..397b098c4 100644 --- a/libsolidity/ArrayUtils.cpp +++ b/libsolidity/ArrayUtils.cpp @@ -364,7 +364,13 @@ void ArrayUtils::clearStorageLoop(Type const& _type) const return; } // stack: end_pos pos - eth::AssemblyItem loopStart = m_context.newTag(); + + // jump to and return from the loop to allow for duplicate code removal + eth::AssemblyItem returnTag = m_context.pushNewTag(); + m_context << eth::Instruction::SWAP2 << eth::Instruction::SWAP1; + + // stack: end_pos pos + eth::AssemblyItem loopStart = m_context.appendJumpToNew(); m_context << loopStart; // check for loop condition m_context << eth::Instruction::DUP1 << eth::Instruction::DUP3 @@ -380,7 +386,11 @@ void ArrayUtils::clearStorageLoop(Type const& _type) const m_context.appendJumpTo(loopStart); // cleanup m_context << zeroLoopEnd; - m_context << eth::Instruction::POP; + m_context << eth::Instruction::POP << eth::Instruction::SWAP1; + // "return" + m_context << eth::Instruction::JUMP; + + m_context << returnTag; solAssert(m_context.getStackHeight() == stackHeightStart - 1, ""); } diff --git a/test/libsolidity/SolidityOptimizer.cpp b/test/libsolidity/SolidityOptimizer.cpp index 744fc48ae..827d8833a 100644 --- a/test/libsolidity/SolidityOptimizer.cpp +++ b/test/libsolidity/SolidityOptimizer.cpp @@ -1004,6 +1004,38 @@ BOOST_AUTO_TEST_CASE(block_deduplicator) BOOST_CHECK_EQUAL(pushTags.size(), 2); } +BOOST_AUTO_TEST_CASE(block_deduplicator_loops) +{ + AssemblyItems input{ + u256(0), + eth::Instruction::SLOAD, + AssemblyItem(PushTag, 1), + AssemblyItem(PushTag, 2), + eth::Instruction::JUMPI, + eth::Instruction::JUMP, + AssemblyItem(Tag, 1), + u256(5), + u256(6), + eth::Instruction::SSTORE, + AssemblyItem(PushTag, 1), + eth::Instruction::JUMP, + AssemblyItem(Tag, 2), + u256(5), + u256(6), + eth::Instruction::SSTORE, + AssemblyItem(PushTag, 2), + eth::Instruction::JUMP, + }; + BlockDeduplicator dedup(input); + dedup.deduplicate(); + + set pushTags; + for (AssemblyItem const& item: input) + if (item.type() == PushTag) + pushTags.insert(item.data()); + BOOST_CHECK_EQUAL(pushTags.size(), 1); +} + BOOST_AUTO_TEST_SUITE_END() } From b6f9d51cd622253352eec72517851dda5e6f8e4f Mon Sep 17 00:00:00 2001 From: chriseth Date: Thu, 28 May 2015 16:20:50 +0200 Subject: [PATCH 368/461] Re-introduce string type. --- libsolidity/AST.cpp | 2 ++ libsolidity/ExpressionCompiler.cpp | 3 ++ libsolidity/Token.h | 2 +- libsolidity/Types.cpp | 20 +++++++---- libsolidity/Types.h | 22 +++++++++---- mix/CodeModel.cpp | 4 ++- mix/SolidityType.h | 1 + test/libsolidity/SolidityABIJSON.cpp | 27 +++++++++++++++ .../SolidityNameAndTypeResolution.cpp | 33 +++++++++++++++++++ 9 files changed, 100 insertions(+), 14 deletions(-) diff --git a/libsolidity/AST.cpp b/libsolidity/AST.cpp index 14884254e..248abfdb9 100644 --- a/libsolidity/AST.cpp +++ b/libsolidity/AST.cpp @@ -890,6 +890,8 @@ void IndexAccess::checkTypeRequirements(TypePointers const*) ArrayType const& type = dynamic_cast(*m_base->getType()); if (!m_index) BOOST_THROW_EXCEPTION(createTypeError("Index expression cannot be omitted.")); + if (type.isString()) + BOOST_THROW_EXCEPTION(createTypeError("Index access for string is not possible.")); m_index->expectType(IntegerType(256)); if (type.isByteArray()) m_type = make_shared(1); diff --git a/libsolidity/ExpressionCompiler.cpp b/libsolidity/ExpressionCompiler.cpp index 2e513b7fc..5a9782858 100644 --- a/libsolidity/ExpressionCompiler.cpp +++ b/libsolidity/ExpressionCompiler.cpp @@ -824,7 +824,10 @@ bool ExpressionCompiler::visit(IndexAccess const& _indexAccess) if (arrayType.getLocation() == ArrayType::Location::Storage) { if (arrayType.isByteArray()) + { + solAssert(!arrayType.isString(), "Index access to string is not allowed."); setLValue(_indexAccess); + } else setLValueToStorageItem(_indexAccess); } diff --git a/libsolidity/Token.h b/libsolidity/Token.h index 8a373da34..bce16ed17 100644 --- a/libsolidity/Token.h +++ b/libsolidity/Token.h @@ -286,6 +286,7 @@ namespace solidity K(Bytes32, "bytes32", 0) \ K(Bytes, "bytes", 0) \ K(Byte, "byte", 0) \ + K(String, "string", 0) \ K(Address, "address", 0) \ K(Bool, "bool", 0) \ K(Real, "real", 0) \ @@ -312,7 +313,6 @@ namespace solidity K(Match, "match", 0) \ K(Of, "of", 0) \ K(Relocatable, "relocatable", 0) \ - T(String, "string", 0) \ K(Switch, "switch", 0) \ K(Throw, "throw", 0) \ K(Try, "try", 0) \ diff --git a/libsolidity/Types.cpp b/libsolidity/Types.cpp index 7577b83a1..0e9ea9876 100644 --- a/libsolidity/Types.cpp +++ b/libsolidity/Types.cpp @@ -145,6 +145,8 @@ TypePointer Type::fromElementaryTypeName(Token::Value _typeToken) return make_shared(); else if (_typeToken == Token::Bytes) return make_shared(ArrayType::Location::Storage); + else if (_typeToken == Token::String) + return make_shared(ArrayType::Location::Storage, true); else BOOST_THROW_EXCEPTION(InternalCompilerError() << errinfo_comment("Unable to convert elementary typename " + std::string(Token::toString(_typeToken)) + " to type.")); @@ -663,7 +665,7 @@ bool ArrayType::isImplicitlyConvertibleTo(const Type& _convertTo) const // let us not allow assignment to memory arrays for now if (convertTo.getLocation() != Location::Storage) return false; - if (convertTo.isByteArray() != isByteArray()) + if (convertTo.isByteArray() != isByteArray() || convertTo.isString() != isString()) return false; if (!getBaseType()->isImplicitlyConvertibleTo(*convertTo.getBaseType())) return false; @@ -684,8 +686,12 @@ bool ArrayType::operator==(Type const& _other) const if (_other.getCategory() != getCategory()) return false; ArrayType const& other = dynamic_cast(_other); - if (other.m_location != m_location || other.isByteArray() != isByteArray() || - other.isDynamicallySized() != isDynamicallySized()) + if ( + other.m_location != m_location || + other.isByteArray() != isByteArray() || + other.isString() != isString() || + other.isDynamicallySized() != isDynamicallySized() + ) return false; return isDynamicallySized() || getLength() == other.getLength(); } @@ -736,7 +742,9 @@ unsigned ArrayType::getSizeOnStack() const string ArrayType::toString() const { - if (isByteArray()) + if (isString()) + return "string"; + else if (isByteArray()) return "bytes"; string ret = getBaseType()->toString() + "["; if (!isDynamicallySized()) @@ -746,7 +754,7 @@ string ArrayType::toString() const TypePointer ArrayType::externalType() const { - if (m_isByteArray) + if (m_arrayKind != ArrayKind::Ordinary) return shared_from_this(); if (!m_baseType->externalType()) return TypePointer(); @@ -762,7 +770,7 @@ TypePointer ArrayType::externalType() const shared_ptr ArrayType::copyForLocation(ArrayType::Location _location) const { auto copy = make_shared(_location); - copy->m_isByteArray = m_isByteArray; + copy->m_arrayKind = m_arrayKind; if (m_baseType->getCategory() == Type::Category::Array) copy->m_baseType = dynamic_cast(*m_baseType).copyForLocation(_location); else diff --git a/libsolidity/Types.h b/libsolidity/Types.h index a69df964c..65f6e4474 100644 --- a/libsolidity/Types.h +++ b/libsolidity/Types.h @@ -367,10 +367,10 @@ public: virtual Category getCategory() const override { return Category::Array; } - /// Constructor for a byte array ("bytes") - explicit ArrayType(Location _location): + /// Constructor for a byte array ("bytes") and string. + explicit ArrayType(Location _location, bool _isString = false): m_location(_location), - m_isByteArray(true), + m_arrayKind(_isString ? ArrayKind::String : ArrayKind::Bytes), m_baseType(std::make_shared(1)) {} /// Constructor for a dynamically sized array type ("type[]") @@ -394,11 +394,17 @@ public: virtual u256 getStorageSize() const override; virtual unsigned getSizeOnStack() const override; virtual std::string toString() const override; - virtual MemberList const& getMembers() const override { return s_arrayTypeMemberList; } + virtual MemberList const& getMembers() const override + { + return isString() ? EmptyMemberList : s_arrayTypeMemberList; + } virtual TypePointer externalType() const override; Location getLocation() const { return m_location; } - bool isByteArray() const { return m_isByteArray; } + /// @returns true if this is a byte array or a string + bool isByteArray() const { return m_arrayKind != ArrayKind::Ordinary; } + /// @returns true if this is a string + bool isString() const { return m_arrayKind == ArrayKind::String; } TypePointer const& getBaseType() const { solAssert(!!m_baseType, ""); return m_baseType;} u256 const& getLength() const { return m_length; } @@ -407,8 +413,12 @@ public: std::shared_ptr copyForLocation(Location _location) const; private: + /// String is interpreted as a subtype of Bytes. + enum class ArrayKind { Ordinary, Bytes, String }; + Location m_location; - bool m_isByteArray = false; ///< Byte arrays ("bytes") have different semantics from ordinary arrays. + ///< Byte arrays ("bytes") and strings have different semantics from ordinary arrays. + ArrayKind m_arrayKind = ArrayKind::Ordinary; TypePointer m_baseType; bool m_hasDynamicLength = true; u256 m_length; diff --git a/mix/CodeModel.cpp b/mix/CodeModel.cpp index 2b4e332c0..bfa4dada9 100644 --- a/mix/CodeModel.cpp +++ b/mix/CodeModel.cpp @@ -507,7 +507,9 @@ SolidityType CodeModel::nodeType(dev::solidity::Type const* _type) case Type::Category::Array: { ArrayType const* array = dynamic_cast(_type); - if (array->isByteArray()) + if (array->isString()) + r.type = SolidityType::Type::String; + else if (array->isByteArray()) r.type = SolidityType::Type::Bytes; else { diff --git a/mix/SolidityType.h b/mix/SolidityType.h index accdb14b4..75f47e7fa 100644 --- a/mix/SolidityType.h +++ b/mix/SolidityType.h @@ -45,6 +45,7 @@ struct SolidityType Bool, Address, Bytes, + String, Enum, Struct }; diff --git a/test/libsolidity/SolidityABIJSON.cpp b/test/libsolidity/SolidityABIJSON.cpp index f9bf78d0a..f7390dc93 100644 --- a/test/libsolidity/SolidityABIJSON.cpp +++ b/test/libsolidity/SolidityABIJSON.cpp @@ -568,6 +568,33 @@ BOOST_AUTO_TEST_CASE(return_param_in_abi) checkInterface(sourceCode, interface); } +BOOST_AUTO_TEST_CASE(strings_and_arrays) +{ + // bug #1801 + char const* sourceCode = R"( + contract test { + function f(string a, bytes b, uint[] c) external {} + } + )"; + + char const* interface = R"( + [ + { + "constant" : false, + "name": "f", + "inputs": [ + { "name": "a", "type": "string" }, + { "name": "b", "type": "bytes" }, + { "name": "c", "type": "uint256[]" } + ], + "outputs": [], + "type" : "function" + } + ] + )"; + checkInterface(sourceCode, interface); +} + BOOST_AUTO_TEST_SUITE_END() } diff --git a/test/libsolidity/SolidityNameAndTypeResolution.cpp b/test/libsolidity/SolidityNameAndTypeResolution.cpp index c52bbf9de..48404aaac 100644 --- a/test/libsolidity/SolidityNameAndTypeResolution.cpp +++ b/test/libsolidity/SolidityNameAndTypeResolution.cpp @@ -1783,6 +1783,39 @@ BOOST_AUTO_TEST_CASE(uninitialized_var) BOOST_CHECK_THROW(parseTextAndResolveNames(sourceCode), TypeError); } +BOOST_AUTO_TEST_CASE(string) +{ + char const* sourceCode = R"( + contract C { + string s; + function f(string x) external { s = x; } + } + )"; + BOOST_CHECK_NO_THROW(parseTextAndResolveNames(sourceCode)); +} + +BOOST_AUTO_TEST_CASE(string_index) +{ + char const* sourceCode = R"( + contract C { + string s; + function f() { var a = s[2]; } + } + )"; + BOOST_CHECK_THROW(parseTextAndResolveNames(sourceCode), TypeError); +} + +BOOST_AUTO_TEST_CASE(string_length) +{ + char const* sourceCode = R"( + contract C { + string s; + function f() { var a = s.length; } + } + )"; + BOOST_CHECK_THROW(parseTextAndResolveNames(sourceCode), TypeError); +} + BOOST_AUTO_TEST_SUITE_END() } From df3313046b1129aee39a62a6a50169c87f3071f4 Mon Sep 17 00:00:00 2001 From: yann300 Date: Thu, 28 May 2015 17:05:52 +0200 Subject: [PATCH 369/461] - add validation for input parameters. - ui bug fix. --- mix/qml.qrc | 1 + mix/qml/QIntTypeView.qml | 7 +++ mix/qml/TransactionDialog.qml | 23 ++++++- mix/qml/js/InputValidator.js | 112 ++++++++++++++++++++++++++++++++++ 4 files changed, 141 insertions(+), 2 deletions(-) create mode 100644 mix/qml/js/InputValidator.js diff --git a/mix/qml.qrc b/mix/qml.qrc index c47a7254f..784404270 100644 --- a/mix/qml.qrc +++ b/mix/qml.qrc @@ -63,5 +63,6 @@ qml/js/Printer.js qml/js/ansi2html.js qml/js/NetworkDeployment.js + qml/js/InputValidator.js diff --git a/mix/qml/QIntTypeView.qml b/mix/qml/QIntTypeView.qml index a3c67aafc..c42e65654 100644 --- a/mix/qml/QIntTypeView.qml +++ b/mix/qml/QIntTypeView.qml @@ -21,8 +21,15 @@ Item clip: true selectByMouse: true text: value + anchors.fill: parent font.pointSize: dbgStyle.general.basicFontSize color: dbgStyle.general.basicColor + MouseArea { + id: mouseArea + anchors.fill: parent + hoverEnabled: true + onClicked: textinput.forceActiveFocus() + } } } } diff --git a/mix/qml/TransactionDialog.qml b/mix/qml/TransactionDialog.qml index e7fe22e51..a4c896d3f 100644 --- a/mix/qml/TransactionDialog.qml +++ b/mix/qml/TransactionDialog.qml @@ -6,6 +6,7 @@ import QtQuick.Window 2.0 import QtQuick.Controls.Styles 1.3 import org.ethereum.qml.QEther 1.0 import "js/TransactionHelper.js" as TransactionHelper +import "js/InputValidator.js" as InputValidator import "." Dialog { @@ -503,10 +504,22 @@ Dialog { anchors.right: parent.right; Button { + text: qsTr("OK"); onClicked: { - close(); - accepted(); + var invalid = InputValidator.validate(paramsModel, paramValues); + if (invalid.length === 0) + { + close(); + accepted(); + } + else + { + errorDialog.text = qsTr("some parameters are invalid:\n"); + for (var k in invalid) + errorDialog.text += invalid[k].message + "\n"; + errorDialog.open(); + } } } @@ -514,6 +527,12 @@ Dialog { text: qsTr("Cancel"); onClicked: close(); } + + MessageDialog { + id: errorDialog + standardButtons: StandardButton.Ok + icon: StandardIcon.Critical + } } } } diff --git a/mix/qml/js/InputValidator.js b/mix/qml/js/InputValidator.js new file mode 100644 index 000000000..6e94dec6e --- /dev/null +++ b/mix/qml/js/InputValidator.js @@ -0,0 +1,112 @@ +var nbRegEx = new RegExp('^[0-9]+$'); +function validate(model, values) +{ + var inError = []; + for (var k in model) + { + if (values[model[k].name]) + { + var type = model[k].type.name; + var res; + if (type.indexOf("int") !== -1) + res = validateInt(type, values[model[k].name]); + else if (type.indexOf("bytes") !== -1) + res = validateBytes(type, values[model[k].name]); + else if (type.indexOf("bool") !== -1) + res = validateBool(type, values[model[k].name]); + else if (type.indexOf("address") !== -1) + res = validateAddress(type, values[model[k].name]); + else + res = validateAddress(type, values[model[k].name]); //we suppose that this is a ctr type. + if (!res.valid) + inError.push({ type: type, value: values, message: res.message }); + } + } + return inError; +} + +function validateInt(_type, _value) +{ + var ret = { valid: true, message: "" } + if (_value.indexOf("-") === 0) + { + _value = _value.substring(1); + if (_type.indexOf("uint") === -1) + { + ret.valid = false; + ret.message = "uint type cannot represent negative number"; + return false; + } + } + ret.valid = nbRegEx.test(_value); + if (!ret.valid) + ret.message = _value + " does not represent " + _type + " type."; + else + { + var t = _type.replace("uint", "").replace("int", ""); + var max = parseInt(t) / 4; + if (_value.length > max) + { + ret.valid = false; + ret.message = _type + " should not contains more than " + max + " digits"; + } + } + return ret; +} + +function validateAddress(_type, _value) +{ + var ret = { valid: true, message: "" } + if (_value.indexOf("<") === 0 && _value.indexOf(">") === _value.length - 1) + { + var v = _value.split(' - '); + console.log(JSON.stringify(v)); + if (v.length !== 2 || !nbRegEx.test(v[1].replace(">", ""))) // + { + ret.valid = false; + ret.message = _value + " is not a valid token for address type."; + } + } + else if (_value.indexOf("0x") !== 0) + { + ret.valid = false + ret.message = "Address type should start with 0x."; + } + else + { + _value = _value.substring(2); + if (_value.length !== 40) + { + ret.valid = false + ret.message = "Address type should contain 40 characters."; + } + } + return ret; +} + +function validateBytes(_type, _value) +{ + var ret = { valid: true, message: "" } + if (_value.length > parseInt(_type.replace("bytes", "")) ) + { + ret.valid = false; + ret.message = _type + " should not contains more than " + _type.replace("bytes", "") + " characters"; + } + return ret; +} + +function validateBool(_type, _value) +{ + var ret = { valid: true, message: "" } + if (_value !== "1" && _value !== "0") + { + ret.valid = false; + ret.message = _value + " is not in the correct bool format"; + } + return ret; +} + +function validateEnum(_type, _value) +{ +} + From b649409cbf5d798f0a4a4c05c4500332a91a8575 Mon Sep 17 00:00:00 2001 From: subtly Date: Thu, 28 May 2015 22:13:30 +0200 Subject: [PATCH 370/461] Code review optimization. --- libethereum/EthereumHost.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libethereum/EthereumHost.cpp b/libethereum/EthereumHost.cpp index 43af332c6..cea9339f2 100644 --- a/libethereum/EthereumHost.cpp +++ b/libethereum/EthereumHost.cpp @@ -224,7 +224,7 @@ tuple>, vector>, list> allowed; list> sessions; - auto ps = peerSessions(); + auto const& ps = peerSessions(); allowed.reserve(ps.size()); for (auto const& j: ps) { From 17e9896cd4ff3a2884ddece48f3cab5e23586a3b Mon Sep 17 00:00:00 2001 From: Vlad Gluhovsky Date: Thu, 28 May 2015 23:00:47 +0200 Subject: [PATCH 371/461] last two parameters of seal() were swapped --- libwhisper/Message.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/libwhisper/Message.h b/libwhisper/Message.h index 893602190..0735d6714 100644 --- a/libwhisper/Message.h +++ b/libwhisper/Message.h @@ -119,11 +119,11 @@ public: operator bool() const { return !!m_payload.size() || m_from || m_to; } /// Turn this message into a ditributable Envelope. - Envelope seal(Secret _from, FullTopic const& _topic, unsigned _workToProve = 50, unsigned _ttl = 50) const; + Envelope seal(Secret _from, FullTopic const& _topic, unsigned _ttl = 50, unsigned _workToProve = 50) const; // Overloads for skipping _from or specifying _to. - Envelope seal(FullTopic const& _topic, unsigned _ttl = 50, unsigned _workToProve = 50) const { return seal(Secret(), _topic, _workToProve, _ttl); } - Envelope sealTo(Public _to, FullTopic const& _topic, unsigned _workToProve = 50, unsigned _ttl = 50) { m_to = _to; return seal(Secret(), _topic, _workToProve, _ttl); } - Envelope sealTo(Secret _from, Public _to, FullTopic const& _topic, unsigned _workToProve = 50, unsigned _ttl = 50) { m_to = _to; return seal(_from, _topic, _workToProve, _ttl); } + Envelope seal(FullTopic const& _topic, unsigned _ttl = 50, unsigned _workToProve = 50) const { return seal(Secret(), _topic, _ttl, _workToProve); } + Envelope sealTo(Public _to, FullTopic const& _topic, unsigned _ttl = 50, unsigned _workToProve = 50) { m_to = _to; return seal(Secret(), _topic, _ttl, _workToProve); } + Envelope sealTo(Secret _from, Public _to, FullTopic const& _topic, unsigned _ttl = 50, unsigned _workToProve = 50) { m_to = _to; return seal(_from, _topic, _ttl, _workToProve); } private: bool populate(bytes const& _data); From 55b30a4a64baa6b39c3e089690cb97759269f775 Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Tue, 26 May 2015 12:52:32 +0200 Subject: [PATCH 372/461] add creation transaction merge cleanup --- libevm/VM.cpp | 6 ++-- libevm/VM.h | 2 +- libjsqrc/ethereumjs/dist/web3.js.map | 2 +- .../StateTestsFiller/stSpecialTestFiller.json | 36 +++++++++++++++++++ 4 files changed, 41 insertions(+), 5 deletions(-) diff --git a/libevm/VM.cpp b/libevm/VM.cpp index ff771d21c..f7956d382 100644 --- a/libevm/VM.cpp +++ b/libevm/VM.cpp @@ -71,7 +71,7 @@ bytesConstRef VM::go(ExtVMFace& _ext, OnOpFunc const& _onOp, uint64_t _steps) for (unsigned i = 0; i < _ext.code.size(); ++i) { if (_ext.code[i] == (byte)Instruction::JUMPDEST) - m_jumpDests.insert(i); + m_jumpDests.push_back(i); else if (_ext.code[i] >= (byte)Instruction::PUSH1 && _ext.code[i] <= (byte)Instruction::PUSH32) i += _ext.code[i] - (unsigned)Instruction::PUSH1 + 1; } @@ -546,7 +546,7 @@ bytesConstRef VM::go(ExtVMFace& _ext, OnOpFunc const& _onOp, uint64_t _steps) break; case Instruction::JUMP: nextPC = m_stack.back(); - if (!m_jumpDests.count(nextPC)) + if (find(m_jumpDests.begin(), m_jumpDests.end(), nextPC) == m_jumpDests.end()) BOOST_THROW_EXCEPTION(BadJumpDestination()); m_stack.pop_back(); break; @@ -554,7 +554,7 @@ bytesConstRef VM::go(ExtVMFace& _ext, OnOpFunc const& _onOp, uint64_t _steps) if (m_stack[m_stack.size() - 2]) { nextPC = m_stack.back(); - if (!m_jumpDests.count(nextPC)) + if (find(m_jumpDests.begin(), m_jumpDests.end(), nextPC) == m_jumpDests.end()) BOOST_THROW_EXCEPTION(BadJumpDestination()); } m_stack.pop_back(); diff --git a/libevm/VM.h b/libevm/VM.h index 181fcdc2e..9b67d3724 100644 --- a/libevm/VM.h +++ b/libevm/VM.h @@ -74,7 +74,7 @@ private: u256 m_curPC = 0; bytes m_temp; u256s m_stack; - std::set m_jumpDests; + std::vector m_jumpDests; std::function m_onFail; bigint m_gas = 0; }; diff --git a/libjsqrc/ethereumjs/dist/web3.js.map b/libjsqrc/ethereumjs/dist/web3.js.map index e25fa3aed..519e05543 100644 --- a/libjsqrc/ethereumjs/dist/web3.js.map +++ b/libjsqrc/ethereumjs/dist/web3.js.map @@ -29,7 +29,7 @@ "lib/web3/shh.js", "lib/web3/watches.js", "node_modules/browserify/lib/_empty.js", - "bignumber.js", + "node_modules/bignumber.js/bignumber.js", "index.js" ], "names": [], diff --git a/test/libethereum/StateTestsFiller/stSpecialTestFiller.json b/test/libethereum/StateTestsFiller/stSpecialTestFiller.json index 7ffc5f28d..60d9882c4 100644 --- a/test/libethereum/StateTestsFiller/stSpecialTestFiller.json +++ b/test/libethereum/StateTestsFiller/stSpecialTestFiller.json @@ -120,5 +120,41 @@ "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", "value" : "100000" } + }, + + "JUMPDEST_Attack" : { + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "256", + "currentGasLimit" : "100000000", + "currentNumber" : "0", + "currentTimestamp" : 1, + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000000", + "code" : "0x600060006000600060003061c3505a03f1005b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b", + "nonce" : "0", + "storage" : { + } + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1000000000000000000", + "code" : "0x", + "nonce" : "0", + "storage" : { + } + } + }, + "transaction" : { + "data" : "", + "gasLimit" : "100000000", + "gasPrice" : "1", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "100000" + } } } From af75a0551beb8c5f83dad6dbdec102421d4556dc Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Fri, 29 May 2015 10:34:37 +0200 Subject: [PATCH 373/461] clean up --- libjsqrc/ethereumjs/dist/web3.js.map | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libjsqrc/ethereumjs/dist/web3.js.map b/libjsqrc/ethereumjs/dist/web3.js.map index 519e05543..e25fa3aed 100644 --- a/libjsqrc/ethereumjs/dist/web3.js.map +++ b/libjsqrc/ethereumjs/dist/web3.js.map @@ -29,7 +29,7 @@ "lib/web3/shh.js", "lib/web3/watches.js", "node_modules/browserify/lib/_empty.js", - "node_modules/bignumber.js/bignumber.js", + "bignumber.js", "index.js" ], "names": [], From 1722dd6695a7ad1b35e7b935a70006599c1d3499 Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Fri, 29 May 2015 11:07:23 +0200 Subject: [PATCH 374/461] Remove deprecated std::auto_ptr - With gcc 5.1.0 we now get warnings for usage of std::auto_ptr. It is deprecated by the C++0x standard and afterwards so it's prudent to replace them with unique pointers. --- libtestutils/BlockChainLoader.h | 2 +- mix/MixClient.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/libtestutils/BlockChainLoader.h b/libtestutils/BlockChainLoader.h index 58b1affaf..b963638d1 100644 --- a/libtestutils/BlockChainLoader.h +++ b/libtestutils/BlockChainLoader.h @@ -44,7 +44,7 @@ public: private: TransientDirectory m_dir; - std::auto_ptr m_bc; + std::unique_ptr m_bc; eth::State m_state; }; diff --git a/mix/MixClient.h b/mix/MixClient.h index 2c6734234..4c5b51a09 100644 --- a/mix/MixClient.h +++ b/mix/MixClient.h @@ -94,7 +94,7 @@ private: eth::State m_state; eth::State m_startState; OverlayDB m_stateDB; - std::auto_ptr m_bc; + std::unique_ptr m_bc; mutable boost::shared_mutex x_state; mutable boost::shared_mutex x_executions; ExecutionResults m_executions; From 0519bdbd71458cb3450e0f2b48c1637bab4ad3c7 Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Fri, 29 May 2015 11:18:03 +0200 Subject: [PATCH 375/461] max pc is uint64_t --- libevm/VM.cpp | 4 ++-- libevm/VM.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libevm/VM.cpp b/libevm/VM.cpp index f7956d382..3d20fe519 100644 --- a/libevm/VM.cpp +++ b/libevm/VM.cpp @@ -546,7 +546,7 @@ bytesConstRef VM::go(ExtVMFace& _ext, OnOpFunc const& _onOp, uint64_t _steps) break; case Instruction::JUMP: nextPC = m_stack.back(); - if (find(m_jumpDests.begin(), m_jumpDests.end(), nextPC) == m_jumpDests.end()) + if (find(m_jumpDests.begin(), m_jumpDests.end(), (uint64_t)nextPC) == m_jumpDests.end() || nextPC > numeric_limits::max() ) BOOST_THROW_EXCEPTION(BadJumpDestination()); m_stack.pop_back(); break; @@ -554,7 +554,7 @@ bytesConstRef VM::go(ExtVMFace& _ext, OnOpFunc const& _onOp, uint64_t _steps) if (m_stack[m_stack.size() - 2]) { nextPC = m_stack.back(); - if (find(m_jumpDests.begin(), m_jumpDests.end(), nextPC) == m_jumpDests.end()) + if (find(m_jumpDests.begin(), m_jumpDests.end(), (uint64_t)nextPC) == m_jumpDests.end() || nextPC > numeric_limits::max() ) BOOST_THROW_EXCEPTION(BadJumpDestination()); } m_stack.pop_back(); diff --git a/libevm/VM.h b/libevm/VM.h index 9b67d3724..8fa3911b5 100644 --- a/libevm/VM.h +++ b/libevm/VM.h @@ -74,7 +74,7 @@ private: u256 m_curPC = 0; bytes m_temp; u256s m_stack; - std::vector m_jumpDests; + std::vector m_jumpDests; std::function m_onFail; bigint m_gas = 0; }; From 597f56843b2d9e24b34de9876f06733d07cd4e06 Mon Sep 17 00:00:00 2001 From: arkpar Date: Wed, 27 May 2015 16:22:14 +0200 Subject: [PATCH 376/461] GetBlockHashesByNumber packet --- libethereum/Client.cpp | 3 +- libethereum/CommonNet.h | 1 + libethereum/DownloadMan.cpp | 3 +- libethereum/DownloadMan.h | 12 +- libethereum/EthereumHost.cpp | 148 ++++++++++++-------- libethereum/EthereumHost.h | 51 +++---- libethereum/EthereumPeer.cpp | 264 +++++++++++------------------------ libethereum/EthereumPeer.h | 40 +++--- libp2p/Capability.h | 1 - libp2p/Host.cpp | 6 +- libp2p/HostCapability.h | 4 +- libwhisper/WhisperPeer.cpp | 2 +- libwhisper/WhisperPeer.h | 3 +- test/libp2p/capability.cpp | 2 +- 14 files changed, 230 insertions(+), 310 deletions(-) diff --git a/libethereum/Client.cpp b/libethereum/Client.cpp index 3ca9a3172..e7d7a543b 100644 --- a/libethereum/Client.cpp +++ b/libethereum/Client.cpp @@ -185,10 +185,9 @@ Client::Client(p2p::Host* _extNet, std::shared_ptr _gp, std::string c m_gp->update(m_bc); - auto host = _extNet->registerCapability(new EthereumHost(m_bc, m_tq, m_bq, _networkId)); m_host = host; - _extNet->addCapability(host, EthereumHost::staticName(), EthereumHost::staticVersion() - 1); + _extNet->addCapability(host, EthereumHost::staticName(), EthereumHost::c_oldProtocolVersion); //TODO: remove this one v61+ protocol is common if (_dbPath.size()) Defaults::setDBPath(_dbPath); diff --git a/libethereum/CommonNet.h b/libethereum/CommonNet.h index 8b810bd10..a2f4a2e7c 100644 --- a/libethereum/CommonNet.h +++ b/libethereum/CommonNet.h @@ -63,6 +63,7 @@ enum GetBlocksPacket, BlocksPacket, NewBlockPacket, + GetBlockHashesByNumberPacket, PacketCount }; diff --git a/libethereum/DownloadMan.cpp b/libethereum/DownloadMan.cpp index 838e29078..3e33f3eb5 100644 --- a/libethereum/DownloadMan.cpp +++ b/libethereum/DownloadMan.cpp @@ -122,5 +122,6 @@ void HashDownloadSub::noteHash(unsigned _index, unsigned _size) Guard l(m_fetch); if (m_man) for(unsigned i = _index; i < _index + _size; ++i) - m_man->m_got += i; + if (i >= m_man->m_got.all().first && i < m_man->m_got.all().second) + m_man->m_got += i; } diff --git a/libethereum/DownloadMan.h b/libethereum/DownloadMan.h index 4ff83847c..3e1a071c9 100644 --- a/libethereum/DownloadMan.h +++ b/libethereum/DownloadMan.h @@ -234,12 +234,6 @@ public: m_chainStart = _start; m_chainCount = 0; m_got = RangeMask(_start, _start); - - { - ReadGuard l(x_subs); - for (auto i: m_subs) - i->resetFetch(); - } } RangeMask taken(bool _desperate = false) const @@ -259,7 +253,7 @@ public: { ReadGuard l(m_lock); return m_got.full(); - }\ + } size_t chainSize() const { ReadGuard l(m_lock); return m_chainCount; } size_t chainEmpty() const { ReadGuard l(m_lock); return m_chainCount == 0; } @@ -277,10 +271,6 @@ private: std::unordered_set m_subs; }; - - - - } } diff --git a/libethereum/EthereumHost.cpp b/libethereum/EthereumHost.cpp index af1caf3d4..cbf96a011 100644 --- a/libethereum/EthereumHost.cpp +++ b/libethereum/EthereumHost.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include "BlockChain.h" #include "TransactionQueue.h" #include "BlockQueue.h" @@ -37,7 +38,7 @@ using namespace dev; using namespace dev::eth; using namespace p2p; -const unsigned c_prevProtocolVersion = 60; +unsigned const EthereumHost::c_oldProtocolVersion = 60; //TODO: remove this once v61+ is common EthereumHost::EthereumHost(BlockChain const& _ch, TransactionQueue& _tq, BlockQueue& _bq, u256 _networkId): HostCapability(), @@ -71,12 +72,6 @@ bool EthereumHost::ensureInitialised() return false; } -void EthereumHost::noteNeedsSyncing(EthereumPeer* _who) -{ - if (_who->m_asking == Asking::Nothing) - continueSync(_who); -} - void EthereumHost::reset() { forEachPeer([](EthereumPeer* _p) { _p->abortSync(); }); @@ -88,7 +83,7 @@ void EthereumHost::reset() m_syncingTotalDifficulty = 0; m_latestBlockSent = h256(); m_transactionsSent.clear(); - m_v60Hashes.clear(); + m_hashes.clear(); } void EthereumHost::doWork() @@ -130,7 +125,7 @@ void EthereumHost::maintainTransactions() } for (auto const& t: ts) m_transactionsSent.insert(t.first); - forEachPeer([&](shared_ptr _p) + forEachPeerPtr([&](shared_ptr _p) { bytes b; unsigned n = 0; @@ -153,29 +148,27 @@ void EthereumHost::maintainTransactions() }); } -void EthereumHost::forEachPeer(std::function const& _f) +void EthereumHost::forEachPeer(std::function const& _f) const { - forEachPeer([&](std::shared_ptr _p) + forEachPeerPtr([&](std::shared_ptr _p) { if (_p) _f(_p.get()); }); } -void EthereumHost::forEachPeer(std::function)> const& _f) +void EthereumHost::forEachPeerPtr(std::function)> const& _f) const { for (auto s: peerSessions()) _f(s.first->cap()); - for (auto s: peerSessions(protocolVersion() - 1)) //TODO: - _f(s.first->cap(protocolVersion() - 1)); - + for (auto s: peerSessions(c_oldProtocolVersion)) //TODO: remove once v61+ is common + _f(s.first->cap(c_oldProtocolVersion)); } pair>, vector>> EthereumHost::randomSelection(unsigned _percent, std::function const& _allow) { pair>, vector>> ret; - vector> peers; - forEachPeer([&](shared_ptr _p) + forEachPeerPtr([&](shared_ptr _p) { if (_p && _allow(_p.get())) ret.second.push_back(_p); @@ -233,16 +226,12 @@ void EthereumHost::maintainBlocks(h256 const& _currentHash) } } -void EthereumHost::onPeerState(EthereumPeer* _peer) +void EthereumHost::onPeerStatus(EthereumPeer* _peer) { - if (!_peer->enabled()) - { - clog(NetNote) << "Ignoring status from disabled peer"; - return; - } + Guard l(x_sync); if (_peer->m_genesisHash != m_chain.genesisHash()) _peer->disable("Invalid genesis hash"); - else if (_peer->m_protocolVersion != protocolVersion())// && _peer->m_protocolVersion != c_prevProtocolVersion) + else if (_peer->m_protocolVersion != protocolVersion() && _peer->m_protocolVersion != c_oldProtocolVersion) _peer->disable("Invalid protocol version."); else if (_peer->m_networkId != networkId()) _peer->disable("Invalid network identifier."); @@ -252,16 +241,44 @@ void EthereumHost::onPeerState(EthereumPeer* _peer) _peer->disable("Peer banned for previous bad behaviour."); else { - - _peer->m_expectedHashes = 500000; //TODO: + if (_peer->m_protocolVersion != protocolVersion()) + estimatePeerHashes(_peer); + else if (_peer->m_latestBlockNumber > m_chain.number()) + _peer->m_expectedHashes = (unsigned)_peer->m_latestBlockNumber - m_chain.number(); if (m_hashMan.chainSize() < _peer->m_expectedHashes) m_hashMan.resetToRange(m_chain.number() + 1, _peer->m_expectedHashes); continueSync(_peer); } } +void EthereumHost::estimatePeerHashes(EthereumPeer* _peer) +{ + BlockInfo block = m_chain.info(); + time_t lastBlockTime = (block.hash() == m_chain.genesisHash()) ? 1428192000 : (time_t)block.timestamp; + time_t now = time(0); + unsigned blockCount = 1000; + if (lastBlockTime > now) + clog(NetWarn) << "Clock skew? Latest block is in the future"; + else + blockCount += (now - lastBlockTime) / (unsigned)c_durationLimit; + clog(NetAllDetail) << "Estimated hashes: " << blockCount; + _peer->m_expectedHashes = blockCount; +} + void EthereumHost::onPeerHashes(EthereumPeer* _peer, h256s const& _hashes) { + Guard l(x_sync); + assert(_peer->m_asking == Asking::Nothing); + onPeerHashes(_peer, _hashes, false); +} + +void EthereumHost::onPeerHashes(EthereumPeer* _peer, h256s const& _hashes, bool _complete) +{ + if (_hashes.empty()) + { + onPeerDoneHashes(_peer, true); + return; + } unsigned knowns = 0; unsigned unknowns = 0; h256s neededBlocks; @@ -273,8 +290,8 @@ void EthereumHost::onPeerHashes(EthereumPeer* _peer, h256s const& _hashes) if (status == QueueStatus::Importing || status == QueueStatus::Ready || m_chain.isKnown(h)) { clog(NetMessageSummary) << "block hash ready:" << h << ". Start blocks download..."; - m_v60Hashes += neededBlocks; - onPeerDoneHashes(_peer, false); + m_hashes += neededBlocks; + onPeerDoneHashes(_peer, true); return; } else if (status == QueueStatus::Bad) @@ -292,7 +309,7 @@ void EthereumHost::onPeerHashes(EthereumPeer* _peer, h256s const& _hashes) knowns++; m_syncingLatestHash = h; } - m_v60Hashes += neededBlocks; + m_hashes += neededBlocks; clog(NetMessageSummary) << knowns << "knowns," << unknowns << "unknowns; now at" << m_syncingLatestHash; if (_complete) { @@ -312,6 +329,13 @@ void EthereumHost::onPeerHashes(EthereumPeer* _peer, h256s const& _hashes) void EthereumHost::onPeerHashes(EthereumPeer* _peer, unsigned /*_index*/, h256s const& _hashes) { + Guard l(x_sync); + assert(_peer->m_asking == Asking::Nothing); + if (_hashes.empty()) + { + onPeerDoneHashes(_peer, true); + return; + } unsigned knowns = 0; unsigned unknowns = 0; h256s neededBlocks; @@ -322,11 +346,11 @@ void EthereumHost::onPeerHashes(EthereumPeer* _peer, unsigned /*_index*/, h256s auto status = m_bq.blockStatus(h); if (status == QueueStatus::Importing || status == QueueStatus::Ready || m_chain.isKnown(h)) { - clog(NetWarn) << "block hash alrady known:" << h; + clog(NetWarn) << "block hash already known:" << h; } else if (status == QueueStatus::Bad) { - cwarn << "block hash bad!" << h << ". Bailing..."; + clog(NetWarn) << "block hash bad!" << h << ". Bailing..."; _peer->setIdle(); return; } @@ -337,10 +361,9 @@ void EthereumHost::onPeerHashes(EthereumPeer* _peer, unsigned /*_index*/, h256s } else knowns++; - m_syncingLatestHash = h; } m_man.appendToChain(neededBlocks); - clog(NetMessageSummary) << knowns << "knowns," << unknowns << "unknowns; now at" << m_syncingLatestHash; + clog(NetMessageSummary) << knowns << "knowns," << unknowns << "unknowns"; if (m_hashMan.isComplete()) { @@ -356,33 +379,30 @@ void EthereumHost::onPeerHashes(EthereumPeer* _peer, unsigned /*_index*/, h256s continueSync(_peer); } -void EthereumHost::onPeerDoneHashes(EthereumPeer* _peer, bool _new) +void EthereumHost::onPeerDoneHashes(EthereumPeer* _peer, bool _localChain) { + assert(_peer->m_asking == Asking::Nothing); m_needSyncHashes = false; - if (_peer->m_protocolVersion == protocolVersion() || _new) - { - continueSync(_peer); - } - else + if (_peer->m_protocolVersion != protocolVersion() || _localChain) { - m_man.resetToChain(m_v60Hashes); - continueSync(); + m_man.resetToChain(m_hashes); + m_hashes.clear(); } + continueSync(); } void EthereumHost::onPeerBlocks(EthereumPeer* _peer, RLP const& _r) { - if (!_peer->enabled()) - { - clog(NetNote) << "Ignoring blocks from disabled peer"; - return; - } + Guard l(x_sync); + assert(_peer->m_asking == Asking::Nothing); unsigned itemCount = _r.itemCount(); clog(NetMessageSummary) << "Blocks (" << dec << itemCount << "entries)" << (itemCount ? "" : ": NoMoreBlocks"); if (itemCount == 0) { // Got to this peer's latest block - just give up. + clog(NetNote) << "Finishing blocks fetch..."; + // NOTE: need to notify of giving up on chain-hashes, too, altering state as necessary. _peer->setIdle(); return; } @@ -550,9 +570,9 @@ void EthereumHost::onPeerTransactions(EthereumPeer* _peer, RLP const& _r) void EthereumHost::continueSync() { + clog(NetAllDetail) << "Getting help with downloading hashes and blocks"; forEachPeer([&](EthereumPeer* _p) { - clog(NetNote) << "Getting help with downloading hashes and blocks"; if (_p->m_asking == Asking::Nothing) continueSync(_p); }); @@ -560,29 +580,23 @@ void EthereumHost::continueSync() void EthereumHost::continueSync(EthereumPeer* _peer) { + assert(_peer->m_asking == Asking::Nothing); bool otherPeerSync = false; - bool thisPeerSync = false; if (m_needSyncHashes && peerShouldGrabChain(_peer)) { forEachPeer([&](EthereumPeer* _p) { - if (_p->m_asking == Asking::Hashes && _p->m_protocolVersion != protocolVersion()) - { - // Already have a peer downloading hash chain with old protocol, do nothing - if (_p == _peer) - thisPeerSync = true; - else - otherPeerSync = true; - - } + if (_p != _peer && _p->m_asking == Asking::Hashes && _p->m_protocolVersion != protocolVersion()) + otherPeerSync = true; // Already have a peer downloading hash chain with old protocol, do nothing }); if (otherPeerSync) { + /// Downloading from other peer with v60 protocol, nothing ese we can do _peer->setIdle(); return; } - if (_peer->m_protocolVersion == protocolVersion()) - _peer->requestHashes(); + if (_peer->m_protocolVersion == protocolVersion() && !m_syncingLatestHash) + _peer->requestHashes(); /// v61+ and not catching up to a particular hash else { // Restart/continue sync in single peer mode @@ -606,11 +620,9 @@ bool EthereumHost::peerShouldGrabBlocks(EthereumPeer* _peer) const auto lh = m_syncingLatestHash; auto ctd = m_chain.details().totalDifficulty; - clog(NetNote) << "Should grab blocks? " << td << "vs" << ctd; - + clog(NetAllDetail) << "Should grab blocks? " << td << "vs" << ctd; if (td < ctd || (td == ctd && m_chain.currentHash() == lh)) return false; - return true; } @@ -632,3 +644,15 @@ bool EthereumHost::peerShouldGrabChain(EthereumPeer* _peer) const return true; } } + +bool EthereumHost::isSyncing() const +{ + Guard l(x_sync); + bool syncing = false; + forEachPeer([&](EthereumPeer* _p) + { + if (_p->m_asking != Asking::Nothing) + syncing = true; + }); + return syncing; +} diff --git a/libethereum/EthereumHost.h b/libethereum/EthereumHost.h index 900e515b8..497255034 100644 --- a/libethereum/EthereumHost.h +++ b/libethereum/EthereumHost.h @@ -56,7 +56,6 @@ class BlockQueue; */ class EthereumHost: public p2p::HostCapability, Worker { - friend class EthereumPeer; public: /// Start server, but don't listen. EthereumHost(BlockChain const& _ch, TransactionQueue& _tq, BlockQueue& _bq, u256 _networkId); @@ -71,22 +70,30 @@ public: void reset(); DownloadMan const& downloadMan() const { return m_man; } - bool isSyncing() const { return m_needSyncBlocks || m_needSyncHashes; } + bool isSyncing() const; bool isBanned(p2p::NodeId _id) const { return !!m_banned.count(_id); } void noteNewTransactions() { m_newTransactions = true; } void noteNewBlocks() { m_newBlocks = true; } - void onPeerState(EthereumPeer* _peer); + void onPeerStatus(EthereumPeer* _peer); ///< Called by peer to report status + void onPeerBlocks(EthereumPeer* _peer, RLP const& _r); ///< Called by peer once it has new blocks during syn + void onPeerNewBlock(EthereumPeer* _peer, RLP const& _r); ///< Called by peer once it has new blocks + void onPeerNewHashes(EthereumPeer* _peer, h256s const& _hashes); ///< Called by peer once it has new hashes + void onPeerHashes(EthereumPeer* _peer, h256s const& _hashes); ///< Called by peer once it has another sequential block of hashes during sync + void onPeerHashes(EthereumPeer* _peer, unsigned _index, h256s const& _hashes); ///< Called by peer once it has a new ordered block of hashes starting with a particular number + void onPeerTransactions(EthereumPeer* _peer, RLP const& _r); ///< Called by peer when it has new transactions + DownloadMan& downloadMan() { return m_man; } + HashDownloadMan& hashDownloadMan() { return m_hashMan; } + BlockChain const& chain() { return m_chain; } + + static unsigned const c_oldProtocolVersion; private: std::pair>, std::vector>> randomSelection(unsigned _percent = 25, std::function const& _allow = [](EthereumPeer const*){ return true; }); - void forEachPeer(std::function)> const& _f); - void forEachPeer(std::function const& _f); - - /// Session is tell us that we may need (re-)syncing with the peer. - void noteNeedsSyncing(EthereumPeer* _who); + void forEachPeerPtr(std::function)> const& _f) const; + void forEachPeer(std::function const& _f) const; /// Sync with the BlockChain. It might contain one of our mined blocks, we might have new candidates from the network. void doWork(); @@ -108,15 +115,13 @@ private: virtual void onStarting() { startWorking(); } virtual void onStopping() { stopWorking(); } - void changeSyncer(EthereumPeer* _ignore, bool _needHelp = true); - void continueSync(); - void continueSync(EthereumPeer* _peer); - void onPeerBlocks(EthereumPeer* _peer, RLP const& _r); - void onPeerDoneHashes(EthereumPeer* _peer, bool _new); - void onPeerHashes(EthereumPeer* _peer, h256s const& _hashes); - void onPeerHashes(EthereumPeer* _peer, unsigned _index, h256s const& _hashes); + void continueSync(); /// Find something to do for all peers + void continueSync(EthereumPeer* _peer); /// Find some work to do for a peer + void onPeerDoneHashes(EthereumPeer* _peer, bool _new); /// Called when done downloading hashes from peer + void onPeerHashes(EthereumPeer* _peer, h256s const& _hashes, bool _complete); bool peerShouldGrabBlocks(EthereumPeer* _peer) const; bool peerShouldGrabChain(EthereumPeer* _peer) const; + void estimatePeerHashes(EthereumPeer* _peer); BlockChain const& m_chain; TransactionQueue& m_tq; ///< Maintains a list of incoming transactions not yet in a block on the blockchain. @@ -124,8 +129,6 @@ private: u256 m_networkId; - std::weak_ptr m_hashSyncer; - DownloadMan m_man; HashDownloadMan m_hashMan; @@ -137,14 +140,12 @@ private: bool m_newTransactions = false; bool m_newBlocks = false; - unsigned m_maxKnownNumber = 0; - u256 m_maxKnownDifficulty; - bool m_needSyncHashes = true; - bool m_needSyncBlocks = true; - h256 m_syncingLatestHash; ///< Peer's latest block's hash, as of the current sync. - u256 m_syncingTotalDifficulty; ///< Peer's latest block's total difficulty, as of the current sync. - h256s m_v60Hashes; - + mutable Mutex x_sync; + bool m_needSyncHashes = true; ///< Indicates if need to downlad hashes + bool m_needSyncBlocks = true; ///< Indicates if we still need to download some blocks + h256 m_syncingLatestHash; ///< Latest block's hash, as of the current sync. + u256 m_syncingTotalDifficulty; ///< Latest block's total difficulty, as of the current sync. + h256s m_hashes; ///< List of hashes with unknown block numbers. Used for v60 chain downloading and catching up to a particular unknown }; } diff --git a/libethereum/EthereumPeer.cpp b/libethereum/EthereumPeer.cpp index 1813bb956..a1c22e449 100644 --- a/libethereum/EthereumPeer.cpp +++ b/libethereum/EthereumPeer.cpp @@ -34,12 +34,14 @@ using namespace dev; using namespace dev::eth; using namespace p2p; -EthereumPeer::EthereumPeer(Session* _s, HostCapabilityFace* _h, unsigned _i): +EthereumPeer::EthereumPeer(Session* _s, HostCapabilityFace* _h, unsigned _i, CapDesc const& _cap): Capability(_s, _h, _i), - m_sub(host()->m_man), - m_hashSub(host()->m_hashMan) + m_sub(host()->downloadMan()), + m_hashSub(host()->hashDownloadMan()), + m_peerCapabilityVersion(_cap.second) { - requestState(); + m_syncHashNumber = host()->chain().number() + 1; + requestStatus(); } EthereumPeer::~EthereumPeer() @@ -78,55 +80,44 @@ string toString(Asking _a) void EthereumPeer::setIdle() { - if (m_asking == Asking::Blocks) - { - clog(NetNote) << "Finishing blocks fetch..."; - // NOTE: need to notify of giving up on chain-hashes, too, altering state as necessary. - m_sub.doneFetch(); - m_hashSub.doneFetch(); - - setAsking(Asking::Nothing); - } - else if (m_asking == Asking::Hashes) - { - clog(NetNote) << "Finishing hashes fetch..."; - - setAsking(Asking::Nothing); - } - else if (m_asking == Asking::State) - { - setAsking(Asking::Nothing); - } + m_sub.doneFetch(); + m_hashSub.doneFetch(); + setAsking(Asking::Nothing); } -void EthereumPeer::requestState() +void EthereumPeer::requestStatus() { if (m_asking != Asking::Nothing) clog(NetWarn) << "Bad state: requesting state should be the first action"; setAsking(Asking::State); RLPStream s; - prep(s, StatusPacket, 5) - << host()->protocolVersion() - 1 + bool latest = m_peerCapabilityVersion == host()->protocolVersion(); + prep(s, StatusPacket, latest ? 6 : 5) + << (latest ? host()->protocolVersion() : EthereumHost::c_oldProtocolVersion) << host()->networkId() - << host()->m_chain.details().totalDifficulty - << host()->m_chain.currentHash() - << host()->m_chain.genesisHash(); + << host()->chain().details().totalDifficulty + << host()->chain().currentHash() + << host()->chain().genesisHash(); + if (latest) + s << u256(host()->chain().number()); sealAndSend(s); } void EthereumPeer::requestHashes() { - assert(m_asking != Asking::Blocks); - m_syncHashNumber = m_hashSub.nextFetch(c_maxBlocksAsk); + if (m_asking == Asking::Blocks) + return; + m_syncHashNumber = m_hashSub.nextFetch(c_maxHashesAsk); setAsking(Asking::Hashes); RLPStream s; - prep(s, GetBlockHashesPacket, 2) << m_syncHashNumber << c_maxHashesAsk; + prep(s, GetBlockHashesByNumberPacket, 2) << m_syncHashNumber << c_maxHashesAsk; sealAndSend(s); } void EthereumPeer::requestHashes(h256 const& _lastHash) { - assert(m_asking != Asking::Blocks); + if (m_asking == Asking::Blocks) + return; setAsking(Asking::Hashes); RLPStream s; prep(s, GetBlockHashesPacket, 2) << _lastHash << c_maxHashesAsk; @@ -135,8 +126,7 @@ void EthereumPeer::requestHashes(h256 const& _lastHash) void EthereumPeer::requestBlocks() { - // Looks like it's the best yet for total difficulty. Set to download. - setAsking(Asking::Blocks); // will kick off other peers to help if available. + setAsking(Asking::Blocks); auto blocks = m_sub.nextFetch(c_maxBlocksAsk); if (blocks.size()) { @@ -154,31 +144,12 @@ void EthereumPeer::requestBlocks() void EthereumPeer::setAsking(Asking _a) { m_asking = _a; - - if (!isSyncing()) - { - m_syncingLatestHash = h256(); - m_syncingTotalDifficulty = 0; - m_syncingNeededBlocks.clear(); - } - m_lastAsk = chrono::system_clock::now(); session()->addNote("ask", _a == Asking::Nothing ? "nothing" : _a == Asking::State ? "state" : _a == Asking::Hashes ? "hashes" : _a == Asking::Blocks ? "blocks" : "?"); session()->addNote("sync", string(isSyncing() ? "ongoing" : "holding") + (needsSyncing() ? " & needed" : "")); } -void EthereumPeer::setNeedsSyncing(h256 _latestHash, u256 _td) -{ - m_latestHash = _latestHash; - m_totalDifficulty = _td; - - if (m_latestHash) - host()->noteNeedsSyncing(this); - - session()->addNote("sync", string(isSyncing() ? "ongoing" : "holding") + (needsSyncing() ? " & needed" : "")); -} - void EthereumPeer::tick() { if (chrono::system_clock::now() - m_lastAsk > chrono::seconds(10) && m_asking != Asking::Nothing) @@ -200,87 +171,62 @@ bool EthereumPeer::interpret(unsigned _id, RLP const& _r) case StatusPacket: { m_protocolVersion = _r[0].toInt(); - if (!!session()->cap(EthereumHost::staticVersion())) - m_protocolVersion = host()->protocolVersion(); m_networkId = _r[1].toInt(); - - // a bit dirty as we're misusing these to communicate the values to transition, but harmless. m_totalDifficulty = _r[2].toInt(); m_latestHash = _r[3].toHash(); m_genesisHash = _r[4].toHash(); - clog(NetMessageSummary) << "Status:" << m_protocolVersion << "/" << m_networkId << "/" << m_genesisHash << ", TD:" << m_totalDifficulty << "=" << m_latestHash; - host()->onPeerState(this); + if (m_peerCapabilityVersion == host()->protocolVersion()) + { + m_protocolVersion = host()->protocolVersion(); + m_latestBlockNumber = _r[5].toInt(); + } + + clog(NetMessageSummary) << "Status:" << m_protocolVersion << "/" << m_networkId << "/" << m_genesisHash << "/" << m_latestBlockNumber << ", TD:" << m_totalDifficulty << "=" << m_latestHash; + setAsking(Asking::Nothing); + host()->onPeerStatus(this); break; } case TransactionsPacket: { - unsigned itemCount = _r.itemCount(); - clog(NetAllDetail) << "Transactions (" << dec << itemCount << "entries)"; - Guard l(x_knownTransactions); - for (unsigned i = 0; i < itemCount; ++i) - { - auto h = sha3(_r[i].data()); - m_knownTransactions.insert(h); - ImportResult ir = host()->m_tq.import(_r[i].data()); - switch (ir) - { - case ImportResult::Malformed: - addRating(-100); - break; - case ImportResult::AlreadyKnown: - // if we already had the transaction, then don't bother sending it on. - host()->m_transactionsSent.insert(h); - addRating(0); - break; - case ImportResult::Success: - addRating(100); - break; - default:; - } - } + host()->onPeerTransactions(this, _r); break; } case GetBlockHashesPacket: { - if (m_protocolVersion == host()->protocolVersion()) + h256 later = _r[0].toHash(); + unsigned limit = _r[1].toInt(); + clog(NetMessageSummary) << "GetBlockHashes (" << limit << "entries," << later << ")"; + unsigned c = min(host()->chain().number(later), limit); + RLPStream s; + prep(s, BlockHashesPacket, c); + h256 p = host()->chain().details(later).parent; + for (unsigned i = 0; i < c && p; ++i, p = host()->chain().details(p).parent) + s << p; + sealAndSend(s); + addRating(0); + break; + } + case GetBlockHashesByNumberPacket: + { + u256 number256 = _r[0].toInt(); + unsigned number = (unsigned) number256; + unsigned limit = _r[1].toInt(); + clog(NetMessageSummary) << "GetBlockHashesByNumber (" << number << "-" << number + limit << ")"; + RLPStream s; + if (number <= host()->chain().number()) { - u256 number256 = _r[0].toInt(); - unsigned number = (unsigned) number256; - unsigned limit = _r[1].toInt(); - clog(NetMessageSummary) << "GetBlockHashes (" << number << "-" << number + limit << ")"; - RLPStream s; - if (number <= host()->m_chain.number()) + unsigned c = min(host()->chain().number() - number + 1, limit); + prep(s, BlockHashesPacket, c); + for (unsigned n = number; n < number + c; n++) { - unsigned c = min(host()->m_chain.number() - number + 1, limit); - prep(s, BlockHashesPacket, c); - for (unsigned n = number; n < number + c; n++) - { - h256 p = host()->m_chain.numberHash(n); - s << p; - } + h256 p = host()->chain().numberHash(n); + s << p; } - else - prep(s, BlockHashesPacket, 0); - sealAndSend(s); - addRating(0); } else - { - // Support V60 protocol - h256 later = _r[0].toHash(); - unsigned limit = _r[1].toInt(); - clog(NetMessageSummary) << "GetBlockHashes (" << limit << "entries," << later << ")"; - - unsigned c = min(host()->m_chain.number(later), limit); - - RLPStream s; - prep(s, BlockHashesPacket, c); - h256 p = host()->m_chain.details(later).parent; - for (unsigned i = 0; i < c && p; ++i, p = host()->m_chain.details(p).parent) - s << p; - sealAndSend(s); - addRating(0); - } + prep(s, BlockHashesPacket, 0); + sealAndSend(s); + addRating(0); break; } case BlockHashesPacket: @@ -290,14 +236,10 @@ bool EthereumPeer::interpret(unsigned _id, RLP const& _r) if (m_asking != Asking::Hashes) { - cwarn << "Peer giving us hashes when we didn't ask for them."; + clog(NetWarn) << "Peer giving us hashes when we didn't ask for them."; break; } - if (itemCount == 0) - { - host()->onPeerDoneHashes(this, false); - return true; - } + setAsking(Asking::Nothing); h256s hashes(itemCount); for (unsigned i = 0; i < itemCount; ++i) { @@ -306,10 +248,7 @@ bool EthereumPeer::interpret(unsigned _id, RLP const& _r) } if (m_protocolVersion == host()->protocolVersion()) - { - //v61, report hashes ordered by number - host()->onPeerHashes(this, m_syncHashNumber, hashes); - } + host()->onPeerHashes(this, m_syncHashNumber, hashes); // V61+, report hashes by number else host()->onPeerHashes(this, hashes); m_syncHashNumber += itemCount; @@ -332,9 +271,9 @@ bool EthereumPeer::interpret(unsigned _id, RLP const& _r) for (unsigned i = 0; i < min(count, c_maxBlocks); ++i) { auto h = _r[i].toHash(); - if (host()->m_chain.isKnown(h)) + if (host()->chain().isKnown(h)) { - rlp += host()->m_chain.block(_r[i].toHash()); + rlp += host()->chain().block(_r[i].toHash()); ++n; } } @@ -351,67 +290,30 @@ bool EthereumPeer::interpret(unsigned _id, RLP const& _r) } case BlocksPacket: { - host()->onPeerBlocks(this, _r); + if (m_asking != Asking::Blocks) + clog(NetWarn) << "Peer giving us blocks when we didn't ask for them."; + else + { + setAsking(Asking::Nothing); + host()->onPeerBlocks(this, _r); + } break; } case NewBlockPacket: { - auto h = BlockInfo::headerHash(_r[0].data()); - clog(NetMessageSummary) << "NewBlock: " << h; - - if (_r.itemCount() != 2) - disable("NewBlock without 2 data fields."); - else - { - switch (host()->m_bq.import(_r[0].data(), host()->m_chain)) - { - case ImportResult::Success: - addRating(100); - break; - case ImportResult::FutureTime: - //TODO: Rating dependent on how far in future it is. - break; - - case ImportResult::Malformed: - case ImportResult::BadChain: - disable("Malformed block received."); - return true; - - case ImportResult::AlreadyInChain: - case ImportResult::AlreadyKnown: - break; - - case ImportResult::UnknownParent: - clog(NetMessageSummary) << "Received block with no known parent. Resyncing..."; - setNeedsSyncing(h, _r[1].toInt()); - break; - default:; - } - - DEV_GUARDED(x_knownBlocks) - m_knownBlocks.insert(h); - } + host()->onPeerNewBlock(this, _r); break; } case NewBlockHashesPacket: { - clog(NetMessageSummary) << "NewBlockHashes"; - if (host()->isSyncing()) - clog(NetMessageSummary) << "Ignoring since we're already downloading."; - else - { - unsigned itemCount = _r.itemCount(); - clog(NetMessageSummary) << "BlockHashes (" << dec << itemCount << "entries)" << (itemCount ? "" : ": NoMoreHashes"); + unsigned itemCount = _r.itemCount(); + clog(NetMessageSummary) << "BlockHashes (" << dec << itemCount << "entries)" << (itemCount ? "" : ": NoMoreHashes"); - h256s hashes(itemCount); - for (unsigned i = 0; i < itemCount; ++i) - hashes[i] = _r[i].toHash(); + h256s hashes(itemCount); + for (unsigned i = 0; i < itemCount; ++i) + hashes[i] = _r[i].toHash(); - clog(NetNote) << "Not syncing and new block hash discovered: syncing without help."; - host()->onPeerHashes(this, hashes); - host()->onPeerDoneHashes(this, true); - return true; - } + host()->onPeerNewHashes(this, hashes); break; } default: diff --git a/libethereum/EthereumPeer.h b/libethereum/EthereumPeer.h index 2dd17d8c3..94dc60501 100644 --- a/libethereum/EthereumPeer.h +++ b/libethereum/EthereumPeer.h @@ -49,11 +49,11 @@ namespace eth */ class EthereumPeer: public p2p::Capability { - friend class EthereumHost; + friend class EthereumHost; //TODO: remove this public: /// Basic constructor. - EthereumPeer(p2p::Session* _s, p2p::HostCapabilityFace* _h, unsigned _i); + EthereumPeer(p2p::Session* _s, p2p::HostCapabilityFace* _h, unsigned _i, p2p::CapDesc const& _cap); /// Basic destructor. virtual ~EthereumPeer(); @@ -70,10 +70,16 @@ public: /// What is the ethereum subprotocol host object. EthereumHost* host() const; + /// Abort sync and reset fetch void setIdle(); - void requestState(); + + /// Request hashes. Uses hash download manager to get hash number. v61+ protocol version only void requestHashes(); + + /// Request hashes for given parent hash. void requestHashes(h256 const& _lastHash); + + /// Request blocks. Uses block download manager. void requestBlocks(); private: @@ -82,6 +88,9 @@ private: /// Interpret an incoming message. virtual bool interpret(unsigned _id, RLP const& _r); + /// Request status. Called from constructor + void requestStatus(); + /// Abort the sync operation. void abortSync(); @@ -91,24 +100,18 @@ private: /// Update our asking state. void setAsking(Asking _g); - /// Update our syncing requirements state. - void setNeedsSyncing(h256 _latestHash, u256 _td); - void resetNeedsSyncing() { setNeedsSyncing(h256(), 0); } - /// Do we presently need syncing with this peer? bool needsSyncing() const { return !!m_latestHash; } /// Are we presently syncing with this peer? bool isSyncing() const; - /// Check whether the session should bother grabbing the peer's blocks. - bool shouldGrabBlocks() const; - /// Runs period checks to check up on the peer. void tick(); /// Peer's protocol version. unsigned m_protocolVersion; + /// Peer's network id. u256 m_networkId; @@ -117,28 +120,24 @@ private: /// When we asked for it. Allows a time out. std::chrono::system_clock::time_point m_lastAsk; - /// Whether this peer is in the process of syncing or not. Only one peer can be syncing at once. - bool m_isSyncing = false; - /// These are determined through either a Status message or from NewBlock. h256 m_latestHash; ///< Peer's latest block's hash that we know about or default null value if no need to sync. u256 m_totalDifficulty; ///< Peer's latest block's total difficulty. h256 m_genesisHash; ///< Peer's genesis hash - /// Once a sync is started on this peer, they are cleared and moved into m_syncing*. + u256 m_latestBlockNumber; ///< Number of the latest block this peer has /// This is built as we ask for hashes. Once no more hashes are given, we present this to the /// host who initialises the DownloadMan and m_sub becomes active for us to begin asking for blocks. - h256s m_syncingNeededBlocks; ///< The blocks that we should download from this peer. - h256 m_syncingLastReceivedHash; ///< Hash most recently received from peer. - h256 m_syncingLatestHash; ///< Peer's latest block's hash, as of the current sync. - u256 m_syncingTotalDifficulty; ///< Peer's latest block's total difficulty, as of the current sync. - unsigned m_expectedHashes = 0; ///< Estimated Upper bound of hashes to expect from this peer. - unsigned m_syncHashNumber = 0; + unsigned m_expectedHashes = 0; ///< Estimated upper bound of hashes to expect from this peer. + unsigned m_syncHashNumber = 0; ///< Number of latest hash we sync to /// Once we're asking for blocks, this becomes in use. DownloadSub m_sub; + + /// Once we're asking for hashes, this becomes in use. HashDownloadSub m_hashSub; + u256 m_peerCapabilityVersion; ///< Protocol version this peer supports received as capability /// Have we received a GetTransactions packet that we haven't yet answered? bool m_requireTransactions = false; @@ -146,7 +145,6 @@ private: h256Hash m_knownBlocks; ///< Blocks that the peer already knows about (that don't need to be sent to them). Mutex x_knownTransactions; h256Hash m_knownTransactions; ///< Transactions that the peer already knows of. - }; } diff --git a/libp2p/Capability.h b/libp2p/Capability.h index 536357b51..d09391655 100644 --- a/libp2p/Capability.h +++ b/libp2p/Capability.h @@ -44,7 +44,6 @@ public: */ Session* session() const { return m_session; } HostCapabilityFace* hostCapability() const { return m_host; } - bool enabled() { return m_enabled; } protected: virtual bool interpret(unsigned _id, RLP const&) = 0; diff --git a/libp2p/Host.cpp b/libp2p/Host.cpp index 998579a90..b6c9efec9 100644 --- a/libp2p/Host.cpp +++ b/libp2p/Host.cpp @@ -202,6 +202,10 @@ void Host::startPeerSession(Public const& _id, RLP const& _rlp, RLPXFrameIO* _io // clang error (previously: ... << hex << caps ...) // "'operator<<' should be declared prior to the call site or in an associated namespace of one of its arguments" stringstream capslog; + + if (caps.size() > 1) + caps.erase(remove_if(caps.begin(), caps.end(), [&](CapDesc const& _r){ return any_of(caps.begin(), caps.end(), [&](CapDesc const& _o){ return _r.first == _o.first && _o.second > _r.second; }); }), caps.end()); + for (auto cap: caps) capslog << "(" << cap.first << "," << dec << cap.second << ")"; clog(NetMessageSummary) << "Hello: " << clientVersion << "V[" << protocolVersion << "]" << _id << showbase << capslog.str() << dec << listenPort; @@ -237,7 +241,7 @@ void Host::startPeerSession(Public const& _id, RLP const& _rlp, RLPXFrameIO* _io for (auto const& i: caps) if (haveCapability(i)) { - ps->m_capabilities[i] = shared_ptr(m_capabilities[i]->newPeerCapability(ps.get(), o)); + ps->m_capabilities[i] = shared_ptr(m_capabilities[i]->newPeerCapability(ps.get(), o, i)); o += m_capabilities[i]->messageCount(); } ps->start(); diff --git a/libp2p/HostCapability.h b/libp2p/HostCapability.h index a9ce1585b..19b149085 100644 --- a/libp2p/HostCapability.h +++ b/libp2p/HostCapability.h @@ -53,7 +53,7 @@ protected: virtual u256 version() const = 0; CapDesc capDesc() const { return std::make_pair(name(), version()); } virtual unsigned messageCount() const = 0; - virtual Capability* newPeerCapability(Session* _s, unsigned _idOffset) = 0; + virtual Capability* newPeerCapability(Session* _s, unsigned _idOffset, CapDesc const& _cap) = 0; virtual void onStarting() {} virtual void onStopping() {} @@ -77,7 +77,7 @@ protected: virtual std::string name() const { return PeerCap::name(); } virtual u256 version() const { return PeerCap::version(); } virtual unsigned messageCount() const { return PeerCap::messageCount(); } - virtual Capability* newPeerCapability(Session* _s, unsigned _idOffset) { return new PeerCap(_s, this, _idOffset); } + virtual Capability* newPeerCapability(Session* _s, unsigned _idOffset, CapDesc const& _cap) { return new PeerCap(_s, this, _idOffset, _cap); } }; } diff --git a/libwhisper/WhisperPeer.cpp b/libwhisper/WhisperPeer.cpp index 7bcdfe8aa..0b75def28 100644 --- a/libwhisper/WhisperPeer.cpp +++ b/libwhisper/WhisperPeer.cpp @@ -29,7 +29,7 @@ using namespace dev; using namespace dev::p2p; using namespace dev::shh; -WhisperPeer::WhisperPeer(Session* _s, HostCapabilityFace* _h, unsigned _i): Capability(_s, _h, _i) +WhisperPeer::WhisperPeer(Session* _s, HostCapabilityFace* _h, unsigned _i, CapDesc const&): Capability(_s, _h, _i) { RLPStream s; sealAndSend(prep(s, StatusPacket, 1) << version()); diff --git a/libwhisper/WhisperPeer.h b/libwhisper/WhisperPeer.h index ab9c8222a..9344da024 100644 --- a/libwhisper/WhisperPeer.h +++ b/libwhisper/WhisperPeer.h @@ -42,6 +42,7 @@ using p2p::Session; using p2p::HostCapabilityFace; using p2p::HostCapability; using p2p::Capability; +using p2p::CapDesc; /** */ @@ -50,7 +51,7 @@ class WhisperPeer: public Capability friend class WhisperHost; public: - WhisperPeer(Session* _s, HostCapabilityFace* _h, unsigned _i); + WhisperPeer(Session* _s, HostCapabilityFace* _h, unsigned _i, CapDesc const& _cap); virtual ~WhisperPeer(); static std::string name() { return "shh"; } diff --git a/test/libp2p/capability.cpp b/test/libp2p/capability.cpp index 2c158f4d8..0a8542ee0 100644 --- a/test/libp2p/capability.cpp +++ b/test/libp2p/capability.cpp @@ -49,7 +49,7 @@ struct VerbosityHolder class TestCapability: public Capability { public: - TestCapability(Session* _s, HostCapabilityFace* _h, unsigned _idOffset): Capability(_s, _h, _idOffset), m_cntReceivedMessages(0), m_testSum(0) {} + TestCapability(Session* _s, HostCapabilityFace* _h, unsigned _idOffset, CapDesc const&): Capability(_s, _h, _idOffset), m_cntReceivedMessages(0), m_testSum(0) {} virtual ~TestCapability() {} int countReceivedMessages() { return m_cntReceivedMessages; } int testSum() { return m_testSum; } From be05a43e22053db9ac89571eff2cdc4712fe17fe Mon Sep 17 00:00:00 2001 From: Vlad Gluhovsky Date: Thu, 28 May 2015 12:31:55 +0200 Subject: [PATCH 377/461] topic encryption with pbkdf2 --- libwhisper/Message.cpp | 81 +++++++++++------------ libwhisper/Message.h | 2 + test/libwhisper/whisperMessage.cpp | 103 +++++++++++++++++++++++++++++ 3 files changed, 145 insertions(+), 41 deletions(-) create mode 100644 test/libwhisper/whisperMessage.cpp diff --git a/libwhisper/Message.cpp b/libwhisper/Message.cpp index 4375e0727..7b91da114 100644 --- a/libwhisper/Message.cpp +++ b/libwhisper/Message.cpp @@ -35,34 +35,8 @@ Message::Message(Envelope const& _e, FullTopic const& _fk, Secret const& _s) if (!decrypt(_s, &(_e.data()), b)) return; else{} - else - { - // public - need to get the key through combining with the topic/topicIndex we know. - unsigned topicIndex = 0; - Secret topicSecret; - - // determine topicSecret/topicIndex from knowledge of the collapsed topics (which give the order) and our full-size filter topic. - CollapsedTopic knownTopic = collapse(_fk); - for (unsigned ti = 0; ti < _fk.size() && !topicSecret; ++ti) - for (unsigned i = 0; i < _e.topic().size(); ++i) - if (_e.topic()[i] == knownTopic[ti]) - { - topicSecret = _fk[ti]; - topicIndex = i; - break; - } - - if (_e.data().size() < _e.topic().size() * 32) - return; - - // get key from decrypted topic key: just xor - h256 tk = h256(bytesConstRef(&(_e.data())).cropped(32 * topicIndex, 32)); - bytesConstRef cipherText = bytesConstRef(&(_e.data())).cropped(32 * _e.topic().size()); -// cdebug << "Decrypting(" << topicIndex << "): " << topicSecret << tk << (topicSecret ^ tk) << toHex(cipherText); - if (!decryptSym(topicSecret ^ tk, cipherText, b)) - return; -// cdebug << "Got: " << toHex(b); - } + else if (!openBroadcastEnvelope(_e, _fk, b)) + return; if (populate(b)) if (_s) @@ -73,6 +47,40 @@ Message::Message(Envelope const& _e, FullTopic const& _fk, Secret const& _s) } } +bool Message::openBroadcastEnvelope(Envelope const& _e, FullTopic const& _fk, bytes& o_b) +{ + // retrieve the key using the known topic and topicIndex. + unsigned topicIndex = 0; + Secret topicSecret; + + // determine topicSecret/topicIndex from knowledge of the collapsed topics (which give the order) and our full-size filter topic. + CollapsedTopic knownTopic = collapse(_fk); + for (unsigned ti = 0; ti < _fk.size() && !topicSecret; ++ti) + for (unsigned i = 0; i < _e.topic().size(); ++i) + if (_e.topic()[i] == knownTopic[ti]) + { + topicSecret = _fk[ti]; + topicIndex = i; + break; + } + + if (_e.data().size() < _e.topic().size() * 32) + return false; + + h256 encryptedKey = h256(bytesConstRef(&(_e.data())).cropped(32 * topicIndex, 32)); + h256 key = generateGamma(topicSecret) ^ encryptedKey; + bytesConstRef cipherText = bytesConstRef(&(_e.data())).cropped(32 * _e.topic().size()); + return decryptSym(key, cipherText, o_b); +} + +h256 Message::generateGamma(h256 const& _seed) const +{ + int const c_rounds = 128; + bytes zeroSalt; + bytes hashedTopic = dev::pbkdf2(_seed.hex(), zeroSalt, c_rounds); + return h256(hashedTopic); +} + bool Message::populate(bytes const& _data) { if (!_data.size()) @@ -116,23 +124,14 @@ Envelope Message::seal(Secret _from, FullTopic const& _fullTopic, unsigned _ttl, encrypt(m_to, &input, ret.m_data); else { - // create the shared secret and encrypt + // create the shared secret for encrypting the payload, then encrypt the shared secret with each topic Secret s = Secret::random(); - for (h256 const& t: _fullTopic) - ret.m_data += (t ^ s).asBytes(); + for (h256 const& t : _fullTopic) + ret.m_data += (generateGamma(t) ^ s).asBytes(); + bytes d; encryptSym(s, &input, d); ret.m_data += d; - - for (unsigned i = 0; i < _fullTopic.size(); ++i) - { - bytes b; - h256 tk = h256(bytesConstRef(&(ret.m_data)).cropped(32 * i, 32)); - bytesConstRef cipherText = bytesConstRef(&(ret.m_data)).cropped(32 * ret.topic().size()); - cnote << "Test decrypting(" << i << "): " << _fullTopic[i] << tk << (_fullTopic[i] ^ tk) << toHex(cipherText); - assert(decryptSym(_fullTopic[i] ^ tk, cipherText, b)); - cnote << "Got: " << toHex(b); - } } ret.proveWork(_workToProve); diff --git a/libwhisper/Message.h b/libwhisper/Message.h index 0735d6714..c9e6d7dc0 100644 --- a/libwhisper/Message.h +++ b/libwhisper/Message.h @@ -127,6 +127,8 @@ public: private: bool populate(bytes const& _data); + h256 generateGamma(h256 const& _seed) const; + bool openBroadcastEnvelope(Envelope const& _e, FullTopic const& _fk, bytes& o_b); Public m_from; Public m_to; diff --git a/test/libwhisper/whisperMessage.cpp b/test/libwhisper/whisperMessage.cpp new file mode 100644 index 000000000..26fdb0bd5 --- /dev/null +++ b/test/libwhisper/whisperMessage.cpp @@ -0,0 +1,103 @@ +/* +This file is part of cpp-ethereum. + +cpp-ethereum is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +cpp-ethereum is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with cpp-ethereum. If not, see . +*/ +/** @file whisperMessage.cpp +* @author Vladislav Gluhovsky +* @date May 2015 +*/ + +#include +#include + +using namespace std; +using namespace dev; +using namespace dev::shh; + +struct VerbosityHolder +{ + VerbosityHolder() : oldLogVerbosity(g_logVerbosity) { g_logVerbosity = 10; } + ~VerbosityHolder() { g_logVerbosity = oldLogVerbosity; } + + int oldLogVerbosity; +}; + +FullTopic createRandomTopics(unsigned int i) +{ + FullTopic ret; + h256 t(i); + + for (int j = 0; j < 8; ++j) + { + t = sha3(t); + ret.push_back(t); + } + + return move(ret); +} + +bytes createRandomPayload(unsigned int i) +{ + bytes ret; + srand(i); + int const sz = rand() % 1024; + for (int j = 0; j < sz; ++j) + ret.push_back(rand() % 256); + + return move(ret); +} + +void comparePayloads(Message const& m1, Message const& m2) +{ + bytes const& p1 = m1.payload(); + bytes const& p2 = m2.payload(); + BOOST_REQUIRE_EQUAL(p1.size(), p2.size()); + + for (size_t i = 0; i < p1.size(); ++i) + BOOST_REQUIRE_EQUAL(p1[i], p2[i]); +} + +void sealAndOpenSingleMessage(unsigned int i) +{ + Secret zero; + FullTopic topics = createRandomTopics(i); + bytes const payload = createRandomPayload(i); + Message m1(payload); + Envelope e = m1.seal(zero, topics, 1, 1); + + for (auto const& t: topics) + { + FullTopic singleTopic; + singleTopic.push_back(t); + Message m2(e, singleTopic, zero); + comparePayloads(m1, m2); + } +} + +BOOST_AUTO_TEST_SUITE(whisperMessage) + +BOOST_AUTO_TEST_CASE(seal) +{ + VerbosityHolder verbosityHolder; + cnote << "Testing Envelope encryption..."; + + for (unsigned int i = 1; i < 32; ++i) + { + cnote << i; + sealAndOpenSingleMessage(i); + } +} + +BOOST_AUTO_TEST_SUITE_END() From b81a180edb2980e8f9d2dae75f0ad4864e97d4dc Mon Sep 17 00:00:00 2001 From: Vlad Gluhovsky Date: Fri, 29 May 2015 12:25:48 +0200 Subject: [PATCH 378/461] gamma generation algorithm changed --- libwhisper/Message.cpp | 27 +++++++++++++-------------- libwhisper/Message.h | 2 +- test/libwhisper/whisperMessage.cpp | 9 +++------ 3 files changed, 17 insertions(+), 21 deletions(-) diff --git a/libwhisper/Message.cpp b/libwhisper/Message.cpp index 7b91da114..9ba67ff9c 100644 --- a/libwhisper/Message.cpp +++ b/libwhisper/Message.cpp @@ -64,23 +64,17 @@ bool Message::openBroadcastEnvelope(Envelope const& _e, FullTopic const& _fk, by break; } - if (_e.data().size() < _e.topic().size() * 32) + if (_e.data().size() < _e.topic().size() * h256::size) return false; - h256 encryptedKey = h256(bytesConstRef(&(_e.data())).cropped(32 * topicIndex, 32)); - h256 key = generateGamma(topicSecret) ^ encryptedKey; - bytesConstRef cipherText = bytesConstRef(&(_e.data())).cropped(32 * _e.topic().size()); + unsigned index = topicIndex * 2; + h256 encryptedKey = h256(bytesConstRef(&(_e.data())).cropped(h256::size * index, h256::size)); + h256 salt = h256(bytesConstRef(&(_e.data())).cropped(h256::size * ++index, h256::size)); + h256 key = generateGamma(topicSecret, salt) ^ encryptedKey; + bytesConstRef cipherText = bytesConstRef(&(_e.data())).cropped(h256::size * 2 * _e.topic().size()); return decryptSym(key, cipherText, o_b); } -h256 Message::generateGamma(h256 const& _seed) const -{ - int const c_rounds = 128; - bytes zeroSalt; - bytes hashedTopic = dev::pbkdf2(_seed.hex(), zeroSalt, c_rounds); - return h256(hashedTopic); -} - bool Message::populate(bytes const& _data) { if (!_data.size()) @@ -111,7 +105,7 @@ Envelope Message::seal(Secret _from, FullTopic const& _fullTopic, unsigned _ttl, input[0] = 0; memcpy(input.data() + 1, m_payload.data(), m_payload.size()); - if (_from) // needs a sig + if (_from) // needs a signature { input.resize(1 + m_payload.size() + sizeof(Signature)); input[0] |= ContainsSignature; @@ -124,10 +118,15 @@ Envelope Message::seal(Secret _from, FullTopic const& _fullTopic, unsigned _ttl, encrypt(m_to, &input, ret.m_data); else { + // this message is for broadcast (could be read by anyone who knows at least one of the topics) // create the shared secret for encrypting the payload, then encrypt the shared secret with each topic Secret s = Secret::random(); for (h256 const& t : _fullTopic) - ret.m_data += (generateGamma(t) ^ s).asBytes(); + { + h256 salt = h256::random(); + ret.m_data += (generateGamma(t, salt) ^ s).asBytes(); + ret.m_data += salt.asBytes(); + } bytes d; encryptSym(s, &input, d); diff --git a/libwhisper/Message.h b/libwhisper/Message.h index c9e6d7dc0..5b069f57b 100644 --- a/libwhisper/Message.h +++ b/libwhisper/Message.h @@ -127,8 +127,8 @@ public: private: bool populate(bytes const& _data); - h256 generateGamma(h256 const& _seed) const; bool openBroadcastEnvelope(Envelope const& _e, FullTopic const& _fk, bytes& o_b); + h256 generateGamma(h256 const& _key, h256 const& _salt) const { return sha3(_key ^ _salt); } Public m_from; Public m_to; diff --git a/test/libwhisper/whisperMessage.cpp b/test/libwhisper/whisperMessage.cpp index 26fdb0bd5..5e4dff725 100644 --- a/test/libwhisper/whisperMessage.cpp +++ b/test/libwhisper/whisperMessage.cpp @@ -28,7 +28,7 @@ using namespace dev::shh; struct VerbosityHolder { - VerbosityHolder() : oldLogVerbosity(g_logVerbosity) { g_logVerbosity = 10; } + VerbosityHolder(int _temporaryValue) : oldLogVerbosity(g_logVerbosity) { g_logVerbosity = _temporaryValue; } ~VerbosityHolder() { g_logVerbosity = oldLogVerbosity; } int oldLogVerbosity; @@ -90,14 +90,11 @@ BOOST_AUTO_TEST_SUITE(whisperMessage) BOOST_AUTO_TEST_CASE(seal) { - VerbosityHolder verbosityHolder; + VerbosityHolder setTemporaryLevel(10); cnote << "Testing Envelope encryption..."; - for (unsigned int i = 1; i < 32; ++i) - { - cnote << i; + for (unsigned int i = 1; i < 10; ++i) sealAndOpenSingleMessage(i); - } } BOOST_AUTO_TEST_SUITE_END() From dc90ba234695307032e70aea62b1c64f7ea84279 Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Fri, 29 May 2015 12:44:05 +0200 Subject: [PATCH 379/461] add test for PC overflow in jump --- .../vmIOandFlowOperationsTestFiller.json | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/test/libevm/VMTestsFiller/vmIOandFlowOperationsTestFiller.json b/test/libevm/VMTestsFiller/vmIOandFlowOperationsTestFiller.json index 3253ec2cd..d3fa596ed 100644 --- a/test/libevm/VMTestsFiller/vmIOandFlowOperationsTestFiller.json +++ b/test/libevm/VMTestsFiller/vmIOandFlowOperationsTestFiller.json @@ -854,6 +854,76 @@ } }, + "jumpToUintmaxPlus1": { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "1000000", + "currentDifficulty" : "256", + "currentTimestamp" : "1", + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "expect" : { + "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "storage" : { + "0x03" : "0x02" + } + } + }, + "pre" : { + "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "100000000000000000000000", + "nonce" : "0", + "code" : "0x5b5b64010000000056", + "storage": {} + } + }, + "exec" : { + "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681", + "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "1000000000000000000", + "data" : "", + "gasPrice" : "100000000000000", + "gas" : "100000" + } + }, + + "jumpToUint64maxPlus1": { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "1000000", + "currentDifficulty" : "256", + "currentTimestamp" : "1", + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "expect" : { + "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "storage" : { + "0x03" : "0x02" + } + } + }, + "pre" : { + "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "100000000000000000000000", + "nonce" : "0", + "code" : "0x5b5b6801000000000000000056", + "storage": {} + } + }, + "exec" : { + "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681", + "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "1000000000000000000", + "data" : "", + "gasPrice" : "100000000000000", + "gas" : "100000" + } + }, + "jumpiAfterStop": { "env" : { "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", From 9e177a01dcad951abcb8324400e935969c26b2bd Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Fri, 29 May 2015 12:49:59 +0200 Subject: [PATCH 380/461] fix test --- .../VMTestsFiller/vmIOandFlowOperationsTestFiller.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/libevm/VMTestsFiller/vmIOandFlowOperationsTestFiller.json b/test/libevm/VMTestsFiller/vmIOandFlowOperationsTestFiller.json index d3fa596ed..0e3ebbd2f 100644 --- a/test/libevm/VMTestsFiller/vmIOandFlowOperationsTestFiller.json +++ b/test/libevm/VMTestsFiller/vmIOandFlowOperationsTestFiller.json @@ -866,7 +866,7 @@ "expect" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "storage" : { - "0x03" : "0x02" + "0x01" : "0x00" } } }, @@ -874,7 +874,7 @@ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "balance" : "100000000000000000000000", "nonce" : "0", - "code" : "0x5b5b64010000000056", + "code" : "0x640100000007565b5b6001600155", "storage": {} } }, @@ -901,7 +901,7 @@ "expect" : { "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "storage" : { - "0x03" : "0x02" + "0x01" : "0x00" } } }, @@ -909,7 +909,7 @@ "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { "balance" : "100000000000000000000000", "nonce" : "0", - "code" : "0x5b5b6801000000000000000056", + "code" : "0x6801000000000000000b565b5b6001600155", "storage": {} } }, From 03d5ffd166840149d2c1e18857fa75bbf9e8af1c Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Fri, 29 May 2015 12:59:01 +0200 Subject: [PATCH 381/461] add similiar tests for jumpi --- .../vmIOandFlowOperationsTestFiller.json | 70 +++++++++++++++++++ 1 file changed, 70 insertions(+) diff --git a/test/libevm/VMTestsFiller/vmIOandFlowOperationsTestFiller.json b/test/libevm/VMTestsFiller/vmIOandFlowOperationsTestFiller.json index 0e3ebbd2f..ee68f0d67 100644 --- a/test/libevm/VMTestsFiller/vmIOandFlowOperationsTestFiller.json +++ b/test/libevm/VMTestsFiller/vmIOandFlowOperationsTestFiller.json @@ -924,6 +924,76 @@ } }, + "jumpiToUintmaxPlus1": { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "1000000", + "currentDifficulty" : "256", + "currentTimestamp" : "1", + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "expect" : { + "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "storage" : { + "0x01" : "0x00" + } + } + }, + "pre" : { + "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "100000000000000000000000", + "nonce" : "0", + "code" : "0x6001640100000009575b5b6001600155", + "storage": {} + } + }, + "exec" : { + "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681", + "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "1000000000000000000", + "data" : "", + "gasPrice" : "100000000000000", + "gas" : "100000" + } + }, + + "jumpiToUint64maxPlus1": { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "1000000", + "currentDifficulty" : "256", + "currentTimestamp" : "1", + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "expect" : { + "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "storage" : { + "0x01" : "0x00" + } + } + }, + "pre" : { + "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "100000000000000000000000", + "nonce" : "0", + "code" : "0x60016801000000000000000d575b5b6001600155", + "storage": {} + } + }, + "exec" : { + "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681", + "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "1000000000000000000", + "data" : "", + "gasPrice" : "100000000000000", + "gas" : "100000" + } + }, + "jumpiAfterStop": { "env" : { "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", From 46acfde02176a274e0dcdd15f665e731ab6566b7 Mon Sep 17 00:00:00 2001 From: Vlad Gluhovsky Date: Fri, 29 May 2015 14:00:58 +0200 Subject: [PATCH 382/461] added extdep/download --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 43ed10adf..199746006 100644 --- a/.gitignore +++ b/.gitignore @@ -35,6 +35,7 @@ build_xc # build system build.*/ extdep/install +extdep/download *.pyc From 9dd24197a429e30a83af03028926f5a257d6d97a Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Fri, 29 May 2015 20:28:44 +0800 Subject: [PATCH 383/461] Fix #2031 --- eth/main.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/eth/main.cpp b/eth/main.cpp index a57928e72..9b9c58d17 100644 --- a/eth/main.cpp +++ b/eth/main.cpp @@ -693,15 +693,16 @@ int main(int argc, char** argv) } if (keyManager.exists()) - while (masterPassword.empty()) - { - masterPassword = getPassword("Please enter your MASTER password: "); - if (!keyManager.load(masterPassword)) + { + if (masterPassword.empty() || !keyManager.load(masterPassword)) + while (true) { + masterPassword = getPassword("Please enter your MASTER password: "); + if (keyManager.load(masterPassword)) + break; cout << "Password invalid. Try again." << endl; - masterPassword.clear(); } - } + } else { while (masterPassword.empty()) From bed201a691c5793a1da0e1d8bc8343bd83665f6b Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Fri, 29 May 2015 15:17:08 +0200 Subject: [PATCH 384/461] add JUMPDEST attack test with JUMP --- .../StateTestsFiller/stSpecialTestFiller.json | 36 +++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/test/libethereum/StateTestsFiller/stSpecialTestFiller.json b/test/libethereum/StateTestsFiller/stSpecialTestFiller.json index 60d9882c4..fd1d6ac0e 100644 --- a/test/libethereum/StateTestsFiller/stSpecialTestFiller.json +++ b/test/libethereum/StateTestsFiller/stSpecialTestFiller.json @@ -156,5 +156,41 @@ "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", "value" : "100000" } + }, + + "JUMPDEST_AttackwithJump" : { + "env" : { + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba", + "currentDifficulty" : "256", + "currentGasLimit" : "100000000", + "currentNumber" : "0", + "currentTimestamp" : 1, + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "1000000000000000000", + "code" : "0x6003565b600060006000600060003061c3505a03f1005b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b5b", + "nonce" : "0", + "storage" : { + } + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1000000000000000000", + "code" : "0x", + "nonce" : "0", + "storage" : { + } + } + }, + "transaction" : { + "data" : "", + "gasLimit" : "100000000", + "gasPrice" : "1", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "100000" + } } } From 1482599e521d1406611969eceeb6e8c593a84544 Mon Sep 17 00:00:00 2001 From: yann300 Date: Fri, 29 May 2015 16:28:30 +0200 Subject: [PATCH 385/461] - Check uint, int input from c++. - Check address also by contract name. --- mix/QBigInt.cpp | 35 +++++++++++++++++++++++++++++++++++ mix/QBigInt.h | 3 +++ mix/qml/TransactionDialog.qml | 2 +- mix/qml/js/InputValidator.js | 29 +++++++++++++++++++++-------- 4 files changed, 60 insertions(+), 9 deletions(-) diff --git a/mix/QBigInt.cpp b/mix/QBigInt.cpp index 21d32a9c3..ee29cea43 100644 --- a/mix/QBigInt.cpp +++ b/mix/QBigInt.cpp @@ -57,3 +57,38 @@ QBigInt* QBigInt::divide(QBigInt* const& _value) const BigIntVariant toDivide = _value->internalValue(); return new QBigInt(boost::apply_visitor(mix::divide(), m_internalValue, toDivide)); } + +QVariantMap QBigInt::checkAgainst(QString const& _type) const +{ + QVariantMap ret; + QString type = _type; + QString capacity = type.replace("uint", "").replace("int", ""); + if (capacity.isEmpty()) + capacity = "256"; + bigint range = 256^(capacity.toInt() / 8); + bigint value = boost::get(this->internalValue()); + ret.insert("valid", true); + if (_type.startsWith("uint") && value > range - 1) + { + ret.insert("minValue", "0"); + std::ostringstream s; + s << range - 1; + ret.insert("maxValue", QString::fromStdString(s.str())); + if (value > range) + ret["valid"] = false; + } + else if (_type.startsWith("int")) + { + range = range / 2; + std::ostringstream s; + s << -range; + ret.insert("minValue", QString::fromStdString(s.str())); + s.str(""); + s.clear(); + s << range - 1; + ret.insert("maxValue", QString::fromStdString(s.str())); + if (-range > value || value > range - 1) + ret["valid"] = false; + } + return ret; +} diff --git a/mix/QBigInt.h b/mix/QBigInt.h index b549a16db..ccf487d2a 100644 --- a/mix/QBigInt.h +++ b/mix/QBigInt.h @@ -84,6 +84,7 @@ public: Q_INVOKABLE QString value() const; /// Set the value of the BigInteger used. Will use u256 type. Invokable from QML. Q_INVOKABLE void setValue(QString const& _value) { m_internalValue = dev::jsToU256(_value.toStdString()); } + Q_INVOKABLE void setBigInt(QString const& _value) { m_internalValue = bigint(_value.toStdString()); } /// Subtract by @a _value. Invokable from QML. Q_INVOKABLE QBigInt* subtract(QBigInt* const& _value) const; /// Add @a _value to the current big integer. Invokable from QML. @@ -92,6 +93,8 @@ public: Q_INVOKABLE QBigInt* multiply(QBigInt* const& _value) const; /// divide by @a _value. Invokable from QML. Q_INVOKABLE QBigInt* divide(QBigInt* const& _value) const; + /// check if the current value satisfy the given type + Q_INVOKABLE QVariantMap checkAgainst(QString const& _type) const; protected: BigIntVariant m_internalValue; diff --git a/mix/qml/TransactionDialog.qml b/mix/qml/TransactionDialog.qml index a4c896d3f..df5ad781b 100644 --- a/mix/qml/TransactionDialog.qml +++ b/mix/qml/TransactionDialog.qml @@ -515,7 +515,7 @@ Dialog { } else { - errorDialog.text = qsTr("some parameters are invalid:\n"); + errorDialog.text = qsTr("Some parameters are invalid:\n"); for (var k in invalid) errorDialog.text += invalid[k].message + "\n"; errorDialog.open(); diff --git a/mix/qml/js/InputValidator.js b/mix/qml/js/InputValidator.js index 6e94dec6e..37185b898 100644 --- a/mix/qml/js/InputValidator.js +++ b/mix/qml/js/InputValidator.js @@ -1,3 +1,5 @@ +Qt.include("QEtherHelper.js") + var nbRegEx = new RegExp('^[0-9]+$'); function validate(model, values) { @@ -8,7 +10,9 @@ function validate(model, values) { var type = model[k].type.name; var res; - if (type.indexOf("int") !== -1) + if (isContractType(type)) + res = validateAddress(type, values[model[k].name]); + else if (type.indexOf("int") !== -1) res = validateInt(type, values[model[k].name]); else if (type.indexOf("bytes") !== -1) res = validateBytes(type, values[model[k].name]); @@ -17,7 +21,7 @@ function validate(model, values) else if (type.indexOf("address") !== -1) res = validateAddress(type, values[model[k].name]); else - res = validateAddress(type, values[model[k].name]); //we suppose that this is a ctr type. + res.valid = true; if (!res.valid) inError.push({ type: type, value: values, message: res.message }); } @@ -25,6 +29,16 @@ function validate(model, values) return inError; } +function isContractType(_type) +{ + for (var k in Object.keys(codeModel.contracts)) + { + if ("contract " + Object.keys(codeModel.contracts)[k] === _type) + return true; + } + return false; +} + function validateInt(_type, _value) { var ret = { valid: true, message: "" } @@ -35,7 +49,6 @@ function validateInt(_type, _value) { ret.valid = false; ret.message = "uint type cannot represent negative number"; - return false; } } ret.valid = nbRegEx.test(_value); @@ -43,12 +56,13 @@ function validateInt(_type, _value) ret.message = _value + " does not represent " + _type + " type."; else { - var t = _type.replace("uint", "").replace("int", ""); - var max = parseInt(t) / 4; - if (_value.length > max) + var bigInt = createBigInt(_value); + bigInt.setBigInt(_value); + var result = bigInt.checkAgainst(_type); + if (!result.valid) { ret.valid = false; - ret.message = _type + " should not contains more than " + max + " digits"; + ret.message = _type + " should be between " + result.minValue + " and " + result.maxValue; } } return ret; @@ -60,7 +74,6 @@ function validateAddress(_type, _value) if (_value.indexOf("<") === 0 && _value.indexOf(">") === _value.length - 1) { var v = _value.split(' - '); - console.log(JSON.stringify(v)); if (v.length !== 2 || !nbRegEx.test(v[1].replace(">", ""))) // { ret.valid = false; From 74c46b8298a9c69327441c8fd4596f2d2566f6c6 Mon Sep 17 00:00:00 2001 From: yann300 Date: Fri, 29 May 2015 16:34:34 +0200 Subject: [PATCH 386/461] rollback --- eth/main.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/eth/main.cpp b/eth/main.cpp index 645465234..b7bdee78b 100644 --- a/eth/main.cpp +++ b/eth/main.cpp @@ -628,7 +628,6 @@ int main(int argc, char** argv) nodeMode == NodeMode::Full ? set{"eth"/*, "shh"*/} : set(), netPrefs, &nodesState); - auto toNumber = [&](string const& s) -> unsigned { if (s == "latest") return web3.ethereum()->number(); From 15afbdd2827345a08e1b35b1a05a99634fe43a8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Fri, 29 May 2015 16:36:36 +0200 Subject: [PATCH 387/461] Workaround for incorrect mixed type big int comparison. Fixes ethereum/cpp-ethereum#1977. --- libdevcore/Common.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/libdevcore/Common.h b/libdevcore/Common.h index ae98861c1..346bb53cf 100644 --- a/libdevcore/Common.h +++ b/libdevcore/Common.h @@ -85,6 +85,20 @@ using u160s = std::vector; using u256Set = std::set; using u160Set = std::set; +// Workaround for mixed type big int comparison bug introduced in boost 1.58 +// https://svn.boost.org/trac/boost/ticket/11328 +#define ETH_BIGINT_WRONG_COMPARISON_WORKAROUND(_OP) \ + template auto operator _OP (_T const& a, _U const& b) -> typename std::enable_if::value && std::is_same<_U, bigint>::value, bool>::type { return (bigint)a _OP b; } \ + template auto operator _OP (_U const& a, _T const& b) -> typename std::enable_if::value && std::is_same<_U, bigint>::value, bool>::type { return a _OP (bigint)b; } + +ETH_BIGINT_WRONG_COMPARISON_WORKAROUND(==) +ETH_BIGINT_WRONG_COMPARISON_WORKAROUND(!=) +ETH_BIGINT_WRONG_COMPARISON_WORKAROUND(>=) +ETH_BIGINT_WRONG_COMPARISON_WORKAROUND(<=) +ETH_BIGINT_WRONG_COMPARISON_WORKAROUND(<) +ETH_BIGINT_WRONG_COMPARISON_WORKAROUND(>) + + extern const u256 UndefinedU256; // Map types. From 05c47db94769bac8afe7f18171c9c6a04f275f4a Mon Sep 17 00:00:00 2001 From: yann300 Date: Fri, 29 May 2015 16:39:07 +0200 Subject: [PATCH 388/461] rollback --- eth/main.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/eth/main.cpp b/eth/main.cpp index b7bdee78b..645465234 100644 --- a/eth/main.cpp +++ b/eth/main.cpp @@ -628,6 +628,7 @@ int main(int argc, char** argv) nodeMode == NodeMode::Full ? set{"eth"/*, "shh"*/} : set(), netPrefs, &nodesState); + auto toNumber = [&](string const& s) -> unsigned { if (s == "latest") return web3.ethereum()->number(); From 70a49b1f3532f65c539d21790094aa6a7c61e868 Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Fri, 29 May 2015 16:44:25 +0200 Subject: [PATCH 389/461] Increase win32 executable stack size to 32MB --- cmake/EthCompilerSettings.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/EthCompilerSettings.cmake b/cmake/EthCompilerSettings.cmake index dcf2e19b8..eb8588ceb 100644 --- a/cmake/EthCompilerSettings.cmake +++ b/cmake/EthCompilerSettings.cmake @@ -44,7 +44,7 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC") # warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/SAFESEH' specification # warning LNK4099: pdb was not found with lib # stack size 16MB - set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /ignore:4099,4075 /STACK:16777216") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /ignore:4099,4075 /STACK:33554432") # windows likes static if (NOT ETH_STATIC) From 87628fc432144e7f8943f0c1de368325cfecf066 Mon Sep 17 00:00:00 2001 From: Vern Date: Sat, 30 May 2015 10:00:31 +0200 Subject: [PATCH 390/461] windows build: fixed dangling catch problem --- libethereum/BlockQueue.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libethereum/BlockQueue.cpp b/libethereum/BlockQueue.cpp index 4a7a61a31..bbdac5e7b 100644 --- a/libethereum/BlockQueue.cpp +++ b/libethereum/BlockQueue.cpp @@ -101,7 +101,8 @@ void BlockQueue::verifierBody() } RLP r(&res.second); - for (auto const& uncle: r[2]) + for (auto const& uncle : r[2]) + { try { BlockInfo().populateFromHeader(RLP(uncle.data()), CheckEverything); @@ -125,6 +126,7 @@ void BlockQueue::verifierBody() badBlockHeader(uncle.data(), _e.what()); throw; } + } } catch (...) { From fcc6d2f62172eb6aa547b76653328522a0cc35c5 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Mon, 1 Jun 2015 12:38:25 +0800 Subject: [PATCH 391/461] Possible MSVC workaround. --- libethereum/BlockQueue.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libethereum/BlockQueue.cpp b/libethereum/BlockQueue.cpp index 4a7a61a31..c2bd35afc 100644 --- a/libethereum/BlockQueue.cpp +++ b/libethereum/BlockQueue.cpp @@ -102,6 +102,7 @@ void BlockQueue::verifierBody() RLP r(&res.second); for (auto const& uncle: r[2]) + { try { BlockInfo().populateFromHeader(RLP(uncle.data()), CheckEverything); @@ -125,6 +126,7 @@ void BlockQueue::verifierBody() badBlockHeader(uncle.data(), _e.what()); throw; } + } } catch (...) { From 152e3b83fec33bc5b66bb26f6fcaa39967d8e9d4 Mon Sep 17 00:00:00 2001 From: arkpar Date: Mon, 1 Jun 2015 08:51:50 +0200 Subject: [PATCH 392/461] disabled v61 protocol --- alethzero/MainWin.cpp | 2 +- libethereum/EthereumHost.cpp | 1 + libethereum/EthereumPeer.cpp | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index 3a67fc3ae..6a11736a4 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -1899,7 +1899,7 @@ void Main::on_net_triggered() { web3()->setIdealPeerCount(ui->idealPeers->value()); web3()->setNetworkPreferences(netPrefs(), ui->dropPeers->isChecked()); - ethereum()->setNetworkId(m_privateChain.size() ? sha3(m_privateChain.toStdString()) : h256(u256(42))); + ethereum()->setNetworkId(m_privateChain.size() ? sha3(m_privateChain.toStdString()) : h256()); web3()->startNetwork(); ui->downloadView->setDownloadMan(ethereum()->downloadMan()); ui->enode->setText(QString::fromStdString(web3()->enode())); diff --git a/libethereum/EthereumHost.cpp b/libethereum/EthereumHost.cpp index cbf96a011..a50c1c706 100644 --- a/libethereum/EthereumHost.cpp +++ b/libethereum/EthereumHost.cpp @@ -241,6 +241,7 @@ void EthereumHost::onPeerStatus(EthereumPeer* _peer) _peer->disable("Peer banned for previous bad behaviour."); else { + _peer->m_protocolVersion = EthereumHost::c_oldProtocolVersion; //force V60 for now if (_peer->m_protocolVersion != protocolVersion()) estimatePeerHashes(_peer); else if (_peer->m_latestBlockNumber > m_chain.number()) diff --git a/libethereum/EthereumPeer.cpp b/libethereum/EthereumPeer.cpp index a1c22e449..aa979e4b8 100644 --- a/libethereum/EthereumPeer.cpp +++ b/libethereum/EthereumPeer.cpp @@ -40,6 +40,7 @@ EthereumPeer::EthereumPeer(Session* _s, HostCapabilityFace* _h, unsigned _i, Cap m_hashSub(host()->hashDownloadMan()), m_peerCapabilityVersion(_cap.second) { + m_peerCapabilityVersion = EthereumHost::c_oldProtocolVersion; m_syncHashNumber = host()->chain().number() + 1; requestStatus(); } From ec0074c225ecce21ed73cee2df87af95fae216af Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Mon, 1 Jun 2015 09:48:19 +0200 Subject: [PATCH 393/461] add ability to test uncle as brother --- test/libethereum/blockchain.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/libethereum/blockchain.cpp b/test/libethereum/blockchain.cpp index 4e98b4036..0ea8b95a8 100644 --- a/test/libethereum/blockchain.cpp +++ b/test/libethereum/blockchain.cpp @@ -547,6 +547,10 @@ mArray importUncles(mObject const& blObj, vector& vBiUncles, vector Date: Mon, 1 Jun 2015 09:50:39 +0200 Subject: [PATCH 394/461] add uncle is brother test --- .../BlockTestsFiller/bcUncleTestFiller.json | 102 ++++++++++++++++++ 1 file changed, 102 insertions(+) diff --git a/test/libethereum/BlockTestsFiller/bcUncleTestFiller.json b/test/libethereum/BlockTestsFiller/bcUncleTestFiller.json index aeb372f67..761bce316 100644 --- a/test/libethereum/BlockTestsFiller/bcUncleTestFiller.json +++ b/test/libethereum/BlockTestsFiller/bcUncleTestFiller.json @@ -85,6 +85,108 @@ ] }, + "UncleIsBrother" : { + "genesisBlockHeader" : { + "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1", + "difficulty" : "131072", + "extraData" : "0x42", + "gasLimit" : "3141592", + "gasUsed" : "0", + "number" : "0", + "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000", + "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "stateRoot" : "0xf99eb1626cfa6db435c0836235942d7ccaa935f1ae247d3f1c21e495685f903a", + "timestamp" : "0x54c98c81", + "mixHash" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "nonce" : "0x0102030405060708", + "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + }, + "expect" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "20" + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "nonce" : "2" + } + }, + "pre" : { + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "10000000000000", + "nonce" : "0", + "code" : "", + "storage": {} + } + }, + "blocks" : [ + { + "transactions" : [ + { + "data" : "", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "1", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "2", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "10" + } + ], + "uncleHeaders" : [ + { + "overwriteAndRedoPoW" : "parentHashIsBlocksParent", + "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "coinbase" : "acde5374fce5edbc8e2a8697c15331677e6ebf0b", + "difficulty" : "131072", + "extraData" : "0x", + "gasLimit" : "4141592", + "gasUsed" : "150000", + "hash" : "9de9879b6a81d1b6c4993c63c90a3c9d1e775f14572694778e828bc64972ae04", + "mixHash" : "b557f905d29ed0fca99d65d0adcce698dee97cf72a13c7cd8d7a7826b8eee770", + "nonce" : "18a524c1790fa83b", + "number" : "2", + "parentHash" : "6134fc6b5d99ee03c4aab1592640f6f9dcbc850668d75d631aee34989b938fae", + "receiptTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "stateRoot" : "ff640b30d613c35dad43e3693329e1b1ee6350f989cf46a288025a1cbfdab9cd", + "timestamp" : "142813170", + "transactionsTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + } + ] + } + ] + }, + "uncleHeaderWithGeneration0" : { "genesisBlockHeader" : { "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", From be62f618372e41005dfe4612f102b1aeb1935939 Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Tue, 19 May 2015 16:55:43 +0200 Subject: [PATCH 395/461] Test for issue #1977 Test that reproduces issue #1977 and will fail on ArchLinux with Boost version: 1.58.0-1 gcc version: 4.9.2-4 --- test/libevm/vm.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/test/libevm/vm.cpp b/test/libevm/vm.cpp index 7b589d238..9f790501d 100644 --- a/test/libevm/vm.cpp +++ b/test/libevm/vm.cpp @@ -438,6 +438,15 @@ void doVMTests(json_spirit::mValue& v, bool _fillin) BOOST_AUTO_TEST_SUITE(VMTests) +// test that reproduces issue https://github.com/ethereum/cpp-ethereum/issues/1977 +BOOST_AUTO_TEST_CASE(u256_overflow_test) +{ + dev::u256 a = 14; + dev::bigint b = dev::bigint("115792089237316195423570985008687907853269984665640564039457584007913129639948"); + // to fix cast `a` to dev::bigint + BOOST_CHECK(a < b); +} + BOOST_AUTO_TEST_CASE(vmtests) { dev::test::executeTests("vmtests", "/VMTests",dev::test::getFolder(__FILE__) + "/VMTestsFiller", dev::test::doVMTests); From a61e4a70a33fde189e50bab45a67d7c5b40bbdc6 Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Mon, 1 Jun 2015 10:40:17 +0200 Subject: [PATCH 396/461] Move the u256 test to external_dependencies tests --- test/CMakeLists.txt | 1 + .../external_dependencies/CMakeLists.txt | 5 +++ .../external_dependencies/boost.cpp | 37 +++++++++++++++++++ test/libevm/vm.cpp | 9 ----- 4 files changed, 43 insertions(+), 9 deletions(-) create mode 100644 test/libdevcore/external_dependencies/CMakeLists.txt create mode 100644 test/libdevcore/external_dependencies/boost.cpp diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 39a235c58..0812a278a 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -19,6 +19,7 @@ endmacro() add_subdirectory(fuzzTesting) add_subdirectory(libdevcore) +add_subdirectory(libdevcore/external_dependencies) add_subdirectory(libdevcrypto) add_subdirectory(libethcore) add_subdirectory(libethereum) diff --git a/test/libdevcore/external_dependencies/CMakeLists.txt b/test/libdevcore/external_dependencies/CMakeLists.txt new file mode 100644 index 000000000..3ceda13b0 --- /dev/null +++ b/test/libdevcore/external_dependencies/CMakeLists.txt @@ -0,0 +1,5 @@ +cmake_policy(SET CMP0015 NEW) + +aux_source_directory(. SRCS) + +add_sources(${SRCS}) diff --git a/test/libdevcore/external_dependencies/boost.cpp b/test/libdevcore/external_dependencies/boost.cpp new file mode 100644 index 000000000..5212c260b --- /dev/null +++ b/test/libdevcore/external_dependencies/boost.cpp @@ -0,0 +1,37 @@ +/* + This file is part of cpp-ethereum. + + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file boost.cpp + * @author Lefteris Karapetsas + * @date 205 + * Tests for external dependencies: Boost + */ + +#include +#include + +BOOST_AUTO_TEST_SUITE(ExtDepBoost) + +// test that reproduces issue https://github.com/ethereum/cpp-ethereum/issues/1977 +BOOST_AUTO_TEST_CASE(u256_overflow_test) +{ + dev::u256 a = 14; + dev::bigint b = dev::bigint("115792089237316195423570985008687907853269984665640564039457584007913129639948"); + // to fix cast `a` to dev::bigint + BOOST_CHECK(a < b); +} + +BOOST_AUTO_TEST_SUITE_END() diff --git a/test/libevm/vm.cpp b/test/libevm/vm.cpp index 9f790501d..7b589d238 100644 --- a/test/libevm/vm.cpp +++ b/test/libevm/vm.cpp @@ -438,15 +438,6 @@ void doVMTests(json_spirit::mValue& v, bool _fillin) BOOST_AUTO_TEST_SUITE(VMTests) -// test that reproduces issue https://github.com/ethereum/cpp-ethereum/issues/1977 -BOOST_AUTO_TEST_CASE(u256_overflow_test) -{ - dev::u256 a = 14; - dev::bigint b = dev::bigint("115792089237316195423570985008687907853269984665640564039457584007913129639948"); - // to fix cast `a` to dev::bigint - BOOST_CHECK(a < b); -} - BOOST_AUTO_TEST_CASE(vmtests) { dev::test::executeTests("vmtests", "/VMTests",dev::test::getFolder(__FILE__) + "/VMTestsFiller", dev::test::doVMTests); From 2c89b071d0515d7335048f71de17625ef03db25b Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Mon, 1 Jun 2015 11:09:38 +0200 Subject: [PATCH 397/461] Move external-dependencies test out of lifdevcore --- test/CMakeLists.txt | 2 +- .../CMakeLists.txt | 0 .../external_dependencies => external-dependencies}/boost.cpp | 2 +- 3 files changed, 2 insertions(+), 2 deletions(-) rename test/{libdevcore/external_dependencies => external-dependencies}/CMakeLists.txt (100%) rename test/{libdevcore/external_dependencies => external-dependencies}/boost.cpp (98%) diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 0812a278a..d39a5cca1 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -19,13 +19,13 @@ endmacro() add_subdirectory(fuzzTesting) add_subdirectory(libdevcore) -add_subdirectory(libdevcore/external_dependencies) add_subdirectory(libdevcrypto) add_subdirectory(libethcore) add_subdirectory(libethereum) add_subdirectory(libevm) add_subdirectory(libnatspec) add_subdirectory(libp2p) +add_subdirectory(external-dependencies) if (JSCONSOLE) add_subdirectory(libjsengine) diff --git a/test/libdevcore/external_dependencies/CMakeLists.txt b/test/external-dependencies/CMakeLists.txt similarity index 100% rename from test/libdevcore/external_dependencies/CMakeLists.txt rename to test/external-dependencies/CMakeLists.txt diff --git a/test/libdevcore/external_dependencies/boost.cpp b/test/external-dependencies/boost.cpp similarity index 98% rename from test/libdevcore/external_dependencies/boost.cpp rename to test/external-dependencies/boost.cpp index 5212c260b..91bf384b1 100644 --- a/test/libdevcore/external_dependencies/boost.cpp +++ b/test/external-dependencies/boost.cpp @@ -16,7 +16,7 @@ */ /** @file boost.cpp * @author Lefteris Karapetsas - * @date 205 + * @date 2015 * Tests for external dependencies: Boost */ From a706397875f37bafd85e3d280ed02f341197cde2 Mon Sep 17 00:00:00 2001 From: Vlad Gluhovsky Date: Mon, 1 Jun 2015 12:01:01 +0200 Subject: [PATCH 398/461] MSVS compiler error and warnings fixed --- libp2p/UDP.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libp2p/UDP.h b/libp2p/UDP.h index a455b5057..b032c9e73 100644 --- a/libp2p/UDP.h +++ b/libp2p/UDP.h @@ -65,8 +65,8 @@ protected: */ struct RLPXDatagramFace: public UDPDatagram { - static uint32_t futureFromEpoch(std::chrono::seconds _sec) { return std::chrono::duration_cast((std::chrono::system_clock::now() + _sec).time_since_epoch()).count(); } - static uint32_t secondsSinceEpoch() { return std::chrono::duration_cast((std::chrono::system_clock::now()).time_since_epoch()).count(); } + static uint32_t futureFromEpoch(std::chrono::seconds _sec) { return static_cast(std::chrono::duration_cast((std::chrono::system_clock::now() + _sec).time_since_epoch()).count()); } + static uint32_t secondsSinceEpoch() { return static_cast(std::chrono::duration_cast((std::chrono::system_clock::now()).time_since_epoch()).count()); } static Public authenticate(bytesConstRef _sig, bytesConstRef _rlp); virtual uint8_t packetType() = 0; @@ -115,7 +115,7 @@ class UDPSocket: UDPSocketFace, public std::enable_shared_from_this Date: Mon, 1 Jun 2015 12:41:50 +0200 Subject: [PATCH 399/461] exception in destructor --- libdevcore/TransientDirectory.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/libdevcore/TransientDirectory.cpp b/libdevcore/TransientDirectory.cpp index db702181e..3e5462700 100644 --- a/libdevcore/TransientDirectory.cpp +++ b/libdevcore/TransientDirectory.cpp @@ -19,6 +19,7 @@ * @date 2015 */ +#include #include #include "Exceptions.h" #include "TransientDirectory.h" @@ -42,5 +43,16 @@ TransientDirectory::TransientDirectory(std::string const& _path): TransientDirectory::~TransientDirectory() { - boost::filesystem::remove_all(m_path); + for (int i = 0; i < 3; ++i) + { + try + { + boost::filesystem::remove_all(m_path); + break; + } + catch (...) + { + std::this_thread::sleep_for(chrono::milliseconds(10)); + } + } } From f7ee67a8db7aa0d835744e74706495d7472ca364 Mon Sep 17 00:00:00 2001 From: arkpar Date: Mon, 1 Jun 2015 12:43:25 +0200 Subject: [PATCH 400/461] fixed pv61+ hash downloading stalling --- libethereum/EthereumHost.cpp | 98 +++++++++++++----------------------- libethereum/EthereumHost.h | 1 - libethereum/EthereumPeer.cpp | 20 +++----- 3 files changed, 42 insertions(+), 77 deletions(-) diff --git a/libethereum/EthereumHost.cpp b/libethereum/EthereumHost.cpp index a50c1c706..899960c23 100644 --- a/libethereum/EthereumHost.cpp +++ b/libethereum/EthereumHost.cpp @@ -91,7 +91,10 @@ void EthereumHost::doWork() bool netChange = ensureInitialised(); auto h = m_chain.currentHash(); // If we've finished our initial sync (including getting all the blocks into the chain so as to reduce invalid transactions), start trading transactions & blocks - if (!isSyncing() && m_chain.isKnown(m_latestBlockSent)) + bool syncing = false; + DEV_GUARDED(x_sync) + syncing = isSyncing(); + if (syncing && m_chain.isKnown(m_latestBlockSent)) { if (m_newTransactions) { @@ -241,7 +244,6 @@ void EthereumHost::onPeerStatus(EthereumPeer* _peer) _peer->disable("Peer banned for previous bad behaviour."); else { - _peer->m_protocolVersion = EthereumHost::c_oldProtocolVersion; //force V60 for now if (_peer->m_protocolVersion != protocolVersion()) estimatePeerHashes(_peer); else if (_peer->m_latestBlockNumber > m_chain.number()) @@ -283,6 +285,7 @@ void EthereumHost::onPeerHashes(EthereumPeer* _peer, h256s const& _hashes, bool unsigned knowns = 0; unsigned unknowns = 0; h256s neededBlocks; + bool syncByNumber = !m_syncingLatestHash; for (unsigned i = 0; i < _hashes.size(); ++i) { _peer->addRating(1); @@ -290,10 +293,14 @@ void EthereumHost::onPeerHashes(EthereumPeer* _peer, h256s const& _hashes, bool auto status = m_bq.blockStatus(h); if (status == QueueStatus::Importing || status == QueueStatus::Ready || m_chain.isKnown(h)) { - clog(NetMessageSummary) << "block hash ready:" << h << ". Start blocks download..."; - m_hashes += neededBlocks; - onPeerDoneHashes(_peer, true); - return; + clog(NetMessageSummary) << "Block hash already known:" << h; + if (!syncByNumber) + { + m_hashes += neededBlocks; + clog(NetMessageSummary) << "Start blocks download..."; + onPeerDoneHashes(_peer, true); + return; + } } else if (status == QueueStatus::Bad) { @@ -308,65 +315,25 @@ void EthereumHost::onPeerHashes(EthereumPeer* _peer, h256s const& _hashes, bool } else knowns++; - m_syncingLatestHash = h; - } - m_hashes += neededBlocks; - clog(NetMessageSummary) << knowns << "knowns," << unknowns << "unknowns; now at" << m_syncingLatestHash; - if (_complete) - { - m_needSyncBlocks = true; - continueSync(_peer); + if (!syncByNumber) + m_syncingLatestHash = h; } - else if (m_hashes.size() > _peer->m_expectedHashes) + if (syncByNumber) { - _peer->disable("Too many hashes"); - m_hashes.clear(); - m_syncingLatestHash = h256(); - continueSync(); ///Try with some other peer, keep the chain + m_man.appendToChain(neededBlocks); // Append to download manager immediatelly + clog(NetMessageSummary) << knowns << "knowns," << unknowns << "unknowns"; } else - continueSync(_peer); /// Grab next hashes -} - -void EthereumHost::onPeerHashes(EthereumPeer* _peer, unsigned /*_index*/, h256s const& _hashes) -{ - Guard l(x_sync); - assert(_peer->m_asking == Asking::Nothing); - if (_hashes.empty()) { - onPeerDoneHashes(_peer, true); - return; + m_hashes += neededBlocks; // Append to local list + clog(NetMessageSummary) << knowns << "knowns," << unknowns << "unknowns; now at" << m_syncingLatestHash; } - unsigned knowns = 0; - unsigned unknowns = 0; - h256s neededBlocks; - for (unsigned i = 0; i < _hashes.size(); ++i) + if (_complete) { - _peer->addRating(1); - auto h = _hashes[i]; - auto status = m_bq.blockStatus(h); - if (status == QueueStatus::Importing || status == QueueStatus::Ready || m_chain.isKnown(h)) - { - clog(NetWarn) << "block hash already known:" << h; - } - else if (status == QueueStatus::Bad) - { - clog(NetWarn) << "block hash bad!" << h << ". Bailing..."; - _peer->setIdle(); - return; - } - else if (status == QueueStatus::Unknown) - { - unknowns++; - neededBlocks.push_back(h); - } - else - knowns++; + m_needSyncBlocks = true; + continueSync(_peer); } - m_man.appendToChain(neededBlocks); - clog(NetMessageSummary) << knowns << "knowns," << unknowns << "unknowns"; - - if (m_hashMan.isComplete()) + else if (syncByNumber && m_hashMan.isComplete()) { // Done our chain-get. m_needSyncHashes = false; @@ -376,8 +343,15 @@ void EthereumHost::onPeerHashes(EthereumPeer* _peer, unsigned /*_index*/, h256s m_hashMan.reset(m_chain.number() + 1); continueSync(); } + else if (m_hashes.size() > _peer->m_expectedHashes) + { + _peer->disable("Too many hashes"); + m_hashes.clear(); + m_syncingLatestHash = h256(); + continueSync(); ///Try with some other peer, keep the chain + } else - continueSync(_peer); + continueSync(_peer); /// Grab next hashes } void EthereumHost::onPeerDoneHashes(EthereumPeer* _peer, bool _localChain) @@ -470,8 +444,7 @@ void EthereumHost::onPeerBlocks(EthereumPeer* _peer, RLP const& _r) void EthereumHost::onPeerNewHashes(EthereumPeer* _peer, h256s const& _hashes) { - Guard l(x_sync); - if (_peer->m_asking != Asking::Nothing) + if (isSyncing()) { clog(NetMessageSummary) << "Ignoring new hashes since we're already downloading."; return; @@ -483,7 +456,7 @@ void EthereumHost::onPeerNewHashes(EthereumPeer* _peer, h256s const& _hashes) void EthereumHost::onPeerNewBlock(EthereumPeer* _peer, RLP const& _r) { Guard l(x_sync); - if (_peer->m_asking != Asking::Nothing) + if (isSyncing()) { clog(NetMessageSummary) << "Ignoring new blocks since we're already downloading."; return; @@ -525,7 +498,7 @@ void EthereumHost::onPeerNewBlock(EthereumPeer* _peer, RLP const& _r) _peer->m_totalDifficulty = difficulty; m_needSyncHashes = true; m_needSyncBlocks = true; - m_syncingLatestHash = _peer->m_latestHash; + m_syncingLatestHash = h; sync = true; } } @@ -648,7 +621,6 @@ bool EthereumHost::peerShouldGrabChain(EthereumPeer* _peer) const bool EthereumHost::isSyncing() const { - Guard l(x_sync); bool syncing = false; forEachPeer([&](EthereumPeer* _p) { diff --git a/libethereum/EthereumHost.h b/libethereum/EthereumHost.h index 497255034..f8fa79a15 100644 --- a/libethereum/EthereumHost.h +++ b/libethereum/EthereumHost.h @@ -82,7 +82,6 @@ public: void onPeerNewBlock(EthereumPeer* _peer, RLP const& _r); ///< Called by peer once it has new blocks void onPeerNewHashes(EthereumPeer* _peer, h256s const& _hashes); ///< Called by peer once it has new hashes void onPeerHashes(EthereumPeer* _peer, h256s const& _hashes); ///< Called by peer once it has another sequential block of hashes during sync - void onPeerHashes(EthereumPeer* _peer, unsigned _index, h256s const& _hashes); ///< Called by peer once it has a new ordered block of hashes starting with a particular number void onPeerTransactions(EthereumPeer* _peer, RLP const& _r); ///< Called by peer when it has new transactions DownloadMan& downloadMan() { return m_man; } diff --git a/libethereum/EthereumPeer.cpp b/libethereum/EthereumPeer.cpp index aa979e4b8..d6b0b50c3 100644 --- a/libethereum/EthereumPeer.cpp +++ b/libethereum/EthereumPeer.cpp @@ -40,7 +40,6 @@ EthereumPeer::EthereumPeer(Session* _s, HostCapabilityFace* _h, unsigned _i, Cap m_hashSub(host()->hashDownloadMan()), m_peerCapabilityVersion(_cap.second) { - m_peerCapabilityVersion = EthereumHost::c_oldProtocolVersion; m_syncHashNumber = host()->chain().number() + 1; requestStatus(); } @@ -78,7 +77,6 @@ string toString(Asking _a) return "?"; } - void EthereumPeer::setIdle() { m_sub.doneFetch(); @@ -88,8 +86,7 @@ void EthereumPeer::setIdle() void EthereumPeer::requestStatus() { - if (m_asking != Asking::Nothing) - clog(NetWarn) << "Bad state: requesting state should be the first action"; + assert(m_asking == Asking::Nothing); setAsking(Asking::State); RLPStream s; bool latest = m_peerCapabilityVersion == host()->protocolVersion(); @@ -106,22 +103,22 @@ void EthereumPeer::requestStatus() void EthereumPeer::requestHashes() { - if (m_asking == Asking::Blocks) - return; + assert(m_asking == Asking::Nothing); m_syncHashNumber = m_hashSub.nextFetch(c_maxHashesAsk); setAsking(Asking::Hashes); RLPStream s; prep(s, GetBlockHashesByNumberPacket, 2) << m_syncHashNumber << c_maxHashesAsk; + clog(NetMessageDetail) << "Requesting block hashes for numbers " << m_syncHashNumber << "-" << m_syncHashNumber + c_maxHashesAsk - 1; sealAndSend(s); } void EthereumPeer::requestHashes(h256 const& _lastHash) { - if (m_asking == Asking::Blocks) - return; + assert(m_asking == Asking::Nothing); setAsking(Asking::Hashes); RLPStream s; prep(s, GetBlockHashesPacket, 2) << _lastHash << c_maxHashesAsk; + clog(NetMessageDetail) << "Requesting block hashes staring from " << _lastHash; sealAndSend(s); } @@ -212,7 +209,7 @@ bool EthereumPeer::interpret(unsigned _id, RLP const& _r) u256 number256 = _r[0].toInt(); unsigned number = (unsigned) number256; unsigned limit = _r[1].toInt(); - clog(NetMessageSummary) << "GetBlockHashesByNumber (" << number << "-" << number + limit << ")"; + clog(NetMessageSummary) << "GetBlockHashesByNumber (" << number << "-" << number + limit - 1 << ")"; RLPStream s; if (number <= host()->chain().number()) { @@ -248,11 +245,8 @@ bool EthereumPeer::interpret(unsigned _id, RLP const& _r) m_hashSub.noteHash(m_syncHashNumber + i, 1); } - if (m_protocolVersion == host()->protocolVersion()) - host()->onPeerHashes(this, m_syncHashNumber, hashes); // V61+, report hashes by number - else - host()->onPeerHashes(this, hashes); m_syncHashNumber += itemCount; + host()->onPeerHashes(this, hashes); break; } case GetBlocksPacket: From 10fe1b4cfedccadff90325de7157d5b720f3d177 Mon Sep 17 00:00:00 2001 From: Liana Husikyan Date: Fri, 15 May 2015 12:23:13 +0200 Subject: [PATCH 401/461] added error jump instead of STOP instraction in case of exception --- libevmasm/Assembly.cpp | 28 +++- libevmasm/Assembly.h | 6 +- libevmasm/AssemblyItem.h | 2 +- libevmasm/ControlFlowGraph.cpp | 8 +- libsolidity/ArrayUtils.cpp | 8 +- libsolidity/Compiler.cpp | 3 +- libsolidity/CompilerContext.h | 2 + libsolidity/ExpressionCompiler.cpp | 7 +- test/libsolidity/SolidityCompiler.cpp | 192 ---------------------- test/libsolidity/SolidityEndToEndTest.cpp | 1 + 10 files changed, 43 insertions(+), 214 deletions(-) delete mode 100644 test/libsolidity/SolidityCompiler.cpp diff --git a/libevmasm/Assembly.cpp b/libevmasm/Assembly.cpp index 5cf3b787a..f492260af 100644 --- a/libevmasm/Assembly.cpp +++ b/libevmasm/Assembly.cpp @@ -127,7 +127,10 @@ ostream& Assembly::streamAsm(ostream& _out, string const& _prefix, StringMap con _out << " PUSH \"" << m_strings.at((h256)i.data()) << "\""; break; case PushTag: - _out << " PUSH [tag" << dec << i.data() << "]"; + if (i.data() == 0) + _out << " PUSH [ErrorTag]"; + else + _out << " PUSH [tag" << dec << i.data() << "]"; break; case PushSub: _out << " PUSH [$" << h256(i.data()).abridged() << "]"; @@ -207,6 +210,10 @@ Json::Value Assembly::streamAsmJson(ostream& _out, StringMap const& _sourceCodes createJsonValue("PUSH tag", i.getLocation().start, i.getLocation().end, m_strings.at((h256)i.data()))); break; case PushTag: + if (i.data() == 0) + collection.append( + createJsonValue("PUSH [ErrorTag]", i.getLocation().start, i.getLocation().end, "")); + collection.append( createJsonValue("PUSH [tag]", i.getLocation().start, i.getLocation().end, string(i.data()))); break; @@ -226,7 +233,7 @@ Json::Value Assembly::streamAsmJson(ostream& _out, StringMap const& _sourceCodes collection.append( createJsonValue("tag", i.getLocation().start, i.getLocation().end, string(i.data()))); collection.append( - createJsonValue("JUMDEST", i.getLocation().start, i.getLocation().end)); + createJsonValue("JUMPDEST", i.getLocation().start, i.getLocation().end)); break; case PushData: collection.append(createJsonValue("PUSH data", i.getLocation().start, i.getLocation().end, toStringInHex(i.data()))); @@ -387,6 +394,11 @@ bytes Assembly::assemble() const // m_data must not change from here on for (AssemblyItem const& i: m_items) + { + // store position of the invalid jump destination + if (i.type() != Tag && tagPos[0] == 0) + tagPos[0] = ret.size(); + switch (i.type()) { case Operation: @@ -448,17 +460,23 @@ bytes Assembly::assemble() const } case Tag: tagPos[(unsigned)i.data()] = ret.size(); + assertThrow(i.data() != 0, AssemblyException, ""); ret.push_back((byte)Instruction::JUMPDEST); break; default: BOOST_THROW_EXCEPTION(InvalidOpcode()); } - + } for (auto const& i: tagRef) { bytesRef r(ret.data() + i.first, bytesPerTag); - //@todo in the failure case, we could use the position of the invalid jumpdest - toBigEndian(i.second < tagPos.size() ? tagPos[i.second] : (1 << (8 * bytesPerTag)) - 1, r); + auto tag = i.second; + if (tag >= tagPos.size()) + tag = 0; + if (tag == 0) + assertThrow(tagPos[tag] != 0, AssemblyException, ""); + + toBigEndian(tagPos[tag], r); } if (!m_data.empty()) diff --git a/libevmasm/Assembly.h b/libevmasm/Assembly.h index b4850f7d0..4550eb6e7 100644 --- a/libevmasm/Assembly.h +++ b/libevmasm/Assembly.h @@ -67,6 +67,8 @@ public: AssemblyItem appendJumpI() { auto ret = append(newPushTag()); append(Instruction::JUMPI); return ret; } AssemblyItem appendJump(AssemblyItem const& _tag) { auto ret = append(_tag.pushTag()); append(Instruction::JUMP); return ret; } AssemblyItem appendJumpI(AssemblyItem const& _tag) { auto ret = append(_tag.pushTag()); append(Instruction::JUMPI); return ret; } + AssemblyItem errorTag() { return AssemblyItem(PushTag, 0); } + template Assembly& operator<<(T const& _d) { append(_d); return *this; } AssemblyItems const& getItems() const { return m_items; } AssemblyItem const& back() const { return m_items.back(); } @@ -97,7 +99,6 @@ public: const StringMap &_sourceCodes = StringMap(), bool _inJsonFormat = false ) const; - protected: std::string getLocationFromSources(StringMap const& _sourceCodes, SourceLocation const& _location) const; void donePath() { if (m_totalDeposit != INT_MAX && m_totalDeposit != m_deposit) BOOST_THROW_EXCEPTION(InvalidDeposit()); } @@ -109,7 +110,8 @@ private: Json::Value createJsonValue(std::string _name, int _begin, int _end, std::string _value = std::string(), std::string _jumpType = std::string()) const; protected: - unsigned m_usedTags = 0; + // 0 is reserved for exception + unsigned m_usedTags = 1; AssemblyItems m_items; mutable std::map m_data; std::vector m_subs; diff --git a/libevmasm/AssemblyItem.h b/libevmasm/AssemblyItem.h index 7d8f3d9a4..9eca0a7d1 100644 --- a/libevmasm/AssemblyItem.h +++ b/libevmasm/AssemblyItem.h @@ -65,7 +65,7 @@ public: /// @returns the instruction of this item (only valid if type() == Operation) Instruction instruction() const { return Instruction(byte(m_data)); } - /// @returns true iff the type and data of the items are equal. + /// @returns true if the type and data of the items are equal. bool operator==(AssemblyItem const& _other) const { return m_type == _other.m_type && m_data == _other.m_data; } bool operator!=(AssemblyItem const& _other) const { return !operator==(_other); } /// Less-than operator compatible with operator==. diff --git a/libevmasm/ControlFlowGraph.cpp b/libevmasm/ControlFlowGraph.cpp index 3566bdb17..41a53aa82 100644 --- a/libevmasm/ControlFlowGraph.cpp +++ b/libevmasm/ControlFlowGraph.cpp @@ -226,7 +226,10 @@ void ControlFlowGraph::gatherKnowledge() //@todo we might have to do something like incrementing the sequence number for each JUMPDEST assertThrow(!!workQueue.back().first, OptimizerException, ""); if (!m_blocks.count(workQueue.back().first)) + { + workQueue.pop_back(); continue; // too bad, we do not know the tag, probably an invalid jump + } BasicBlock& block = m_blocks.at(workQueue.back().first); KnownStatePointer state = workQueue.back().second; workQueue.pop_back(); @@ -257,10 +260,7 @@ void ControlFlowGraph::gatherKnowledge() ); state->feedItem(m_items.at(pc++)); - if (tags.empty() || std::any_of(tags.begin(), tags.end(), [&](u256 const& _tag) - { - return !m_blocks.count(BlockId(_tag)); - })) + if (tags.empty()) { if (!unknownJumpEncountered) { diff --git a/libsolidity/ArrayUtils.cpp b/libsolidity/ArrayUtils.cpp index 448e4da2a..f59385d97 100644 --- a/libsolidity/ArrayUtils.cpp +++ b/libsolidity/ArrayUtils.cpp @@ -455,12 +455,10 @@ void ArrayUtils::accessIndex(ArrayType const& _arrayType) const m_context << eth::Instruction::DUP2 << load; // stack: // check out-of-bounds access - m_context << eth::Instruction::DUP2 << eth::Instruction::LT; - eth::AssemblyItem legalAccess = m_context.appendConditionalJump(); - // out-of-bounds access throws exception (just STOP for now) - m_context << eth::Instruction::STOP; + m_context << eth::Instruction::DUP2 << eth::Instruction::LT << eth::Instruction::ISZERO; + // out-of-bounds access throws exception + m_context.appendConditionalJumpTo(m_context.errorTag()); - m_context << legalAccess; // stack: m_context << eth::Instruction::SWAP1; if (_arrayType.isDynamicallySized()) diff --git a/libsolidity/Compiler.cpp b/libsolidity/Compiler.cpp index 5e24aaaa2..261473404 100644 --- a/libsolidity/Compiler.cpp +++ b/libsolidity/Compiler.cpp @@ -193,8 +193,7 @@ void Compiler::appendFunctionSelector(ContractDefinition const& _contract) appendReturnValuePacker(FunctionType(*fallback).getReturnParameterTypes()); } else - m_context << eth::Instruction::STOP; // function not found - + m_context.appendConditionalJumpTo(m_context.errorTag()); // function not found for (auto const& it: interfaceFunctions) { FunctionTypePointer const& functionType = it.second; diff --git a/libsolidity/CompilerContext.h b/libsolidity/CompilerContext.h index 7bc29de1a..dbf3dcd4f 100644 --- a/libsolidity/CompilerContext.h +++ b/libsolidity/CompilerContext.h @@ -98,6 +98,8 @@ public: eth::AssemblyItem appendJumpToNew() { return m_asm.appendJump().tag(); } /// Appends a JUMP to a tag already on the stack CompilerContext& appendJump(eth::AssemblyItem::JumpType _jumpType = eth::AssemblyItem::JumpType::Ordinary); + /// Appends a JUMP to an "ErrorTag" + eth::AssemblyItem errorTag() { return m_asm.errorTag(); } /// Appends a JUMP to a specific tag CompilerContext& appendJumpTo(eth::AssemblyItem const& _tag) { m_asm.appendJump(_tag); return *this; } /// Appends pushing of a new tag and @returns the new tag. diff --git a/libsolidity/ExpressionCompiler.cpp b/libsolidity/ExpressionCompiler.cpp index 2e513b7fc..a9f0ba3ef 100644 --- a/libsolidity/ExpressionCompiler.cpp +++ b/libsolidity/ExpressionCompiler.cpp @@ -1102,9 +1102,10 @@ void ExpressionCompiler::appendExternalFunctionCall( ) m_context << eth::Instruction::CALLCODE; else - m_context << eth::Instruction::CALL; - auto tag = m_context.appendConditionalJump(); - m_context << eth::Instruction::STOP << tag; // STOP if CALL leaves 0. + { + m_context << eth::Instruction::CALL << eth::Instruction::ISZERO; + auto tag = m_context.appendConditionalJumpTo(m_context.errorTag());// if CALL leaves 0. + } if (_functionType.valueSet()) m_context << eth::Instruction::POP; if (_functionType.gasSet()) diff --git a/test/libsolidity/SolidityCompiler.cpp b/test/libsolidity/SolidityCompiler.cpp deleted file mode 100644 index dda7847ed..000000000 --- a/test/libsolidity/SolidityCompiler.cpp +++ /dev/null @@ -1,192 +0,0 @@ -/* - This file is part of cpp-ethereum. - - cpp-ethereum is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - cpp-ethereum is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with cpp-ethereum. If not, see . -*/ -/** - * @author Christian - * @date 2014 - * Unit tests for the solidity compiler. - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include - -using namespace std; -using namespace dev::eth; - -namespace dev -{ -namespace solidity -{ -namespace test -{ - -namespace -{ - -bytes compileContract(const string& _sourceCode) -{ - Parser parser; - ASTPointer sourceUnit; - BOOST_REQUIRE_NO_THROW(sourceUnit = parser.parse(make_shared(CharStream(_sourceCode)))); - NameAndTypeResolver resolver({}); - resolver.registerDeclarations(*sourceUnit); - for (ASTPointer const& node: sourceUnit->getNodes()) - if (ContractDefinition* contract = dynamic_cast(node.get())) - { - BOOST_REQUIRE_NO_THROW(resolver.resolveNamesAndTypes(*contract)); - } - for (ASTPointer const& node: sourceUnit->getNodes()) - if (ContractDefinition* contract = dynamic_cast(node.get())) - { - BOOST_REQUIRE_NO_THROW(resolver.checkTypeRequirements(*contract)); - } - for (ASTPointer const& node: sourceUnit->getNodes()) - if (ContractDefinition* contract = dynamic_cast(node.get())) - { - Compiler compiler; - compiler.compileContract(*contract, map{}); - - // debug - //compiler.streamAssembly(cout); - return compiler.getAssembledBytecode(); - } - BOOST_FAIL("No contract found in source."); - return bytes(); -} - -/// Checks that @a _compiledCode is present starting from offset @a _offset in @a _expectation. -/// This is necessary since the compiler will add boilerplate add the beginning that is not -/// tested here. -void checkCodePresentAt(bytes const& _compiledCode, bytes const& _expectation, unsigned _offset) -{ - BOOST_REQUIRE(_compiledCode.size() >= _offset + _expectation.size()); - auto checkStart = _compiledCode.begin() + _offset; - BOOST_CHECK_EQUAL_COLLECTIONS(checkStart, checkStart + _expectation.size(), - _expectation.begin(), _expectation.end()); -} - -} // end anonymous namespace - -BOOST_AUTO_TEST_SUITE(SolidityCompiler) - -BOOST_AUTO_TEST_CASE(smoke_test) -{ - char const* sourceCode = "contract test {\n" - " function f() { var x = 2; }\n" - "}\n"; - bytes code = compileContract(sourceCode); - - unsigned boilerplateSize = 73; - bytes expectation({byte(Instruction::JUMPDEST), - byte(Instruction::PUSH1), 0x0, // initialize local variable x - byte(Instruction::PUSH1), 0x2, - byte(Instruction::SWAP1), - byte(Instruction::POP), - byte(Instruction::JUMPDEST), - byte(Instruction::POP), - byte(Instruction::JUMP)}); - checkCodePresentAt(code, expectation, boilerplateSize); -} - -BOOST_AUTO_TEST_CASE(ifStatement) -{ - char const* sourceCode = "contract test {\n" - " function f() { bool x; if (x) 77; else if (!x) 78; else 79; }" - "}\n"; - bytes code = compileContract(sourceCode); - unsigned shift = 60; - unsigned boilerplateSize = 73; - bytes expectation({ - byte(Instruction::JUMPDEST), - byte(Instruction::PUSH1), 0x0, - byte(Instruction::DUP1), - byte(Instruction::ISZERO), - byte(Instruction::PUSH1), byte(0x0f + shift), // "false" target - byte(Instruction::JUMPI), - // "if" body - byte(Instruction::PUSH1), 0x4d, - byte(Instruction::POP), - byte(Instruction::PUSH1), byte(0x21 + shift), - byte(Instruction::JUMP), - // new check "else if" condition - byte(Instruction::JUMPDEST), - byte(Instruction::DUP1), - byte(Instruction::ISZERO), - byte(Instruction::ISZERO), - byte(Instruction::PUSH1), byte(0x1c + shift), - byte(Instruction::JUMPI), - // "else if" body - byte(Instruction::PUSH1), 0x4e, - byte(Instruction::POP), - byte(Instruction::PUSH1), byte(0x20 + shift), - byte(Instruction::JUMP), - // "else" body - byte(Instruction::JUMPDEST), - byte(Instruction::PUSH1), 0x4f, - byte(Instruction::POP), - }); - checkCodePresentAt(code, expectation, boilerplateSize); -} - -BOOST_AUTO_TEST_CASE(loops) -{ - char const* sourceCode = "contract test {\n" - " function f() { while(true){1;break;2;continue;3;return;4;} }" - "}\n"; - bytes code = compileContract(sourceCode); - unsigned shift = 60; - unsigned boilerplateSize = 73; - bytes expectation({byte(Instruction::JUMPDEST), - byte(Instruction::JUMPDEST), - byte(Instruction::PUSH1), 0x1, - byte(Instruction::ISZERO), - byte(Instruction::PUSH1), byte(0x21 + shift), - byte(Instruction::JUMPI), - byte(Instruction::PUSH1), 0x1, - byte(Instruction::POP), - byte(Instruction::PUSH1), byte(0x21 + shift), - byte(Instruction::JUMP), // break - byte(Instruction::PUSH1), 0x2, - byte(Instruction::POP), - byte(Instruction::PUSH1), byte(0x2 + shift), - byte(Instruction::JUMP), // continue - byte(Instruction::PUSH1), 0x3, - byte(Instruction::POP), - byte(Instruction::PUSH1), byte(0x22 + shift), - byte(Instruction::JUMP), // return - byte(Instruction::PUSH1), 0x4, - byte(Instruction::POP), - byte(Instruction::PUSH1), byte(0x2 + shift), - byte(Instruction::JUMP), - byte(Instruction::JUMPDEST), - byte(Instruction::JUMPDEST), - byte(Instruction::JUMP)}); - - checkCodePresentAt(code, expectation, boilerplateSize); -} - -BOOST_AUTO_TEST_SUITE_END() - -} -} -} // end namespaces diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index 503615a5a..f8d20d70f 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -1784,6 +1784,7 @@ BOOST_AUTO_TEST_CASE(contracts_as_addresses) } )"; compileAndRun(sourceCode, 20); + auto res = callContractFunction("getBalance()"); BOOST_REQUIRE(callContractFunction("getBalance()") == encodeArgs(u256(20 - 5), u256(5))); } From fb564b222ddc581bfbfb73c4f02f646b3d937979 Mon Sep 17 00:00:00 2001 From: Liana Husikyan Date: Tue, 19 May 2015 12:58:12 +0200 Subject: [PATCH 402/461] fixed mistake because of conflict resolving --- libsolidity/ExpressionCompiler.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/libsolidity/ExpressionCompiler.cpp b/libsolidity/ExpressionCompiler.cpp index a9f0ba3ef..063af7ce6 100644 --- a/libsolidity/ExpressionCompiler.cpp +++ b/libsolidity/ExpressionCompiler.cpp @@ -1102,10 +1102,11 @@ void ExpressionCompiler::appendExternalFunctionCall( ) m_context << eth::Instruction::CALLCODE; else - { - m_context << eth::Instruction::CALL << eth::Instruction::ISZERO; - auto tag = m_context.appendConditionalJumpTo(m_context.errorTag());// if CALL leaves 0. - } + m_context << eth::Instruction::CALL; + + m_context << eth::Instruction::ISZERO; + auto tag = m_context.appendConditionalJumpTo(m_context.errorTag());// if CALL leaves 0. + if (_functionType.valueSet()) m_context << eth::Instruction::POP; if (_functionType.gasSet()) From 74549bd60fff00dc0b01d4ba9e8ab7af43c7078b Mon Sep 17 00:00:00 2001 From: Liana Husikyan Date: Tue, 19 May 2015 14:55:12 +0200 Subject: [PATCH 403/461] added test to check evm exception --- test/libsolidity/SolidityEndToEndTest.cpp | 24 +++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index f8d20d70f..faa5dad4d 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -4111,6 +4111,30 @@ BOOST_AUTO_TEST_CASE(struct_delete_struct_in_mapping) BOOST_CHECK(callContractFunction("deleteIt()") == encodeArgs(0)); } +BOOST_AUTO_TEST_CASE(evm_exceptions) +{ + char const* sourceCode = R"( + contract A { + uint[3] arr; + bool public test = false; + function getElement(uint i) returns (uint) + { + return arr[i]; + } + function testIt() returns (bool) + { + uint i = this.getElement(5); + test = true; + return true; + } + } + )"; + compileAndRun(sourceCode, 0, "A"); + BOOST_CHECK(callContractFunction("test()") == encodeArgs(false)); + BOOST_CHECK(callContractFunction("testIt()") == encodeArgs()); + BOOST_CHECK(callContractFunction("test()") == encodeArgs(false)); +} + BOOST_AUTO_TEST_SUITE_END() } From d89589febc52aa7a85a013dfefb0f52eb5da93bd Mon Sep 17 00:00:00 2001 From: Liana Husikyan Date: Tue, 19 May 2015 15:44:58 +0200 Subject: [PATCH 404/461] style fixes --- libevmasm/Assembly.h | 2 +- libsolidity/CompilerContext.h | 2 +- libsolidity/ExpressionCompiler.cpp | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/libevmasm/Assembly.h b/libevmasm/Assembly.h index 4550eb6e7..3c82125a1 100644 --- a/libevmasm/Assembly.h +++ b/libevmasm/Assembly.h @@ -67,7 +67,7 @@ public: AssemblyItem appendJumpI() { auto ret = append(newPushTag()); append(Instruction::JUMPI); return ret; } AssemblyItem appendJump(AssemblyItem const& _tag) { auto ret = append(_tag.pushTag()); append(Instruction::JUMP); return ret; } AssemblyItem appendJumpI(AssemblyItem const& _tag) { auto ret = append(_tag.pushTag()); append(Instruction::JUMPI); return ret; } - AssemblyItem errorTag() { return AssemblyItem(PushTag, 0); } + AssemblyItem errorTag() { return AssemblyItem(PushTag, 0); } template Assembly& operator<<(T const& _d) { append(_d); return *this; } AssemblyItems const& getItems() const { return m_items; } diff --git a/libsolidity/CompilerContext.h b/libsolidity/CompilerContext.h index dbf3dcd4f..573e0b576 100644 --- a/libsolidity/CompilerContext.h +++ b/libsolidity/CompilerContext.h @@ -98,7 +98,7 @@ public: eth::AssemblyItem appendJumpToNew() { return m_asm.appendJump().tag(); } /// Appends a JUMP to a tag already on the stack CompilerContext& appendJump(eth::AssemblyItem::JumpType _jumpType = eth::AssemblyItem::JumpType::Ordinary); - /// Appends a JUMP to an "ErrorTag" + /// Returns an "ErrorTag" eth::AssemblyItem errorTag() { return m_asm.errorTag(); } /// Appends a JUMP to a specific tag CompilerContext& appendJumpTo(eth::AssemblyItem const& _tag) { m_asm.appendJump(_tag); return *this; } diff --git a/libsolidity/ExpressionCompiler.cpp b/libsolidity/ExpressionCompiler.cpp index 063af7ce6..c8aece85a 100644 --- a/libsolidity/ExpressionCompiler.cpp +++ b/libsolidity/ExpressionCompiler.cpp @@ -1104,8 +1104,9 @@ void ExpressionCompiler::appendExternalFunctionCall( else m_context << eth::Instruction::CALL; + //Propagate error condition (if CALL pushes 0 on stack). m_context << eth::Instruction::ISZERO; - auto tag = m_context.appendConditionalJumpTo(m_context.errorTag());// if CALL leaves 0. + auto tag = m_context.appendConditionalJumpTo(m_context.errorTag()); if (_functionType.valueSet()) m_context << eth::Instruction::POP; From 77e1d116ca21fff8983fa67810f7c07806e95251 Mon Sep 17 00:00:00 2001 From: Liana Husikyan Date: Thu, 21 May 2015 12:10:26 +0200 Subject: [PATCH 405/461] one more test to test the call of non-existed function Conflicts: test/libsolidity/SolidityEndToEndTest.cpp --- libsolidity/ExpressionCompiler.cpp | 2 +- test/libsolidity/SolidityEndToEndTest.cpp | 28 ++++++++++++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/libsolidity/ExpressionCompiler.cpp b/libsolidity/ExpressionCompiler.cpp index c8aece85a..ae8bcaeee 100644 --- a/libsolidity/ExpressionCompiler.cpp +++ b/libsolidity/ExpressionCompiler.cpp @@ -1106,7 +1106,7 @@ void ExpressionCompiler::appendExternalFunctionCall( //Propagate error condition (if CALL pushes 0 on stack). m_context << eth::Instruction::ISZERO; - auto tag = m_context.appendConditionalJumpTo(m_context.errorTag()); + m_context.appendConditionalJumpTo(m_context.errorTag()); if (_functionType.valueSet()) m_context << eth::Instruction::POP; diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index faa5dad4d..839ad7928 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -4111,7 +4111,7 @@ BOOST_AUTO_TEST_CASE(struct_delete_struct_in_mapping) BOOST_CHECK(callContractFunction("deleteIt()") == encodeArgs(0)); } -BOOST_AUTO_TEST_CASE(evm_exceptions) +BOOST_AUTO_TEST_CASE(evm_exceptions_out_of_band_access) { char const* sourceCode = R"( contract A { @@ -4135,6 +4135,32 @@ BOOST_AUTO_TEST_CASE(evm_exceptions) BOOST_CHECK(callContractFunction("test()") == encodeArgs(false)); } +BOOST_AUTO_TEST_CASE(evm_exceptions_when_calling_non_existing_function) +{ + char const* sourceCode = R"( + contract A { + uint public test = 0; + function badFunction() returns (uint) + { + this.call("123"); + test = 1; + return 2; + } + function testIt() returns (bool) + { + this.badFunction(); + test = 2; + return true; + } + } + )"; + compileAndRun(sourceCode, 0, "A"); + + BOOST_CHECK(callContractFunction("test()") == encodeArgs(0)); + BOOST_CHECK(callContractFunction("testIt()") == encodeArgs()); + BOOST_CHECK(callContractFunction("test()") == encodeArgs(0)); +} + BOOST_AUTO_TEST_SUITE_END() } From 52fad1282c64f003c7d60244d21f368f0a269013 Mon Sep 17 00:00:00 2001 From: Liana Husikyan Date: Wed, 20 May 2015 13:15:01 +0200 Subject: [PATCH 406/461] corrected asm-json output --- libevmasm/Assembly.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libevmasm/Assembly.cpp b/libevmasm/Assembly.cpp index f492260af..dabf646c1 100644 --- a/libevmasm/Assembly.cpp +++ b/libevmasm/Assembly.cpp @@ -213,9 +213,9 @@ Json::Value Assembly::streamAsmJson(ostream& _out, StringMap const& _sourceCodes if (i.data() == 0) collection.append( createJsonValue("PUSH [ErrorTag]", i.getLocation().start, i.getLocation().end, "")); - - collection.append( - createJsonValue("PUSH [tag]", i.getLocation().start, i.getLocation().end, string(i.data()))); + else + collection.append( + createJsonValue("PUSH [tag]", i.getLocation().start, i.getLocation().end, string(i.data()))); break; case PushSub: collection.append( From 4b0e0d86914d5d52e620524c4d8cc952397983cf Mon Sep 17 00:00:00 2001 From: Liana Husikyan Date: Thu, 21 May 2015 13:02:24 +0200 Subject: [PATCH 407/461] test for exception in constructor --- test/libsolidity/SolidityEndToEndTest.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index 839ad7928..76952c676 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -4161,6 +4161,23 @@ BOOST_AUTO_TEST_CASE(evm_exceptions_when_calling_non_existing_function) BOOST_CHECK(callContractFunction("test()") == encodeArgs(0)); } +BOOST_AUTO_TEST_CASE(evm_exceptions_in_constructor) +{ + char const* sourceCode = R"( + contract A { + uint public test = 0; + function A() + { + this.call("123"); + test = 1; + } + } + )"; + compileAndRun(sourceCode, 0, "A"); + + BOOST_CHECK(callContractFunction("test()") == encodeArgs(1)); +} + BOOST_AUTO_TEST_SUITE_END() } From 803bea66544d5d2c0f7ee112566dbfb054e5d52f Mon Sep 17 00:00:00 2001 From: Liana Husikyan Date: Thu, 21 May 2015 13:45:32 +0200 Subject: [PATCH 408/461] test for constructor (out of band exception) --- test/libsolidity/SolidityEndToEndTest.cpp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index 76952c676..c150a488c 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -4161,7 +4161,7 @@ BOOST_AUTO_TEST_CASE(evm_exceptions_when_calling_non_existing_function) BOOST_CHECK(callContractFunction("test()") == encodeArgs(0)); } -BOOST_AUTO_TEST_CASE(evm_exceptions_in_constructor) +BOOST_AUTO_TEST_CASE(evm_exceptions_in_constructor_call_fail) { char const* sourceCode = R"( contract A { @@ -4169,7 +4169,25 @@ BOOST_AUTO_TEST_CASE(evm_exceptions_in_constructor) function A() { this.call("123"); - test = 1; + ++test; + } + } + )"; + compileAndRun(sourceCode, 0, "A"); + + BOOST_CHECK(callContractFunction("test()") == encodeArgs(1)); +} + +BOOST_AUTO_TEST_CASE(evm_exceptions_in_constructor_out_of_band) +{ + char const* sourceCode = R"( + contract A { + uint public test = 0; + uint[3] arr; + function A() + { + test = arr[5]; + ++test; } } )"; From 5996d912a2efeaceeeecba382e49d2e884f47d44 Mon Sep 17 00:00:00 2001 From: Liana Husikyan Date: Fri, 22 May 2015 14:07:05 +0200 Subject: [PATCH 409/461] remove line for debugging --- test/libsolidity/SolidityEndToEndTest.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index c150a488c..e4c5b47f1 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -1784,7 +1784,6 @@ BOOST_AUTO_TEST_CASE(contracts_as_addresses) } )"; compileAndRun(sourceCode, 20); - auto res = callContractFunction("getBalance()"); BOOST_REQUIRE(callContractFunction("getBalance()") == encodeArgs(u256(20 - 5), u256(5))); } From 7ef2c7dc4424ac6858b43f9be04ab6f3dfd5b597 Mon Sep 17 00:00:00 2001 From: Liana Husikyan Date: Fri, 22 May 2015 17:48:38 +0200 Subject: [PATCH 410/461] modified the test --- test/libsolidity/SolidityEndToEndTest.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index e4c5b47f1..538174ab5 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -4164,24 +4164,32 @@ BOOST_AUTO_TEST_CASE(evm_exceptions_in_constructor_call_fail) { char const* sourceCode = R"( contract A { - uint public test = 0; function A() { this.call("123"); + + } + } + contract B { + uint public test = 1; + function testIt() + { + A a; ++test; } } )"; - compileAndRun(sourceCode, 0, "A"); + compileAndRun(sourceCode, 0, "B"); - BOOST_CHECK(callContractFunction("test()") == encodeArgs(1)); + BOOST_CHECK(callContractFunction("testIt()") == encodeArgs()); + BOOST_CHECK(callContractFunction("test()") == encodeArgs(2)); } BOOST_AUTO_TEST_CASE(evm_exceptions_in_constructor_out_of_band) { char const* sourceCode = R"( contract A { - uint public test = 0; + uint public test = 1; uint[3] arr; function A() { From a723fb7e813e098ea50fa1f9ba7e62d35db01c8a Mon Sep 17 00:00:00 2001 From: Liana Husikyan Date: Tue, 26 May 2015 15:05:58 +0200 Subject: [PATCH 411/461] special handle of send --- libsolidity/ExpressionCompiler.cpp | 18 +++++++++++++----- libsolidity/ExpressionCompiler.h | 3 ++- test/libsolidity/SolidityEndToEndTest.cpp | 1 - 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/libsolidity/ExpressionCompiler.cpp b/libsolidity/ExpressionCompiler.cpp index ae8bcaeee..e8ac8ff8b 100644 --- a/libsolidity/ExpressionCompiler.cpp +++ b/libsolidity/ExpressionCompiler.cpp @@ -534,7 +534,8 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall) true, true ), - {} + {}, + true ); break; case Location::Suicide: @@ -1034,8 +1035,8 @@ void ExpressionCompiler::appendHighBitsCleanup(IntegerType const& _typeOnStack) void ExpressionCompiler::appendExternalFunctionCall( FunctionType const& _functionType, - vector> const& _arguments -) + vector> const& _arguments, + bool isSend) { solAssert(_functionType.takesArbitraryParameters() || _arguments.size() == _functionType.getParameterTypes().size(), ""); @@ -1105,8 +1106,15 @@ void ExpressionCompiler::appendExternalFunctionCall( m_context << eth::Instruction::CALL; //Propagate error condition (if CALL pushes 0 on stack). - m_context << eth::Instruction::ISZERO; - m_context.appendConditionalJumpTo(m_context.errorTag()); + if (!isSend) + { + m_context << eth::Instruction::ISZERO; + m_context.appendConditionalJumpTo(m_context.errorTag()); + } else + { + auto tag = m_context.appendConditionalJump(); + m_context << eth::Instruction::STOP << tag; + } if (_functionType.valueSet()) m_context << eth::Instruction::POP; diff --git a/libsolidity/ExpressionCompiler.h b/libsolidity/ExpressionCompiler.h index 954e32c84..6f47762b9 100644 --- a/libsolidity/ExpressionCompiler.h +++ b/libsolidity/ExpressionCompiler.h @@ -100,7 +100,8 @@ private: /// Appends code to call a function of the given type with the given arguments. void appendExternalFunctionCall( FunctionType const& _functionType, - std::vector> const& _arguments + std::vector> const& _arguments, + bool isSend = false ); /// Appends code that evaluates the given arguments and moves the result to memory encoded as /// specified by the ABI. The memory offset is expected to be on the stack and is updated by diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index 538174ab5..efebbb2f0 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -4167,7 +4167,6 @@ BOOST_AUTO_TEST_CASE(evm_exceptions_in_constructor_call_fail) function A() { this.call("123"); - } } contract B { From 0d55798adf4757eb26393555f0b8c2ae12de8ed7 Mon Sep 17 00:00:00 2001 From: Liana Husikyan Date: Thu, 28 May 2015 14:48:37 +0200 Subject: [PATCH 412/461] removed exception when function is not found --- libsolidity/Compiler.cpp | 2 +- libsolidity/ExpressionCompiler.cpp | 18 ++++--------- libsolidity/ExpressionCompiler.h | 6 +---- test/libsolidity/SolidityEndToEndTest.cpp | 32 ++--------------------- 4 files changed, 9 insertions(+), 49 deletions(-) diff --git a/libsolidity/Compiler.cpp b/libsolidity/Compiler.cpp index 261473404..93d786bed 100644 --- a/libsolidity/Compiler.cpp +++ b/libsolidity/Compiler.cpp @@ -193,7 +193,7 @@ void Compiler::appendFunctionSelector(ContractDefinition const& _contract) appendReturnValuePacker(FunctionType(*fallback).getReturnParameterTypes()); } else - m_context.appendConditionalJumpTo(m_context.errorTag()); // function not found + m_context << eth::Instruction::STOP; // function not found for (auto const& it: interfaceFunctions) { FunctionTypePointer const& functionType = it.second; diff --git a/libsolidity/ExpressionCompiler.cpp b/libsolidity/ExpressionCompiler.cpp index e8ac8ff8b..d618c6311 100644 --- a/libsolidity/ExpressionCompiler.cpp +++ b/libsolidity/ExpressionCompiler.cpp @@ -534,8 +534,7 @@ bool ExpressionCompiler::visit(FunctionCall const& _functionCall) true, true ), - {}, - true + {} ); break; case Location::Suicide: @@ -1035,8 +1034,8 @@ void ExpressionCompiler::appendHighBitsCleanup(IntegerType const& _typeOnStack) void ExpressionCompiler::appendExternalFunctionCall( FunctionType const& _functionType, - vector> const& _arguments, - bool isSend) + vector> const& _arguments + ) { solAssert(_functionType.takesArbitraryParameters() || _arguments.size() == _functionType.getParameterTypes().size(), ""); @@ -1106,15 +1105,8 @@ void ExpressionCompiler::appendExternalFunctionCall( m_context << eth::Instruction::CALL; //Propagate error condition (if CALL pushes 0 on stack). - if (!isSend) - { - m_context << eth::Instruction::ISZERO; - m_context.appendConditionalJumpTo(m_context.errorTag()); - } else - { - auto tag = m_context.appendConditionalJump(); - m_context << eth::Instruction::STOP << tag; - } + auto tag = m_context.appendConditionalJump(); + m_context << eth::Instruction::STOP << tag; // STOP if CALL leaves 0.// } if (_functionType.valueSet()) m_context << eth::Instruction::POP; diff --git a/libsolidity/ExpressionCompiler.h b/libsolidity/ExpressionCompiler.h index 6f47762b9..174e16d8d 100644 --- a/libsolidity/ExpressionCompiler.h +++ b/libsolidity/ExpressionCompiler.h @@ -98,11 +98,7 @@ private: void appendHighBitsCleanup(IntegerType const& _typeOnStack); /// Appends code to call a function of the given type with the given arguments. - void appendExternalFunctionCall( - FunctionType const& _functionType, - std::vector> const& _arguments, - bool isSend = false - ); + void appendExternalFunctionCall(FunctionType const& _functionType, std::vector> const& _arguments); /// Appends code that evaluates the given arguments and moves the result to memory encoded as /// specified by the ABI. The memory offset is expected to be on the stack and is updated by /// this call. If @a _padToWordBoundaries is set to false, all values are concatenated without diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index efebbb2f0..d2faaae08 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -4080,7 +4080,6 @@ BOOST_AUTO_TEST_CASE(struct_delete_member) } )"; compileAndRun(sourceCode, 0, "test"); - auto res = callContractFunction("deleteMember()"); BOOST_CHECK(callContractFunction("deleteMember()") == encodeArgs(0)); } @@ -4106,7 +4105,6 @@ BOOST_AUTO_TEST_CASE(struct_delete_struct_in_mapping) } )"; compileAndRun(sourceCode, 0, "test"); - auto res = callContractFunction("deleteIt()"); BOOST_CHECK(callContractFunction("deleteIt()") == encodeArgs(0)); } @@ -4134,32 +4132,6 @@ BOOST_AUTO_TEST_CASE(evm_exceptions_out_of_band_access) BOOST_CHECK(callContractFunction("test()") == encodeArgs(false)); } -BOOST_AUTO_TEST_CASE(evm_exceptions_when_calling_non_existing_function) -{ - char const* sourceCode = R"( - contract A { - uint public test = 0; - function badFunction() returns (uint) - { - this.call("123"); - test = 1; - return 2; - } - function testIt() returns (bool) - { - this.badFunction(); - test = 2; - return true; - } - } - )"; - compileAndRun(sourceCode, 0, "A"); - - BOOST_CHECK(callContractFunction("test()") == encodeArgs(0)); - BOOST_CHECK(callContractFunction("testIt()") == encodeArgs()); - BOOST_CHECK(callContractFunction("test()") == encodeArgs(0)); -} - BOOST_AUTO_TEST_CASE(evm_exceptions_in_constructor_call_fail) { char const* sourceCode = R"( @@ -4184,7 +4156,7 @@ BOOST_AUTO_TEST_CASE(evm_exceptions_in_constructor_call_fail) BOOST_CHECK(callContractFunction("test()") == encodeArgs(2)); } -BOOST_AUTO_TEST_CASE(evm_exceptions_in_constructor_out_of_band) +BOOST_AUTO_TEST_CASE(evm_exceptions_in_constructor_out_of_baund) { char const* sourceCode = R"( contract A { @@ -4199,7 +4171,7 @@ BOOST_AUTO_TEST_CASE(evm_exceptions_in_constructor_out_of_band) )"; compileAndRun(sourceCode, 0, "A"); - BOOST_CHECK(callContractFunction("test()") == encodeArgs(1)); + //BOOST_CHECK(m_output.empty()); todo } BOOST_AUTO_TEST_SUITE_END() From e8148a444f6f9d5906f0f0f9f9853dc4ea054259 Mon Sep 17 00:00:00 2001 From: Liana Husikyan Date: Fri, 29 May 2015 15:39:42 +0200 Subject: [PATCH 413/461] style fixes in test/libsolidity/solidityExecutionFramework.h fixed the test --- test/libsolidity/SolidityEndToEndTest.cpp | 4 +- test/libsolidity/solidityExecutionFramework.h | 281 ++++++++++-------- 2 files changed, 150 insertions(+), 135 deletions(-) diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index d2faaae08..ef7b5c2a4 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -4169,9 +4169,7 @@ BOOST_AUTO_TEST_CASE(evm_exceptions_in_constructor_out_of_baund) } } )"; - compileAndRun(sourceCode, 0, "A"); - - //BOOST_CHECK(m_output.empty()); todo + BOOST_CHECK(execute(sourceCode, 0, "A").empty()); } BOOST_AUTO_TEST_SUITE_END() diff --git a/test/libsolidity/solidityExecutionFramework.h b/test/libsolidity/solidityExecutionFramework.h index fa25fb12c..2c70415eb 100644 --- a/test/libsolidity/solidityExecutionFramework.h +++ b/test/libsolidity/solidityExecutionFramework.h @@ -40,142 +40,159 @@ namespace test class ExecutionFramework { public: - ExecutionFramework() { g_logVerbosity = 0; } - - bytes const& compileAndRun(std::string const& _sourceCode, u256 const& _value = 0, std::string const& _contractName = "") - { - m_compiler.reset(false, m_addStandardSources); - m_compiler.addSource("", _sourceCode); - ETH_TEST_REQUIRE_NO_THROW(m_compiler.compile(m_optimize), "Compiling contract failed"); - - bytes code = m_compiler.getBytecode(_contractName); - sendMessage(code, true, _value); - BOOST_REQUIRE(!m_output.empty()); - return m_output; - } - - template - bytes const& callContractFunctionWithValue(std::string _sig, u256 const& _value, - Args const&... _arguments) - { - FixedHash<4> hash(dev::sha3(_sig)); - sendMessage(hash.asBytes() + encodeArgs(_arguments...), false, _value); - return m_output; - } - - template - bytes const& callContractFunction(std::string _sig, Args const&... _arguments) - { - return callContractFunctionWithValue(_sig, 0, _arguments...); - } - - template - void testSolidityAgainstCpp(std::string _sig, CppFunction const& _cppFunction, Args const&... _arguments) - { - bytes solidityResult = callContractFunction(_sig, _arguments...); - bytes cppResult = callCppAndEncodeResult(_cppFunction, _arguments...); - BOOST_CHECK_MESSAGE(solidityResult == cppResult, "Computed values do not match." - "\nSolidity: " + toHex(solidityResult) + "\nC++: " + toHex(cppResult)); - } - - template - void testSolidityAgainstCppOnRange(std::string _sig, CppFunction const& _cppFunction, - u256 const& _rangeStart, u256 const& _rangeEnd) - { - for (u256 argument = _rangeStart; argument < _rangeEnd; ++argument) - { - bytes solidityResult = callContractFunction(_sig, argument); - bytes cppResult = callCppAndEncodeResult(_cppFunction, argument); - BOOST_CHECK_MESSAGE(solidityResult == cppResult, "Computed values do not match." - "\nSolidity: " + toHex(solidityResult) + "\nC++: " + toHex(cppResult) + - "\nArgument: " + toHex(encode(argument))); - } - } - - static bytes encode(bool _value) { return encode(byte(_value)); } - static bytes encode(int _value) { return encode(u256(_value)); } - static bytes encode(char const* _value) { return encode(std::string(_value)); } - static bytes encode(byte _value) { return bytes(31, 0) + bytes{_value}; } - static bytes encode(u256 const& _value) { return toBigEndian(_value); } - static bytes encode(h256 const& _value) { return _value.asBytes(); } - static bytes encode(bytes const& _value, bool _padLeft = true) - { - bytes padding = bytes((32 - _value.size() % 32) % 32, 0); - return _padLeft ? padding + _value : _value + padding; - } - static bytes encode(std::string const& _value) { return encode(asBytes(_value), false); } - - template - static bytes encodeArgs(FirstArg const& _firstArg, Args const&... _followingArgs) - { - return encode(_firstArg) + encodeArgs(_followingArgs...); - } - static bytes encodeArgs() - { - return bytes(); - } + ExecutionFramework() { g_logVerbosity = 0; } + + bytes const& execute(std::string const& _sourceCode, u256 const& _value = 0, std::string const& _contractName = "") + { + m_compiler.reset(false, m_addStandardSources); + m_compiler.addSource("", _sourceCode); + ETH_TEST_REQUIRE_NO_THROW(m_compiler.compile(m_optimize), "Compiling contract failed"); + + bytes code = m_compiler.getBytecode(_contractName); + sendMessage(code, true, _value); + return m_output; + } + + bytes const& compileAndRun(std::string const& _sourceCode, u256 const& _value = 0, std::string const& _contractName = "") + { + execute(_sourceCode, _value, _contractName); + BOOST_REQUIRE(!m_output.empty()); + return m_output; + } + + template + bytes const& callContractFunctionWithValue(std::string _sig, u256 const& _value, Args const&... _arguments) + { + FixedHash<4> hash(dev::sha3(_sig)); + sendMessage(hash.asBytes() + encodeArgs(_arguments...), false, _value); + return m_output; + } + + template + bytes const& callContractFunction(std::string _sig, Args const&... _arguments) + { + return callContractFunctionWithValue(_sig, 0, _arguments...); + } + + template + void testSolidityAgainstCpp(std::string _sig, CppFunction const& _cppFunction, Args const&... _arguments) + { + bytes solidityResult = callContractFunction(_sig, _arguments...); + bytes cppResult = callCppAndEncodeResult(_cppFunction, _arguments...); + BOOST_CHECK_MESSAGE( + solidityResult == cppResult, "Computed values do not match.\nSolidity: " + toHex(solidityResult) + "\nC++: " + toHex(cppResult)); + } + + template + void testSolidityAgainstCppOnRange( + std::string _sig, + CppFunction const& _cppFunction, + u256 const& _rangeStart, + u256 const& _rangeEnd + ) + { + for (u256 argument = _rangeStart; argument < _rangeEnd; ++argument) + { + bytes solidityResult = callContractFunction(_sig, argument); + bytes cppResult = callCppAndEncodeResult(_cppFunction, argument); + BOOST_CHECK_MESSAGE( + solidityResult == cppResult, + "Computed values do not match.\nSolidity: " + + toHex(solidityResult) + + "\nC++: " + + toHex(cppResult) + + "\nArgument: " + + toHex(encode(argument)) + ); + } + } + + static bytes encode(bool _value) { return encode(byte(_value)); } + static bytes encode(int _value) { return encode(u256(_value)); } + static bytes encode(char const* _value) { return encode(std::string(_value)); } + static bytes encode(byte _value) { return bytes(31, 0) + bytes{_value}; } + static bytes encode(u256 const& _value) { return toBigEndian(_value); } + static bytes encode(h256 const& _value) { return _value.asBytes(); } + static bytes encode(bytes const& _value, bool _padLeft = true) + { + bytes padding = bytes((32 - _value.size() % 32) % 32, 0); + return _padLeft ? padding + _value : _value + padding; + } + static bytes encode(std::string const& _value) { return encode(asBytes(_value), false); } + + template + static bytes encodeArgs(FirstArg const& _firstArg, Args const&... _followingArgs) + { + return encode(_firstArg) + encodeArgs(_followingArgs...); + } + static bytes encodeArgs() + { + return bytes(); + } private: - template - auto callCppAndEncodeResult(CppFunction const& _cppFunction, Args const&... _arguments) - -> typename std::enable_if::value, bytes>::type - { - _cppFunction(_arguments...); - return bytes(); - } - template - auto callCppAndEncodeResult(CppFunction const& _cppFunction, Args const&... _arguments) - -> typename std::enable_if::value, bytes>::type - { - return encode(_cppFunction(_arguments...)); - } + template + auto callCppAndEncodeResult(CppFunction const& _cppFunction, Args const&... _arguments) + -> typename std::enable_if::value, bytes>::type + { + _cppFunction(_arguments...); + return bytes(); + } + template + auto callCppAndEncodeResult(CppFunction const& _cppFunction, Args const&... _arguments) + -> typename std::enable_if::value, bytes>::type + { + return encode(_cppFunction(_arguments...)); + } protected: - void sendMessage(bytes const& _data, bool _isCreation, u256 const& _value = 0) - { - m_state.addBalance(m_sender, _value); // just in case - eth::Executive executive(m_state, eth::LastHashes(), 0); - eth::Transaction t = _isCreation ? eth::Transaction(_value, m_gasPrice, m_gas, _data, 0, KeyPair::create().sec()) - : eth::Transaction(_value, m_gasPrice, m_gas, m_contractAddress, _data, 0, KeyPair::create().sec()); - bytes transactionRLP = t.rlp(); - try - { - // this will throw since the transaction is invalid, but it should nevertheless store the transaction - executive.initialize(&transactionRLP); - executive.execute(); - } - catch (...) {} - if (_isCreation) - { - BOOST_REQUIRE(!executive.create(m_sender, _value, m_gasPrice, m_gas, &_data, m_sender)); - m_contractAddress = executive.newAddress(); - BOOST_REQUIRE(m_contractAddress); - BOOST_REQUIRE(m_state.addressHasCode(m_contractAddress)); - } - else - { - BOOST_REQUIRE(m_state.addressHasCode(m_contractAddress)); - BOOST_REQUIRE(!executive.call(m_contractAddress, m_contractAddress, m_sender, _value, m_gasPrice, &_data, m_gas, m_sender)); - } - BOOST_REQUIRE(executive.go()); - m_state.noteSending(m_sender); - executive.finalize(); - m_gasUsed = executive.gasUsed(); - m_output = executive.out().toVector(); - m_logs = executive.logs(); - } - - bool m_optimize = false; - bool m_addStandardSources = false; - dev::solidity::CompilerStack m_compiler; - Address m_sender; - Address m_contractAddress; - eth::State m_state; - u256 const m_gasPrice = 100 * eth::szabo; - u256 const m_gas = 100000000; - bytes m_output; - eth::LogEntries m_logs; - u256 m_gasUsed; + void sendMessage(bytes const& _data, bool _isCreation, u256 const& _value = 0) + { + m_state.addBalance(m_sender, _value); // just in case + eth::Executive executive(m_state, eth::LastHashes(), 0); + eth::Transaction t = _isCreation ? eth::Transaction( + _value, m_gasPrice, m_gas, _data, 0, KeyPair::create().sec() + ) : eth::Transaction(_value, m_gasPrice, m_gas, m_contractAddress, _data, 0, KeyPair::create().sec()); + + bytes transactionRLP = t.rlp(); + try + { + // this will throw since the transaction is invalid, but it should nevertheless store the transaction + executive.initialize(&transactionRLP); + executive.execute(); + } + catch (...) {} + if (_isCreation) + { + BOOST_REQUIRE(!executive.create(m_sender, _value, m_gasPrice, m_gas, &_data, m_sender)); + m_contractAddress = executive.newAddress(); + BOOST_REQUIRE(m_contractAddress); + BOOST_REQUIRE(m_state.addressHasCode(m_contractAddress)); + } + else + { + BOOST_REQUIRE(m_state.addressHasCode(m_contractAddress)); + BOOST_REQUIRE(!executive.call(m_contractAddress, m_contractAddress, m_sender, _value, m_gasPrice, &_data, m_gas, m_sender)); + } + BOOST_REQUIRE(executive.go()); + m_state.noteSending(m_sender); + executive.finalize(); + m_gasUsed = executive.gasUsed(); + m_output = executive.out().toVector(); + m_logs = executive.logs(); + } + + bool m_optimize = false; + bool m_addStandardSources = false; + dev::solidity::CompilerStack m_compiler; + Address m_sender; + Address m_contractAddress; + eth::State m_state; + u256 const m_gasPrice = 100 * eth::szabo; + u256 const m_gas = 100000000; + bytes m_output; + eth::LogEntries m_logs; + u256 m_gasUsed; }; } From 7512689becc4e623a1e576350abd0c191b57242d Mon Sep 17 00:00:00 2001 From: Liana Husikyan Date: Fri, 29 May 2015 18:38:57 +0200 Subject: [PATCH 414/461] style fixes --- libsolidity/ExpressionCompiler.cpp | 4 +- test/libsolidity/SolidityEndToEndTest.cpp | 2 +- test/libsolidity/solidityExecutionFramework.h | 284 +++++++++--------- 3 files changed, 144 insertions(+), 146 deletions(-) diff --git a/libsolidity/ExpressionCompiler.cpp b/libsolidity/ExpressionCompiler.cpp index d618c6311..6a246f441 100644 --- a/libsolidity/ExpressionCompiler.cpp +++ b/libsolidity/ExpressionCompiler.cpp @@ -1035,7 +1035,7 @@ void ExpressionCompiler::appendHighBitsCleanup(IntegerType const& _typeOnStack) void ExpressionCompiler::appendExternalFunctionCall( FunctionType const& _functionType, vector> const& _arguments - ) +) { solAssert(_functionType.takesArbitraryParameters() || _arguments.size() == _functionType.getParameterTypes().size(), ""); @@ -1106,7 +1106,7 @@ void ExpressionCompiler::appendExternalFunctionCall( //Propagate error condition (if CALL pushes 0 on stack). auto tag = m_context.appendConditionalJump(); - m_context << eth::Instruction::STOP << tag; // STOP if CALL leaves 0.// } + m_context << eth::Instruction::STOP << tag; // STOP if CALL leaves 0. if (_functionType.valueSet()) m_context << eth::Instruction::POP; diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index ef7b5c2a4..db115b104 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -4145,7 +4145,7 @@ BOOST_AUTO_TEST_CASE(evm_exceptions_in_constructor_call_fail) uint public test = 1; function testIt() { - A a; + A a = new A(); ++test; } } diff --git a/test/libsolidity/solidityExecutionFramework.h b/test/libsolidity/solidityExecutionFramework.h index 2c70415eb..879667fde 100644 --- a/test/libsolidity/solidityExecutionFramework.h +++ b/test/libsolidity/solidityExecutionFramework.h @@ -40,159 +40,157 @@ namespace test class ExecutionFramework { public: - ExecutionFramework() { g_logVerbosity = 0; } - - bytes const& execute(std::string const& _sourceCode, u256 const& _value = 0, std::string const& _contractName = "") - { - m_compiler.reset(false, m_addStandardSources); - m_compiler.addSource("", _sourceCode); - ETH_TEST_REQUIRE_NO_THROW(m_compiler.compile(m_optimize), "Compiling contract failed"); - - bytes code = m_compiler.getBytecode(_contractName); - sendMessage(code, true, _value); - return m_output; - } - - bytes const& compileAndRun(std::string const& _sourceCode, u256 const& _value = 0, std::string const& _contractName = "") - { - execute(_sourceCode, _value, _contractName); - BOOST_REQUIRE(!m_output.empty()); - return m_output; - } - - template - bytes const& callContractFunctionWithValue(std::string _sig, u256 const& _value, Args const&... _arguments) - { - FixedHash<4> hash(dev::sha3(_sig)); - sendMessage(hash.asBytes() + encodeArgs(_arguments...), false, _value); - return m_output; - } - - template - bytes const& callContractFunction(std::string _sig, Args const&... _arguments) - { - return callContractFunctionWithValue(_sig, 0, _arguments...); - } - - template - void testSolidityAgainstCpp(std::string _sig, CppFunction const& _cppFunction, Args const&... _arguments) - { - bytes solidityResult = callContractFunction(_sig, _arguments...); - bytes cppResult = callCppAndEncodeResult(_cppFunction, _arguments...); - BOOST_CHECK_MESSAGE( - solidityResult == cppResult, "Computed values do not match.\nSolidity: " + toHex(solidityResult) + "\nC++: " + toHex(cppResult)); - } - - template - void testSolidityAgainstCppOnRange( - std::string _sig, - CppFunction const& _cppFunction, - u256 const& _rangeStart, - u256 const& _rangeEnd - ) - { - for (u256 argument = _rangeStart; argument < _rangeEnd; ++argument) + ExecutionFramework() { g_logVerbosity = 0; } + + bytes const& execute(std::string const& _sourceCode, u256 const& _value = 0, std::string const& _contractName = "") { - bytes solidityResult = callContractFunction(_sig, argument); - bytes cppResult = callCppAndEncodeResult(_cppFunction, argument); - BOOST_CHECK_MESSAGE( - solidityResult == cppResult, - "Computed values do not match.\nSolidity: " + - toHex(solidityResult) + - "\nC++: " + - toHex(cppResult) + - "\nArgument: " + - toHex(encode(argument)) - ); + m_compiler.reset(false, m_addStandardSources); + m_compiler.addSource("", _sourceCode); + ETH_TEST_REQUIRE_NO_THROW(m_compiler.compile(m_optimize), "Compiling contract failed"); + bytes code = m_compiler.getBytecode(_contractName); + sendMessage(code, true, _value); + return m_output; } - } - - static bytes encode(bool _value) { return encode(byte(_value)); } - static bytes encode(int _value) { return encode(u256(_value)); } - static bytes encode(char const* _value) { return encode(std::string(_value)); } - static bytes encode(byte _value) { return bytes(31, 0) + bytes{_value}; } - static bytes encode(u256 const& _value) { return toBigEndian(_value); } - static bytes encode(h256 const& _value) { return _value.asBytes(); } - static bytes encode(bytes const& _value, bool _padLeft = true) - { - bytes padding = bytes((32 - _value.size() % 32) % 32, 0); - return _padLeft ? padding + _value : _value + padding; - } - static bytes encode(std::string const& _value) { return encode(asBytes(_value), false); } - - template - static bytes encodeArgs(FirstArg const& _firstArg, Args const&... _followingArgs) - { - return encode(_firstArg) + encodeArgs(_followingArgs...); - } - static bytes encodeArgs() - { - return bytes(); - } -private: - template - auto callCppAndEncodeResult(CppFunction const& _cppFunction, Args const&... _arguments) - -> typename std::enable_if::value, bytes>::type - { - _cppFunction(_arguments...); - return bytes(); - } - template - auto callCppAndEncodeResult(CppFunction const& _cppFunction, Args const&... _arguments) - -> typename std::enable_if::value, bytes>::type - { - return encode(_cppFunction(_arguments...)); - } + bytes const& compileAndRun(std::string const& _sourceCode, u256 const& _value = 0, std::string const& _contractName = "") + { + execute(_sourceCode, _value, _contractName); + BOOST_REQUIRE(!m_output.empty()); + return m_output; + } -protected: - void sendMessage(bytes const& _data, bool _isCreation, u256 const& _value = 0) - { - m_state.addBalance(m_sender, _value); // just in case - eth::Executive executive(m_state, eth::LastHashes(), 0); - eth::Transaction t = _isCreation ? eth::Transaction( - _value, m_gasPrice, m_gas, _data, 0, KeyPair::create().sec() - ) : eth::Transaction(_value, m_gasPrice, m_gas, m_contractAddress, _data, 0, KeyPair::create().sec()); - - bytes transactionRLP = t.rlp(); - try + template + bytes const& callContractFunctionWithValue(std::string _sig, u256 const& _value, Args const&... _arguments) { - // this will throw since the transaction is invalid, but it should nevertheless store the transaction - executive.initialize(&transactionRLP); - executive.execute(); + FixedHash<4> hash(dev::sha3(_sig)); + sendMessage(hash.asBytes() + encodeArgs(_arguments...), false, _value); + return m_output; } - catch (...) {} - if (_isCreation) + + template + bytes const& callContractFunction(std::string _sig, Args const&... _arguments) { - BOOST_REQUIRE(!executive.create(m_sender, _value, m_gasPrice, m_gas, &_data, m_sender)); - m_contractAddress = executive.newAddress(); - BOOST_REQUIRE(m_contractAddress); - BOOST_REQUIRE(m_state.addressHasCode(m_contractAddress)); + return callContractFunctionWithValue(_sig, 0, _arguments...); } - else + + template + void testSolidityAgainstCpp(std::string _sig, CppFunction const& _cppFunction, Args const&... _arguments) { - BOOST_REQUIRE(m_state.addressHasCode(m_contractAddress)); - BOOST_REQUIRE(!executive.call(m_contractAddress, m_contractAddress, m_sender, _value, m_gasPrice, &_data, m_gas, m_sender)); + bytes solidityResult = callContractFunction(_sig, _arguments...); + bytes cppResult = callCppAndEncodeResult(_cppFunction, _arguments...); + BOOST_CHECK_MESSAGE( + solidityResult == cppResult, + "Computed values do not match.\nSolidity: " + + toHex(solidityResult) + + "\nC++: " + + toHex(cppResult)); } - BOOST_REQUIRE(executive.go()); - m_state.noteSending(m_sender); - executive.finalize(); - m_gasUsed = executive.gasUsed(); - m_output = executive.out().toVector(); - m_logs = executive.logs(); - } - - bool m_optimize = false; - bool m_addStandardSources = false; - dev::solidity::CompilerStack m_compiler; - Address m_sender; - Address m_contractAddress; - eth::State m_state; - u256 const m_gasPrice = 100 * eth::szabo; - u256 const m_gas = 100000000; - bytes m_output; - eth::LogEntries m_logs; - u256 m_gasUsed; + + template + void testSolidityAgainstCppOnRange(std::string _sig, CppFunction const& _cppFunction, u256 const& _rangeStart, u256 const& _rangeEnd) + { + for (u256 argument = _rangeStart; argument < _rangeEnd; ++argument) + { + bytes solidityResult = callContractFunction(_sig, argument); + bytes cppResult = callCppAndEncodeResult(_cppFunction, argument); + BOOST_CHECK_MESSAGE( + solidityResult == cppResult, + "Computed values do not match.\nSolidity: " + + toHex(solidityResult) + + "\nC++: " + + toHex(cppResult) + + "\nArgument: " + + toHex(encode(argument)) + ); + } + } + + static bytes encode(bool _value) { return encode(byte(_value)); } + static bytes encode(int _value) { return encode(u256(_value)); } + static bytes encode(char const* _value) { return encode(std::string(_value)); } + static bytes encode(byte _value) { return bytes(31, 0) + bytes{_value}; } + static bytes encode(u256 const& _value) { return toBigEndian(_value); } + static bytes encode(h256 const& _value) { return _value.asBytes(); } + static bytes encode(bytes const& _value, bool _padLeft = true) + { + bytes padding = bytes((32 - _value.size() % 32) % 32, 0); + return _padLeft ? padding + _value : _value + padding; + } + static bytes encode(std::string const& _value) { return encode(asBytes(_value), false); } + + template + static bytes encodeArgs(FirstArg const& _firstArg, Args const&... _followingArgs) + { + return encode(_firstArg) + encodeArgs(_followingArgs...); + } + static bytes encodeArgs() + { + return bytes(); + } + +private: + template + auto callCppAndEncodeResult(CppFunction const& _cppFunction, Args const&... _arguments) + -> typename std::enable_if::value, bytes>::type + { + _cppFunction(_arguments...); + return bytes(); + } + template + auto callCppAndEncodeResult(CppFunction const& _cppFunction, Args const&... _arguments) + -> typename std::enable_if::value, bytes>::type + { + return encode(_cppFunction(_arguments...)); + } + +protected: + void sendMessage(bytes const& _data, bool _isCreation, u256 const& _value = 0) + { + m_state.addBalance(m_sender, _value); // just in case + eth::Executive executive(m_state, eth::LastHashes(), 0); + eth::Transaction t = + _isCreation ? + eth::Transaction(_value, m_gasPrice, m_gas, _data, 0, KeyPair::create().sec()) : + eth::Transaction(_value, m_gasPrice, m_gas, m_contractAddress, _data, 0, KeyPair::create().sec()); + bytes transactionRLP = t.rlp(); + try + { + // this will throw since the transaction is invalid, but it should nevertheless store the transaction + executive.initialize(&transactionRLP); + executive.execute(); + } + catch (...) {} + if (_isCreation) + { + BOOST_REQUIRE(!executive.create(m_sender, _value, m_gasPrice, m_gas, &_data, m_sender)); + m_contractAddress = executive.newAddress(); + BOOST_REQUIRE(m_contractAddress); + BOOST_REQUIRE(m_state.addressHasCode(m_contractAddress)); + } + else + { + BOOST_REQUIRE(m_state.addressHasCode(m_contractAddress)); + BOOST_REQUIRE(!executive.call(m_contractAddress, m_contractAddress, m_sender, _value, m_gasPrice, &_data, m_gas, m_sender)); + } + BOOST_REQUIRE(executive.go()); + m_state.noteSending(m_sender); + executive.finalize(); + m_gasUsed = executive.gasUsed(); + m_output = executive.out().toVector(); + m_logs = executive.logs(); + } + + bool m_optimize = false; + bool m_addStandardSources = false; + dev::solidity::CompilerStack m_compiler; + Address m_sender; + Address m_contractAddress; + eth::State m_state; + u256 const m_gasPrice = 100 * eth::szabo; + u256 const m_gas = 100000000; + bytes m_output; + eth::LogEntries m_logs; + u256 m_gasUsed; }; } From 8ece3534ad0d8369dd12e6f75b31a6872698ea93 Mon Sep 17 00:00:00 2001 From: chriseth Date: Mon, 1 Jun 2015 13:25:02 +0200 Subject: [PATCH 415/461] Gas estimates for JSON compiler. --- solc/jsonCompiler.cpp | 57 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/solc/jsonCompiler.cpp b/solc/jsonCompiler.cpp index d47903fca..7bde3e47c 100644 --- a/solc/jsonCompiler.cpp +++ b/solc/jsonCompiler.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #include #include #include @@ -58,6 +59,61 @@ Json::Value functionHashes(ContractDefinition const& _contract) return functionHashes; } +Json::Value gasToJson(GasEstimator::GasConsumption const& _gas) +{ + if (_gas.isInfinite || _gas.value > std::numeric_limits::max()) + return Json::Value(Json::nullValue); + else + return Json::Value(Json::LargestUInt(_gas.value)); +} + +Json::Value estimateGas(CompilerStack const& _compiler, string const& _contract) +{ + Json::Value gasEstimates(Json::objectValue); + using Gas = GasEstimator::GasConsumption; + if (!_compiler.getAssemblyItems(_contract) && !_compiler.getRuntimeAssemblyItems(_contract)) + return gasEstimates; + if (eth::AssemblyItems const* items = _compiler.getAssemblyItems(_contract)) + { + Gas gas = GasEstimator::functionalEstimation(*items); + u256 bytecodeSize(_compiler.getRuntimeBytecode(_contract).size()); + Json::Value creationGas(Json::arrayValue); + creationGas[0] = gasToJson(gas); + creationGas[1] = gasToJson(bytecodeSize * eth::c_createDataGas); + gasEstimates["creation"] = creationGas; + } + if (eth::AssemblyItems const* items = _compiler.getRuntimeAssemblyItems(_contract)) + { + ContractDefinition const& contract = _compiler.getContractDefinition(_contract); + Json::Value externalFunctions(Json::objectValue); + for (auto it: contract.getInterfaceFunctions()) + { + string sig = it.second->externalSignature(); + externalFunctions[sig] = gasToJson(GasEstimator::functionalEstimation(*items, sig)); + } + gasEstimates["external"] = externalFunctions; + Json::Value internalFunctions(Json::objectValue); + for (auto const& it: contract.getDefinedFunctions()) + { + if (it->isPartOfExternalInterface() || it->isConstructor()) + continue; + size_t entry = _compiler.getFunctionEntryPoint(_contract, *it); + GasEstimator::GasConsumption gas = GasEstimator::GasConsumption::infinite(); + if (entry > 0) + gas = GasEstimator::functionalEstimation(*items, entry, *it); + FunctionType type(*it); + string sig = it->getName() + "("; + auto end = type.getParameterTypes().end(); + for (auto it = type.getParameterTypes().begin(); it != end; ++it) + sig += (*it)->toString() + (it + 1 == end ? "" : ","); + sig += ")"; + internalFunctions[sig] = gasToJson(gas); + } + gasEstimates["internal"] = internalFunctions; + } + return gasEstimates; +} + string compile(string _input, bool _optimize) { StringMap sources; @@ -109,6 +165,7 @@ string compile(string _input, bool _optimize) contractData["bytecode"] = toHex(compiler.getBytecode(contractName)); contractData["opcodes"] = eth::disassemble(compiler.getBytecode(contractName)); contractData["functionHashes"] = functionHashes(compiler.getContractDefinition(contractName)); + contractData["gasEstimates"] = estimateGas(compiler, contractName); ostringstream unused; contractData["assembly"] = compiler.streamAssembly(unused, contractName, sources, true); output["contracts"][contractName] = contractData; From 2d076b8954bcf9e9aa1c6262d88f6b0dc6d70e1b Mon Sep 17 00:00:00 2001 From: Liana Husikyan Date: Mon, 1 Jun 2015 13:03:29 +0200 Subject: [PATCH 416/461] corrected intends in solidityExecutionFramwork.h --- test/libsolidity/solidityExecutionFramework.h | 294 +++++++++--------- 1 file changed, 147 insertions(+), 147 deletions(-) diff --git a/test/libsolidity/solidityExecutionFramework.h b/test/libsolidity/solidityExecutionFramework.h index 879667fde..29f3c4710 100644 --- a/test/libsolidity/solidityExecutionFramework.h +++ b/test/libsolidity/solidityExecutionFramework.h @@ -40,157 +40,157 @@ namespace test class ExecutionFramework { public: - ExecutionFramework() { g_logVerbosity = 0; } - - bytes const& execute(std::string const& _sourceCode, u256 const& _value = 0, std::string const& _contractName = "") - { - m_compiler.reset(false, m_addStandardSources); - m_compiler.addSource("", _sourceCode); - ETH_TEST_REQUIRE_NO_THROW(m_compiler.compile(m_optimize), "Compiling contract failed"); - bytes code = m_compiler.getBytecode(_contractName); - sendMessage(code, true, _value); - return m_output; - } - - bytes const& compileAndRun(std::string const& _sourceCode, u256 const& _value = 0, std::string const& _contractName = "") - { - execute(_sourceCode, _value, _contractName); - BOOST_REQUIRE(!m_output.empty()); - return m_output; - } - - template - bytes const& callContractFunctionWithValue(std::string _sig, u256 const& _value, Args const&... _arguments) - { - FixedHash<4> hash(dev::sha3(_sig)); - sendMessage(hash.asBytes() + encodeArgs(_arguments...), false, _value); - return m_output; - } - - template - bytes const& callContractFunction(std::string _sig, Args const&... _arguments) - { - return callContractFunctionWithValue(_sig, 0, _arguments...); - } - - template - void testSolidityAgainstCpp(std::string _sig, CppFunction const& _cppFunction, Args const&... _arguments) - { - bytes solidityResult = callContractFunction(_sig, _arguments...); - bytes cppResult = callCppAndEncodeResult(_cppFunction, _arguments...); - BOOST_CHECK_MESSAGE( - solidityResult == cppResult, - "Computed values do not match.\nSolidity: " + - toHex(solidityResult) + - "\nC++: " + - toHex(cppResult)); - } - - template - void testSolidityAgainstCppOnRange(std::string _sig, CppFunction const& _cppFunction, u256 const& _rangeStart, u256 const& _rangeEnd) - { - for (u256 argument = _rangeStart; argument < _rangeEnd; ++argument) - { - bytes solidityResult = callContractFunction(_sig, argument); - bytes cppResult = callCppAndEncodeResult(_cppFunction, argument); - BOOST_CHECK_MESSAGE( - solidityResult == cppResult, - "Computed values do not match.\nSolidity: " + - toHex(solidityResult) + - "\nC++: " + - toHex(cppResult) + - "\nArgument: " + - toHex(encode(argument)) - ); - } - } - - static bytes encode(bool _value) { return encode(byte(_value)); } - static bytes encode(int _value) { return encode(u256(_value)); } - static bytes encode(char const* _value) { return encode(std::string(_value)); } - static bytes encode(byte _value) { return bytes(31, 0) + bytes{_value}; } - static bytes encode(u256 const& _value) { return toBigEndian(_value); } - static bytes encode(h256 const& _value) { return _value.asBytes(); } - static bytes encode(bytes const& _value, bool _padLeft = true) - { - bytes padding = bytes((32 - _value.size() % 32) % 32, 0); - return _padLeft ? padding + _value : _value + padding; - } - static bytes encode(std::string const& _value) { return encode(asBytes(_value), false); } - - template - static bytes encodeArgs(FirstArg const& _firstArg, Args const&... _followingArgs) - { - return encode(_firstArg) + encodeArgs(_followingArgs...); - } - static bytes encodeArgs() - { - return bytes(); - } +ExecutionFramework() { g_logVerbosity = 0; } + + bytes const& execute(std::string const& _sourceCode, u256 const& _value = 0, std::string const& _contractName = "") + { + m_compiler.reset(false, m_addStandardSources); + m_compiler.addSource("", _sourceCode); + ETH_TEST_REQUIRE_NO_THROW(m_compiler.compile(m_optimize), "Compiling contract failed"); + bytes code = m_compiler.getBytecode(_contractName); + sendMessage(code, true, _value); + return m_output; + } + + bytes const& compileAndRun(std::string const& _sourceCode, u256 const& _value = 0, std::string const& _contractName = "") + { + execute(_sourceCode, _value, _contractName); + BOOST_REQUIRE(!m_output.empty()); + return m_output; + } + + template + bytes const& callContractFunctionWithValue(std::string _sig, u256 const& _value, Args const&... _arguments) + { + FixedHash<4> hash(dev::sha3(_sig)); + sendMessage(hash.asBytes() + encodeArgs(_arguments...), false, _value); + return m_output; + } + + template + bytes const& callContractFunction(std::string _sig, Args const&... _arguments) + { + return callContractFunctionWithValue(_sig, 0, _arguments...); + } + + template + void testSolidityAgainstCpp(std::string _sig, CppFunction const& _cppFunction, Args const&... _arguments) + { + bytes solidityResult = callContractFunction(_sig, _arguments...); + bytes cppResult = callCppAndEncodeResult(_cppFunction, _arguments...); + BOOST_CHECK_MESSAGE( + solidityResult == cppResult, + "Computed values do not match.\nSolidity: " + + toHex(solidityResult) + + "\nC++: " + + toHex(cppResult)); + } + + template + void testSolidityAgainstCppOnRange(std::string _sig, CppFunction const& _cppFunction, u256 const& _rangeStart, u256 const& _rangeEnd) + { + for (u256 argument = _rangeStart; argument < _rangeEnd; ++argument) + { + bytes solidityResult = callContractFunction(_sig, argument); + bytes cppResult = callCppAndEncodeResult(_cppFunction, argument); + BOOST_CHECK_MESSAGE( + solidityResult == cppResult, + "Computed values do not match.\nSolidity: " + + toHex(solidityResult) + + "\nC++: " + + toHex(cppResult) + + "\nArgument: " + + toHex(encode(argument)) + ); + } + } + + static bytes encode(bool _value) { return encode(byte(_value)); } + static bytes encode(int _value) { return encode(u256(_value)); } + static bytes encode(char const* _value) { return encode(std::string(_value)); } + static bytes encode(byte _value) { return bytes(31, 0) + bytes{_value}; } + static bytes encode(u256 const& _value) { return toBigEndian(_value); } + static bytes encode(h256 const& _value) { return _value.asBytes(); } + static bytes encode(bytes const& _value, bool _padLeft = true) + { + bytes padding = bytes((32 - _value.size() % 32) % 32, 0); + return _padLeft ? padding + _value : _value + padding; + } + static bytes encode(std::string const& _value) { return encode(asBytes(_value), false); } + + template + static bytes encodeArgs(FirstArg const& _firstArg, Args const&... _followingArgs) + { + return encode(_firstArg) + encodeArgs(_followingArgs...); + } + static bytes encodeArgs() + { + return bytes(); + } private: - template - auto callCppAndEncodeResult(CppFunction const& _cppFunction, Args const&... _arguments) - -> typename std::enable_if::value, bytes>::type - { - _cppFunction(_arguments...); - return bytes(); - } - template - auto callCppAndEncodeResult(CppFunction const& _cppFunction, Args const&... _arguments) - -> typename std::enable_if::value, bytes>::type - { - return encode(_cppFunction(_arguments...)); - } + template + auto callCppAndEncodeResult(CppFunction const& _cppFunction, Args const&... _arguments) + -> typename std::enable_if::value, bytes>::type + { + _cppFunction(_arguments...); + return bytes(); + } + template + auto callCppAndEncodeResult(CppFunction const& _cppFunction, Args const&... _arguments) + -> typename std::enable_if::value, bytes>::type + { + return encode(_cppFunction(_arguments...)); + } protected: - void sendMessage(bytes const& _data, bool _isCreation, u256 const& _value = 0) - { - m_state.addBalance(m_sender, _value); // just in case - eth::Executive executive(m_state, eth::LastHashes(), 0); - eth::Transaction t = - _isCreation ? - eth::Transaction(_value, m_gasPrice, m_gas, _data, 0, KeyPair::create().sec()) : - eth::Transaction(_value, m_gasPrice, m_gas, m_contractAddress, _data, 0, KeyPair::create().sec()); - bytes transactionRLP = t.rlp(); - try - { - // this will throw since the transaction is invalid, but it should nevertheless store the transaction - executive.initialize(&transactionRLP); - executive.execute(); - } - catch (...) {} - if (_isCreation) - { - BOOST_REQUIRE(!executive.create(m_sender, _value, m_gasPrice, m_gas, &_data, m_sender)); - m_contractAddress = executive.newAddress(); - BOOST_REQUIRE(m_contractAddress); - BOOST_REQUIRE(m_state.addressHasCode(m_contractAddress)); - } - else - { - BOOST_REQUIRE(m_state.addressHasCode(m_contractAddress)); - BOOST_REQUIRE(!executive.call(m_contractAddress, m_contractAddress, m_sender, _value, m_gasPrice, &_data, m_gas, m_sender)); - } - BOOST_REQUIRE(executive.go()); - m_state.noteSending(m_sender); - executive.finalize(); - m_gasUsed = executive.gasUsed(); - m_output = executive.out().toVector(); - m_logs = executive.logs(); - } - - bool m_optimize = false; - bool m_addStandardSources = false; - dev::solidity::CompilerStack m_compiler; - Address m_sender; - Address m_contractAddress; - eth::State m_state; - u256 const m_gasPrice = 100 * eth::szabo; - u256 const m_gas = 100000000; - bytes m_output; - eth::LogEntries m_logs; - u256 m_gasUsed; + void sendMessage(bytes const& _data, bool _isCreation, u256 const& _value = 0) + { + m_state.addBalance(m_sender, _value); // just in case + eth::Executive executive(m_state, eth::LastHashes(), 0); + eth::Transaction t = + _isCreation ? + eth::Transaction(_value, m_gasPrice, m_gas, _data, 0, KeyPair::create().sec()) : + eth::Transaction(_value, m_gasPrice, m_gas, m_contractAddress, _data, 0, KeyPair::create().sec()); + bytes transactionRLP = t.rlp(); + try + { + // this will throw since the transaction is invalid, but it should nevertheless store the transaction + executive.initialize(&transactionRLP); + executive.execute(); + } + catch (...) {} + if (_isCreation) + { + BOOST_REQUIRE(!executive.create(m_sender, _value, m_gasPrice, m_gas, &_data, m_sender)); + m_contractAddress = executive.newAddress(); + BOOST_REQUIRE(m_contractAddress); + BOOST_REQUIRE(m_state.addressHasCode(m_contractAddress)); + } + else + { + BOOST_REQUIRE(m_state.addressHasCode(m_contractAddress)); + BOOST_REQUIRE(!executive.call(m_contractAddress, m_contractAddress, m_sender, _value, m_gasPrice, &_data, m_gas, m_sender)); + } + BOOST_REQUIRE(executive.go()); + m_state.noteSending(m_sender); + executive.finalize(); + m_gasUsed = executive.gasUsed(); + m_output = executive.out().toVector(); + m_logs = executive.logs(); + } + + bool m_optimize = false; + bool m_addStandardSources = false; + dev::solidity::CompilerStack m_compiler; + Address m_sender; + Address m_contractAddress; + eth::State m_state; + u256 const m_gasPrice = 100 * eth::szabo; + u256 const m_gas = 100000000; + bytes m_output; + eth::LogEntries m_logs; + u256 m_gasUsed; }; } From 850c21eb3abf6c4e8ea701c0e9ed6065f14fdad6 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Mon, 1 Jun 2015 20:10:49 +0800 Subject: [PATCH 417/461] Avoid redownloading chain for non-breaking changes. --- libethereum/Client.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libethereum/Client.cpp b/libethereum/Client.cpp index e7d7a543b..96353ade2 100644 --- a/libethereum/Client.cpp +++ b/libethereum/Client.cpp @@ -44,10 +44,11 @@ VersionChecker::VersionChecker(string const& _dbPath): try { auto protocolVersion = (unsigned)status[0]; + (void)protocolVersion; auto minorProtocolVersion = (unsigned)status[1]; auto databaseVersion = (unsigned)status[2]; m_action = - protocolVersion != eth::c_protocolVersion || databaseVersion != c_databaseVersion ? + databaseVersion != c_databaseVersion ? WithExisting::Kill : minorProtocolVersion != eth::c_minorProtocolVersion ? WithExisting::Verify From d1f19fe2d4fe75788669535af5e8aa40b791d89a Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Mon, 1 Jun 2015 20:11:59 +0800 Subject: [PATCH 418/461] Fix for windows. Better failure reporting on consensus issues. --- libethereum/Executive.cpp | 11 ++++++----- libethereum/Executive.h | 1 + libethereum/State.cpp | 33 ++++++++++++++++++++++++++++++++- libethereum/Transaction.cpp | 21 +++++++++++++++++++++ libethereum/Transaction.h | 3 +++ 5 files changed, 63 insertions(+), 6 deletions(-) diff --git a/libethereum/Executive.cpp b/libethereum/Executive.cpp index 09cdc6b04..8c77903ef 100644 --- a/libethereum/Executive.cpp +++ b/libethereum/Executive.cpp @@ -32,6 +32,7 @@ using namespace dev; using namespace dev::eth; const char* VMTraceChannel::name() { return "EVM"; } +const char* ExecutiveWarnChannel::name() { return WarnChannel::name(); } Executive::Executive(State& _s, BlockChain const& _bc, unsigned _level): m_s(_s), @@ -63,7 +64,7 @@ void Executive::initialize(Transaction const& _transaction) u256 startGasUsed = m_s.gasUsed(); if (startGasUsed + (bigint)m_t.gas() > m_s.m_currentBlock.gasLimit) { - clog(StateDetail) << "Too much gas used in this block: Require <" << (m_s.m_currentBlock.gasLimit - startGasUsed) << " Got" << m_t.gas(); + clog(ExecutiveWarnChannel) << "Too much gas used in this block: Require <" << (m_s.m_currentBlock.gasLimit - startGasUsed) << " Got" << m_t.gas(); m_excepted = TransactionException::BlockGasLimitReached; BOOST_THROW_EXCEPTION(BlockGasLimitReached() << RequirementError((bigint)(m_s.m_currentBlock.gasLimit - startGasUsed), (bigint)m_t.gas())); } @@ -71,7 +72,7 @@ void Executive::initialize(Transaction const& _transaction) // Check gas cost is enough. if (!m_t.checkPayment()) { - clog(StateDetail) << "Not enough gas to pay for the transaction: Require >" << m_t.gasRequired() << " Got" << m_t.gas(); + clog(ExecutiveWarnChannel) << "Not enough gas to pay for the transaction: Require >" << m_t.gasRequired() << " Got" << m_t.gas(); m_excepted = TransactionException::OutOfGas; BOOST_THROW_EXCEPTION(OutOfGasBase() << RequirementError(m_t.gasRequired(), (bigint)m_t.gas())); } @@ -84,13 +85,13 @@ void Executive::initialize(Transaction const& _transaction) } catch (...) { - clog(StateDetail) << "Invalid Signature"; + clog(ExecutiveWarnChannel) << "Invalid Signature"; m_excepted = TransactionException::InvalidSignature; throw; } if (m_t.nonce() != nonceReq) { - clog(StateDetail) << "Invalid Nonce: Require" << nonceReq << " Got" << m_t.nonce(); + clog(ExecutiveWarnChannel) << "Invalid Nonce: Require" << nonceReq << " Got" << m_t.nonce(); m_excepted = TransactionException::InvalidNonce; BOOST_THROW_EXCEPTION(InvalidNonce() << RequirementError((bigint)nonceReq, (bigint)m_t.nonce())); } @@ -100,7 +101,7 @@ void Executive::initialize(Transaction const& _transaction) m_totalCost = m_t.value() + m_gasCost; if (m_s.balance(m_t.sender()) < m_totalCost) { - clog(StateDetail) << "Not enough cash: Require >" << m_totalCost << " Got" << m_s.balance(m_t.sender()); + clog(ExecutiveWarnChannel) << "Not enough cash: Require >" << m_totalCost << " Got" << m_s.balance(m_t.sender()); m_excepted = TransactionException::NotEnoughCash; BOOST_THROW_EXCEPTION(NotEnoughCash() << RequirementError(m_totalCost, (bigint)m_s.balance(m_t.sender()))); } diff --git a/libethereum/Executive.h b/libethereum/Executive.h index 949e2dc34..447f76eb9 100644 --- a/libethereum/Executive.h +++ b/libethereum/Executive.h @@ -36,6 +36,7 @@ class ExtVM; struct Manifest; struct VMTraceChannel: public LogChannel { static const char* name(); static const int verbosity = 11; }; +struct ExecutiveWarnChannel: public LogChannel { static const char* name(); static const int verbosity = 6; }; /** * @brief Message-call/contract-creation executor; useful for executing transactions. diff --git a/libethereum/State.cpp b/libethereum/State.cpp index 23405912c..20249f2eb 100644 --- a/libethereum/State.cpp +++ b/libethereum/State.cpp @@ -592,6 +592,24 @@ string State::vmTrace(bytesConstRef _block, BlockChain const& _bc, ImportRequire return ss.str(); } +template +class LogOverride +{ +public: + LogOverride(bool _value): m_old(g_logOverride.count(&typeid(Channel)) ? (int)g_logOverride[&typeid(Channel)] : c_null) { g_logOverride[&typeid(Channel)] = _value; } + ~LogOverride() + { + if (m_old == c_null) + g_logOverride.erase(&typeid(Channel)); + else + g_logOverride[&typeid(Channel)] = (bool)m_old; + } + +private: + static const int c_null = -1; + int m_old; +}; + u256 State::enact(bytesConstRef _block, BlockChain const& _bc, ImportRequirements::value _ir) { // m_currentBlock is assumed to be prepopulated and reset. @@ -624,7 +642,19 @@ u256 State::enact(bytesConstRef _block, BlockChain const& _bc, ImportRequirement unsigned i = 0; for (auto const& tr: rlp[1]) { - execute(lh, Transaction(tr.data(), CheckTransaction::Everything)); + try { + LogOverride o(false); + execute(lh, Transaction(tr.data(), CheckTransaction::Everything)); + } + catch (...) + { + badBlock(_block, "Invalid transaction"); + cwarn << " Transaction Index:" << i; + LogOverride o(true); + execute(lh, Transaction(tr.data(), CheckTransaction::Everything)); + throw; + } + RLPStream receiptRLP; m_receipts.back().streamRLP(receiptRLP); receipts.push_back(receiptRLP.out()); @@ -1163,6 +1193,7 @@ ExecutionResult State::execute(LastHashes const& _lh, Transaction const& _t, Per ctrace << "Executing" << e.t() << "on" << h; ctrace << toHex(e.t().rlp()); #endif + (void)_onOp; if (!e.execute()) #if ETH_VMTRACE e.go(e.simpleTrace()); diff --git a/libethereum/Transaction.cpp b/libethereum/Transaction.cpp index 975af53a5..b8d8d64c1 100644 --- a/libethereum/Transaction.cpp +++ b/libethereum/Transaction.cpp @@ -39,6 +39,27 @@ std::ostream& dev::eth::operator<<(std::ostream& _out, ExecutionResult const& _e return _out; } +std::string badTransaction(bytesConstRef _tx, string const& _err) +{ + stringstream ret; + ret << "========================================================================" << endl; + ret << "== Software Failure " << (_err + string(max(0, 44 - _err.size()), ' ')) << " ==" << endl; + ret << "== Guru Meditation " << sha3(_tx).abridged() << " ==" << endl; + ret << "========================================================================" << endl; + ret << " Transaction: " << toHex(_tx) << endl; + ret << " Transaction RLP: "; + try { + ret << RLP(_tx); + } + catch (Exception& _e) + { + ret << "Invalid: " << _e.what(); + } + ret << endl; + + return ret.str(); +} + TransactionException dev::eth::toTransactionException(VMException const& _e) { if (!!dynamic_cast(&_e)) diff --git a/libethereum/Transaction.h b/libethereum/Transaction.h index 09d6cd54c..935b78c2a 100644 --- a/libethereum/Transaction.h +++ b/libethereum/Transaction.h @@ -235,5 +235,8 @@ inline std::ostream& operator<<(std::ostream& _out, Transaction const& _t) return _out; } +void badTransaction(bytesConstRef _tx, std::string const& _err); +inline void badTransaction(bytes const& _tx, std::string const& _err) { badTransaction(&_tx, _err); } + } } From 208d504314a11abda493d3b9672d1581c49c51c9 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Mon, 1 Jun 2015 20:13:49 +0800 Subject: [PATCH 419/461] Fixes #2052 --- libethereum/State.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libethereum/State.cpp b/libethereum/State.cpp index 20249f2eb..b35ef98ce 100644 --- a/libethereum/State.cpp +++ b/libethereum/State.cpp @@ -1193,10 +1193,12 @@ ExecutionResult State::execute(LastHashes const& _lh, Transaction const& _t, Per ctrace << "Executing" << e.t() << "on" << h; ctrace << toHex(e.t().rlp()); #endif - (void)_onOp; if (!e.execute()) #if ETH_VMTRACE + { + (void)_onOp; e.go(e.simpleTrace()); + } #else e.go(_onOp); #endif From b325a5c3b2053a45a8c841001be03cfad743c9ea Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Mon, 1 Jun 2015 15:43:55 +0200 Subject: [PATCH 420/461] Mutex guard m_fulls on eval() --- libethcore/EthashAux.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/libethcore/EthashAux.cpp b/libethcore/EthashAux.cpp index 06da22f98..4b546404a 100644 --- a/libethcore/EthashAux.cpp +++ b/libethcore/EthashAux.cpp @@ -240,8 +240,9 @@ Ethash::Result EthashAux::eval(BlockInfo const& _header, Nonce const& _nonce) Ethash::Result EthashAux::eval(h256 const& _seedHash, h256 const& _headerHash, Nonce const& _nonce) { - if (FullType dag = get()->m_fulls[_seedHash].lock()) - return dag->compute(_headerHash, _nonce); + DEV_GUARDED(get()->x_fulls) + if (FullType dag = get()->m_fulls[_seedHash].lock()) + return dag->compute(_headerHash, _nonce); DEV_IF_THROWS(return EthashAux::get()->light(_seedHash)->compute(_headerHash, _nonce)) { return Ethash::Result{ ~h256(), h256() }; From f070e3b493e5cf90eb7329ce5efd8e83b4947fc0 Mon Sep 17 00:00:00 2001 From: Vlad Gluhovsky Date: Mon, 1 Jun 2015 16:32:04 +0200 Subject: [PATCH 421/461] a minor update --- libdevcore/TransientDirectory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libdevcore/TransientDirectory.cpp b/libdevcore/TransientDirectory.cpp index 3e5462700..3c88e42a3 100644 --- a/libdevcore/TransientDirectory.cpp +++ b/libdevcore/TransientDirectory.cpp @@ -52,7 +52,7 @@ TransientDirectory::~TransientDirectory() } catch (...) { - std::this_thread::sleep_for(chrono::milliseconds(10)); + this_thread::sleep_for(chrono::milliseconds(10)); } } } From 1f8bd0fe680b1350a5a930f7c8a96089ab959e39 Mon Sep 17 00:00:00 2001 From: Dimitry Date: Mon, 1 Jun 2015 17:34:11 +0300 Subject: [PATCH 422/461] BlockWeight: uncle POW issue --- test/libethereum/blockchain.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/test/libethereum/blockchain.cpp b/test/libethereum/blockchain.cpp index 0ea8b95a8..0ff7e57f3 100644 --- a/test/libethereum/blockchain.cpp +++ b/test/libethereum/blockchain.cpp @@ -214,9 +214,12 @@ void doBlockchainTests(json_spirit::mValue& _v, bool _fillin) uncleStream.appendRaw(uncleRlp.out()); } - // update unclehash in case of invalid uncles - current_BlockHeader.sha3Uncles = sha3(uncleStream.out()); - updatePoW(current_BlockHeader); + if (vBiUncles.size()) + { + // update unclehash in case of invalid uncles + current_BlockHeader.sha3Uncles = sha3(uncleStream.out()); + updatePoW(current_BlockHeader); + } if (blObj.count("blockHeader")) overwriteBlockHeader(current_BlockHeader, blObj); @@ -242,7 +245,10 @@ void doBlockchainTests(json_spirit::mValue& _v, bool _fillin) blObj["rlp"] = toHex(block2.out(), 2, HexPrefix::Add); if (sha3(RLP(state.blockData())[0].data()) != sha3(RLP(block2.out())[0].data())) - cnote << "block header mismatch\n"; + { + cnote << "block header mismatch state.blockData() vs updated state.info()\n"; + cerr << toHex(state.blockData()) << "vs" << toHex(block2.out()); + } if (sha3(RLP(state.blockData())[1].data()) != sha3(RLP(block2.out())[1].data())) cnote << "txs mismatch\n"; From 32458c0808ce6a6e396ab66281a5c22d58ef0929 Mon Sep 17 00:00:00 2001 From: Liana Husikyan Date: Mon, 1 Jun 2015 16:39:09 +0200 Subject: [PATCH 423/461] fixed CALL case. added exception --- libsolidity/ExpressionCompiler.cpp | 4 ++-- test/libsolidity/solidityExecutionFramework.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libsolidity/ExpressionCompiler.cpp b/libsolidity/ExpressionCompiler.cpp index 6a246f441..ae8bcaeee 100644 --- a/libsolidity/ExpressionCompiler.cpp +++ b/libsolidity/ExpressionCompiler.cpp @@ -1105,8 +1105,8 @@ void ExpressionCompiler::appendExternalFunctionCall( m_context << eth::Instruction::CALL; //Propagate error condition (if CALL pushes 0 on stack). - auto tag = m_context.appendConditionalJump(); - m_context << eth::Instruction::STOP << tag; // STOP if CALL leaves 0. + m_context << eth::Instruction::ISZERO; + m_context.appendConditionalJumpTo(m_context.errorTag()); if (_functionType.valueSet()) m_context << eth::Instruction::POP; diff --git a/test/libsolidity/solidityExecutionFramework.h b/test/libsolidity/solidityExecutionFramework.h index 29f3c4710..ddbbb0161 100644 --- a/test/libsolidity/solidityExecutionFramework.h +++ b/test/libsolidity/solidityExecutionFramework.h @@ -40,7 +40,7 @@ namespace test class ExecutionFramework { public: -ExecutionFramework() { g_logVerbosity = 0; } + ExecutionFramework() { g_logVerbosity = 0; } bytes const& execute(std::string const& _sourceCode, u256 const& _value = 0, std::string const& _contractName = "") { From 214542eb5e62cb6b909580bd6d98163c850ebe69 Mon Sep 17 00:00:00 2001 From: Liana Husikyan Date: Mon, 1 Jun 2015 16:48:13 +0200 Subject: [PATCH 424/461] renamed the test framwork function. --- test/libsolidity/SolidityEndToEndTest.cpp | 2 +- test/libsolidity/solidityExecutionFramework.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/test/libsolidity/SolidityEndToEndTest.cpp b/test/libsolidity/SolidityEndToEndTest.cpp index db115b104..9f6f27d7d 100644 --- a/test/libsolidity/SolidityEndToEndTest.cpp +++ b/test/libsolidity/SolidityEndToEndTest.cpp @@ -4169,7 +4169,7 @@ BOOST_AUTO_TEST_CASE(evm_exceptions_in_constructor_out_of_baund) } } )"; - BOOST_CHECK(execute(sourceCode, 0, "A").empty()); + BOOST_CHECK(compileAndRunWthoutCheck(sourceCode, 0, "A").empty()); } BOOST_AUTO_TEST_SUITE_END() diff --git a/test/libsolidity/solidityExecutionFramework.h b/test/libsolidity/solidityExecutionFramework.h index ddbbb0161..c29257dd9 100644 --- a/test/libsolidity/solidityExecutionFramework.h +++ b/test/libsolidity/solidityExecutionFramework.h @@ -42,7 +42,7 @@ class ExecutionFramework public: ExecutionFramework() { g_logVerbosity = 0; } - bytes const& execute(std::string const& _sourceCode, u256 const& _value = 0, std::string const& _contractName = "") + bytes const& compileAndRunWthoutCheck(std::string const& _sourceCode, u256 const& _value = 0, std::string const& _contractName = "") { m_compiler.reset(false, m_addStandardSources); m_compiler.addSource("", _sourceCode); @@ -54,7 +54,7 @@ public: bytes const& compileAndRun(std::string const& _sourceCode, u256 const& _value = 0, std::string const& _contractName = "") { - execute(_sourceCode, _value, _contractName); + compileAndRunWthoutCheck(_sourceCode, _value, _contractName); BOOST_REQUIRE(!m_output.empty()); return m_output; } From 120611e9d4c6ac5b223f34ae8a7db84c995e1a07 Mon Sep 17 00:00:00 2001 From: winsvega Date: Thu, 21 May 2015 17:52:39 +0300 Subject: [PATCH 425/461] Random Code --- test/fuzzTesting/CMakeLists.txt | 7 +- test/fuzzTesting/createRandomStateTest.cpp | 57 +---------- test/fuzzTesting/fuzzHelper.cpp | 112 +++++++++++++++++++++ test/fuzzTesting/fuzzHelper.h | 75 ++++++++++++++ test/libethereum/blockchain.cpp | 9 +- 5 files changed, 205 insertions(+), 55 deletions(-) create mode 100644 test/fuzzTesting/fuzzHelper.cpp create mode 100644 test/fuzzTesting/fuzzHelper.h diff --git a/test/fuzzTesting/CMakeLists.txt b/test/fuzzTesting/CMakeLists.txt index b0b3b0776..371d6504d 100644 --- a/test/fuzzTesting/CMakeLists.txt +++ b/test/fuzzTesting/CMakeLists.txt @@ -9,10 +9,13 @@ include_directories(${CRYPTOPP_INCLUDE_DIRS}) include_directories(${JSON_RPC_CPP_INCLUDE_DIRS}) add_executable(createRandomVMTest "./createRandomVMTest.cpp" "../libevm/vm.cpp" "../TestHelper.cpp" "../Stats.cpp") -add_executable(createRandomStateTest "./createRandomStateTest.cpp" "../TestHelper.cpp" "../Stats.cpp") -add_executable(checkRandomVMTest "./checkRandomVMTest.cpp" "../libevm/vm.cpp" "../TestHelper.cpp" "../Stats.cpp") +add_executable(createRandomStateTest "./createRandomStateTest.cpp" "../TestHelper.cpp" "../Stats.cpp" "fuzzHelper.cpp") +add_executable(checkRandomVMTest "./checkRandomVMTest.cpp" "../libevm/vm.cpp" "../TestHelper.cpp" "../Stats.cpp" ) add_executable(checkRandomStateTest "./checkRandomStateTest.cpp" "../TestHelper.cpp" "../Stats.cpp") +list(APPEND SRCS "./fuzzHelper.cpp") +add_sources(${SRCS}) + target_link_libraries(createRandomVMTest ${Boost_UNIT_TEST_FRAMEWORK_LIBRARIES}) target_link_libraries(createRandomVMTest ethereum) target_link_libraries(createRandomVMTest ethcore) diff --git a/test/fuzzTesting/createRandomStateTest.cpp b/test/fuzzTesting/createRandomStateTest.cpp index e0cb35dd1..65bfa2cfa 100644 --- a/test/fuzzTesting/createRandomStateTest.cpp +++ b/test/fuzzTesting/createRandomStateTest.cpp @@ -37,6 +37,7 @@ #include #include #include +#include using namespace std; using namespace json_spirit; @@ -47,55 +48,7 @@ void doStateTests(json_spirit::mValue& _v); int main(int argc, char *argv[]) { g_logVerbosity = 0; - - // create random code - - boost::random::mt19937 gen; - - auto now = chrono::steady_clock::now().time_since_epoch(); - auto timeSinceEpoch = chrono::duration_cast(now).count(); - gen.seed(static_cast(timeSinceEpoch)); - // set min and max length of the random evm code - boost::random::uniform_int_distribution<> lengthOfCodeDist(8, 24); - boost::random::uniform_int_distribution<> reasonableInputValuesSize(0, 7); - boost::random::uniform_int_distribution<> opcodeDist(0, 255); - boost::random::uniform_int_distribution<> BlockInfoOpcodeDist(0x40, 0x45); - boost::random::uniform_int_distribution<> uniformInt(0, 0x7fffffff); - boost::random::variate_generator > randGenInputValue(gen, reasonableInputValuesSize); - boost::random::variate_generator > randGenUniformInt(gen, uniformInt); - boost::random::variate_generator > randGen(gen, opcodeDist); - boost::random::variate_generator > randGenBlockInfoOpcode(gen, BlockInfoOpcodeDist); - - std::vector reasonableInputValues; - reasonableInputValues.push_back(0); - reasonableInputValues.push_back(1); - reasonableInputValues.push_back(50000); - reasonableInputValues.push_back(u256("0x10000000000000000000000000000000000000000")); - reasonableInputValues.push_back(u256("0xffffffffffffffffffffffffffffffffffffffff")); - reasonableInputValues.push_back(u256("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe")); - reasonableInputValues.push_back(u256("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")); - reasonableInputValues.push_back(u256("0x945304eb96065b2a98b57a48a06ae28d285a71b5")); - reasonableInputValues.push_back(randGenUniformInt()); - - int lengthOfCode = lengthOfCodeDist(gen); - string randomCode; - - for (int i = 0; i < lengthOfCode; ++i) - { - // pre-fill stack to avoid that most of the test fail with a stackunderflow - if (i < 8 && (randGen() < 192)) - { - randomCode += randGen() < 32 ? toHex(toCompactBigEndian((uint8_t)randGenBlockInfoOpcode())) : "7f" + toHex(reasonableInputValues[randGenInputValue()]); - continue; - } - - uint8_t opcode = randGen(); - // disregard all invalid commands, except of one (0x0c) - if ((dev::eth::isValidInstruction(dev::eth::Instruction(opcode)) || (randGen() > 250))) - randomCode += toHex(toCompactBigEndian(opcode)); - else - i--; - } + string randomCode = dev::test::RandomCode::generate(25); string const s = R"( { @@ -147,16 +100,16 @@ int main(int argc, char *argv[]) read_string(s, v); // insert new random code - v.get_obj().find("randomStatetest")->second.get_obj().find("pre")->second.get_obj().begin()->second.get_obj()["code"] = "0x" + randomCode + (randGen() > 128 ? "55" : "") + (randGen() > 128 ? "60005155" : ""); + v.get_obj().find("randomStatetest")->second.get_obj().find("pre")->second.get_obj().begin()->second.get_obj()["code"] = "0x" + randomCode; // insert new data in tx v.get_obj().find("randomStatetest")->second.get_obj().find("transaction")->second.get_obj()["data"] = "0x" + randomCode; // insert new value in tx - v.get_obj().find("randomStatetest")->second.get_obj().find("transaction")->second.get_obj()["value"] = toString(randGenUniformInt()); + v.get_obj().find("randomStatetest")->second.get_obj().find("transaction")->second.get_obj()["value"] = dev::test::RandomCode::randomUniInt(); // insert new gasLimit in tx - v.get_obj().find("randomStatetest")->second.get_obj().find("transaction")->second.get_obj()["gasLimit"] = "0x" + toHex(toCompactBigEndian((int)randGenUniformInt())); + v.get_obj().find("randomStatetest")->second.get_obj().find("transaction")->second.get_obj()["gasLimit"] = dev::test::RandomCode::randomUniInt(); // fill test doStateTests(v); diff --git a/test/fuzzTesting/fuzzHelper.cpp b/test/fuzzTesting/fuzzHelper.cpp new file mode 100644 index 000000000..5b3b0a7f0 --- /dev/null +++ b/test/fuzzTesting/fuzzHelper.cpp @@ -0,0 +1,112 @@ +/* + This file is part of cpp-ethereum. + + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file fuzzHelper.cpp + * @author Dimitry Khokhlov + * @date 2015 + */ + +#include "fuzzHelper.h" + +#include +#include +#include +#include + +namespace dev +{ +namespace test +{ + +boost::random::mt19937 RandomCode::gen; +boostIntDistrib RandomCode::opCodeDist = boostIntDistrib (0, 255); +boostIntDistrib RandomCode::opLengDist = boostIntDistrib (1, 32); +boostIntDistrib RandomCode::uniIntDist = boostIntDistrib (0, 0x7fffffff); + +boostIntGenerator RandomCode::randOpCodeGen = boostIntGenerator(gen, opCodeDist); +boostIntGenerator RandomCode::randOpLengGen = boostIntGenerator(gen, opLengDist); +boostIntGenerator RandomCode::randUniIntGen = boostIntGenerator(gen, uniIntDist); + + +std::string RandomCode::rndByteSequence(int length) +{ + refreshSeed(); + std::string hash; + length = std::max(1, length); + for (auto i = 0; i < length; i++) + { + uint8_t byte = randOpCodeGen(); + hash += toCompactHex(byte); + } + return hash; +} + +std::string RandomCode::fillArguments(int num) +{ + std::string code; + for (auto i = 0; i < num; i++) + { + int length = randOpLengGen(); + int pushCode = 96 + length - 1; + code += toCompactHex(pushCode) + rndByteSequence(length); + } + return code; +} + +//generate smart random code +std::string RandomCode::generate(int maxOpNumber, CodeOptions options) +{ + refreshSeed(); + std::string code; + boostIntDistrib sizeDist (0, maxOpNumber); + boostIntGenerator rndSizeGen(gen, sizeDist); + int size = (int)rndSizeGen(); + for (auto i = 0; i < size; i++) + { + uint8_t opcode = randOpCodeGen(); + dev::eth::InstructionInfo info = dev::eth::instructionInfo((dev::eth::Instruction) opcode); + + if (info.name.find_first_of("INVALID_INSTRUCTION") > 0) + { + //Byte code is yet not implemented + if (options == CodeOptions::DontUseUndefinedOpCodes) + { + i--; + continue; + } + } + else + code += fillArguments(info.args); + code += toCompactHex(opcode); + } + return code; +} + +std::string RandomCode::randomUniInt() +{ + refreshSeed(); + return "0x" + toCompactHex((int)randUniIntGen()); +} + +void RandomCode::refreshSeed() +{ + auto now = std::chrono::steady_clock::now().time_since_epoch(); + auto timeSinceEpoch = std::chrono::duration_cast(now).count(); + gen.seed(static_cast(timeSinceEpoch)); +} + +} +} diff --git a/test/fuzzTesting/fuzzHelper.h b/test/fuzzTesting/fuzzHelper.h new file mode 100644 index 000000000..c3e15a24f --- /dev/null +++ b/test/fuzzTesting/fuzzHelper.h @@ -0,0 +1,75 @@ +/* + This file is part of cpp-ethereum. + + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . +*/ +/** @file fuzzHelper.h + * @author Dimitry Khokhlov + * @date 2015 + */ + +#include +#include +#include + +#include +#include +#include + +#pragma once + +namespace dev +{ +namespace test +{ + +typedef boost::random::uniform_int_distribution<> boostIntDistrib; +typedef boost::random::variate_generator boostIntGenerator; + +enum class CodeOptions +{ + UseUndefinedOpCodes, + DontUseUndefinedOpCodes +}; + +class RandomCode +{ +public: + /// Generate random vm code + static std::string generate(int maxOpNumber = 1, CodeOptions options = CodeOptions::DontUseUndefinedOpCodes); + + /// Generate random byte string of a given length + static std::string rndByteSequence(int length = 1); + + /// Generate random uniForm Int with reasonable value 0..0x7fffffff + static std::string randomUniInt(); + +private: + static std::string fillArguments(int num); + static void refreshSeed(); + + static boost::random::mt19937 gen; ///< Random generator + static boostIntDistrib opCodeDist; ///< 0..255 opcodes + static boostIntDistrib opLengDist; ///< 1..32 byte string + static boostIntDistrib uniIntDist; ///< 0..0x7fffffff + + static boostIntGenerator randUniIntGen; ///< Generate random UniformInt from + static boostIntGenerator randOpCodeGen; ///< Generate random value from opCodeDist + static boostIntGenerator randOpLengGen; ///< Generate random length from opLengDist +}; + + + +} +} diff --git a/test/libethereum/blockchain.cpp b/test/libethereum/blockchain.cpp index 0ea8b95a8..a654712fe 100644 --- a/test/libethereum/blockchain.cpp +++ b/test/libethereum/blockchain.cpp @@ -19,7 +19,7 @@ * @date 2015 * block test functions. */ - +#include "test/fuzzTesting/fuzzHelper.h" #include #include #include @@ -811,4 +811,11 @@ BOOST_AUTO_TEST_CASE(userDefinedFile) dev::test::userDefinedTest(dev::test::doBlockchainTests); } +BOOST_AUTO_TEST_CASE(rndCode) +{ + cerr << "Testing Random Code: "; + std::string code = dev::test::RandomCode::generate(10); + cerr << code; +} + BOOST_AUTO_TEST_SUITE_END() From 7788d4f6d9eacebbafcd740c2cb652233ef24bb3 Mon Sep 17 00:00:00 2001 From: winsvega Date: Fri, 22 May 2015 17:28:47 +0300 Subject: [PATCH 426/461] undo vmTest --- test/libethereum/blockchain.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/test/libethereum/blockchain.cpp b/test/libethereum/blockchain.cpp index a654712fe..085a855d4 100644 --- a/test/libethereum/blockchain.cpp +++ b/test/libethereum/blockchain.cpp @@ -813,8 +813,16 @@ BOOST_AUTO_TEST_CASE(userDefinedFile) BOOST_AUTO_TEST_CASE(rndCode) { + std::string code; cerr << "Testing Random Code: "; - std::string code = dev::test::RandomCode::generate(10); + try + { + code = dev::test::RandomCode::generate(10); + } + catch(...) + { + BOOST_ERROR("Exception thrown when generating random code!"); + } cerr << code; } From 3c6f053a79ab75370aface29579263583fc610d4 Mon Sep 17 00:00:00 2001 From: winsvega Date: Fri, 22 May 2015 21:04:12 +0300 Subject: [PATCH 427/461] Random Codes With Probability --- test/fuzzTesting/createRandomStateTest.cpp | 175 +++++++++++++++------ test/fuzzTesting/fuzzHelper.cpp | 16 +- test/fuzzTesting/fuzzHelper.h | 35 ++++- 3 files changed, 169 insertions(+), 57 deletions(-) diff --git a/test/fuzzTesting/createRandomStateTest.cpp b/test/fuzzTesting/createRandomStateTest.cpp index 65bfa2cfa..f93cbfa6e 100644 --- a/test/fuzzTesting/createRandomStateTest.cpp +++ b/test/fuzzTesting/createRandomStateTest.cpp @@ -44,60 +44,139 @@ using namespace json_spirit; using namespace dev; void doStateTests(json_spirit::mValue& _v); +void doChristophAlgo(); +void doRandomCodeAlgo(); + +string const c_testExample = R"( +{ + "randomStatetest" : { + "env" : { + "currentCoinbase" : "945304eb96065b2a98b57a48a06ae28d285a71b5", + "currentDifficulty" : "5623894562375", + "currentGasLimit" : "115792089237316195423570985008687907853269984665640564039457584007913129639935", + "currentNumber" : "0", + "currentTimestamp" : "1", + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" + }, + "pre" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "0", + "code" : "0x6001600101600055", + "nonce" : "0", + "storage" : { + } + }, + "945304eb96065b2a98b57a48a06ae28d285a71b5" : { + "balance" : "46", + "code" : "0x6000355415600957005b60203560003555", + "nonce" : "0", + "storage" : { + } + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "1000000000000000000", + "code" : "0x", + "nonce" : "0", + "storage" : { + } + } + }, + "transaction" : { + "data" : "0x42", + "gasLimit" : "400000", + "gasPrice" : "1", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "100000" + } + } +} +)"; int main(int argc, char *argv[]) +{ + //doChristophAlgo(); + doRandomCodeAlgo(); + return 0; +} + +void doChristophAlgo() { g_logVerbosity = 0; - string randomCode = dev::test::RandomCode::generate(25); - string const s = R"( + // create random code + boost::random::mt19937 gen; + auto now = chrono::steady_clock::now().time_since_epoch(); + auto timeSinceEpoch = chrono::duration_cast(now).count(); + gen.seed(static_cast(timeSinceEpoch)); + + // set min and max length of the random evm code + boost::random::uniform_int_distribution<> lengthOfCodeDist(8, 24); + boost::random::uniform_int_distribution<> reasonableInputValuesSize(0, 7); + boost::random::uniform_int_distribution<> opcodeDist(0, 255); + boost::random::uniform_int_distribution<> BlockInfoOpcodeDist(0x40, 0x45); + boost::random::uniform_int_distribution<> uniformInt(0, 0x7fffffff); + boost::random::variate_generator > randGenInputValue(gen, reasonableInputValuesSize); + boost::random::variate_generator > randGenUniformInt(gen, uniformInt); + boost::random::variate_generator > randGen(gen, opcodeDist); + boost::random::variate_generator > randGenBlockInfoOpcode(gen, BlockInfoOpcodeDist); + + std::vector reasonableInputValues; + reasonableInputValues.push_back(0); + reasonableInputValues.push_back(1); + reasonableInputValues.push_back(50000); + reasonableInputValues.push_back(u256("0x10000000000000000000000000000000000000000")); + reasonableInputValues.push_back(u256("0xffffffffffffffffffffffffffffffffffffffff")); + reasonableInputValues.push_back(u256("0xfffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe")); + reasonableInputValues.push_back(u256("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff")); + reasonableInputValues.push_back(u256("0x945304eb96065b2a98b57a48a06ae28d285a71b5")); + reasonableInputValues.push_back(randGenUniformInt()); + + int lengthOfCode = lengthOfCodeDist(gen); + string randomCode; + for (int i = 0; i < lengthOfCode; ++i) { - "randomStatetest" : { - "env" : { - "currentCoinbase" : "945304eb96065b2a98b57a48a06ae28d285a71b5", - "currentDifficulty" : "5623894562375", - "currentGasLimit" : "115792089237316195423570985008687907853269984665640564039457584007913129639935", - "currentNumber" : "0", - "currentTimestamp" : "1", - "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6" - }, - "pre" : { - "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { - "balance" : "0", - "code" : "0x6001600101600055", - "nonce" : "0", - "storage" : { - } - }, - "945304eb96065b2a98b57a48a06ae28d285a71b5" : { - "balance" : "46", - "code" : "0x6000355415600957005b60203560003555", - "nonce" : "0", - "storage" : { - } - }, - "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { - "balance" : "1000000000000000000", - "code" : "0x", - "nonce" : "0", - "storage" : { - } - } - }, - "transaction" : { - "data" : "0x42", - "gasLimit" : "400000", - "gasPrice" : "1", - "nonce" : "0", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", - "value" : "100000" - } + // pre-fill stack to avoid that most of the test fail with a stackunderflow + if (i < 8 && (randGen() < 192)) + { + randomCode += randGen() < 32 ? toHex(toCompactBigEndian((uint8_t)randGenBlockInfoOpcode())) : "7f" + toHex(reasonableInputValues[randGenInputValue()]); + continue; } + uint8_t opcode = randGen(); + // disregard all invalid commands, except of one (0x0c) + if ((dev::eth::isValidInstruction(dev::eth::Instruction(opcode)) || (randGen() > 250))) + randomCode += toHex(toCompactBigEndian(opcode)); + else + i--; } -)"; + mValue v; - read_string(s, v); + read_string(c_testExample, v); + // insert new random code + v.get_obj().find("randomStatetest")->second.get_obj().find("pre")->second.get_obj().begin()->second.get_obj()["code"] = "0x" + randomCode + (randGen() > 128 ? "55" : "") + (randGen() > 128 ? "60005155" : ""); + // insert new data in tx + v.get_obj().find("randomStatetest")->second.get_obj().find("transaction")->second.get_obj()["data"] = "0x" + randomCode; + // insert new value in tx + v.get_obj().find("randomStatetest")->second.get_obj().find("transaction")->second.get_obj()["value"] = toString(randGenUniformInt()); + // insert new gasLimit in tx + v.get_obj().find("randomStatetest")->second.get_obj().find("transaction")->second.get_obj()["gasLimit"] = "0x" + toHex(toCompactBigEndian((int)randGenUniformInt())); + // fill test + doStateTests(v); + // stream to output for further handling by the bash script + cout << json_spirit::write_string(v, true); +} + +void doRandomCodeAlgo() +{ + g_logVerbosity = 0; + dev::test::RandomCodeOptions options; + options.setWeight(dev::eth::Instruction::STOP, 10); //default 50 + options.setWeight(dev::eth::Instruction::SSTORE, 70); + string randomCode = dev::test::RandomCode::generate(15); + + mValue v; + read_string(c_testExample, v); // insert new random code v.get_obj().find("randomStatetest")->second.get_obj().find("pre")->second.get_obj().begin()->second.get_obj()["code"] = "0x" + randomCode; @@ -116,10 +195,10 @@ int main(int argc, char *argv[]) // stream to output for further handling by the bash script cout << json_spirit::write_string(v, true); - - return 0; } + + void doStateTests(json_spirit::mValue& _v) { eth::VMFactory::setKind(eth::VMKind::Interpreter); @@ -159,3 +238,5 @@ void doStateTests(json_spirit::mValue& _v) } } + + diff --git a/test/fuzzTesting/fuzzHelper.cpp b/test/fuzzTesting/fuzzHelper.cpp index 5b3b0a7f0..ba0e58575 100644 --- a/test/fuzzTesting/fuzzHelper.cpp +++ b/test/fuzzTesting/fuzzHelper.cpp @@ -40,7 +40,6 @@ boostIntGenerator RandomCode::randOpCodeGen = boostIntGenerator(gen, opCodeDist) boostIntGenerator RandomCode::randOpLengGen = boostIntGenerator(gen, opLengDist); boostIntGenerator RandomCode::randUniIntGen = boostIntGenerator(gen, uniIntDist); - std::string RandomCode::rndByteSequence(int length) { refreshSeed(); @@ -67,22 +66,28 @@ std::string RandomCode::fillArguments(int num) } //generate smart random code -std::string RandomCode::generate(int maxOpNumber, CodeOptions options) +std::string RandomCode::generate(int maxOpNumber, RandomCodeOptions options) { refreshSeed(); std::string code; + + //random opCode amount boostIntDistrib sizeDist (0, maxOpNumber); boostIntGenerator rndSizeGen(gen, sizeDist); int size = (int)rndSizeGen(); + + boostWeightGenerator randOpCodeWeight (gen, options.opCodeProbability); + bool weightsDefined = options.opCodeProbability.probabilities().size() == 255; + for (auto i = 0; i < size; i++) { - uint8_t opcode = randOpCodeGen(); + uint8_t opcode = weightsDefined ? randOpCodeWeight() : randOpCodeGen(); dev::eth::InstructionInfo info = dev::eth::instructionInfo((dev::eth::Instruction) opcode); if (info.name.find_first_of("INVALID_INSTRUCTION") > 0) { //Byte code is yet not implemented - if (options == CodeOptions::DontUseUndefinedOpCodes) + if (options.useUndefinedOpCodes == false) { i--; continue; @@ -90,7 +95,8 @@ std::string RandomCode::generate(int maxOpNumber, CodeOptions options) } else code += fillArguments(info.args); - code += toCompactHex(opcode); + std::string byte = toCompactHex(opcode); + code += (byte == "") ? "00" : byte; } return code; } diff --git a/test/fuzzTesting/fuzzHelper.h b/test/fuzzTesting/fuzzHelper.h index c3e15a24f..29d3b19ea 100644 --- a/test/fuzzTesting/fuzzHelper.h +++ b/test/fuzzTesting/fuzzHelper.h @@ -26,6 +26,7 @@ #include #include #include +#include #pragma once @@ -35,19 +36,43 @@ namespace test { typedef boost::random::uniform_int_distribution<> boostIntDistrib; +typedef boost::random::discrete_distribution<> boostDescreteDistrib; + typedef boost::random::variate_generator boostIntGenerator; +typedef boost::random::variate_generator boostWeightGenerator; -enum class CodeOptions +struct RandomCodeOptions { - UseUndefinedOpCodes, - DontUseUndefinedOpCodes +public: + RandomCodeOptions() : useUndefinedOpCodes(false) { + //each op code with same weight-probability + for (auto i = 0; i < 255; i++) + mapWeights.insert(std::pair(i, 50)); + setWeights(); + } + void setWeight(dev::eth::Instruction opCode, int weight) + { + mapWeights.at((int)opCode) = weight; + setWeights(); + } + bool useUndefinedOpCodes; + boostDescreteDistrib opCodeProbability; +private: + void setWeights() + { + std::vector weights; + for (auto const& element: mapWeights) + weights.push_back(element.second); + opCodeProbability = boostDescreteDistrib(weights); + } + std::map mapWeights; }; class RandomCode { public: /// Generate random vm code - static std::string generate(int maxOpNumber = 1, CodeOptions options = CodeOptions::DontUseUndefinedOpCodes); + static std::string generate(int maxOpNumber = 1, RandomCodeOptions options = RandomCodeOptions()); /// Generate random byte string of a given length static std::string rndByteSequence(int length = 1); @@ -64,7 +89,7 @@ private: static boostIntDistrib opLengDist; ///< 1..32 byte string static boostIntDistrib uniIntDist; ///< 0..0x7fffffff - static boostIntGenerator randUniIntGen; ///< Generate random UniformInt from + static boostIntGenerator randUniIntGen; ///< Generate random UniformInt from uniIntDist static boostIntGenerator randOpCodeGen; ///< Generate random value from opCodeDist static boostIntGenerator randOpLengGen; ///< Generate random length from opLengDist }; From b43c4f11456c0eea5fea3bf17fc6e57fb1f90c76 Mon Sep 17 00:00:00 2001 From: Dimitry Date: Tue, 26 May 2015 16:27:22 +0300 Subject: [PATCH 428/461] Random test code --- test/TestHelper.cpp | 4 +++- test/TestHelper.h | 1 + test/fuzzTesting/createRandomStateTest.cpp | 5 +++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/test/TestHelper.cpp b/test/TestHelper.cpp index 476d1ecf9..4836ce7f3 100644 --- a/test/TestHelper.cpp +++ b/test/TestHelper.cpp @@ -328,7 +328,7 @@ void ImportTest::exportTest(bytes const& _output, State const& _statePost) { // export output - m_TestObject["out"] = _output.size() > 4096 ? "#" + toString(_output.size()) : toHex(_output, 2, HexPrefix::Add); + m_TestObject["out"] = (_output.size() > 4096 && !Options::get().fulloutput) ? "#" + toString(_output.size()) : toHex(_output, 2, HexPrefix::Add); // export logs m_TestObject["logs"] = exportLog(_statePost.pending().size() ? _statePost.log(0) : LogEntries()); @@ -760,6 +760,8 @@ Options::Options() else singleTestName = std::move(name1); } + else if (arg == "--fulloutput") + fulloutput = true; } } diff --git a/test/TestHelper.h b/test/TestHelper.h index fc6c77fad..8f0c73bf3 100644 --- a/test/TestHelper.h +++ b/test/TestHelper.h @@ -184,6 +184,7 @@ public: bool stats = false; ///< Execution time stats std::string statsOutFile; ///< Stats output file. "out" for standard output bool checkState = false;///< Throw error when checking test states + bool fulloutput = false;///< Replace large output to just it's length /// Test selection /// @{ diff --git a/test/fuzzTesting/createRandomStateTest.cpp b/test/fuzzTesting/createRandomStateTest.cpp index f93cbfa6e..e2c0600b6 100644 --- a/test/fuzzTesting/createRandomStateTest.cpp +++ b/test/fuzzTesting/createRandomStateTest.cpp @@ -173,7 +173,8 @@ void doRandomCodeAlgo() dev::test::RandomCodeOptions options; options.setWeight(dev::eth::Instruction::STOP, 10); //default 50 options.setWeight(dev::eth::Instruction::SSTORE, 70); - string randomCode = dev::test::RandomCode::generate(15); + string randomCode = dev::test::RandomCode::generate(10); + string randomData = dev::test::RandomCode::generate(10); mValue v; read_string(c_testExample, v); @@ -182,7 +183,7 @@ void doRandomCodeAlgo() v.get_obj().find("randomStatetest")->second.get_obj().find("pre")->second.get_obj().begin()->second.get_obj()["code"] = "0x" + randomCode; // insert new data in tx - v.get_obj().find("randomStatetest")->second.get_obj().find("transaction")->second.get_obj()["data"] = "0x" + randomCode; + v.get_obj().find("randomStatetest")->second.get_obj().find("transaction")->second.get_obj()["data"] = "0x" + randomData; // insert new value in tx v.get_obj().find("randomStatetest")->second.get_obj().find("transaction")->second.get_obj()["value"] = dev::test::RandomCode::randomUniInt(); From b429e1cfde0259c0beb70a49b32d9c35319ed5de Mon Sep 17 00:00:00 2001 From: Dimitry Date: Tue, 26 May 2015 16:51:29 +0300 Subject: [PATCH 429/461] Random Code: Style --- test/fuzzTesting/createRandomStateTest.cpp | 5 ----- test/libethereum/blockchain.cpp | 15 --------------- 2 files changed, 20 deletions(-) diff --git a/test/fuzzTesting/createRandomStateTest.cpp b/test/fuzzTesting/createRandomStateTest.cpp index e2c0600b6..622ccb1ac 100644 --- a/test/fuzzTesting/createRandomStateTest.cpp +++ b/test/fuzzTesting/createRandomStateTest.cpp @@ -198,8 +198,6 @@ void doRandomCodeAlgo() cout << json_spirit::write_string(v, true); } - - void doStateTests(json_spirit::mValue& _v) { eth::VMFactory::setKind(eth::VMKind::Interpreter); @@ -238,6 +236,3 @@ void doStateTests(json_spirit::mValue& _v) #endif } } - - - diff --git a/test/libethereum/blockchain.cpp b/test/libethereum/blockchain.cpp index 085a855d4..67b3955ff 100644 --- a/test/libethereum/blockchain.cpp +++ b/test/libethereum/blockchain.cpp @@ -811,19 +811,4 @@ BOOST_AUTO_TEST_CASE(userDefinedFile) dev::test::userDefinedTest(dev::test::doBlockchainTests); } -BOOST_AUTO_TEST_CASE(rndCode) -{ - std::string code; - cerr << "Testing Random Code: "; - try - { - code = dev::test::RandomCode::generate(10); - } - catch(...) - { - BOOST_ERROR("Exception thrown when generating random code!"); - } - cerr << code; -} - BOOST_AUTO_TEST_SUITE_END() From 8ea48967f1aa1c4dbb9e2acf1623b48afcc41cf1 Mon Sep 17 00:00:00 2001 From: Dimitry Date: Tue, 26 May 2015 18:24:47 +0300 Subject: [PATCH 430/461] Random Code: fulloutput option + test --- test/TestHelper.cpp | 1 - test/fuzzTesting/createRandomStateTest.cpp | 8 ++++++++ test/fuzzTesting/fuzzHelper.cpp | 19 +++++++++++++++++++ 3 files changed, 27 insertions(+), 1 deletion(-) diff --git a/test/TestHelper.cpp b/test/TestHelper.cpp index 4836ce7f3..5ace49e5d 100644 --- a/test/TestHelper.cpp +++ b/test/TestHelper.cpp @@ -771,7 +771,6 @@ Options const& Options::get() return instance; } - LastHashes lastHashes(u256 _currentBlockNumber) { LastHashes ret; diff --git a/test/fuzzTesting/createRandomStateTest.cpp b/test/fuzzTesting/createRandomStateTest.cpp index 622ccb1ac..ea726c09d 100644 --- a/test/fuzzTesting/createRandomStateTest.cpp +++ b/test/fuzzTesting/createRandomStateTest.cpp @@ -96,6 +96,14 @@ string const c_testExample = R"( int main(int argc, char *argv[]) { + for (auto i = 0; i < argc; ++i) + { + auto arg = std::string{argv[i]}; + dev::test::Options& options = const_cast(dev::test::Options::get()); + if (arg == "--fulloutput") + options.fulloutput = true; + } + //doChristophAlgo(); doRandomCodeAlgo(); return 0; diff --git a/test/fuzzTesting/fuzzHelper.cpp b/test/fuzzTesting/fuzzHelper.cpp index ba0e58575..0b50868c5 100644 --- a/test/fuzzTesting/fuzzHelper.cpp +++ b/test/fuzzTesting/fuzzHelper.cpp @@ -114,5 +114,24 @@ void RandomCode::refreshSeed() gen.seed(static_cast(timeSinceEpoch)); } +BOOST_AUTO_TEST_SUITE(RandomCodeTests) + +BOOST_AUTO_TEST_CASE(rndCode) +{ + std::string code; + std::cerr << "Testing Random Code: "; + try + { + code = dev::test::RandomCode::generate(10); + } + catch(...) + { + BOOST_ERROR("Exception thrown when generating random code!"); + } + std::cerr << code; +} + +BOOST_AUTO_TEST_SUITE_END() + } } From 50d6e8cb31f9b80033ca4f92babc493a99ba75e3 Mon Sep 17 00:00:00 2001 From: Dimitry Date: Wed, 27 May 2015 15:45:00 +0300 Subject: [PATCH 431/461] Random Code: exceptions when filling rnd StateTest --- test/fuzzTesting/createRandomStateTest.cpp | 23 ++++++++++++---------- test/fuzzTesting/fuzzHelper.h | 2 -- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/test/fuzzTesting/createRandomStateTest.cpp b/test/fuzzTesting/createRandomStateTest.cpp index ea726c09d..c0c07b53e 100644 --- a/test/fuzzTesting/createRandomStateTest.cpp +++ b/test/fuzzTesting/createRandomStateTest.cpp @@ -218,15 +218,19 @@ void doStateTests(json_spirit::mValue& _v) assert(o.count("env") > 0); assert(o.count("pre") > 0); assert(o.count("transaction") > 0); - - test::ImportTest importer(o, true); - - eth::State theState = importer.m_statePre; bytes output; + eth::State theState; try { - output = theState.execute(test::lastHashes(importer.m_environment.currentBlock.number), importer.m_transaction).output; + test::ImportTest importer(o, true); + eth::State theState = importer.m_statePre; + output = theState.execute(test::lastHashes(importer.m_environment.currentBlock.number), importer.m_transaction).output; + #if ETH_FATDB + importer.exportTest(output, theState); + #else + cout << "You can not fill tests when FATDB is switched off"; + #endif } catch (Exception const& _e) { @@ -237,10 +241,9 @@ void doStateTests(json_spirit::mValue& _v) { cnote << "state execution did throw an exception: " << _e.what(); } -#if ETH_FATDB - importer.exportTest(output, theState); -#else - cout << "You can not fill tests when FATDB is switched off"; -#endif + catch (...) + { + cnote << "state execution did throw an exception!"; + } } } diff --git a/test/fuzzTesting/fuzzHelper.h b/test/fuzzTesting/fuzzHelper.h index 29d3b19ea..26580cb26 100644 --- a/test/fuzzTesting/fuzzHelper.h +++ b/test/fuzzTesting/fuzzHelper.h @@ -94,7 +94,5 @@ private: static boostIntGenerator randOpLengGen; ///< Generate random length from opLengDist }; - - } } From 0021abf270c20d74796e64609a35e44a57489404 Mon Sep 17 00:00:00 2001 From: Dimitry Date: Wed, 27 May 2015 22:51:53 +0300 Subject: [PATCH 432/461] Random Code: smart opcode fuzz --- test/fuzzTesting/createRandomStateTest.cpp | 15 ++- test/fuzzTesting/fuzzHelper.cpp | 119 ++++++++++++++++++--- test/fuzzTesting/fuzzHelper.h | 41 ++++--- 3 files changed, 134 insertions(+), 41 deletions(-) diff --git a/test/fuzzTesting/createRandomStateTest.cpp b/test/fuzzTesting/createRandomStateTest.cpp index c0c07b53e..d0cd82c01 100644 --- a/test/fuzzTesting/createRandomStateTest.cpp +++ b/test/fuzzTesting/createRandomStateTest.cpp @@ -181,8 +181,15 @@ void doRandomCodeAlgo() dev::test::RandomCodeOptions options; options.setWeight(dev::eth::Instruction::STOP, 10); //default 50 options.setWeight(dev::eth::Instruction::SSTORE, 70); - string randomCode = dev::test::RandomCode::generate(10); - string randomData = dev::test::RandomCode::generate(10); + options.setWeight(dev::eth::Instruction::CALL, 75); + options.addAddress(Address("0xffffffffffffffffffffffffffffffffffffffff")); + options.addAddress(Address("0x1000000000000000000000000000000000000000")); + options.addAddress(Address("0x095e7baea6a6c7c4c2dfeb977efac326af552d87")); //coinbase + options.addAddress(Address("0x945304eb96065b2a98b57a48a06ae28d285a71b5")); + options.addAddress(Address("0xa94f5374fce5edbc8e2a8697c15331677e6ebf0b")); + options.smartCodeProbability = 35; + string randomCode = dev::test::RandomCode::generate(10, options); + string randomData = dev::test::RandomCode::generate(10, options); mValue v; read_string(c_testExample, v); @@ -194,10 +201,10 @@ void doRandomCodeAlgo() v.get_obj().find("randomStatetest")->second.get_obj().find("transaction")->second.get_obj()["data"] = "0x" + randomData; // insert new value in tx - v.get_obj().find("randomStatetest")->second.get_obj().find("transaction")->second.get_obj()["value"] = dev::test::RandomCode::randomUniInt(); + v.get_obj().find("randomStatetest")->second.get_obj().find("transaction")->second.get_obj()["value"] = dev::test::RandomCode::randomUniIntHex(); // insert new gasLimit in tx - v.get_obj().find("randomStatetest")->second.get_obj().find("transaction")->second.get_obj()["gasLimit"] = dev::test::RandomCode::randomUniInt(); + v.get_obj().find("randomStatetest")->second.get_obj().find("transaction")->second.get_obj()["gasLimit"] = dev::test::RandomCode::randomUniIntHex(); // fill test doStateTests(v); diff --git a/test/fuzzTesting/fuzzHelper.cpp b/test/fuzzTesting/fuzzHelper.cpp index 0b50868c5..b4905709e 100644 --- a/test/fuzzTesting/fuzzHelper.cpp +++ b/test/fuzzTesting/fuzzHelper.cpp @@ -40,11 +40,11 @@ boostIntGenerator RandomCode::randOpCodeGen = boostIntGenerator(gen, opCodeDist) boostIntGenerator RandomCode::randOpLengGen = boostIntGenerator(gen, opLengDist); boostIntGenerator RandomCode::randUniIntGen = boostIntGenerator(gen, uniIntDist); -std::string RandomCode::rndByteSequence(int length) +std::string RandomCode::rndByteSequence(int length, SizeStrictness sizeType) { refreshSeed(); std::string hash; - length = std::max(1, length); + length = (sizeType == SizeStrictness::Strict) ? std::max(1, length) : randomUniInt() % length; for (auto i = 0; i < length; i++) { uint8_t byte = randOpCodeGen(); @@ -53,18 +53,6 @@ std::string RandomCode::rndByteSequence(int length) return hash; } -std::string RandomCode::fillArguments(int num) -{ - std::string code; - for (auto i = 0; i < num; i++) - { - int length = randOpLengGen(); - int pushCode = 96 + length - 1; - code += toCompactHex(pushCode) + rndByteSequence(length); - } - return code; -} - //generate smart random code std::string RandomCode::generate(int maxOpNumber, RandomCodeOptions options) { @@ -94,19 +82,25 @@ std::string RandomCode::generate(int maxOpNumber, RandomCodeOptions options) } } else - code += fillArguments(info.args); + code += fillArguments((dev::eth::Instruction) opcode, options); std::string byte = toCompactHex(opcode); code += (byte == "") ? "00" : byte; } return code; } -std::string RandomCode::randomUniInt() +std::string RandomCode::randomUniIntHex() { refreshSeed(); return "0x" + toCompactHex((int)randUniIntGen()); } +int RandomCode::randomUniInt() +{ + refreshSeed(); + return (int)randUniIntGen(); +} + void RandomCode::refreshSeed() { auto now = std::chrono::steady_clock::now().time_since_epoch(); @@ -114,6 +108,99 @@ void RandomCode::refreshSeed() gen.seed(static_cast(timeSinceEpoch)); } +std::string RandomCode::getPushCode(std::string hex) +{ + int length = hex.length()/2; + int pushCode = 96 + length - 1; + return toCompactHex(pushCode) + hex; +} + +std::string RandomCode::getPushCode(int value) +{ + std::string hexString = toCompactHex(value); + return getPushCode(hexString); +} + +std::string RandomCode::fillArguments(dev::eth::Instruction opcode, RandomCodeOptions options) +{ + dev::eth::InstructionInfo info = dev::eth::instructionInfo(opcode); + + std::string code; + bool smart = false; + unsigned num = info.args; + int rand = randOpCodeGen() % 100; + if (rand < options.smartCodeProbability) + smart = true; + + if (smart) + { + switch (opcode) + { + case dev::eth::Instruction::CALL: + //(CALL gaslimit address value memstart1 memlen1 memstart2 memlen2) + code += getPushCode(randUniIntGen() % 32); //memlen2 + code += getPushCode(randUniIntGen() % 32); //memstart2 + code += getPushCode(randUniIntGen() % 32); //memlen1 + code += getPushCode(randUniIntGen() % 32); //memlen1 + code += getPushCode(randUniIntGen()); //value + code += getPushCode(toString(options.getRandomAddress()));//address + code += getPushCode(randUniIntGen()); //gaslimit + break; + default: + smart = false; + } + } + + if (smart == false) + for (unsigned i = 0; i < num; i++) + { + //generate random parameters + int length = randOpLengGen(); + code += getPushCode(rndByteSequence(length)); + } + return code; +} + + +//Ramdom Code Options +RandomCodeOptions::RandomCodeOptions() : useUndefinedOpCodes(false), smartCodeProbability(50) +{ + //each op code with same weight-probability + for (auto i = 0; i < 255; i++) + mapWeights.insert(std::pair(i, 50)); + setWeights(); +} + +void RandomCodeOptions::setWeight(dev::eth::Instruction opCode, int weight) +{ + mapWeights.at((int)opCode) = weight; + setWeights(); +} + +void RandomCodeOptions::addAddress(dev::Address address) +{ + addressList.push_back(address); +} + +dev::Address RandomCodeOptions::getRandomAddress() +{ + if (addressList.size() > 0) + { + int index = RandomCode::randomUniInt() % addressList.size(); + return addressList[index]; + } + return Address(RandomCode::rndByteSequence(20)); +} + +void RandomCodeOptions::setWeights() +{ + std::vector weights; + for (auto const& element: mapWeights) + weights.push_back(element.second); + opCodeProbability = boostDescreteDistrib(weights); +} + + BOOST_AUTO_TEST_SUITE(RandomCodeTests) BOOST_AUTO_TEST_CASE(rndCode) diff --git a/test/fuzzTesting/fuzzHelper.h b/test/fuzzTesting/fuzzHelper.h index 26580cb26..593f49328 100644 --- a/test/fuzzTesting/fuzzHelper.h +++ b/test/fuzzTesting/fuzzHelper.h @@ -44,28 +44,24 @@ typedef boost::random::variate_generator struct RandomCodeOptions { public: - RandomCodeOptions() : useUndefinedOpCodes(false) { - //each op code with same weight-probability - for (auto i = 0; i < 255; i++) - mapWeights.insert(std::pair(i, 50)); - setWeights(); - } - void setWeight(dev::eth::Instruction opCode, int weight) - { - mapWeights.at((int)opCode) = weight; - setWeights(); - } + RandomCodeOptions(); + void setWeight(dev::eth::Instruction opCode, int weight); + void addAddress(dev::Address address); + dev::Address getRandomAddress(); + bool useUndefinedOpCodes; + int smartCodeProbability; boostDescreteDistrib opCodeProbability; private: - void setWeights() - { - std::vector weights; - for (auto const& element: mapWeights) - weights.push_back(element.second); - opCodeProbability = boostDescreteDistrib(weights); - } + void setWeights(); std::map mapWeights; + std::vector addressList; +}; + +enum class SizeStrictness +{ + Strict, + Random }; class RandomCode @@ -75,13 +71,16 @@ public: static std::string generate(int maxOpNumber = 1, RandomCodeOptions options = RandomCodeOptions()); /// Generate random byte string of a given length - static std::string rndByteSequence(int length = 1); + static std::string rndByteSequence(int length = 1, SizeStrictness sizeType = SizeStrictness::Strict); /// Generate random uniForm Int with reasonable value 0..0x7fffffff - static std::string randomUniInt(); + static std::string randomUniIntHex(); + static int randomUniInt(); private: - static std::string fillArguments(int num); + static std::string fillArguments(dev::eth::Instruction opcode, RandomCodeOptions options); + static std::string getPushCode(int value); + static std::string getPushCode(std::string hex); static void refreshSeed(); static boost::random::mt19937 gen; ///< Random generator From b1f4f683268792fd11c4a092acc5af743beb2397 Mon Sep 17 00:00:00 2001 From: Dimitry Date: Fri, 29 May 2015 17:06:11 +0300 Subject: [PATCH 433/461] Random Code: cath fill exceptions --- test/TestHelper.cpp | 2 +- test/fuzzTesting/createRandomStateTest.cpp | 38 ++++++++++++---------- test/fuzzTesting/fuzzHelper.cpp | 2 +- 3 files changed, 22 insertions(+), 20 deletions(-) diff --git a/test/TestHelper.cpp b/test/TestHelper.cpp index 5ace49e5d..793e05652 100644 --- a/test/TestHelper.cpp +++ b/test/TestHelper.cpp @@ -588,7 +588,7 @@ void userDefinedTest(std::function doTests) oSingleTest[pos->first] = pos->second; json_spirit::mValue v_singleTest(oSingleTest); - doTests(v_singleTest, false); + doTests(v_singleTest, test::Options::get().fillTests); } catch (Exception const& _e) { diff --git a/test/fuzzTesting/createRandomStateTest.cpp b/test/fuzzTesting/createRandomStateTest.cpp index d0cd82c01..d533ac2da 100644 --- a/test/fuzzTesting/createRandomStateTest.cpp +++ b/test/fuzzTesting/createRandomStateTest.cpp @@ -226,31 +226,33 @@ void doStateTests(json_spirit::mValue& _v) assert(o.count("pre") > 0); assert(o.count("transaction") > 0); bytes output; - eth::State theState; try { test::ImportTest importer(o, true); eth::State theState = importer.m_statePre; - output = theState.execute(test::lastHashes(importer.m_environment.currentBlock.number), importer.m_transaction).output; - #if ETH_FATDB - importer.exportTest(output, theState); - #else - cout << "You can not fill tests when FATDB is switched off"; - #endif - } - catch (Exception const& _e) - { - cnote << "state execution did throw an exception: " << diagnostic_information(_e); - theState.commit(); - } - catch (std::exception const& _e) - { - cnote << "state execution did throw an exception: " << _e.what(); + try + { + output = theState.execute(test::lastHashes(importer.m_environment.currentBlock.number), importer.m_transaction).output; + } + catch (Exception const& _e) + { + cnote << "state execution did throw an exception: " << diagnostic_information(_e); + theState.commit(); + } + catch (std::exception const& _e) + { + cnote << "state execution did throw an exception: " << _e.what(); + } +#if ETH_FATDB + importer.exportTest(output, theState); +#else + cout << "You can not fill tests when FATDB is switched off"; +#endif } - catch (...) + catch(...) { - cnote << "state execution did throw an exception!"; + cnote << "Error filling test, probably..."; } } } diff --git a/test/fuzzTesting/fuzzHelper.cpp b/test/fuzzTesting/fuzzHelper.cpp index b4905709e..4ddd30c0f 100644 --- a/test/fuzzTesting/fuzzHelper.cpp +++ b/test/fuzzTesting/fuzzHelper.cpp @@ -128,7 +128,7 @@ std::string RandomCode::fillArguments(dev::eth::Instruction opcode, RandomCodeOp std::string code; bool smart = false; unsigned num = info.args; - int rand = randOpCodeGen() % 100; + int rand = randUniIntGen() % 100; if (rand < options.smartCodeProbability) smart = true; From b6d904167690f43c1180e5bffc32339df7e7ad0f Mon Sep 17 00:00:00 2001 From: Dimitry Date: Fri, 29 May 2015 17:33:24 +0300 Subject: [PATCH 434/461] Random code: style --- test/fuzzTesting/fuzzHelper.cpp | 46 ++++++++++++++++----------------- test/fuzzTesting/fuzzHelper.h | 14 +++++----- 2 files changed, 30 insertions(+), 30 deletions(-) diff --git a/test/fuzzTesting/fuzzHelper.cpp b/test/fuzzTesting/fuzzHelper.cpp index 4ddd30c0f..7d7896947 100644 --- a/test/fuzzTesting/fuzzHelper.cpp +++ b/test/fuzzTesting/fuzzHelper.cpp @@ -40,12 +40,12 @@ boostIntGenerator RandomCode::randOpCodeGen = boostIntGenerator(gen, opCodeDist) boostIntGenerator RandomCode::randOpLengGen = boostIntGenerator(gen, opLengDist); boostIntGenerator RandomCode::randUniIntGen = boostIntGenerator(gen, uniIntDist); -std::string RandomCode::rndByteSequence(int length, SizeStrictness sizeType) +std::string RandomCode::rndByteSequence(int _length, SizeStrictness sizeType) { refreshSeed(); std::string hash; - length = (sizeType == SizeStrictness::Strict) ? std::max(1, length) : randomUniInt() % length; - for (auto i = 0; i < length; i++) + _length = (sizeType == SizeStrictness::Strict) ? std::max(1, _length) : randomUniInt() % _length; + for (auto i = 0; i < _length; i++) { uint8_t byte = randOpCodeGen(); hash += toCompactHex(byte); @@ -54,18 +54,18 @@ std::string RandomCode::rndByteSequence(int length, SizeStrictness sizeType) } //generate smart random code -std::string RandomCode::generate(int maxOpNumber, RandomCodeOptions options) +std::string RandomCode::generate(int _maxOpNumber, RandomCodeOptions _options) { refreshSeed(); std::string code; //random opCode amount - boostIntDistrib sizeDist (0, maxOpNumber); + boostIntDistrib sizeDist (0, _maxOpNumber); boostIntGenerator rndSizeGen(gen, sizeDist); int size = (int)rndSizeGen(); - boostWeightGenerator randOpCodeWeight (gen, options.opCodeProbability); - bool weightsDefined = options.opCodeProbability.probabilities().size() == 255; + boostWeightGenerator randOpCodeWeight (gen, _options.opCodeProbability); + bool weightsDefined = _options.opCodeProbability.probabilities().size() == 255; for (auto i = 0; i < size; i++) { @@ -75,14 +75,14 @@ std::string RandomCode::generate(int maxOpNumber, RandomCodeOptions options) if (info.name.find_first_of("INVALID_INSTRUCTION") > 0) { //Byte code is yet not implemented - if (options.useUndefinedOpCodes == false) + if (_options.useUndefinedOpCodes == false) { i--; continue; } } else - code += fillArguments((dev::eth::Instruction) opcode, options); + code += fillArguments((dev::eth::Instruction) opcode, _options); std::string byte = toCompactHex(opcode); code += (byte == "") ? "00" : byte; } @@ -108,33 +108,33 @@ void RandomCode::refreshSeed() gen.seed(static_cast(timeSinceEpoch)); } -std::string RandomCode::getPushCode(std::string hex) +std::string RandomCode::getPushCode(std::string const& _hex) { - int length = hex.length()/2; + int length = _hex.length() / 2; int pushCode = 96 + length - 1; - return toCompactHex(pushCode) + hex; + return toCompactHex(pushCode) + _hex; } -std::string RandomCode::getPushCode(int value) +std::string RandomCode::getPushCode(int _value) { - std::string hexString = toCompactHex(value); + std::string hexString = toCompactHex(_value); return getPushCode(hexString); } -std::string RandomCode::fillArguments(dev::eth::Instruction opcode, RandomCodeOptions options) +std::string RandomCode::fillArguments(dev::eth::Instruction _opcode, RandomCodeOptions const& _options) { - dev::eth::InstructionInfo info = dev::eth::instructionInfo(opcode); + dev::eth::InstructionInfo info = dev::eth::instructionInfo(_opcode); std::string code; bool smart = false; unsigned num = info.args; int rand = randUniIntGen() % 100; - if (rand < options.smartCodeProbability) + if (rand < _options.smartCodeProbability) smart = true; if (smart) { - switch (opcode) + switch (_opcode) { case dev::eth::Instruction::CALL: //(CALL gaslimit address value memstart1 memlen1 memstart2 memlen2) @@ -143,7 +143,7 @@ std::string RandomCode::fillArguments(dev::eth::Instruction opcode, RandomCodeOp code += getPushCode(randUniIntGen() % 32); //memlen1 code += getPushCode(randUniIntGen() % 32); //memlen1 code += getPushCode(randUniIntGen()); //value - code += getPushCode(toString(options.getRandomAddress()));//address + code += getPushCode(toString(_options.getRandomAddress()));//address code += getPushCode(randUniIntGen()); //gaslimit break; default: @@ -171,15 +171,15 @@ RandomCodeOptions::RandomCodeOptions() : useUndefinedOpCodes(false), smartCodePr setWeights(); } -void RandomCodeOptions::setWeight(dev::eth::Instruction opCode, int weight) +void RandomCodeOptions::setWeight(dev::eth::Instruction _opCode, int _weight) { - mapWeights.at((int)opCode) = weight; + mapWeights.at((int)_opCode) = _weight; setWeights(); } -void RandomCodeOptions::addAddress(dev::Address address) +void RandomCodeOptions::addAddress(dev::Address const& _address) { - addressList.push_back(address); + addressList.push_back(_address); } dev::Address RandomCodeOptions::getRandomAddress() diff --git a/test/fuzzTesting/fuzzHelper.h b/test/fuzzTesting/fuzzHelper.h index 593f49328..7cdce54ac 100644 --- a/test/fuzzTesting/fuzzHelper.h +++ b/test/fuzzTesting/fuzzHelper.h @@ -45,8 +45,8 @@ struct RandomCodeOptions { public: RandomCodeOptions(); - void setWeight(dev::eth::Instruction opCode, int weight); - void addAddress(dev::Address address); + void setWeight(dev::eth::Instruction _opCode, int _weight); + void addAddress(dev::Address const& _address); dev::Address getRandomAddress(); bool useUndefinedOpCodes; @@ -68,19 +68,19 @@ class RandomCode { public: /// Generate random vm code - static std::string generate(int maxOpNumber = 1, RandomCodeOptions options = RandomCodeOptions()); + static std::string generate(int _maxOpNumber = 1, RandomCodeOptions _options = RandomCodeOptions()); /// Generate random byte string of a given length - static std::string rndByteSequence(int length = 1, SizeStrictness sizeType = SizeStrictness::Strict); + static std::string rndByteSequence(int _length = 1, SizeStrictness _sizeType = SizeStrictness::Strict); /// Generate random uniForm Int with reasonable value 0..0x7fffffff static std::string randomUniIntHex(); static int randomUniInt(); private: - static std::string fillArguments(dev::eth::Instruction opcode, RandomCodeOptions options); - static std::string getPushCode(int value); - static std::string getPushCode(std::string hex); + static std::string fillArguments(dev::eth::Instruction _opcode, RandomCodeOptions const& _options); + static std::string getPushCode(int _value); + static std::string getPushCode(std::string const& _hex); static void refreshSeed(); static boost::random::mt19937 gen; ///< Random generator From 3bcee73c84f9dc169adc5351e225e6996d043d51 Mon Sep 17 00:00:00 2001 From: Dimitry Date: Mon, 1 Jun 2015 14:07:31 +0300 Subject: [PATCH 435/461] Random Code: build issues --- test/fuzzTesting/fuzzHelper.cpp | 6 +++--- test/fuzzTesting/fuzzHelper.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/test/fuzzTesting/fuzzHelper.cpp b/test/fuzzTesting/fuzzHelper.cpp index 7d7896947..3b6cf19c9 100644 --- a/test/fuzzTesting/fuzzHelper.cpp +++ b/test/fuzzTesting/fuzzHelper.cpp @@ -40,11 +40,11 @@ boostIntGenerator RandomCode::randOpCodeGen = boostIntGenerator(gen, opCodeDist) boostIntGenerator RandomCode::randOpLengGen = boostIntGenerator(gen, opLengDist); boostIntGenerator RandomCode::randUniIntGen = boostIntGenerator(gen, uniIntDist); -std::string RandomCode::rndByteSequence(int _length, SizeStrictness sizeType) +std::string RandomCode::rndByteSequence(int _length, SizeStrictness _sizeType) { refreshSeed(); std::string hash; - _length = (sizeType == SizeStrictness::Strict) ? std::max(1, _length) : randomUniInt() % _length; + _length = (_sizeType == SizeStrictness::Strict) ? std::max(1, _length) : randomUniInt() % _length; for (auto i = 0; i < _length; i++) { uint8_t byte = randOpCodeGen(); @@ -182,7 +182,7 @@ void RandomCodeOptions::addAddress(dev::Address const& _address) addressList.push_back(_address); } -dev::Address RandomCodeOptions::getRandomAddress() +dev::Address RandomCodeOptions::getRandomAddress() const { if (addressList.size() > 0) { diff --git a/test/fuzzTesting/fuzzHelper.h b/test/fuzzTesting/fuzzHelper.h index 7cdce54ac..371e40fbf 100644 --- a/test/fuzzTesting/fuzzHelper.h +++ b/test/fuzzTesting/fuzzHelper.h @@ -47,7 +47,7 @@ public: RandomCodeOptions(); void setWeight(dev::eth::Instruction _opCode, int _weight); void addAddress(dev::Address const& _address); - dev::Address getRandomAddress(); + dev::Address getRandomAddress() const; bool useUndefinedOpCodes; int smartCodeProbability; From b81ae7d4708f088f44f04eb5c7a5eca003aba404 Mon Sep 17 00:00:00 2001 From: chriseth Date: Mon, 1 Jun 2015 18:30:05 +0200 Subject: [PATCH 436/461] Do not put duplicate labels for accessor functions. --- libsolidity/Compiler.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/libsolidity/Compiler.cpp b/libsolidity/Compiler.cpp index 93d786bed..6425367dd 100644 --- a/libsolidity/Compiler.cpp +++ b/libsolidity/Compiler.cpp @@ -288,7 +288,6 @@ bool Compiler::visit(VariableDeclaration const& _variableDeclaration) m_breakTags.clear(); m_continueTags.clear(); - m_context << m_context.getFunctionEntryLabel(_variableDeclaration); ExpressionCompiler(m_context, m_optimize).appendStateVariableAccessor(_variableDeclaration); return false; From 06f5bfc2cff3ebf66094854f3fc0ffd94859ec7f Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Mon, 1 Jun 2015 16:51:48 +0200 Subject: [PATCH 437/461] add ambiguous push test --- .../vmPushDupSwapTestFiller.json | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/test/libevm/VMTestsFiller/vmPushDupSwapTestFiller.json b/test/libevm/VMTestsFiller/vmPushDupSwapTestFiller.json index f1c9c676c..00253eabd 100644 --- a/test/libevm/VMTestsFiller/vmPushDupSwapTestFiller.json +++ b/test/libevm/VMTestsFiller/vmPushDupSwapTestFiller.json @@ -2446,5 +2446,64 @@ "gasPrice" : "100000000000000", "gas" : "100000" } + }, + + + "push32Undefined": { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "1000000", + "currentDifficulty" : "256", + "currentTimestamp" : "1", + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "pre" : { + "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "100000000000000000000000", + "nonce" : "0", + "code" : "0x7f010203600055", + "storage": {} + } + }, + "exec" : { + "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681", + "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "1000000000000000000", + "data" : "", + "gasPrice" : "100000000000000", + "gas" : "100000" + } + }, + + "push32Undefined2": { + "env" : { + "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", + "currentNumber" : "0", + "currentGasLimit" : "1000000", + "currentDifficulty" : "256", + "currentTimestamp" : "1", + "currentCoinbase" : "2adc25665018aa1fe0e6bc666dac8fc2697ff9ba" + }, + "pre" : { + "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6" : { + "balance" : "100000000000000000000000", + "nonce" : "0", + "code" : "0x7f0102030000000000000000000000000000000000000000000000000000000000600055", + "storage": {} + } + }, + "exec" : { + "address" : "0f572e5295c57f15886f9b263e2f6d2d6c7b5ec6", + "origin" : "cd1722f3947def4cf144679da39c4c32bdc35681", + "caller" : "cd1722f3947def4cf144679da39c4c32bdc35681", + "value" : "1000000000000000000", + "data" : "", + "gasPrice" : "100000000000000", + "gas" : "100000" + } } + + } From 76868a89edc476065329b5fe52bcb667bcc3e94e Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Mon, 1 Jun 2015 16:57:53 +0200 Subject: [PATCH 438/461] add debug info for BlockQueueStatus --- libethereum/BlockQueue.cpp | 12 ++++++++++++ libethereum/BlockQueue.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/libethereum/BlockQueue.cpp b/libethereum/BlockQueue.cpp index c2bd35afc..013d8a000 100644 --- a/libethereum/BlockQueue.cpp +++ b/libethereum/BlockQueue.cpp @@ -418,3 +418,15 @@ void BlockQueue::retryAllUnknown() m_unknown.clear(); m_moreToVerify.notify_all(); } + +std::ostream& dev::eth::operator<<(std::ostream& _out, BlockQueueStatus const& _bqs) +{ + _out << "verified: " << _bqs.verified << endl; + _out << "verifying: " << _bqs.verifying << endl; + _out << "unverified: " << _bqs.unverified << endl; + _out << "future: " << _bqs.future << endl; + _out << "unknown: " << _bqs.unknown << endl; + _out << "bad: " << _bqs.bad << endl; + + return _out; +} diff --git a/libethereum/BlockQueue.h b/libethereum/BlockQueue.h index d0437739d..45043559b 100644 --- a/libethereum/BlockQueue.h +++ b/libethereum/BlockQueue.h @@ -136,5 +136,7 @@ private: bool m_deleting = false; ///< Exit condition for verifiers. }; +std::ostream& operator<<(std::ostream& _out, BlockQueueStatus const& _s); + } } From 30b531d0ad0442b890d8222d9e1e837fe5bb3084 Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Mon, 1 Jun 2015 16:59:06 +0200 Subject: [PATCH 439/461] fix block chain tests creation --- test/libethereum/blockchain.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/libethereum/blockchain.cpp b/test/libethereum/blockchain.cpp index 0ff7e57f3..72cbc51dc 100644 --- a/test/libethereum/blockchain.cpp +++ b/test/libethereum/blockchain.cpp @@ -168,6 +168,8 @@ void doBlockchainTests(json_spirit::mValue& _v, bool _fillin) { uncleBlockQueue.import(&uncle.out(), bc); uncleBlockQueueList.push_back(uncle.out()); + // wait until block is verified + this_thread::sleep_for(chrono::seconds(1)); } catch(...) { From fddc206d849bfb5ab9a9a4503252910d190b3a5b Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Tue, 2 Jun 2015 09:34:27 +0200 Subject: [PATCH 440/461] add EqualUncleInTwoDifferentBlocks test Conflicts: test/libethereum/blockchain.cpp --- .../BlockTestsFiller/bcUncleTestFiller.json | 123 ++++++++++++++++++ test/libethereum/blockchain.cpp | 67 ++++++---- 2 files changed, 166 insertions(+), 24 deletions(-) diff --git a/test/libethereum/BlockTestsFiller/bcUncleTestFiller.json b/test/libethereum/BlockTestsFiller/bcUncleTestFiller.json index 761bce316..1d4d7e186 100644 --- a/test/libethereum/BlockTestsFiller/bcUncleTestFiller.json +++ b/test/libethereum/BlockTestsFiller/bcUncleTestFiller.json @@ -151,6 +151,10 @@ ] }, { + "blockHeader" : { + "bruncle" : "1" + }, + "transactions" : [ { "data" : "", @@ -2562,5 +2566,124 @@ ] } ] + }, + + "EqualUncleInTwoDifferentBlocks" : { + "genesisBlockHeader" : { + "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "coinbase" : "0x8888f1f195afa192cfee860698584c030f4c9db1", + "difficulty" : "131072", + "extraData" : "0x42", + "gasLimit" : "3141592", + "gasUsed" : "0", + "number" : "0", + "parentHash" : "0x0000000000000000000000000000000000000000000000000000000000000000", + "receiptTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "stateRoot" : "0xf99eb1626cfa6db435c0836235942d7ccaa935f1ae247d3f1c21e495685f903a", + "timestamp" : "0x54c98c81", + "mixHash" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "nonce" : "0x0102030405060708", + "transactionsTrie" : "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "uncleHash" : "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + }, + "expect" : { + "095e7baea6a6c7c4c2dfeb977efac326af552d87" : { + "balance" : "20" + }, + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "nonce" : "2" + } + }, + "pre" : { + "a94f5374fce5edbc8e2a8697c15331677e6ebf0b" : { + "balance" : "10000000000000", + "nonce" : "0", + "code" : "", + "storage": {} + } + }, + "blocks" : [ + { + "transactions" : [ + { + "data" : "", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "0", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "1", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "10" + } + ], + "uncleHeaders" : [ + ] + }, + { + "transactions" : [ + { + "data" : "", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "2", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "10" + } + ], + "uncleHeaders" : [ + { + "bloom" : "00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000", + "coinbase" : "bcde5374fce5edbc8e2a8697c15331677e6ebf0b", + "difficulty" : "131072", + "extraData" : "0x", + "gasLimit" : "3141592", + "gasUsed" : "0", + "hash" : "9de9879b6a81d1b6c4993c63c90a3c9d1e775f14572694778e828bc64972ae04", + "mixHash" : "b557f905d29ed0fca99d65d0adcce698dee97cf72a13c7cd8d7a7826b8eee770", + "nonce" : "18a524c1790fa83b", + "number" : "2", + "parentHash" : "6134fc6b5d99ee03c4aab1592640f6f9dcbc850668d75d631aee34989b938fae", + "receiptTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "stateRoot" : "ff640b30d613c35dad43e3693329e1b1ee6350f989cf46a288025a1cbfdab9cd", + "timestamp" : "0x54c98c82", + "transactionsTrie" : "56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421", + "uncleHash" : "1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347" + } + ] + }, + { + "transactions" : [ + { + "data" : "", + "gasLimit" : "314159", + "gasPrice" : "1", + "nonce" : "2", + "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", + "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", + "value" : "10" + } + ], + "uncleHeaders" : [ + { + "sameAsPreviousBlockUncle" : "3" + } + ] + } + ] } } diff --git a/test/libethereum/blockchain.cpp b/test/libethereum/blockchain.cpp index 72cbc51dc..91234605a 100644 --- a/test/libethereum/blockchain.cpp +++ b/test/libethereum/blockchain.cpp @@ -33,6 +33,9 @@ using namespace dev::eth; namespace dev { namespace test { +typedef std::vector uncleList; +typedef std::pair blockSet; + BlockInfo constructBlock(mObject& _o); bytes createBlockRLPFromFields(mObject& _tObj); RLPStream createFullBlockFromHeader(BlockInfo const& _bi, bytes const& _txs = RLPEmptyList, bytes const& _uncles = RLPEmptyList); @@ -42,7 +45,7 @@ mObject writeBlockHeaderToJson(mObject& _o, BlockInfo const& _bi); void overwriteBlockHeader(BlockInfo& _current_BlockHeader, mObject& _blObj); BlockInfo constructBlock(mObject& _o); void updatePoW(BlockInfo& _bi); -mArray importUncles(mObject const& blObj, vector& vBiUncles, vector const& vBiBlocks); +mArray importUncles(mObject const& _blObj, vector& _vBiUncles, vector const& _vBiBlocks, std::vector _blockSet); void doBlockchainTests(json_spirit::mValue& _v, bool _fillin) { @@ -65,8 +68,6 @@ void doBlockchainTests(json_spirit::mValue& _v, bool _fillin) State trueState(OverlayDB(State::openDB(td_stateDB_tmp.path())), BaseState::Empty, biGenesisBlock.coinbaseAddress); //Imported blocks from the start - typedef std::vector uncleList; - typedef std::pair blockSet; std::vector blockSets; importer.importState(o["pre"].get_obj(), trueState); @@ -138,7 +139,6 @@ void doBlockchainTests(json_spirit::mValue& _v, bool _fillin) bc.sync(uncleQueue, state.db(), 4); bc.attemptImport(block, state.db()); vBiBlocks.push_back(BlockInfo(block)); - state.sync(bc); } @@ -156,7 +156,7 @@ void doBlockchainTests(json_spirit::mValue& _v, bool _fillin) //get uncles vector vBiUncles; - blObj["uncleHeaders"] = importUncles(blObj, vBiUncles, vBiBlocks); + blObj["uncleHeaders"] = importUncles(blObj, vBiUncles, vBiBlocks, blockSets); BlockQueue uncleBlockQueue; uncleList uncleBlockQueueList; @@ -176,7 +176,6 @@ void doBlockchainTests(json_spirit::mValue& _v, bool _fillin) cnote << "error in importing uncle! This produces an invalid block (May be by purpose for testing)."; } } - bc.sync(uncleBlockQueue, state.db(), 4); state.commitToMine(bc); @@ -216,6 +215,12 @@ void doBlockchainTests(json_spirit::mValue& _v, bool _fillin) uncleStream.appendRaw(uncleRlp.out()); } + if (blObj.count("blockHeader")) + overwriteBlockHeader(current_BlockHeader, blObj); + + if (blObj.count("blockHeader") && blObj["blockHeader"].get_obj().count("bruncle")) + current_BlockHeader.populateFromParent(vBiBlocks[vBiBlocks.size() -1]); + if (vBiUncles.size()) { // update unclehash in case of invalid uncles @@ -223,9 +228,6 @@ void doBlockchainTests(json_spirit::mValue& _v, bool _fillin) updatePoW(current_BlockHeader); } - if (blObj.count("blockHeader")) - overwriteBlockHeader(current_BlockHeader, blObj); - // write block header mObject oBlockHeader; writeBlockHeaderToJson(oBlockHeader, current_BlockHeader); @@ -496,36 +498,48 @@ void doBlockchainTests(json_spirit::mValue& _v, bool _fillin) // helping functions -mArray importUncles(mObject const& blObj, vector& vBiUncles, vector const& vBiBlocks) +mArray importUncles(mObject const& _blObj, vector& _vBiUncles, vector const& _vBiBlocks, std::vector _blockSet) { // write uncle list mArray aUncleList; mObject uncleHeaderObj_pre; - for (auto const& uHObj: blObj.at("uncleHeaders").get_array()) + for (auto const& uHObj: _blObj.at("uncleHeaders").get_array()) { mObject uncleHeaderObj = uHObj.get_obj(); if (uncleHeaderObj.count("sameAsPreviousSibling")) { - writeBlockHeaderToJson(uncleHeaderObj_pre, vBiUncles[vBiUncles.size()-1]); + writeBlockHeaderToJson(uncleHeaderObj_pre, _vBiUncles[_vBiUncles.size()-1]); aUncleList.push_back(uncleHeaderObj_pre); - vBiUncles.push_back(vBiUncles[vBiUncles.size()-1]); + _vBiUncles.push_back(_vBiUncles[_vBiUncles.size()-1]); uncleHeaderObj_pre = uncleHeaderObj; continue; } if (uncleHeaderObj.count("sameAsBlock")) { - size_t number = (size_t)toInt(uncleHeaderObj["sameAsBlock"]); uncleHeaderObj.erase("sameAsBlock"); - BlockInfo currentUncle = vBiBlocks[number]; + BlockInfo currentUncle = _vBiBlocks[number]; writeBlockHeaderToJson(uncleHeaderObj, currentUncle); aUncleList.push_back(uncleHeaderObj); - vBiUncles.push_back(currentUncle); + _vBiUncles.push_back(currentUncle); uncleHeaderObj_pre = uncleHeaderObj; continue; } + + if (uncleHeaderObj.count("sameAsPreviousBlockUncle")) + { + bytes uncleRLP = _blockSet[(size_t)toInt(uncleHeaderObj["sameAsPreviousBlockUncle"])].second[0]; + BlockInfo uncleHeader(uncleRLP); + writeBlockHeaderToJson(uncleHeaderObj, uncleHeader); + aUncleList.push_back(uncleHeaderObj); + + _vBiUncles.push_back(uncleHeader); + uncleHeaderObj_pre = uncleHeaderObj; + continue; + } + string overwrite = "false"; if (uncleHeaderObj.count("overwriteAndRedoPoW")) { @@ -538,12 +552,12 @@ mArray importUncles(mObject const& blObj, vector& vBiUncles, vector& vBiUncles, vector Date: Mon, 1 Jun 2015 21:48:06 +0200 Subject: [PATCH 441/461] fix bruncle test --- test/libethereum/BlockTestsFiller/bcUncleTestFiller.json | 9 --------- 1 file changed, 9 deletions(-) diff --git a/test/libethereum/BlockTestsFiller/bcUncleTestFiller.json b/test/libethereum/BlockTestsFiller/bcUncleTestFiller.json index 1d4d7e186..76f0f0d46 100644 --- a/test/libethereum/BlockTestsFiller/bcUncleTestFiller.json +++ b/test/libethereum/BlockTestsFiller/bcUncleTestFiller.json @@ -156,15 +156,6 @@ }, "transactions" : [ - { - "data" : "", - "gasLimit" : "314159", - "gasPrice" : "1", - "nonce" : "2", - "secretKey" : "45a915e4d060149eb4365960e6a7a45f334393093061116b197e3240065ff2d8", - "to" : "095e7baea6a6c7c4c2dfeb977efac326af552d87", - "value" : "10" - } ], "uncleHeaders" : [ { From 6f9e7ef3c88446729813b566184514098f2ccd05 Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Mon, 1 Jun 2015 22:27:24 +0200 Subject: [PATCH 442/461] style --- test/libevm/VMTestsFiller/vmPushDupSwapTestFiller.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/test/libevm/VMTestsFiller/vmPushDupSwapTestFiller.json b/test/libevm/VMTestsFiller/vmPushDupSwapTestFiller.json index 00253eabd..1316dfb70 100644 --- a/test/libevm/VMTestsFiller/vmPushDupSwapTestFiller.json +++ b/test/libevm/VMTestsFiller/vmPushDupSwapTestFiller.json @@ -2448,7 +2448,6 @@ } }, - "push32Undefined": { "env" : { "previousHash" : "5e20a0453cecd065ea59c37ac63e079ee08998b6045136a8ce6635c7912ec0b6", @@ -2504,6 +2503,4 @@ "gas" : "100000" } } - - } From a67d783379256d94bcb1bfbc56c2e89bf40667a2 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Tue, 2 Jun 2015 15:44:13 +0800 Subject: [PATCH 443/461] Code cleanup. --- libp2p/UDP.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libp2p/UDP.h b/libp2p/UDP.h index b032c9e73..ce2a570b2 100644 --- a/libp2p/UDP.h +++ b/libp2p/UDP.h @@ -115,7 +115,7 @@ class UDPSocket: UDPSocketFace, public std::enable_shared_from_this::disconnectWithError(boost::system::err } } -} \ No newline at end of file +} From 81a7f463851e308e9427959c8d6f40b00b8c75aa Mon Sep 17 00:00:00 2001 From: CJentzsch Date: Tue, 2 Jun 2015 10:13:12 +0200 Subject: [PATCH 444/461] forbid uncle to be your brother --- libethcore/Exceptions.h | 15 ++++++++------- libethereum/State.cpp | 8 ++++++++ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/libethcore/Exceptions.h b/libethcore/Exceptions.h index 8b73c96fe..9362e4fed 100644 --- a/libethcore/Exceptions.h +++ b/libethcore/Exceptions.h @@ -49,27 +49,28 @@ struct FeeTooSmall: virtual dev::Exception {}; struct TooMuchGasUsed: virtual dev::Exception {}; struct ExtraDataTooBig: virtual dev::Exception {}; struct InvalidSignature: virtual dev::Exception {}; -class InvalidBlockFormat: virtual public dev::Exception {}; +struct InvalidBlockFormat: virtual dev::Exception {}; struct InvalidUnclesHash: virtual dev::Exception {}; struct InvalidUncle: virtual dev::Exception {}; struct TooManyUncles: virtual dev::Exception {}; struct UncleTooOld: virtual dev::Exception {}; -class UncleInChain: virtual public dev::Exception {}; +struct UncleIsBrother: virtual dev::Exception {}; +struct UncleInChain: virtual dev::Exception {}; struct DuplicateUncleNonce: virtual dev::Exception {}; struct InvalidStateRoot: virtual dev::Exception {}; struct InvalidGasUsed: virtual dev::Exception {}; -class InvalidTransactionsHash: virtual public dev::Exception {}; +struct InvalidTransactionsHash: virtual dev::Exception {}; struct InvalidTransaction: virtual dev::Exception {}; struct InvalidDifficulty: virtual dev::Exception {}; -class InvalidGasLimit: virtual public dev::Exception {}; +struct InvalidGasLimit: virtual dev::Exception {}; struct InvalidTransactionGasUsed: virtual dev::Exception {}; struct InvalidTransactionsStateRoot: virtual dev::Exception {}; struct InvalidReceiptsStateRoot: virtual dev::Exception {}; struct InvalidTimestamp: virtual dev::Exception {}; struct InvalidLogBloom: virtual dev::Exception {}; -class InvalidNonce: virtual public dev::Exception {}; -class InvalidBlockHeaderItemCount: virtual public dev::Exception {}; -class InvalidBlockNonce: virtual public dev::Exception {}; +struct InvalidNonce: virtual dev::Exception {}; +struct InvalidBlockHeaderItemCount: virtual dev::Exception {}; +struct InvalidBlockNonce: virtual dev::Exception {}; struct InvalidParentHash: virtual dev::Exception {}; struct InvalidNumber: virtual dev::Exception {}; struct InvalidContractAddress: virtual public dev::Exception {}; diff --git a/libethereum/State.cpp b/libethereum/State.cpp index b35ef98ce..09765d9ee 100644 --- a/libethereum/State.cpp +++ b/libethereum/State.cpp @@ -726,6 +726,14 @@ u256 State::enact(bytesConstRef _block, BlockChain const& _bc, ImportRequirement cwarn << " Block number: " << m_currentBlock.number; BOOST_THROW_EXCEPTION(UncleTooOld()); } + else if (uncle.number == m_currentBlock.number) + { + badBlock(_block, "Uncle is brother"); + cwarn << " Uncle number: " << uncle.number; + cwarn << " Uncle parent number: " << uncleParent.number; + cwarn << " Block number: " << m_currentBlock.number; + BOOST_THROW_EXCEPTION(UncleIsBrother()); + } uncle.verifyParent(uncleParent); // tdIncrease += uncle.difficulty; From 9ad3cdfcb5f4fc843216e093b4021c5621abc461 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Tue, 2 Jun 2015 11:33:34 +0200 Subject: [PATCH 445/461] Boost mutiprecision number comparison bug workaround 2 I add fixed version of boost/multiprecision/detail/number_compare.hpp to sources. It is injected with #included if buggy version of boost detected. --- libdevcore/Common.h | 18 +- ...recision_number_compare_bug_workaround.hpp | 520 ++++++++++++++++++ 2 files changed, 524 insertions(+), 14 deletions(-) create mode 100644 libdevcore/boost_multiprecision_number_compare_bug_workaround.hpp diff --git a/libdevcore/Common.h b/libdevcore/Common.h index 346bb53cf..453c17e6f 100644 --- a/libdevcore/Common.h +++ b/libdevcore/Common.h @@ -45,6 +45,10 @@ #pragma warning(push) #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wunused-parameter" +#include +#if (BOOST_VERSION == 105800) + #include "boost_multiprecision_number_compare_bug_workaround.hpp" +#endif #include #pragma warning(pop) #pragma GCC diagnostic pop @@ -85,20 +89,6 @@ using u160s = std::vector; using u256Set = std::set; using u160Set = std::set; -// Workaround for mixed type big int comparison bug introduced in boost 1.58 -// https://svn.boost.org/trac/boost/ticket/11328 -#define ETH_BIGINT_WRONG_COMPARISON_WORKAROUND(_OP) \ - template auto operator _OP (_T const& a, _U const& b) -> typename std::enable_if::value && std::is_same<_U, bigint>::value, bool>::type { return (bigint)a _OP b; } \ - template auto operator _OP (_U const& a, _T const& b) -> typename std::enable_if::value && std::is_same<_U, bigint>::value, bool>::type { return a _OP (bigint)b; } - -ETH_BIGINT_WRONG_COMPARISON_WORKAROUND(==) -ETH_BIGINT_WRONG_COMPARISON_WORKAROUND(!=) -ETH_BIGINT_WRONG_COMPARISON_WORKAROUND(>=) -ETH_BIGINT_WRONG_COMPARISON_WORKAROUND(<=) -ETH_BIGINT_WRONG_COMPARISON_WORKAROUND(<) -ETH_BIGINT_WRONG_COMPARISON_WORKAROUND(>) - - extern const u256 UndefinedU256; // Map types. diff --git a/libdevcore/boost_multiprecision_number_compare_bug_workaround.hpp b/libdevcore/boost_multiprecision_number_compare_bug_workaround.hpp new file mode 100644 index 000000000..dae591dfb --- /dev/null +++ b/libdevcore/boost_multiprecision_number_compare_bug_workaround.hpp @@ -0,0 +1,520 @@ + +// This is a copy of boost/multiprecision/detail/number_compare.hpp from boost 1.59 to replace buggy version from 1.58. + +#ifdef BOOST_MP_COMPARE_HPP +#error This bug workaround header must be included before original boost/multiprecision/detail/number_compare.hpp +#endif + +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2012 John Maddock. Distributed under the Boost +// Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + +#ifndef BOOST_MP_COMPARE_HPP +#define BOOST_MP_COMPARE_HPP + +// A copy of boost/multiprecision/traits/is_backend.hpp +#ifndef BOOST_MP_IS_BACKEND_HPP +#define BOOST_MP_IS_BACKEND_HPP + +#include +#include +#include +#include +#include + +namespace boost{ namespace multiprecision{ namespace detail{ + + BOOST_MPL_HAS_XXX_TRAIT_DEF(signed_types) + BOOST_MPL_HAS_XXX_TRAIT_DEF(unsigned_types) + BOOST_MPL_HAS_XXX_TRAIT_DEF(float_types) + + template + struct is_backend + { + static const bool value = has_signed_types::value && has_unsigned_types::value && has_float_types::value; + }; + + template + struct other_backend + { + typedef typename boost::conditional< + boost::is_same, number >::value, + number, number >::type type; + }; + + template + struct number_from_backend + { + typedef typename boost::conditional < + boost::is_convertible >::value, + number, + typename other_backend::type > ::type type; + }; + + template + struct is_first_backend_imp{ static const bool value = false; }; + template + struct is_first_backend_imp{ static const bool value = is_convertible >::value || is_convertible >::value; }; + + template + struct is_first_backend : is_first_backend_imp::value, T, U> {}; + + template + struct is_second_backend_imp{ static const bool value = false; }; + template + struct is_second_backend_imp{ static const bool value = is_convertible >::value || is_convertible >::value; }; + + template + struct is_second_backend : is_second_backend_imp::value, T, U> {}; + +} +} +} + +#endif // BOOST_MP_IS_BACKEND_HPP + +// +// Comparison operators for number. +// + +namespace boost{ namespace multiprecision{ + +namespace default_ops{ + +template +inline bool eval_eq(const B& a, const B& b) +{ + return a.compare(b) == 0; +} +template +inline typename enable_if_c::value, bool>::type eval_eq(const T& a, const U& b) +{ + typename boost::multiprecision::detail::number_from_backend::type t(b); + return eval_eq(a, t.backend()); +} +template +inline typename enable_if_c::value, bool>::type eval_eq(const T& a, const U& b) +{ + typename boost::multiprecision::detail::number_from_backend::type t(a); + return eval_eq(t.backend(), b); +} + +template +inline bool eval_lt(const B& a, const B& b) +{ + return a.compare(b) < 0; +} +template +inline typename enable_if_c::value, bool>::type eval_lt(const T& a, const U& b) +{ + typename boost::multiprecision::detail::number_from_backend::type t(b); + return eval_lt(a, t.backend()); +} +template +inline typename enable_if_c::value, bool>::type eval_lt(const T& a, const U& b) +{ + typename boost::multiprecision::detail::number_from_backend::type t(a); + return eval_lt(t.backend(), b); +} + +template +inline bool eval_gt(const B& a, const B& b) +{ + return a.compare(b) > 0; +} +template +inline typename enable_if_c::value, bool>::type eval_gt(const T& a, const U& b) +{ + typename boost::multiprecision::detail::number_from_backend::type t(b); + return eval_gt(a, t.backend()); +} +template +inline typename enable_if_c::value, bool>::type eval_gt(const T& a, const U& b) +{ + typename boost::multiprecision::detail::number_from_backend::type t(a); + return eval_gt(t.backend(), b); +} + +} // namespace default_ops + +namespace detail{ + +template +struct is_valid_mixed_compare : public mpl::false_ {}; + +template +struct is_valid_mixed_compare, Val> : public is_convertible > {}; + +template +struct is_valid_mixed_compare, number > : public mpl::false_ {}; + +template +struct is_valid_mixed_compare, expression > + : public mpl::bool_, number >::value> {}; + +template +struct is_valid_mixed_compare, number > + : public mpl::bool_, number >::value> {}; + +template +inline BOOST_CONSTEXPR typename boost::enable_if_c::value != number_kind_floating_point, bool>::type is_unordered_value(const number&) +{ + return false; +} +template +inline BOOST_CONSTEXPR typename boost::enable_if_c::value == number_kind_floating_point, bool>::type is_unordered_value(const number& a) +{ + using default_ops::eval_fpclassify; + return eval_fpclassify(a.backend()) == FP_NAN; +} + +template +inline BOOST_CONSTEXPR typename boost::enable_if_c::value != number_kind_floating_point, bool>::type is_unordered_value(const Arithmetic&) +{ + return false; +} +template +inline BOOST_CONSTEXPR typename boost::enable_if_c::value == number_kind_floating_point, bool>::type is_unordered_value(const Arithmetic& a) +{ + return (boost::math::isnan)(a); +} + +template +inline BOOST_CONSTEXPR bool is_unordered_comparison(const T& a, const U& b) +{ + return is_unordered_value(a) || is_unordered_value(b); +} + +} + +template +inline bool operator == (const number& a, const number& b) +{ + using default_ops::eval_eq; + if(detail::is_unordered_comparison(a, b)) return false; + return eval_eq(a.backend(), b.backend()); +} +template +inline typename enable_if_c, Arithmetic>::value, bool>::type + operator == (const number& a, const Arithmetic& b) +{ + using default_ops::eval_eq; + if(detail::is_unordered_comparison(a, b)) return false; + return eval_eq(a.backend(), number::canonical_value(b)); +} +template +inline typename enable_if_c, Arithmetic>::value, bool>::type + operator == (const Arithmetic& a, const number& b) +{ + using default_ops::eval_eq; + if(detail::is_unordered_comparison(a, b)) return false; + return eval_eq(b.backend(), number::canonical_value(a)); +} +template +inline typename enable_if_c::result_type, Arithmetic>::value, bool>::type + operator == (const Arithmetic& a, const detail::expression& b) +{ + typedef typename detail::expression::result_type result_type; + using default_ops::eval_eq; + result_type t(b); + if(detail::is_unordered_comparison(a, t)) return false; + return eval_eq(t.backend(), result_type::canonical_value(a)); +} +template +inline typename enable_if_c::result_type, Arithmetic>::value, bool>::type + operator == (const detail::expression& a, const Arithmetic& b) +{ + typedef typename detail::expression::result_type result_type; + using default_ops::eval_eq; + result_type t(a); + if(detail::is_unordered_comparison(t, b)) return false; + return eval_eq(t.backend(), result_type::canonical_value(b)); +} +template +inline typename enable_if::result_type, typename detail::expression::result_type>, bool>::type + operator == (const detail::expression& a, const detail::expression& b) +{ + using default_ops::eval_eq; + typename detail::expression::result_type t(a); + typename detail::expression::result_type t2(b); + if(detail::is_unordered_comparison(t, t2)) return false; + return eval_eq(t.backend(), t2.backend()); +} + +template +inline bool operator != (const number& a, const number& b) +{ + using default_ops::eval_eq; + if(detail::is_unordered_comparison(a, b)) return true; + return !eval_eq(a.backend(), b.backend()); +} +template +inline typename enable_if_c, Arithmetic>::value, bool>::type + operator != (const number& a, const Arithmetic& b) +{ + using default_ops::eval_eq; + if(detail::is_unordered_comparison(a, b)) return true; + return !eval_eq(a.backend(), number::canonical_value(b)); +} +template +inline typename enable_if_c, Arithmetic>::value, bool>::type + operator != (const Arithmetic& a, const number& b) +{ + using default_ops::eval_eq; + if(detail::is_unordered_comparison(a, b)) return true; + return !eval_eq(b.backend(), number::canonical_value(a)); +} +template +inline typename enable_if_c::result_type, Arithmetic>::value, bool>::type + operator != (const Arithmetic& a, const detail::expression& b) +{ + typedef typename detail::expression::result_type result_type; + using default_ops::eval_eq; + result_type t(b); + if(detail::is_unordered_comparison(a, t)) return true; + return !eval_eq(t.backend(), result_type::canonical_value(a)); +} +template +inline typename enable_if_c::result_type, Arithmetic>::value, bool>::type + operator != (const detail::expression& a, const Arithmetic& b) +{ + typedef typename detail::expression::result_type result_type; + using default_ops::eval_eq; + result_type t(a); + if(detail::is_unordered_comparison(t, b)) return true; + return !eval_eq(t.backend(), result_type::canonical_value(b)); +} +template +inline typename enable_if::result_type, typename detail::expression::result_type>, bool>::type + operator != (const detail::expression& a, const detail::expression& b) +{ + using default_ops::eval_eq; + typename detail::expression::result_type t(a); + typename detail::expression::result_type t2(b); + if(detail::is_unordered_comparison(t, t2)) return true; + return !eval_eq(t.backend(), t2.backend()); +} + +template +inline bool operator < (const number& a, const number& b) +{ + using default_ops::eval_lt; + if(detail::is_unordered_comparison(a, b)) return false; + return eval_lt(a.backend(), b.backend()); +} +template +inline typename enable_if_c, Arithmetic>::value, bool>::type + operator < (const number& a, const Arithmetic& b) +{ + using default_ops::eval_lt; + if(detail::is_unordered_comparison(a, b)) return false; + return eval_lt(a.backend(), number::canonical_value(b)); +} +template +inline typename enable_if_c, Arithmetic>::value, bool>::type + operator < (const Arithmetic& a, const number& b) +{ + using default_ops::eval_gt; + if(detail::is_unordered_comparison(a, b)) return false; + return eval_gt(b.backend(), number::canonical_value(a)); +} +template +inline typename enable_if_c::result_type, Arithmetic>::value, bool>::type + operator < (const Arithmetic& a, const detail::expression& b) +{ + typedef typename detail::expression::result_type result_type; + using default_ops::eval_gt; + result_type t(b); + if(detail::is_unordered_comparison(a, t)) return false; + return eval_gt(t.backend(), result_type::canonical_value(a)); +} +template +inline typename enable_if_c::result_type, Arithmetic>::value, bool>::type + operator < (const detail::expression& a, const Arithmetic& b) +{ + typedef typename detail::expression::result_type result_type; + using default_ops::eval_lt; + result_type t(a); + if(detail::is_unordered_comparison(t, b)) return false; + return eval_lt(t.backend(), result_type::canonical_value(b)); +} +template +inline typename enable_if::result_type, typename detail::expression::result_type>, bool>::type + operator < (const detail::expression& a, const detail::expression& b) +{ + using default_ops::eval_lt; + typename detail::expression::result_type t(a); + typename detail::expression::result_type t2(b); + if(detail::is_unordered_comparison(t, t2)) return false; + return eval_lt(t.backend(), t2.backend()); +} + +template +inline bool operator > (const number& a, const number& b) +{ + using default_ops::eval_gt; + if(detail::is_unordered_comparison(a, b)) return false; + return eval_gt(a.backend(), b.backend()); +} +template +inline typename enable_if_c, Arithmetic>::value, bool>::type + operator > (const number& a, const Arithmetic& b) +{ + using default_ops::eval_gt; + if(detail::is_unordered_comparison(a, b)) return false; + return eval_gt(a.backend(), number::canonical_value(b)); +} +template +inline typename enable_if_c, Arithmetic>::value, bool>::type + operator > (const Arithmetic& a, const number& b) +{ + using default_ops::eval_lt; + if(detail::is_unordered_comparison(a, b)) return false; + return eval_lt(b.backend(), number::canonical_value(a)); +} +template +inline typename enable_if_c::result_type, Arithmetic>::value, bool>::type + operator > (const Arithmetic& a, const detail::expression& b) +{ + typedef typename detail::expression::result_type result_type; + using default_ops::eval_lt; + result_type t(b); + if(detail::is_unordered_comparison(a, t)) return false; + return a > t; +} +template +inline typename enable_if_c::result_type, Arithmetic>::value, bool>::type + operator > (const detail::expression& a, const Arithmetic& b) +{ + typedef typename detail::expression::result_type result_type; + using default_ops::eval_gt; + result_type t(a); + if(detail::is_unordered_comparison(t, b)) return false; + return t > b; +} +template +inline typename enable_if::result_type, typename detail::expression::result_type>, bool>::type + operator > (const detail::expression& a, const detail::expression& b) +{ + using default_ops::eval_gt; + typename detail::expression::result_type t(a); + typename detail::expression::result_type t2(b); + if(detail::is_unordered_comparison(t, t2)) return false; + return t > t2; +} + +template +inline bool operator <= (const number& a, const number& b) +{ + using default_ops::eval_gt; + if(detail::is_unordered_comparison(a, b)) return false; + return !eval_gt(a.backend(), b.backend()); +} +template +inline typename enable_if_c, Arithmetic>::value, bool>::type + operator <= (const number& a, const Arithmetic& b) +{ + using default_ops::eval_gt; + if(detail::is_unordered_comparison(a, b)) return false; + return !eval_gt(a.backend(), number::canonical_value(b)); +} +template +inline typename enable_if_c, Arithmetic>::value, bool>::type + operator <= (const Arithmetic& a, const number& b) +{ + using default_ops::eval_lt; + if(detail::is_unordered_comparison(a, b)) return false; + return !eval_lt(b.backend(), number::canonical_value(a)); +} +template +inline typename enable_if_c::result_type, Arithmetic>::value, bool>::type + operator <= (const Arithmetic& a, const detail::expression& b) +{ + typedef typename detail::expression::result_type result_type; + using default_ops::eval_lt; + if(detail::is_unordered_value(a) || detail::is_unordered_value(b)) + return false; + result_type t(b); + if(detail::is_unordered_comparison(a, t)) return false; + return !eval_lt(t.backend(), result_type::canonical_value(a)); +} +template +inline typename enable_if_c::result_type, Arithmetic>::value, bool>::type + operator <= (const detail::expression& a, const Arithmetic& b) +{ + typedef typename detail::expression::result_type result_type; + using default_ops::eval_gt; + result_type t(a); + if(detail::is_unordered_comparison(t, b)) return false; + return !eval_gt(t.backend(), result_type::canonical_value(b)); +} +template +inline typename enable_if::result_type, typename detail::expression::result_type>, bool>::type + operator <= (const detail::expression& a, const detail::expression& b) +{ + using default_ops::eval_gt; + typename detail::expression::result_type t(a); + typename detail::expression::result_type t2(b); + if(detail::is_unordered_comparison(t, t2)) return false; + return !eval_gt(t.backend(), t2.backend()); +} + +template +inline bool operator >= (const number& a, const number& b) +{ + using default_ops::eval_lt; + if(detail::is_unordered_comparison(a, b)) return false; + return !eval_lt(a.backend(), b.backend()); +} +template +inline typename enable_if_c, Arithmetic>::value, bool>::type + operator >= (const number& a, const Arithmetic& b) +{ + using default_ops::eval_lt; + if(detail::is_unordered_comparison(a, b)) return false; + return !eval_lt(a.backend(), number::canonical_value(b)); +} +template +inline typename enable_if_c, Arithmetic>::value, bool>::type + operator >= (const Arithmetic& a, const number& b) +{ + using default_ops::eval_gt; + if(detail::is_unordered_comparison(a, b)) return false; + return !eval_gt(b.backend(), number::canonical_value(a)); +} +template +inline typename enable_if_c::result_type, Arithmetic>::value, bool>::type + operator >= (const Arithmetic& a, const detail::expression& b) +{ + typedef typename detail::expression::result_type result_type; + using default_ops::eval_gt; + result_type t(b); + if(detail::is_unordered_comparison(a, t)) return false; + return !eval_gt(t.backend(), result_type::canonical_value(a)); +} +template +inline typename enable_if_c::result_type, Arithmetic>::value, bool>::type + operator >= (const detail::expression& a, const Arithmetic& b) +{ + typedef typename detail::expression::result_type result_type; + using default_ops::eval_lt; + result_type t(a); + if(detail::is_unordered_comparison(t, b)) return false; + return !eval_lt(t.backend(), result_type::canonical_value(b)); +} +template +inline typename enable_if::result_type, typename detail::expression::result_type>, bool>::type + operator >= (const detail::expression& a, const detail::expression& b) +{ + using default_ops::eval_lt; + typename detail::expression::result_type t(a); + typename detail::expression::result_type t2(b); + if(detail::is_unordered_comparison(t, t2)) return false; + return !eval_lt(t.backend(), t2.backend()); +} + + +}} // namespaces + +#endif // BOOST_MP_COMPARE_HPP From 49d753b3027ddccb29358fa6bb280f6e8ad56c20 Mon Sep 17 00:00:00 2001 From: arkpar Date: Tue, 2 Jun 2015 12:37:45 +0200 Subject: [PATCH 446/461] fixed isSyncing usage --- libethereum/EthereumHost.cpp | 12 +++++------- libethereum/EthereumHost.h | 4 ++-- 2 files changed, 7 insertions(+), 9 deletions(-) diff --git a/libethereum/EthereumHost.cpp b/libethereum/EthereumHost.cpp index 899960c23..d90bf57e2 100644 --- a/libethereum/EthereumHost.cpp +++ b/libethereum/EthereumHost.cpp @@ -91,10 +91,7 @@ void EthereumHost::doWork() bool netChange = ensureInitialised(); auto h = m_chain.currentHash(); // If we've finished our initial sync (including getting all the blocks into the chain so as to reduce invalid transactions), start trading transactions & blocks - bool syncing = false; - DEV_GUARDED(x_sync) - syncing = isSyncing(); - if (syncing && m_chain.isKnown(m_latestBlockSent)) + if (isSyncing() && m_chain.isKnown(m_latestBlockSent)) { if (m_newTransactions) { @@ -444,7 +441,8 @@ void EthereumHost::onPeerBlocks(EthereumPeer* _peer, RLP const& _r) void EthereumHost::onPeerNewHashes(EthereumPeer* _peer, h256s const& _hashes) { - if (isSyncing()) + Guard l(x_sync); + if (isSyncingInternal()) { clog(NetMessageSummary) << "Ignoring new hashes since we're already downloading."; return; @@ -456,7 +454,7 @@ void EthereumHost::onPeerNewHashes(EthereumPeer* _peer, h256s const& _hashes) void EthereumHost::onPeerNewBlock(EthereumPeer* _peer, RLP const& _r) { Guard l(x_sync); - if (isSyncing()) + if (isSyncingInternal()) { clog(NetMessageSummary) << "Ignoring new blocks since we're already downloading."; return; @@ -619,7 +617,7 @@ bool EthereumHost::peerShouldGrabChain(EthereumPeer* _peer) const } } -bool EthereumHost::isSyncing() const +bool EthereumHost::isSyncingInternal() const { bool syncing = false; forEachPeer([&](EthereumPeer* _p) diff --git a/libethereum/EthereumHost.h b/libethereum/EthereumHost.h index f8fa79a15..ad18bccc7 100644 --- a/libethereum/EthereumHost.h +++ b/libethereum/EthereumHost.h @@ -70,8 +70,7 @@ public: void reset(); DownloadMan const& downloadMan() const { return m_man; } - bool isSyncing() const; - + bool isSyncing() const { Guard l(x_sync); return isSyncingInternal(); } bool isBanned(p2p::NodeId _id) const { return !!m_banned.count(_id); } void noteNewTransactions() { m_newTransactions = true; } @@ -93,6 +92,7 @@ private: std::pair>, std::vector>> randomSelection(unsigned _percent = 25, std::function const& _allow = [](EthereumPeer const*){ return true; }); void forEachPeerPtr(std::function)> const& _f) const; void forEachPeer(std::function const& _f) const; + bool isSyncingInternal() const; /// Sync with the BlockChain. It might contain one of our mined blocks, we might have new candidates from the network. void doWork(); From c95ddc044dd96edf23212aea7da1e0aa91cf9688 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Bylica?= Date: Tue, 2 Jun 2015 13:08:39 +0200 Subject: [PATCH 447/461] Style improvements --- alethzero/Debugger.cpp | 2 +- mix/MixClient.cpp | 16 ++++++++++++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/alethzero/Debugger.cpp b/alethzero/Debugger.cpp index 21ef3b711..fafa25b2e 100644 --- a/alethzero/Debugger.cpp +++ b/alethzero/Debugger.cpp @@ -104,7 +104,7 @@ bool DebugSession::populate(dev::eth::Executive& _executive, dev::eth::Transacti levels.push_back(&history.back()); else levels.resize(ext.depth); - history.append(WorldState({steps, ext.myAddress, vm.curPC(), inst, newMemSize, (u256)gas, lastHash, lastDataHash, vm.stack(), vm.memory(), gasCost, ext.state().storage(ext.myAddress), levels})); + history.append(WorldState({steps, ext.myAddress, vm.curPC(), inst, newMemSize, static_cast(gas), lastHash, lastDataHash, vm.stack(), vm.memory(), gasCost, ext.state().storage(ext.myAddress), levels})); }; _executive.go(onOp); _executive.finalize(); diff --git a/mix/MixClient.cpp b/mix/MixClient.cpp index b011e0cec..aa469d8a0 100644 --- a/mix/MixClient.cpp +++ b/mix/MixClient.cpp @@ -180,8 +180,20 @@ void MixClient::executeTransaction(Transaction const& _t, State& _state, bool _c else levels.resize(ext.depth); - machineStates.emplace_back(MachineState({steps, vm.curPC(), inst, newMemSize, (u256)gas, - vm.stack(), vm.memory(), gasCost, ext.state().storage(ext.myAddress), levels, codeIndex, dataIndex})); + machineStates.push_back(MachineState{ + steps, + vm.curPC(), + inst, + newMemSize, + static_cast(gas), + vm.stack(), + vm.memory(), + gasCost, + ext.state().storage(ext.myAddress), + std::move(levels), + codeIndex, + dataIndex + }); }; execution.go(onOp); From fdeadf93305f0eb9ceb303d6b221cc7980821ead Mon Sep 17 00:00:00 2001 From: arkpar Date: Tue, 2 Jun 2015 13:41:20 +0200 Subject: [PATCH 448/461] renamed isSyncingInternal --- libethereum/EthereumHost.cpp | 6 +++--- libethereum/EthereumHost.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libethereum/EthereumHost.cpp b/libethereum/EthereumHost.cpp index d90bf57e2..ddb6bdc52 100644 --- a/libethereum/EthereumHost.cpp +++ b/libethereum/EthereumHost.cpp @@ -442,7 +442,7 @@ void EthereumHost::onPeerBlocks(EthereumPeer* _peer, RLP const& _r) void EthereumHost::onPeerNewHashes(EthereumPeer* _peer, h256s const& _hashes) { Guard l(x_sync); - if (isSyncingInternal()) + if (isSyncing_UNSAFE()) { clog(NetMessageSummary) << "Ignoring new hashes since we're already downloading."; return; @@ -454,7 +454,7 @@ void EthereumHost::onPeerNewHashes(EthereumPeer* _peer, h256s const& _hashes) void EthereumHost::onPeerNewBlock(EthereumPeer* _peer, RLP const& _r) { Guard l(x_sync); - if (isSyncingInternal()) + if (isSyncing_UNSAFE()) { clog(NetMessageSummary) << "Ignoring new blocks since we're already downloading."; return; @@ -617,7 +617,7 @@ bool EthereumHost::peerShouldGrabChain(EthereumPeer* _peer) const } } -bool EthereumHost::isSyncingInternal() const +bool EthereumHost::isSyncing_UNSAFE() const { bool syncing = false; forEachPeer([&](EthereumPeer* _p) diff --git a/libethereum/EthereumHost.h b/libethereum/EthereumHost.h index ad18bccc7..a8ae6dd66 100644 --- a/libethereum/EthereumHost.h +++ b/libethereum/EthereumHost.h @@ -70,7 +70,7 @@ public: void reset(); DownloadMan const& downloadMan() const { return m_man; } - bool isSyncing() const { Guard l(x_sync); return isSyncingInternal(); } + bool isSyncing() const { Guard l(x_sync); return isSyncing_UNSAFE(); } bool isBanned(p2p::NodeId _id) const { return !!m_banned.count(_id); } void noteNewTransactions() { m_newTransactions = true; } @@ -92,7 +92,7 @@ private: std::pair>, std::vector>> randomSelection(unsigned _percent = 25, std::function const& _allow = [](EthereumPeer const*){ return true; }); void forEachPeerPtr(std::function)> const& _f) const; void forEachPeer(std::function const& _f) const; - bool isSyncingInternal() const; + bool isSyncing_UNSAFE() const; /// Sync with the BlockChain. It might contain one of our mined blocks, we might have new candidates from the network. void doWork(); From d3b42295ee1e6bb079ae70993eb1deb2bb5c76cd Mon Sep 17 00:00:00 2001 From: arkpar Date: Tue, 2 Jun 2015 13:47:36 +0200 Subject: [PATCH 449/461] comments for isSyncing --- libethereum/EthereumHost.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libethereum/EthereumHost.cpp b/libethereum/EthereumHost.cpp index ddb6bdc52..564e37315 100644 --- a/libethereum/EthereumHost.cpp +++ b/libethereum/EthereumHost.cpp @@ -619,6 +619,8 @@ bool EthereumHost::peerShouldGrabChain(EthereumPeer* _peer) const bool EthereumHost::isSyncing_UNSAFE() const { + /// We need actual peer information here to handle the case when we are the first ever peer on the network to mine. + /// I.e. on a new private network the first node mining has noone to sync with and should start block propogation immediately. bool syncing = false; forEachPeer([&](EthereumPeer* _p) { From 86447d4a40ba86a1c8961515c7f70bde3b7163e3 Mon Sep 17 00:00:00 2001 From: yann300 Date: Tue, 2 Jun 2015 14:00:48 +0200 Subject: [PATCH 450/461] bug fix: #2020 --- mix/QBigInt.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mix/QBigInt.cpp b/mix/QBigInt.cpp index ee29cea43..7d7dd3857 100644 --- a/mix/QBigInt.cpp +++ b/mix/QBigInt.cpp @@ -65,7 +65,9 @@ QVariantMap QBigInt::checkAgainst(QString const& _type) const QString capacity = type.replace("uint", "").replace("int", ""); if (capacity.isEmpty()) capacity = "256"; - bigint range = 256^(capacity.toInt() / 8); + bigint range = 1; + for (int k = 0; k < capacity.toInt() / 8; ++k) + range = range * 256; bigint value = boost::get(this->internalValue()); ret.insert("valid", true); if (_type.startsWith("uint") && value > range - 1) From ff1f386df84234bac89c1d0e790cfcbd165e6fd1 Mon Sep 17 00:00:00 2001 From: gluk256 Date: Tue, 2 Jun 2015 15:54:39 +0200 Subject: [PATCH 451/461] Update TransientDirectory.cpp switched to no-throw version of remove_all() --- libdevcore/TransientDirectory.cpp | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/libdevcore/TransientDirectory.cpp b/libdevcore/TransientDirectory.cpp index 3c88e42a3..c632514ef 100644 --- a/libdevcore/TransientDirectory.cpp +++ b/libdevcore/TransientDirectory.cpp @@ -24,6 +24,7 @@ #include "Exceptions.h" #include "TransientDirectory.h" #include "CommonIO.h" +#include "Log.h" using namespace std; using namespace dev; @@ -43,16 +44,19 @@ TransientDirectory::TransientDirectory(std::string const& _path): TransientDirectory::~TransientDirectory() { - for (int i = 0; i < 3; ++i) - { - try - { - boost::filesystem::remove_all(m_path); - break; - } - catch (...) - { - this_thread::sleep_for(chrono::milliseconds(10)); - } - } + boost::system::error_code ec; + boost::filesystem::remove_all(m_path, ec); + if (0 == ec) + return; + + // In some cases, antivirus runnig on Windows will scan all the newly created directories. + // As a consequence, directory is locked and can not be deleted immediately. + // Retry after 10 milliseconds usually is successful. + // This will help our tests run smoothly in such environment. + this_thread::sleep_for(chrono::milliseconds(10)); + + ec.clear(); + boost::filesystem::remove_all(m_path, ec); + if (ec != 0) + cwarn << "Failed to delete directory '" << m_path << "': " << ec.message(); } From 7b8a4cebd891fa9ff067802f593afcdf221ea586 Mon Sep 17 00:00:00 2001 From: subtly Date: Wed, 3 Jun 2015 12:00:59 +0200 Subject: [PATCH 452/461] Better code. --- libethereum/EthereumHost.cpp | 6 +++--- libethereum/EthereumHost.h | 2 +- libp2p/Session.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/libethereum/EthereumHost.cpp b/libethereum/EthereumHost.cpp index cea9339f2..533304fa6 100644 --- a/libethereum/EthereumHost.cpp +++ b/libethereum/EthereumHost.cpp @@ -218,11 +218,11 @@ void EthereumHost::maintainTransactions() } } -tuple>, vector>, list>> EthereumHost::randomSelection(unsigned _percent, std::function const& _allow) +tuple>, vector>, vector>> EthereumHost::randomSelection(unsigned _percent, std::function const& _allow) { vector> chosen; vector> allowed; - list> sessions; + vector> sessions; auto const& ps = peerSessions(); allowed.reserve(ps.size()); @@ -243,7 +243,7 @@ tuple>, vector>, list>, std::vector>, std::list>> randomSelection(unsigned _percent = 25, std::function const& _allow = [](EthereumPeer const*){ return true; }); + std::tuple>, std::vector>, std::vector>> randomSelection(unsigned _percent = 25, std::function const& _allow = [](EthereumPeer const*){ return true; }); /// Session is tell us that we may need (re-)syncing with the peer. void noteNeedsSyncing(EthereumPeer* _who); diff --git a/libp2p/Session.cpp b/libp2p/Session.cpp index 1c037e783..2a16007ca 100644 --- a/libp2p/Session.cpp +++ b/libp2p/Session.cpp @@ -319,7 +319,7 @@ void Session::send(bytes&& _msg) void Session::write() { - bytes *out; + bytes const* out; DEV_GUARDED(x_writeQueue) { m_io->writeSingleFramePacket(&m_writeQueue[0], m_writeQueue[0]); From 371d23decc70bde894ef794aa9e7fc08237535a1 Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Wed, 3 Jun 2015 16:10:21 +0200 Subject: [PATCH 453/461] Check if GPU has over 2GB of memory If the user's machine contains no OpenCL device that has enough GPU memory then don't allow creation of a GPU miner. Instead default to CPU. --- ethminer/MinerAux.h | 12 +++++- libethash-cl/ethash_cl_miner.cpp | 65 +++++++++++++++++++++++++++----- libethash-cl/ethash_cl_miner.h | 1 + libethcore/Ethash.cpp | 5 +++ libethcore/Ethash.h | 1 + 5 files changed, 72 insertions(+), 12 deletions(-) diff --git a/ethminer/MinerAux.h b/ethminer/MinerAux.h index 47fd2e2ae..bae4b942c 100644 --- a/ethminer/MinerAux.h +++ b/ethminer/MinerAux.h @@ -171,8 +171,16 @@ public: m_minerType = MinerType::CPU; else if (arg == "-G" || arg == "--opencl") { - m_minerType = MinerType::GPU; - miningThreads = 1; + if (!ProofOfWork::GPUMiner::haveSufficientGPUMemory()) + { + cout << "No GPU device with sufficient memory was found. Defaulting to CPU" << endl; + m_minerType = MinerType::CPU; + } + else + { + m_minerType = MinerType::GPU; + miningThreads = 1; + } } else if (arg == "--no-precompute") { diff --git a/libethash-cl/ethash_cl_miner.cpp b/libethash-cl/ethash_cl_miner.cpp index 93ce9ab22..7e2dfd46e 100644 --- a/libethash-cl/ethash_cl_miner.cpp +++ b/libethash-cl/ethash_cl_miner.cpp @@ -35,6 +35,7 @@ #include "ethash_cl_miner_kernel.h" #define ETHASH_BYTES 32 +#define ETHASH_CL_MINIMUM_MEMORY 2000000000 // workaround lame platforms #if !CL_VERSION_1_2 @@ -47,6 +48,9 @@ using namespace std; +// TODO: If at any point we can use libdevcore in here then we should switch to using a LogChannel +#define ETHCL_LOG(_contents) cout << "[OPENCL]:" << _contents << endl + static void add_definition(std::string& source, char const* id, unsigned value) { char buf[256]; @@ -72,7 +76,7 @@ std::string ethash_cl_miner::platform_info(unsigned _platformId, unsigned _devic cl::Platform::get(&platforms); if (platforms.empty()) { - cout << "No OpenCL platforms found." << endl; + ETHCL_LOG("No OpenCL platforms found."); return std::string(); } @@ -82,7 +86,7 @@ std::string ethash_cl_miner::platform_info(unsigned _platformId, unsigned _devic platforms[platform_num].getDevices(CL_DEVICE_TYPE_ALL, &devices); if (devices.empty()) { - cout << "No OpenCL devices found." << endl; + ETHCL_LOG("No OpenCL devices found."); return std::string(); } @@ -107,7 +111,7 @@ unsigned ethash_cl_miner::get_num_devices(unsigned _platformId) cl::Platform::get(&platforms); if (platforms.empty()) { - cout << "No OpenCL platforms found." << endl; + ETHCL_LOG("No OpenCL platforms found."); return 0; } @@ -116,12 +120,53 @@ unsigned ethash_cl_miner::get_num_devices(unsigned _platformId) platforms[platform_num].getDevices(CL_DEVICE_TYPE_ALL, &devices); if (devices.empty()) { - cout << "No OpenCL devices found." << endl; + ETHCL_LOG("No OpenCL devices found."); return 0; } return devices.size(); } +bool ethash_cl_miner::haveSufficientGPUMemory(unsigned _platformId) +{ + std::vector platforms; + cl::Platform::get(&platforms); + if (platforms.empty()) + { + ETHCL_LOG("No OpenCL platforms found."); + return false; + } + + std::vector devices; + unsigned platform_num = std::min(_platformId, platforms.size() - 1); + platforms[platform_num].getDevices(CL_DEVICE_TYPE_ALL, &devices); + if (devices.empty()) + { + ETHCL_LOG("No OpenCL devices found."); + return false; + } + + for (cl::Device const& device: devices) + { + cl_ulong result; + device.getInfo(CL_DEVICE_GLOBAL_MEM_SIZE, &result); + if (result >= ETHASH_CL_MINIMUM_MEMORY) + { + ETHCL_LOG( + "Found suitable OpenCL device [" << device.getInfo() + << "] with " << result << " bytes of GPU memory" + ); + return true; + } + else + ETHCL_LOG( + "OpenCL device " << device.getInfo() + << " has insufficient GPU memory." << result << + " bytes of memory found < " << ETHASH_CL_MINIMUM_MEMORY << " bytes of memory required" + ); + } + return false; +} + void ethash_cl_miner::finish() { if (m_queue()) @@ -135,7 +180,7 @@ bool ethash_cl_miner::init(uint8_t const* _dag, uint64_t _dagSize, unsigned work cl::Platform::get(&platforms); if (platforms.empty()) { - cout << "No OpenCL platforms found." << endl; + ETHCL_LOG("No OpenCL platforms found."); return false; } @@ -143,25 +188,25 @@ bool ethash_cl_miner::init(uint8_t const* _dag, uint64_t _dagSize, unsigned work _platformId = std::min(_platformId, platforms.size() - 1); - cout << "Using platform: " << platforms[_platformId].getInfo().c_str() << endl; + ETHCL_LOG("Using platform: " << platforms[_platformId].getInfo().c_str()); // get GPU device of the default platform std::vector devices; platforms[_platformId].getDevices(CL_DEVICE_TYPE_ALL, &devices); if (devices.empty()) { - cout << "No OpenCL devices found." << endl; + ETHCL_LOG("No OpenCL devices found."); return false; } // use selected device cl::Device& device = devices[std::min(_deviceId, devices.size() - 1)]; std::string device_version = device.getInfo(); - cout << "Using device: " << device.getInfo().c_str() << "(" << device_version.c_str() << ")" << endl; + ETHCL_LOG("Using device: " << device.getInfo().c_str() << "(" << device_version.c_str() << ")"); if (strncmp("OpenCL 1.0", device_version.c_str(), 10) == 0) { - cout << "OpenCL 1.0 is not supported." << endl; + ETHCL_LOG("OpenCL 1.0 is not supported."); return false; } if (strncmp("OpenCL 1.1", device_version.c_str(), 10) == 0) @@ -193,7 +238,7 @@ bool ethash_cl_miner::init(uint8_t const* _dag, uint64_t _dagSize, unsigned work } catch (cl::Error err) { - cout << program.getBuildInfo(device).c_str(); + ETHCL_LOG(program.getBuildInfo(device).c_str()); return false; } m_hash_kernel = cl::Kernel(program, "ethash_hash"); diff --git a/libethash-cl/ethash_cl_miner.h b/libethash-cl/ethash_cl_miner.h index 43bfa2336..ef6745d76 100644 --- a/libethash-cl/ethash_cl_miner.h +++ b/libethash-cl/ethash_cl_miner.h @@ -35,6 +35,7 @@ public: static unsigned get_num_platforms(); static unsigned get_num_devices(unsigned _platformId = 0); static std::string platform_info(unsigned _platformId = 0, unsigned _deviceId = 0); + static bool haveSufficientGPUMemory(unsigned _platformId = 0); bool init(uint8_t const* _dag, uint64_t _dagSize, unsigned workgroup_size = 64, unsigned _platformId = 0, unsigned _deviceId = 0); void finish(); diff --git a/libethcore/Ethash.cpp b/libethcore/Ethash.cpp index f62c1f9cd..0be0b520c 100644 --- a/libethcore/Ethash.cpp +++ b/libethcore/Ethash.cpp @@ -363,6 +363,11 @@ void Ethash::GPUMiner::pause() stopWorking(); } +bool Ethash::GPUMiner::haveSufficientGPUMemory() +{ + return ethash_cl_miner::haveSufficientGPUMemory(s_platformId); +} + std::string Ethash::GPUMiner::platformInfo() { return ethash_cl_miner::platform_info(s_platformId, s_deviceId); diff --git a/libethcore/Ethash.h b/libethcore/Ethash.h index 86540678f..9986c6a03 100644 --- a/libethcore/Ethash.h +++ b/libethcore/Ethash.h @@ -115,6 +115,7 @@ public: static unsigned instances() { return s_numInstances > 0 ? s_numInstances : 1; } static std::string platformInfo(); + static bool haveSufficientGPUMemory(); static unsigned getNumDevices(); static void setDefaultPlatform(unsigned _id) { s_platformId = _id; } static void setDefaultDevice(unsigned _id) { s_deviceId = _id; } From 3e2fc17e8139d418a6e39ee91d0a8b3c23f6fd9f Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Wed, 3 Jun 2015 16:57:24 +0200 Subject: [PATCH 454/461] Print additional info if DAG creation fails --- libethcore/EthashAux.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libethcore/EthashAux.cpp b/libethcore/EthashAux.cpp index 4b546404a..0c1e84ebc 100644 --- a/libethcore/EthashAux.cpp +++ b/libethcore/EthashAux.cpp @@ -137,7 +137,10 @@ EthashAux::FullAllocation::FullAllocation(ethash_light_t _light, ethash_callback full = ethash_full_new(_light, _cb); // cdebug << "Called OK."; if (!full) - BOOST_THROW_EXCEPTION(ExternalFunctionFailure("ethash_full_new()")); + { + clog(DAGChannel) << "DAG Generation Failure. Reason: " << strerror(errno); + BOOST_THROW_EXCEPTION(ExternalFunctionFailure("ethash_full_new")); + } } EthashAux::FullAllocation::~FullAllocation() From bedddefda06c6c4934653d3e6e5056dd5d04ff8b Mon Sep 17 00:00:00 2001 From: Lefteris Karapetsas Date: Wed, 3 Jun 2015 17:09:23 +0200 Subject: [PATCH 455/461] Implement memory check function also for the CPU - Should fix the build, since Ethash is an interface. --- libethcore/Ethash.h | 1 + 1 file changed, 1 insertion(+) diff --git a/libethcore/Ethash.h b/libethcore/Ethash.h index 9986c6a03..075b0522b 100644 --- a/libethcore/Ethash.h +++ b/libethcore/Ethash.h @@ -87,6 +87,7 @@ public: static unsigned instances() { return s_numInstances > 0 ? s_numInstances : std::thread::hardware_concurrency(); } static std::string platformInfo(); + static bool haveSufficientGPUMemory() { return false; } static void setDefaultPlatform(unsigned) {} static void setDefaultDevice(unsigned) {} static void setNumInstances(unsigned _instances) { s_numInstances = std::min(_instances, std::thread::hardware_concurrency()); } From 1a37f2b3dadb851f1377ac336d42c323050d98a9 Mon Sep 17 00:00:00 2001 From: arkpar Date: Wed, 3 Jun 2015 17:14:20 +0200 Subject: [PATCH 456/461] fixed blockchain kill --- libethereum/Client.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/libethereum/Client.cpp b/libethereum/Client.cpp index 96353ade2..1491c83d7 100644 --- a/libethereum/Client.cpp +++ b/libethereum/Client.cpp @@ -269,9 +269,11 @@ void Client::killChain() { WriteGuard l(x_postMine); WriteGuard l2(x_preMine); + WriteGuard l3(x_working); m_preMine = State(); m_postMine = State(); + m_working = State(); m_stateDB = OverlayDB(); m_stateDB = State::openDB(Defaults::dbPath(), WithExisting::Kill); @@ -284,6 +286,7 @@ void Client::killChain() if (auto h = m_host.lock()) h->reset(); + startedWorking(); doWork(); startWorking(); From bf6ec8e32a1855d1609740d565c527e76544b319 Mon Sep 17 00:00:00 2001 From: winsvega Date: Fri, 22 May 2015 16:21:34 +0300 Subject: [PATCH 457/461] evmJit warnings fix --- evmjit/libevmjit-cpp/Env.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/evmjit/libevmjit-cpp/Env.cpp b/evmjit/libevmjit-cpp/Env.cpp index 86a65dbab..4d7865bd0 100644 --- a/evmjit/libevmjit-cpp/Env.cpp +++ b/evmjit/libevmjit-cpp/Env.cpp @@ -54,7 +54,7 @@ extern "C" if (_env->balance(_env->myAddress) >= endowment && _env->depth < 1024) { u256 gas = *io_gas; - h256 address(_env->create(endowment, gas, {_initBeg, _initSize}, {}), h256::AlignRight); + h256 address(_env->create(endowment, gas, {_initBeg, (size_t)_initSize}, {}), h256::AlignRight); *io_gas = static_cast(gas); *o_address = address; } @@ -69,8 +69,8 @@ extern "C" params.senderAddress = _env->myAddress; params.receiveAddress = right160(*_receiveAddress); params.codeAddress = right160(*_codeAddress); - params.data = {_inBeg, _inSize}; - params.out = {_outBeg, _outSize}; + params.data = {_inBeg, (size_t)_inSize}; + params.out = {_outBeg, (size_t)_outSize}; params.onOp = {}; const auto isCall = params.receiveAddress == params.codeAddress; // OPT: The same address pointer can be used if not CODECALL @@ -102,7 +102,7 @@ extern "C" EXPORT void env_sha3(byte* _begin, uint64_t _size, h256* o_hash) { - auto hash = sha3({_begin, _size}); + auto hash = sha3({_begin, (size_t)_size}); *o_hash = hash; } @@ -130,7 +130,7 @@ extern "C" if (_topic4) topics.push_back(*_topic4); - _env->log(std::move(topics), {_beg, _size}); + _env->log(std::move(topics), {_beg, (size_t)_size}); } } From 78e6e007d654590c7b72a740a23fbbcbf3428222 Mon Sep 17 00:00:00 2001 From: Dimitry Date: Wed, 3 Jun 2015 20:00:38 +0300 Subject: [PATCH 458/461] TransactionTest: V = unit64+28 --- .../ttTransactionTestFiller.json | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/test/libethereum/TransactionTestsFiller/ttTransactionTestFiller.json b/test/libethereum/TransactionTestsFiller/ttTransactionTestFiller.json index 5b24b9e51..410434d1d 100644 --- a/test/libethereum/TransactionTestsFiller/ttTransactionTestFiller.json +++ b/test/libethereum/TransactionTestsFiller/ttTransactionTestFiller.json @@ -63,12 +63,12 @@ } }, - "V_overflow64bit" : { + "V_overflow64bitPlus27" : { "expect" : "invalid", "transaction" : { "data" : "0x5544", - "gasLimit" : "21000", + "gasLimit" : "22000", "gasPrice" : "1", "nonce" : "3", "to" : "b94f5374fce5edbc8e2a8697c15331677e6ebf0b", @@ -79,6 +79,22 @@ } }, + "V_overflow64bitPlus28" : { + "expect" : "invalid", + "transaction" : + { + "data" : "0x5544", + "gasLimit" : "22000", + "gasPrice" : "1", + "nonce" : "3", + "to" : "b94f5374fce5edbc8e2a8697c15331677e6ebf0b", + "value" : "10", + "v" : "18446744073709551644", + "r" : "0x98ff921201554726367d2be8c804a7ff89ccf285ebc57dff8ae4c44b9c19ac4a", + "s" : "0x8887321be575c8095f789dd4c743dfe42c1820f9231f98a962b210e3ac2452a3" + } + }, + "V_overflow64bitSigned" : { "expect" : "invalid", "transaction" : From e0c3095bdaaf486fc8d59bafdb2ce3df66a00e97 Mon Sep 17 00:00:00 2001 From: Vlad Gluhovsky Date: Wed, 3 Jun 2015 19:22:34 +0200 Subject: [PATCH 459/461] refactored the topic naming conventions --- alethzero/MainWin.cpp | 6 ++--- libweb3jsonrpc/WebThreeStubServerBase.cpp | 12 +++++----- libwhisper/Common.cpp | 24 +++++++++---------- libwhisper/Common.h | 28 +++++++++++------------ libwhisper/Interface.h | 24 ++++++++----------- libwhisper/Message.cpp | 20 ++++++++-------- libwhisper/Message.h | 20 ++++++++-------- libwhisper/WhisperHost.cpp | 4 ++-- libwhisper/WhisperHost.h | 6 ++--- test/libwhisper/whisperMessage.cpp | 8 +++---- 10 files changed, 73 insertions(+), 79 deletions(-) diff --git a/alethzero/MainWin.cpp b/alethzero/MainWin.cpp index 6a11736a4..59698bac3 100644 --- a/alethzero/MainWin.cpp +++ b/alethzero/MainWin.cpp @@ -1803,7 +1803,7 @@ void Main::on_accounts_doubleClicked() } } -static shh::FullTopic topicFromText(QString _s) +static shh::Topics topicFromText(QString _s) { shh::BuildTopic ret; while (_s.size()) @@ -2187,10 +2187,10 @@ void Main::refreshWhispers() shh::Envelope const& e = w.second; shh::Message m; for (pair const& i: m_server->ids()) - if (!!(m = e.open(shh::FullTopic(), i.second))) + if (!!(m = e.open(shh::Topics(), i.second))) break; if (!m) - m = e.open(shh::FullTopic()); + m = e.open(shh::Topics()); QString msg; if (m.from()) diff --git a/libweb3jsonrpc/WebThreeStubServerBase.cpp b/libweb3jsonrpc/WebThreeStubServerBase.cpp index 6b714f2ac..ff7b84dc4 100644 --- a/libweb3jsonrpc/WebThreeStubServerBase.cpp +++ b/libweb3jsonrpc/WebThreeStubServerBase.cpp @@ -267,7 +267,7 @@ static shh::Envelope toSealed(Json::Value const& _json, shh::Message const& _m, return _m.seal(_from, bt, ttl, workToProve); } -static pair toWatch(Json::Value const& _json) +static pair toWatch(Json::Value const& _json) { shh::BuildTopic bt; Public to; @@ -985,7 +985,7 @@ string WebThreeStubServerBase::shh_newFilter(Json::Value const& _json) try { - pair w = toWatch(_json); + pair w = toWatch(_json); auto ret = face()->installWatch(w.first); m_shhWatches.insert(make_pair(ret, w.second)); return toJS(ret); @@ -1025,10 +1025,10 @@ Json::Value WebThreeStubServerBase::shh_getFilterChanges(string const& _filterId if (pub) { cwarn << "Silently decrypting message from identity" << pub << ": User validation hook goes here."; - m = e.open(face()->fullTopic(id), m_shhIds[pub]); + m = e.open(face()->fullTopics(id), m_shhIds[pub]); } else - m = e.open(face()->fullTopic(id)); + m = e.open(face()->fullTopics(id)); if (!m) continue; ret.append(toJson(h, e, m)); @@ -1058,10 +1058,10 @@ Json::Value WebThreeStubServerBase::shh_getMessages(string const& _filterId) if (pub) { cwarn << "Silently decrypting message from identity" << pub << ": User validation hook goes here."; - m = e.open(face()->fullTopic(id), m_shhIds[pub]); + m = e.open(face()->fullTopics(id), m_shhIds[pub]); } else - m = e.open(face()->fullTopic(id)); + m = e.open(face()->fullTopics(id)); if (!m) continue; ret.append(toJson(h, e, m)); diff --git a/libwhisper/Common.cpp b/libwhisper/Common.cpp index dd9172c70..526072842 100644 --- a/libwhisper/Common.cpp +++ b/libwhisper/Common.cpp @@ -28,26 +28,26 @@ using namespace dev; using namespace dev::p2p; using namespace dev::shh; -CollapsedTopicPart dev::shh::collapse(FullTopicPart const& _p) +AbridgedTopic dev::shh::abridge(Topic const& _p) { - return CollapsedTopicPart(sha3(_p)); + return AbridgedTopic(sha3(_p)); } -CollapsedTopic dev::shh::collapse(FullTopic const& _fullTopic) +AbridgedTopics dev::shh::abridge(Topics const& _topics) { - CollapsedTopic ret; - ret.reserve(_fullTopic.size()); - for (auto const& ft: _fullTopic) - ret.push_back(collapse(ft)); + AbridgedTopics ret; + ret.reserve(_topics.size()); + for (auto const& t : _topics) + ret.push_back(abridge(t)); return ret; } -CollapsedTopic BuildTopic::toTopic() const +AbridgedTopics BuildTopic::toAbridgedTopics() const { - CollapsedTopic ret; + AbridgedTopics ret; ret.reserve(m_parts.size()); for (auto const& h: m_parts) - ret.push_back(collapse(h)); + ret.push_back(abridge(h)); return ret; } @@ -71,7 +71,7 @@ bool TopicFilter::matches(Envelope const& _e) const for (unsigned i = 0; i < t.size(); ++i) { for (auto et: _e.topic()) - if (((t[i].first ^ et) & t[i].second) == CollapsedTopicPart()) + if (((t[i].first ^ et) & t[i].second) == AbridgedTopic()) goto NEXT_TOPICPART; // failed to match topicmask against any topics: move on to next mask goto NEXT_TOPICMASK; @@ -89,7 +89,7 @@ TopicMask BuildTopicMask::toTopicMask() const TopicMask ret; ret.reserve(m_parts.size()); for (auto const& h: m_parts) - ret.push_back(make_pair(collapse(h), ~CollapsedTopicPart())); + ret.push_back(make_pair(abridge(h), ~AbridgedTopic())); return ret; } diff --git a/libwhisper/Common.h b/libwhisper/Common.h index 480b79350..b575166b4 100644 --- a/libwhisper/Common.h +++ b/libwhisper/Common.h @@ -60,14 +60,14 @@ enum WhisperPacket PacketCount }; -using CollapsedTopicPart = FixedHash<4>; -using FullTopicPart = h256; +using AbridgedTopic = FixedHash<4>; +using Topic = h256; -using CollapsedTopic = std::vector; -using FullTopic = h256s; +using AbridgedTopics = std::vector; +using Topics = h256s; -CollapsedTopicPart collapse(FullTopicPart const& _fullTopicPart); -CollapsedTopic collapse(FullTopic const& _fullTopic); +AbridgedTopic abridge(Topic const& _topic); +AbridgedTopics abridge(Topics const& _topics); class BuildTopic { @@ -80,10 +80,10 @@ public: BuildTopic& shiftRaw(h256 const& _part) { m_parts.push_back(_part); return *this; } - operator CollapsedTopic() const { return toTopic(); } - operator FullTopic() const { return toFullTopic(); } - CollapsedTopic toTopic() const; - FullTopic toFullTopic() const { return m_parts; } + operator AbridgedTopics() const { return toAbridgedTopics(); } + operator Topics() const { return toTopics(); } + AbridgedTopics toAbridgedTopics() const; + Topics toTopics() const { return m_parts; } protected: BuildTopic& shiftBytes(bytes const& _b); @@ -91,14 +91,14 @@ protected: h256s m_parts; }; -using TopicMask = std::vector>; +using TopicMask = std::vector>; using TopicMasks = std::vector; class TopicFilter { public: TopicFilter() {} - TopicFilter(FullTopic const& _m) { m_topicMasks.push_back(TopicMask()); for (auto const& h: _m) m_topicMasks.back().push_back(std::make_pair(collapse(h), h ? ~CollapsedTopicPart() : CollapsedTopicPart())); } + TopicFilter(Topics const& _m) { m_topicMasks.push_back(TopicMask()); for (auto const& h: _m) m_topicMasks.back().push_back(std::make_pair(abridge(h), h ? ~AbridgedTopic() : AbridgedTopic())); } TopicFilter(TopicMask const& _m): m_topicMasks(1, _m) {} TopicFilter(TopicMasks const& _m): m_topicMasks(_m) {} TopicFilter(RLP const& _r)//: m_topicMasks(_r.toVector>()) @@ -132,9 +132,9 @@ public: template BuildTopicMask& operator()(T const& _t) { shift(_t); return *this; } operator TopicMask() const { return toTopicMask(); } - operator FullTopic() const { return toFullTopic(); } + operator Topics() const { return toTopics(); } TopicMask toTopicMask() const; - FullTopic toFullTopic() const { return m_parts; } + Topics toTopics() const { return m_parts; } }; } diff --git a/libwhisper/Interface.h b/libwhisper/Interface.h index 8b84193aa..8015957fc 100644 --- a/libwhisper/Interface.h +++ b/libwhisper/Interface.h @@ -38,19 +38,13 @@ namespace dev namespace shh { -/*struct TopicMask -{ - Topic data; - Topic mask; -};*/ - class Watch; struct InstalledFilter { - InstalledFilter(FullTopic const& _f): full(_f), filter(_f) {} + InstalledFilter(Topics const& _t): full(_t), filter(_t) {} - FullTopic full; + Topics full; TopicFilter filter; unsigned refCount = 1; }; @@ -71,8 +65,8 @@ public: virtual void inject(Envelope const& _m, WhisperPeer* _from = nullptr) = 0; - virtual FullTopic const& fullTopic(unsigned _id) const = 0; - virtual unsigned installWatch(FullTopic const& _mask) = 0; + virtual Topics const& fullTopics(unsigned _id) const = 0; + virtual unsigned installWatch(Topics const& _filter) = 0; virtual unsigned installWatchOnId(h256 _filterId) = 0; virtual void uninstallWatch(unsigned _watchId) = 0; virtual h256s peekWatch(unsigned _watchId) const = 0; @@ -81,10 +75,10 @@ public: virtual Envelope envelope(h256 _m) const = 0; - void post(bytes const& _payload, FullTopic _topic, unsigned _ttl = 50, unsigned _workToProve = 50) { inject(Message(_payload).seal(_topic, _ttl, _workToProve)); } - void post(Public _to, bytes const& _payload, FullTopic _topic, unsigned _ttl = 50, unsigned _workToProve = 50) { inject(Message(_payload).sealTo(_to, _topic, _ttl, _workToProve)); } - void post(Secret _from, bytes const& _payload, FullTopic _topic, unsigned _ttl = 50, unsigned _workToProve = 50) { inject(Message(_payload).seal(_from, _topic, _ttl, _workToProve)); } - void post(Secret _from, Public _to, bytes const& _payload, FullTopic _topic, unsigned _ttl = 50, unsigned _workToProve = 50) { inject(Message(_payload).sealTo(_from, _to, _topic, _ttl, _workToProve)); } + void post(bytes const& _payload, Topics _topics, unsigned _ttl = 50, unsigned _workToProve = 50) { inject(Message(_payload).seal(_topics, _ttl, _workToProve)); } + void post(Public _to, bytes const& _payload, Topics _topics, unsigned _ttl = 50, unsigned _workToProve = 50) { inject(Message(_payload).sealTo(_to, _topics, _ttl, _workToProve)); } + void post(Secret _from, bytes const& _payload, Topics _topics, unsigned _ttl = 50, unsigned _workToProve = 50) { inject(Message(_payload).seal(_from, _topics, _ttl, _workToProve)); } + void post(Secret _from, Public _to, bytes const& _payload, Topics _topics, unsigned _ttl = 50, unsigned _workToProve = 50) { inject(Message(_payload).sealTo(_from, _to, _topics, _ttl, _workToProve)); } }; struct WatshhChannel: public dev::LogChannel { static const char* name() { return "shh"; } static const int verbosity = 1; }; @@ -106,7 +100,7 @@ class Watch: public boost::noncopyable public: Watch() {} - Watch(Interface& _c, FullTopic const& _f): m_c(&_c), m_id(_c.installWatch(_f)) {} + Watch(Interface& _c, Topics const& _t) : m_c(&_c), m_id(_c.installWatch(_t)) {} ~Watch() { if (m_c) m_c->uninstallWatch(m_id); } h256s check() { return m_c ? m_c->checkWatch(m_id) : h256s(); } diff --git a/libwhisper/Message.cpp b/libwhisper/Message.cpp index 9ba67ff9c..50020b783 100644 --- a/libwhisper/Message.cpp +++ b/libwhisper/Message.cpp @@ -26,7 +26,7 @@ using namespace dev; using namespace dev::p2p; using namespace dev::shh; -Message::Message(Envelope const& _e, FullTopic const& _fk, Secret const& _s) +Message::Message(Envelope const& _e, Topics const& _t, Secret const& _s) { try { @@ -35,7 +35,7 @@ Message::Message(Envelope const& _e, FullTopic const& _fk, Secret const& _s) if (!decrypt(_s, &(_e.data()), b)) return; else{} - else if (!openBroadcastEnvelope(_e, _fk, b)) + else if (!openBroadcastEnvelope(_e, _t, b)) return; if (populate(b)) @@ -47,14 +47,14 @@ Message::Message(Envelope const& _e, FullTopic const& _fk, Secret const& _s) } } -bool Message::openBroadcastEnvelope(Envelope const& _e, FullTopic const& _fk, bytes& o_b) +bool Message::openBroadcastEnvelope(Envelope const& _e, Topics const& _fk, bytes& o_b) { // retrieve the key using the known topic and topicIndex. unsigned topicIndex = 0; Secret topicSecret; // determine topicSecret/topicIndex from knowledge of the collapsed topics (which give the order) and our full-size filter topic. - CollapsedTopic knownTopic = collapse(_fk); + AbridgedTopics knownTopic = abridge(_fk); for (unsigned ti = 0; ti < _fk.size() && !topicSecret; ++ti) for (unsigned i = 0; i < _e.topic().size(); ++i) if (_e.topic()[i] == knownTopic[ti]) @@ -96,10 +96,10 @@ bool Message::populate(bytes const& _data) return true; } -Envelope Message::seal(Secret _from, FullTopic const& _fullTopic, unsigned _ttl, unsigned _workToProve) const +Envelope Message::seal(Secret _from, Topics const& _fullTopics, unsigned _ttl, unsigned _workToProve) const { - CollapsedTopic topic = collapse(_fullTopic); - Envelope ret(time(0) + _ttl, _ttl, topic); + AbridgedTopics topics = abridge(_fullTopics); + Envelope ret(time(0) + _ttl, _ttl, topics); bytes input(1 + m_payload.size()); input[0] = 0; @@ -121,7 +121,7 @@ Envelope Message::seal(Secret _from, FullTopic const& _fullTopic, unsigned _ttl, // this message is for broadcast (could be read by anyone who knows at least one of the topics) // create the shared secret for encrypting the payload, then encrypt the shared secret with each topic Secret s = Secret::random(); - for (h256 const& t : _fullTopic) + for (h256 const& t : _fullTopics) { h256 salt = h256::random(); ret.m_data += (generateGamma(t, salt) ^ s).asBytes(); @@ -146,9 +146,9 @@ Envelope::Envelope(RLP const& _m) m_nonce = _m[4].toInt(); } -Message Envelope::open(FullTopic const& _ft, Secret const& _s) const +Message Envelope::open(Topics const& _t, Secret const& _s) const { - return Message(*this, _ft, _s); + return Message(*this, _t, _s); } unsigned Envelope::workProved() const diff --git a/libwhisper/Message.h b/libwhisper/Message.h index 5b069f57b..3529054e0 100644 --- a/libwhisper/Message.h +++ b/libwhisper/Message.h @@ -72,22 +72,22 @@ public: unsigned sent() const { return m_expiry - m_ttl; } unsigned expiry() const { return m_expiry; } unsigned ttl() const { return m_ttl; } - CollapsedTopic const& topic() const { return m_topic; } + AbridgedTopics const& topic() const { return m_topic; } bytes const& data() const { return m_data; } - Message open(FullTopic const& _ft, Secret const& _s = Secret()) const; + Message open(Topics const& _t, Secret const& _s = Secret()) const; unsigned workProved() const; void proveWork(unsigned _ms); private: - Envelope(unsigned _exp, unsigned _ttl, CollapsedTopic const& _topic): m_expiry(_exp), m_ttl(_ttl), m_topic(_topic) {} + Envelope(unsigned _exp, unsigned _ttl, AbridgedTopics const& _topic): m_expiry(_exp), m_ttl(_ttl), m_topic(_topic) {} unsigned m_expiry = 0; unsigned m_ttl = 0; u256 m_nonce; - CollapsedTopic m_topic; + AbridgedTopics m_topic; bytes m_data; }; @@ -102,7 +102,7 @@ class Message { public: Message() {} - Message(Envelope const& _e, FullTopic const& _ft, Secret const& _s = Secret()); + Message(Envelope const& _e, Topics const& _t, Secret const& _s = Secret()); Message(bytes const& _payload): m_payload(_payload) {} Message(bytesConstRef _payload): m_payload(_payload.toBytes()) {} Message(bytes&& _payload) { std::swap(_payload, m_payload); } @@ -119,15 +119,15 @@ public: operator bool() const { return !!m_payload.size() || m_from || m_to; } /// Turn this message into a ditributable Envelope. - Envelope seal(Secret _from, FullTopic const& _topic, unsigned _ttl = 50, unsigned _workToProve = 50) const; + Envelope seal(Secret _from, Topics const& _topics, unsigned _ttl = 50, unsigned _workToProve = 50) const; // Overloads for skipping _from or specifying _to. - Envelope seal(FullTopic const& _topic, unsigned _ttl = 50, unsigned _workToProve = 50) const { return seal(Secret(), _topic, _ttl, _workToProve); } - Envelope sealTo(Public _to, FullTopic const& _topic, unsigned _ttl = 50, unsigned _workToProve = 50) { m_to = _to; return seal(Secret(), _topic, _ttl, _workToProve); } - Envelope sealTo(Secret _from, Public _to, FullTopic const& _topic, unsigned _ttl = 50, unsigned _workToProve = 50) { m_to = _to; return seal(_from, _topic, _ttl, _workToProve); } + Envelope seal(Topics const& _topics, unsigned _ttl = 50, unsigned _workToProve = 50) const { return seal(Secret(), _topics, _ttl, _workToProve); } + Envelope sealTo(Public _to, Topics const& _topics, unsigned _ttl = 50, unsigned _workToProve = 50) { m_to = _to; return seal(Secret(), _topics, _ttl, _workToProve); } + Envelope sealTo(Secret _from, Public _to, Topics const& _topics, unsigned _ttl = 50, unsigned _workToProve = 50) { m_to = _to; return seal(_from, _topics, _ttl, _workToProve); } private: bool populate(bytes const& _data); - bool openBroadcastEnvelope(Envelope const& _e, FullTopic const& _fk, bytes& o_b); + bool openBroadcastEnvelope(Envelope const& _e, Topics const& _t, bytes& o_b); h256 generateGamma(h256 const& _key, h256 const& _salt) const { return sha3(_key ^ _salt); } Public m_from; diff --git a/libwhisper/WhisperHost.cpp b/libwhisper/WhisperHost.cpp index ab3576292..366bb92e4 100644 --- a/libwhisper/WhisperHost.cpp +++ b/libwhisper/WhisperHost.cpp @@ -103,11 +103,11 @@ unsigned WhisperHost::installWatchOnId(h256 _h) return ret; } -unsigned WhisperHost::installWatch(shh::FullTopic const& _ft) +unsigned WhisperHost::installWatch(shh::Topics const& _t) { Guard l(m_filterLock); - InstalledFilter f(_ft); + InstalledFilter f(_t); h256 h = f.filter.sha3(); if (!m_filters.count(h)) diff --git a/libwhisper/WhisperHost.h b/libwhisper/WhisperHost.h index cd427da35..c5ec5867b 100644 --- a/libwhisper/WhisperHost.h +++ b/libwhisper/WhisperHost.h @@ -40,7 +40,7 @@ namespace dev namespace shh { -static const FullTopic EmptyFullTopic; +static const Topics EmptyTopics; class WhisperHost: public HostCapability, public Interface, public Worker { @@ -54,8 +54,8 @@ public: virtual void inject(Envelope const& _e, WhisperPeer* _from = nullptr) override; - virtual FullTopic const& fullTopic(unsigned _id) const { try { return m_filters.at(m_watches.at(_id).id).full; } catch (...) { return EmptyFullTopic; } } - virtual unsigned installWatch(FullTopic const& _filter) override; + virtual Topics const& fullTopics(unsigned _id) const { try { return m_filters.at(m_watches.at(_id).id).full; } catch (...) { return EmptyTopics; } } + virtual unsigned installWatch(Topics const& _filter) override; virtual unsigned installWatchOnId(h256 _filterId) override; virtual void uninstallWatch(unsigned _watchId) override; virtual h256s peekWatch(unsigned _watchId) const override { dev::Guard l(m_filterLock); try { return m_watches.at(_watchId).changes; } catch (...) { return h256s(); } } diff --git a/test/libwhisper/whisperMessage.cpp b/test/libwhisper/whisperMessage.cpp index 5e4dff725..b3cda581b 100644 --- a/test/libwhisper/whisperMessage.cpp +++ b/test/libwhisper/whisperMessage.cpp @@ -34,9 +34,9 @@ struct VerbosityHolder int oldLogVerbosity; }; -FullTopic createRandomTopics(unsigned int i) +Topics createRandomTopics(unsigned int i) { - FullTopic ret; + Topics ret; h256 t(i); for (int j = 0; j < 8; ++j) @@ -72,14 +72,14 @@ void comparePayloads(Message const& m1, Message const& m2) void sealAndOpenSingleMessage(unsigned int i) { Secret zero; - FullTopic topics = createRandomTopics(i); + Topics topics = createRandomTopics(i); bytes const payload = createRandomPayload(i); Message m1(payload); Envelope e = m1.seal(zero, topics, 1, 1); for (auto const& t: topics) { - FullTopic singleTopic; + Topics singleTopic; singleTopic.push_back(t); Message m2(e, singleTopic, zero); comparePayloads(m1, m2); From f0ec754e46cbc9232a57853593ed40ddb782fac2 Mon Sep 17 00:00:00 2001 From: gluk256 Date: Wed, 3 Jun 2015 22:23:17 +0200 Subject: [PATCH 460/461] Update Interface.h --- libwhisper/Interface.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libwhisper/Interface.h b/libwhisper/Interface.h index 8015957fc..ff16c7e53 100644 --- a/libwhisper/Interface.h +++ b/libwhisper/Interface.h @@ -100,7 +100,7 @@ class Watch: public boost::noncopyable public: Watch() {} - Watch(Interface& _c, Topics const& _t) : m_c(&_c), m_id(_c.installWatch(_t)) {} + Watch(Interface& _c, Topics const& _t): m_c(&_c), m_id(_c.installWatch(_t)) {} ~Watch() { if (m_c) m_c->uninstallWatch(m_id); } h256s check() { return m_c ? m_c->checkWatch(m_id) : h256s(); } From fdff985a300617877567cf1b9d20e4f0eee47a03 Mon Sep 17 00:00:00 2001 From: Gav Wood Date: Thu, 4 Jun 2015 19:06:01 +0900 Subject: [PATCH 461/461] --ask and --bid --- eth/main.cpp | 45 +++++++++++++++++++++++++++++------- libethereum/EthereumHost.cpp | 20 ++++++++-------- libethereum/EthereumHost.h | 4 ++-- libethereum/State.h | 13 ++++++++--- 4 files changed, 59 insertions(+), 23 deletions(-) diff --git a/eth/main.cpp b/eth/main.cpp index 095540a1c..27e5f4ca0 100644 --- a/eth/main.cpp +++ b/eth/main.cpp @@ -124,9 +124,11 @@ void help() << " --password Give a password for a private key." << endl << endl << "Client transacting:" << endl - << " -B,--block-fees Set the block fee profit in the reference unit e.g. ¢ (default: 15)." << endl + /*<< " -B,--block-fees Set the block fee profit in the reference unit e.g. ¢ (default: 15)." << endl << " -e,--ether-price Set the ether price in the reference unit e.g. ¢ (default: 30.679)." << endl - << " -P,--priority <0 - 100> Default % priority of a transaction (default: 50)." << endl + << " -P,--priority <0 - 100> Default % priority of a transaction (default: 50)." << endl*/ + << " --ask Set the minimum ask gas price under which no transactions will be mined (default 500000000000)." << endl + << " --bid Set the bid gas price for to pay for transactions (default 500000000000)." << endl << endl << "Client mining:" << endl << " -a,--address Set the coinbase (mining payout) address to addr (default: auto)." << endl @@ -299,8 +301,10 @@ int main(int argc, char** argv) /// Transaction params TransactionPriority priority = TransactionPriority::Medium; - double etherPrice = 30.679; - double blockFees = 15.0; +// double etherPrice = 30.679; +// double blockFees = 15.0; + u256 askPrice("500000000000"); + u256 bidPrice("500000000000"); // javascript console bool useConsole = false; @@ -464,7 +468,7 @@ int main(int argc, char** argv) } else if ((arg == "-d" || arg == "--path" || arg == "--db-path") && i + 1 < argc) dbPath = argv[++i]; - else if ((arg == "-B" || arg == "--block-fees") && i + 1 < argc) +/* else if ((arg == "-B" || arg == "--block-fees") && i + 1 < argc) { try { @@ -487,6 +491,30 @@ int main(int argc, char** argv) cerr << "Bad " << arg << " option: " << argv[i] << endl; return -1; } + }*/ + else if (arg == "--ask" && i + 1 < argc) + { + try + { + askPrice = u256(argv[++i]); + } + catch (...) + { + cerr << "Bad " << arg << " option: " << argv[i] << endl; + return -1; + } + } + else if (arg == "--bid" && i + 1 < argc) + { + try + { + bidPrice = u256(argv[++i]); + } + catch (...) + { + cerr << "Bad " << arg << " option: " << argv[i] << endl; + return -1; + } } else if ((arg == "-P" || arg == "--priority") && i + 1 < argc) { @@ -730,7 +758,8 @@ int main(int argc, char** argv) cout << ethCredits(); web3.setIdealPeerCount(peers); - std::shared_ptr gasPricer = make_shared(u256(double(ether / 1000) / etherPrice), u256(blockFees * 1000)); +// std::shared_ptr gasPricer = make_shared(u256(double(ether / 1000) / etherPrice), u256(blockFees * 1000)); + std::shared_ptr gasPricer = make_shared(askPrice, bidPrice); eth::Client* c = nodeMode == NodeMode::Full ? web3.ethereum() : nullptr; StructuredLogger::starting(clientImplString, dev::Version); if (c) @@ -829,7 +858,7 @@ int main(int argc, char** argv) iss >> enable; c->setForceMining(isTrue(enable)); } - else if (c && cmd == "setblockfees") +/* else if (c && cmd == "setblockfees") { iss >> blockFees; try @@ -884,7 +913,7 @@ int main(int argc, char** argv) cerr << "Unknown priority: " << m << endl; } cout << "Priority: " << (int)priority << "/8" << endl; - } + }*/ else if (cmd == "verbosity") { if (iss.peek() != -1) diff --git a/libethereum/EthereumHost.cpp b/libethereum/EthereumHost.cpp index ebbde4d07..68619d627 100644 --- a/libethereum/EthereumHost.cpp +++ b/libethereum/EthereumHost.cpp @@ -54,7 +54,7 @@ EthereumHost::EthereumHost(BlockChain const& _ch, TransactionQueue& _tq, BlockQu EthereumHost::~EthereumHost() { - forEachPeer([](EthereumPeer* _p) { _p->abortSync(); }); + foreachPeer([](EthereumPeer* _p) { _p->abortSync(); }); } bool EthereumHost::ensureInitialised() @@ -74,7 +74,7 @@ bool EthereumHost::ensureInitialised() void EthereumHost::reset() { - forEachPeer([](EthereumPeer* _p) { _p->abortSync(); }); + foreachPeer([](EthereumPeer* _p) { _p->abortSync(); }); m_man.resetToChain(h256s()); m_hashMan.reset(m_chain.number() + 1); m_needSyncBlocks = true; @@ -105,7 +105,7 @@ void EthereumHost::doWork() } } - forEachPeer([](EthereumPeer* _p) { _p->tick(); }); + foreachPeer([](EthereumPeer* _p) { _p->tick(); }); // return netChange; // TODO: Figure out what to do with netChange. @@ -125,7 +125,7 @@ void EthereumHost::maintainTransactions() } for (auto const& t: ts) m_transactionsSent.insert(t.first); - forEachPeerPtr([&](shared_ptr _p) + foreachPeerPtr([&](shared_ptr _p) { bytes b; unsigned n = 0; @@ -148,16 +148,16 @@ void EthereumHost::maintainTransactions() }); } -void EthereumHost::forEachPeer(std::function const& _f) const +void EthereumHost::foreachPeer(std::function const& _f) const { - forEachPeerPtr([&](std::shared_ptr _p) + foreachPeerPtr([&](std::shared_ptr _p) { if (_p) _f(_p.get()); }); } -void EthereumHost::forEachPeerPtr(std::function)> const& _f) const +void EthereumHost::foreachPeerPtr(std::function)> const& _f) const { for (auto s: peerSessions()) _f(s.first->cap()); @@ -551,7 +551,7 @@ void EthereumHost::onPeerTransactions(EthereumPeer* _peer, RLP const& _r) void EthereumHost::continueSync() { clog(NetAllDetail) << "Getting help with downloading hashes and blocks"; - forEachPeer([&](EthereumPeer* _p) + foreachPeer([&](EthereumPeer* _p) { if (_p->m_asking == Asking::Nothing) continueSync(_p); @@ -564,7 +564,7 @@ void EthereumHost::continueSync(EthereumPeer* _peer) bool otherPeerSync = false; if (m_needSyncHashes && peerShouldGrabChain(_peer)) { - forEachPeer([&](EthereumPeer* _p) + foreachPeer([&](EthereumPeer* _p) { if (_p != _peer && _p->m_asking == Asking::Hashes && _p->m_protocolVersion != protocolVersion()) otherPeerSync = true; // Already have a peer downloading hash chain with old protocol, do nothing @@ -630,7 +630,7 @@ bool EthereumHost::isSyncing_UNSAFE() const /// We need actual peer information here to handle the case when we are the first ever peer on the network to mine. /// I.e. on a new private network the first node mining has noone to sync with and should start block propogation immediately. bool syncing = false; - forEachPeer([&](EthereumPeer* _p) + foreachPeer([&](EthereumPeer* _p) { if (_p->m_asking != Asking::Nothing) syncing = true; diff --git a/libethereum/EthereumHost.h b/libethereum/EthereumHost.h index ff0fc9607..8ca815a17 100644 --- a/libethereum/EthereumHost.h +++ b/libethereum/EthereumHost.h @@ -92,8 +92,8 @@ public: private: std::tuple>, std::vector>, std::vector>> randomSelection(unsigned _percent = 25, std::function const& _allow = [](EthereumPeer const*){ return true; }); - void forEachPeerPtr(std::function)> const& _f) const; - void forEachPeer(std::function const& _f) const; + void foreachPeerPtr(std::function)> const& _f) const; + void foreachPeer(std::function const& _f) const; bool isSyncing_UNSAFE() const; /// Sync with the BlockChain. It might contain one of our mined blocks, we might have new candidates from the network. diff --git a/libethereum/State.h b/libethereum/State.h index afdf41735..ea54d153d 100644 --- a/libethereum/State.h +++ b/libethereum/State.h @@ -84,9 +84,16 @@ public: class TrivialGasPricer: public GasPricer { -protected: - u256 ask(State const&) const override { return 10 * szabo; } - u256 bid(TransactionPriority = TransactionPriority::Medium) const override { return 10 * szabo; } +public: + TrivialGasPricer() = default; + TrivialGasPricer(u256 const& _ask, u256 const& _bid): m_ask(_ask), m_bid(_bid) {} + + u256 ask(State const&) const override { return m_ask; } + u256 bid(TransactionPriority = TransactionPriority::Medium) const override { return m_bid; } + +private: + u256 m_ask = 10 * szabo; + u256 m_bid = 10 * szabo; }; enum class Permanence