diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 26b1cc753..ed3a3675a 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -561,11 +561,9 @@ docker-build: - docker info script: - if [ "$CI_BUILD_REF_NAME" == "beta-release" ]; then DOCKER_TAG="latest"; else DOCKER_TAG=$CI_BUILD_REF_NAME; fi - - docker login -u $Docker_Hub_User -p $Docker_Hub_Pass - - sh scripts/docker-build.sh $DOCKER_TAG ethcore - - docker logout + - echo "Tag:" $DOCKER_TAG - docker login -u $Docker_Hub_User_Parity -p $Docker_Hub_Pass_Parity - - sh scripts/docker-build.sh $DOCKER_TAG parity + - sh scripts/docker-build.sh $DOCKER_TAG - docker logout tags: - docker @@ -613,11 +611,12 @@ test-rust-stable: image: parity/rust:gitlab-ci before_script: - git submodule update --init --recursive - - export RUST_FILES_MODIFIED=$(git --no-pager diff --name-only $CI_BUILD_REF^ $CI_BUILD_REF | grep -v -e ^js -e ^\\. -e ^LICENSE -e ^README.md -e ^appveyor.yml -e ^test.sh -e ^windows/ -e ^scripts/ -e^mac/ -e ^nsis/ | wc -l) + - export RUST_FILES_MODIFIED=$(git --no-pager diff --name-only $CI_BUILD_REF^ $CI_BUILD_REF | grep -v -e ^js -e ^\\. -e ^LICENSE -e ^README.md -e ^test.sh -e ^windows/ -e ^scripts/ -e^mac/ -e ^nsis/ | wc -l) script: - rustup show - export RUST_BACKTRACE=1 - if [ $RUST_FILES_MODIFIED -eq 0 ]; then echo "Skipping Rust tests since no Rust files modified."; else ./test.sh $CARGOFLAGS; fi + - if [ "$CI_BUILD_REF_NAME" == "nightly" ]; then sh scripts/aura-test.sh; fi tags: - rust - rust-stable diff --git a/Cargo.lock b/Cargo.lock index 3c1ac28d9..f985d99bd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -81,6 +81,20 @@ dependencies = [ "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "backtrace" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "backtrace-sys 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "dbghelp-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)", + "rustc-demangle 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "backtrace-sys" version = "0.1.11" @@ -783,6 +797,7 @@ version = "0.1.0" dependencies = [ "docopt 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "ethkey 0.2.0", + "panic_hook 0.1.0", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", @@ -818,6 +833,7 @@ version = "0.1.0" dependencies = [ "docopt 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", "ethstore 0.1.0", + "panic_hook 0.1.0", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", @@ -875,6 +891,7 @@ dependencies = [ "ethcore 1.8.0", "ethcore-util 1.8.0", "evm 0.1.0", + "panic_hook 0.1.0", "rustc-hex 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", "serde 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", "serde_derive 1.0.9 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1713,6 +1730,13 @@ dependencies = [ "stable_deref_trait 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "panic_hook" +version = "0.1.0" +dependencies = [ + "backtrace 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "parity" version = "1.7.0" @@ -1746,6 +1770,7 @@ dependencies = [ "log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "number_prefix 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "panic_hook 0.1.0", "parity-dapps 1.8.0", "parity-hash-fetch 1.8.0", "parity-ipfs-api 1.8.0", @@ -1978,7 +2003,7 @@ dependencies = [ [[package]] name = "parity-ui-precompiled" version = "1.4.0" -source = "git+https://github.com/paritytech/js-precompiled.git#26873a9ae6fca50fbf523f201325a20792db3e23" +source = "git+https://github.com/paritytech/js-precompiled.git#b4c17fb0478fc9655ca373637816ee6e325da0d7" dependencies = [ "parity-dapps-glue 1.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -3126,6 +3151,7 @@ dependencies = [ "checksum aster 0.41.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4ccfdf7355d9db158df68f976ed030ab0f6578af811f5a7bb6dcf221ec24e0e0" "checksum atty 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d912da0db7fa85514874458ca3651fe2cddace8d0b0505571dbdcd41ab490159" "checksum backtrace 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "346d7644f0b5f9bc73082d3b2236b69a05fd35cce0cfa3724e184e6a5c9e2a2f" +"checksum backtrace 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "72f9b4182546f4b04ebc4ab7f84948953a118bd6021a1b6a6c909e3e94f6be76" "checksum backtrace-sys 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)" = "3a0d842ea781ce92be2bf78a9b38883948542749640b8378b3b2f03d1fd9f1ff" "checksum base-x 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "2f59103b47307f76e03bef1633aec7fa9e29bfb5aa6daf5a334f94233c71f6c1" "checksum base32 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1b9605ba46d61df0410d8ac686b0007add8172eba90e8e909c347856fe794d8c" diff --git a/Cargo.toml b/Cargo.toml index d541636da..21961776e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -53,6 +53,7 @@ parity-rpc-client = { path = "rpc_client" } parity-updater = { path = "updater" } parity-whisper = { path = "whisper" } path = { path = "util/path" } +panic_hook = { path = "panic_hook" } parity-dapps = { path = "dapps", optional = true } clippy = { version = "0.0.103", optional = true} diff --git a/docker/hub/Dockerfile b/docker/hub/Dockerfile index 3120eeba7..c3406a5bd 100644 --- a/docker/hub/Dockerfile +++ b/docker/hub/Dockerfile @@ -4,7 +4,7 @@ WORKDIR /build #ENV for build TAG ARG BUILD_TAG ENV BUILD_TAG ${BUILD_TAG:-master} -RUN echo $BUILD_TAG +RUN echo "Build tag:" $BUILD_TAG # install tools and dependencies RUN apt-get update && \ apt-get install -y --force-yes --no-install-recommends \ @@ -48,7 +48,7 @@ RUN apt-get update && \ # show backtraces RUST_BACKTRACE=1 && \ # build parity - cd /build&&git clone https://github.com/paritytech/parity && \ +cd /build&&git clone https://github.com/paritytech/parity && \ cd parity && \ git pull&& \ git checkout $BUILD_TAG && \ diff --git a/ethcore/evm/src/interpreter/mod.rs b/ethcore/evm/src/interpreter/mod.rs index 885557dd3..30b431912 100644 --- a/ethcore/evm/src/interpreter/mod.rs +++ b/ethcore/evm/src/interpreter/mod.rs @@ -211,6 +211,7 @@ impl Interpreter { if (instruction == instructions::DELEGATECALL && !schedule.have_delegate_call) || (instruction == instructions::CREATE2 && !schedule.have_create2) || (instruction == instructions::STATICCALL && !schedule.have_static_call) || + ((instruction == instructions::RETURNDATACOPY || instruction == instructions::RETURNDATASIZE) && !schedule.have_return_data) || (instruction == instructions::REVERT && !schedule.have_revert) { return Err(evm::Error::BadInstruction { diff --git a/ethcore/evm/src/schedule.rs b/ethcore/evm/src/schedule.rs index a8dd09645..e721dc803 100644 --- a/ethcore/evm/src/schedule.rs +++ b/ethcore/evm/src/schedule.rs @@ -107,6 +107,8 @@ pub struct Schedule { pub blockhash_gas: usize, /// Static Call opcode enabled. pub have_static_call: bool, + /// RETURNDATA and RETURNDATASIZE opcodes enabled. + pub have_return_data: bool, /// Kill basic accounts below this balance if touched. pub kill_dust: CleanDustMode, } @@ -140,6 +142,7 @@ impl Schedule { have_delegate_call: true, have_create2: false, have_revert: false, + have_return_data: false, stack_limit: 1024, max_depth: 1024, tier_step_gas: [0, 2, 3, 5, 8, 10, 20, 0], @@ -190,6 +193,7 @@ impl Schedule { schedule.have_create2 = true; schedule.have_revert = true; schedule.have_static_call = true; + schedule.have_return_data = true; schedule.blockhash_gas = 350; schedule } @@ -200,6 +204,7 @@ impl Schedule { have_delegate_call: hdc, have_create2: false, have_revert: false, + have_return_data: false, stack_limit: 1024, max_depth: 1024, tier_step_gas: [0, 2, 3, 5, 8, 10, 20, 0], diff --git a/ethcore/res/ethereum/tests b/ethcore/res/ethereum/tests index 4e8b9be3f..ef191fdc6 160000 --- a/ethcore/res/ethereum/tests +++ b/ethcore/res/ethereum/tests @@ -1 +1 @@ -Subproject commit 4e8b9be3fba16ec32e0cdf50b8f9329826283aaa +Subproject commit ef191fdc61cf76cdb9cdc147465fb447304b0ed2 diff --git a/ethcore/src/snapshot/service.rs b/ethcore/src/snapshot/service.rs index fd4c2cc1e..25fa28b5d 100644 --- a/ethcore/src/snapshot/service.rs +++ b/ethcore/src/snapshot/service.rs @@ -558,9 +558,9 @@ impl SnapshotService for Service { self.reader.read().as_ref().map(|r| r.manifest().clone()) } - fn min_supported_version(&self) -> Option { + fn supported_versions(&self) -> Option<(u64, u64)> { self.engine.snapshot_components() - .map(|c| c.min_supported_version()) + .map(|c| (c.min_supported_version(), c.current_version())) } fn chunk(&self, hash: H256) -> Option { diff --git a/ethcore/src/snapshot/snapshot_service_trait.rs b/ethcore/src/snapshot/snapshot_service_trait.rs index e57b39da1..9df366250 100644 --- a/ethcore/src/snapshot/snapshot_service_trait.rs +++ b/ethcore/src/snapshot/snapshot_service_trait.rs @@ -27,9 +27,9 @@ pub trait SnapshotService : Sync + Send { /// Query the most recent manifest data. fn manifest(&self) -> Option; - /// Get the minimum supported snapshot version number. + /// Get the supported range of snapshot version numbers. /// `None` indicates warp sync isn't supported by the consensus engine. - fn min_supported_version(&self) -> Option; + fn supported_versions(&self) -> Option<(u64, u64)>; /// Get raw chunk for a given hash. fn chunk(&self, hash: H256) -> Option; diff --git a/ethcore/src/spec/spec.rs b/ethcore/src/spec/spec.rs index 40893ad6d..7d3900f2c 100644 --- a/ethcore/src/spec/spec.rs +++ b/ethcore/src/spec/spec.rs @@ -100,6 +100,7 @@ impl CommonParams { schedule.have_create2 = block_number >= self.eip86_transition; schedule.have_revert = block_number >= self.eip140_transition; schedule.have_static_call = block_number >= self.eip214_transition; + schedule.have_return_data = block_number >= self.eip211_transition; if block_number >= self.eip210_transition { schedule.blockhash_gas = 350; } diff --git a/ethkey/cli/Cargo.toml b/ethkey/cli/Cargo.toml index 3ea931e25..6921af745 100644 --- a/ethkey/cli/Cargo.toml +++ b/ethkey/cli/Cargo.toml @@ -9,6 +9,7 @@ serde = "1.0" serde_derive = "1.0" rustc-hex = "1.0" docopt = "0.8" +panic_hook = { path = "../../panic_hook" } [[bin]] name = "ethkey" diff --git a/ethkey/cli/src/main.rs b/ethkey/cli/src/main.rs index 0d96c2a89..7ad07e295 100644 --- a/ethkey/cli/src/main.rs +++ b/ethkey/cli/src/main.rs @@ -20,12 +20,14 @@ extern crate serde; #[macro_use] extern crate serde_derive; extern crate ethkey; +extern crate panic_hook; use std::{env, fmt, process}; use std::num::ParseIntError; use docopt::Docopt; use rustc_hex::{FromHex, FromHexError}; use ethkey::{KeyPair, Random, Brain, Prefix, Error as EthkeyError, Generator, sign, verify_public, verify_address}; +use std::io; pub const USAGE: &'static str = r#" Ethereum keys generator. @@ -87,6 +89,7 @@ enum Error { FromHex(FromHexError), ParseInt(ParseIntError), Docopt(docopt::Error), + Io(io::Error), } impl From for Error { @@ -113,6 +116,12 @@ impl From for Error { } } +impl From for Error { + fn from(err: io::Error) -> Self { + Error::Io(err) + } +} + impl fmt::Display for Error { fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> { match *self { @@ -120,6 +129,7 @@ impl fmt::Display for Error { Error::FromHex(ref e) => write!(f, "{}", e), Error::ParseInt(ref e) => write!(f, "{}", e), Error::Docopt(ref e) => write!(f, "{}", e), + Error::Io(ref e) => write!(f, "{}", e), } } } @@ -146,6 +156,8 @@ impl DisplayMode { } fn main() { + panic_hook::set(); + match execute(env::args()) { Ok(ok) => println!("{}", ok), Err(err) => { @@ -176,17 +188,17 @@ fn execute(command: I) -> Result where I: IntoIterator println!("{}", result), Err(err) => { diff --git a/evmbin/Cargo.toml b/evmbin/Cargo.toml index e3de99f2b..5e9c50f8f 100644 --- a/evmbin/Cargo.toml +++ b/evmbin/Cargo.toml @@ -16,6 +16,7 @@ serde_derive = "1.0" ethcore = { path = "../ethcore" } ethcore-util = { path = "../util" } evm = { path = "../ethcore/evm" } +panic_hook = { path = "../panic_hook" } [features] evm-debug = ["ethcore/evm-debug-tests"] diff --git a/evmbin/src/main.rs b/evmbin/src/main.rs index df9b088d0..7e89c7c7f 100644 --- a/evmbin/src/main.rs +++ b/evmbin/src/main.rs @@ -26,6 +26,7 @@ extern crate serde_derive; extern crate docopt; extern crate ethcore_util as util; extern crate evm; +extern crate panic_hook; use std::sync::Arc; use std::{fmt, fs}; @@ -63,6 +64,8 @@ General options: fn main() { + panic_hook::set(); + let args: Args = Docopt::new(USAGE).and_then(|d| d.deserialize()).unwrap_or_else(|e| e.exit()); if args.flag_json { diff --git a/js/package.json b/js/package.json index dbd6fe68a..908ed0875 100644 --- a/js/package.json +++ b/js/package.json @@ -1,6 +1,6 @@ { "name": "parity.js", - "version": "1.7.101", + "version": "1.8.3", "main": "release/index.js", "jsnext:main": "src/index.js", "author": "Parity Team ", diff --git a/js/src/shared/contracts/code/wallet.js b/js/src/shared/contracts/code/wallet.js index 06142308a..ab60bfc98 100644 --- a/js/src/shared/contracts/code/wallet.js +++ b/js/src/shared/contracts/code/wallet.js @@ -15,16 +15,16 @@ // along with Parity. If not, see . /** - * @version Solidity v0.4.9 - Optimized - * @from https://github.com/paritytech/parity/blob/c4196a5de31e0b97ec42d5263d9db404cea4a776/js/src/contracts/snippets/enhanced-wallet.sol - * @date 07-Mar-2017 @ 16h00 UTC + * @version Solidity v0.4.10 - Optimized + * @from https://github.com/paritytech/parity/blob/6b0e4f9098be6b841353e7c4f116aa86b7c2e3d6/js/src/contracts/snippets/enhanced-wallet.sol + * @date 20-Jul-2017 @ 16h00 UTC */ -export const walletCompiler = 'v0.4.9+commit.364da425'; +export const walletCompiler = 'v0.4.10+commit.f0d539ae'; export const walletSource = 'https://github.com/paritytech/parity/blob/c4196a5de31e0b97ec42d5263d9db404cea4a776/js/src/contracts/snippets/enhanced-wallet.sol'; -export const wallet = '0x6060604052341561000c57fe5b60405161048538038061048583398101604090815281516020830151918301519201915b604080517f696e697457616c6c657428616464726573735b5d2c75696e743235362c75696e81527f7432353629000000000000000000000000000000000000000000000000000000602080830191909152915190819003602501902084516000829052909173_____________WalletLibrary______________91600281019160049182010290819038829003903960006000600483016000866127105a03f45b505050505050505b61039d806100e86000396000f300606060405236156100725763ffffffff60e060020a6000350416632f54bf6e811461012d5780634123cb6b1461015d578063523750931461017f578063659010e7146101a1578063746c9171146101c3578063c2cf7326146101e5578063c41a360a14610218578063f1736d8614610247575b61012b5b60003411156100c75760408051600160a060020a033316815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a1610127565b60003611156101275773_____________WalletLibrary______________600160a060020a0316600036600060405160200152604051808383808284378201915050925050506020604051808303818560325a03f4151561012457fe5b50505b5b5b565b005b341561013557fe5b610149600160a060020a0360043516610269565b604080519115158252519081900360200190f35b341561016557fe5b61016d6102cd565b60408051918252519081900360200190f35b341561018757fe5b61016d6102d3565b60408051918252519081900360200190f35b34156101a957fe5b61016d6102d9565b60408051918252519081900360200190f35b34156101cb57fe5b61016d6102df565b60408051918252519081900360200190f35b34156101ed57fe5b610149600435600160a060020a03602435166102e5565b604080519115158252519081900360200190f35b341561022057fe5b61022b60043561034a565b60408051600160a060020a039092168252519081900360200190f35b341561024f57fe5b61016d61036b565b60408051918252519081900360200190f35b600073_____________WalletLibrary______________600160a060020a0316600036600060405160200152604051808383808284378201915050925050506020604051808303818560325a03f415156102bf57fe5b50506040515190505b919050565b60015481565b60045481565b60035481565b60005481565b600073_____________WalletLibrary______________600160a060020a0316600036600060405160200152604051808383808284378201915050925050506020604051808303818560325a03f4151561033b57fe5b50506040515190505b92915050565b6000600560018301610100811061035d57fe5b0160005b505490505b919050565b600254815600a165627a7a723058204a75c2f5c8009054bd9e9998e8bb6f4bca0b201484709f357b482793957c47130029'; -export const walletLibrary = '0x6060604052341561000c57fe5b5b6116d88061001c6000396000f300606060405236156101015763ffffffff60e060020a600035041663173825d981146101575780632f54bf6e146101755780634123cb6b146101a557806352375093146101c75780635c52c2f5146101e9578063659010e7146101fb5780637065cb481461021d578063746c91711461023b578063797af6271461025d5780639da5e0eb14610284578063b20d30a914610299578063b61d27f6146102ae578063b75c7dc6146102ec578063ba51a6df14610301578063c2cf732614610316578063c41a360a14610349578063c57c5f6014610378578063cbf0b0c0146103cf578063e46dcfeb146103ed578063f00d4b5d14610449578063f1736d861461046d575b6101555b60003411156101525760408051600160a060020a033316815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a15b5b565b005b341561015f57fe5b610155600160a060020a036004351661048f565b005b341561017d57fe5b610191600160a060020a036004351661057d565b604080519115158252519081900360200190f35b34156101ad57fe5b6101b561059e565b60408051918252519081900360200190f35b34156101cf57fe5b6101b56105a4565b60408051918252519081900360200190f35b34156101f157fe5b6101556105aa565b005b341561020357fe5b6101b56105e1565b60408051918252519081900360200190f35b341561022557fe5b610155600160a060020a03600435166105e7565b005b341561024357fe5b6101b56106d7565b60408051918252519081900360200190f35b341561026557fe5b6101916004356106dd565b604080519115158252519081900360200190f35b341561028c57fe5b610155600435610a2f565b005b34156102a157fe5b610155600435610a43565b005b34156102b657fe5b6101b560048035600160a060020a0316906024803591604435918201910135610a7b565b60408051918252519081900360200190f35b34156102f457fe5b610155600435610d5d565b005b341561030957fe5b610155600435610e08565b005b341561031e57fe5b610191600435600160a060020a0360243516610e8a565b604080519115158252519081900360200190f35b341561035157fe5b61035c600435610edf565b60408051600160a060020a039092168252519081900360200190f35b341561038057fe5b6101556004808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437509496505093359350610f0092505050565b005b34156103d757fe5b610155600160a060020a0360043516610fd4565b005b34156103f557fe5b6101556004808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437509496505084359460200135935061101292505050565b005b341561045157fe5b610155600160a060020a036004358116906024351661102b565b005b341561047557fe5b6101b5611125565b60408051918252519081900360200190f35b60006000366040518083838082843782019150509250505060405180910390206104b88161112b565b1561057657600160a060020a0383166000908152610105602052604090205491508115156104e557610576565b60016001540360005411156104f957610576565b6000600583610100811061050957fe5b0160005b5055600160a060020a03831660009081526101056020526040812055610531611296565b610539611386565b60408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a15b5b5b505050565b600160a060020a03811660009081526101056020526040812054115b919050565b60015481565b60045481565b6000366040518083838082843782019150509250505060405180910390206105d18161112b565b156105dc5760006003555b5b5b50565b60035481565b60003660405180838380828437820191505092505050604051809103902061060e8161112b565b156106d15761061c8261057d565b15610626576106d1565b61062e611296565b60015460fa901061064157610641611386565b5b60015460fa9010610652576106d1565b60018054810190819055600160a060020a03831690600590610100811061067557fe5b0160005b5055600154600160a060020a03831660008181526101056020908152604091829020939093558051918252517f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3929181900390910190a15b5b5b5050565b60005481565b60006000826106eb8161112b565b15610a255760008481526101086020526040902054600160a060020a031615158061072757506000848152610108602052604090206001015415155b80610754575060008481526101086020526040902060029081015461010060018216150260001901160415155b15610a255760008481526101086020526040902054600160a060020a0316151561082c57600084815261010860209081526040918290206001808201546002928301805486516000199482161561010002949094011693909304601f810185900485028301850190955284825261082594909391929183018282801561081b5780601f106107f05761010080835404028352916020019161081b565b820191906000526020600020905b8154815290600101906020018083116107fe57829003601f168201915b50505050506114c2565b91506108e3565b60008481526101086020526040908190208054600180830154935160029384018054600160a060020a0390941695949093919283928592918116156101000260001901160480156108be5780601f10610893576101008083540402835291602001916108be565b820191906000526020600020905b8154815290600101906020018083116108a157829003601f168201915b505091505060006040518083038185876185025a03f19250505015156108e357610000565b5b6000848152610108602090815260409182902060018082015482548551600160a060020a033381811683529682018c90529681018390529086166060820181905295881660a082015260c06080820181815260029586018054958616156101000260001901909516959095049082018190527fe3a3a4111a84df27d76b68dc721e65c7711605ea5eee4afd3a9c58195217365c968b959394909390928a9290919060e0830190859080156109d95780601f106109ae576101008083540402835291602001916109d9565b820191906000526020600020905b8154815290600101906020018083116109bc57829003601f168201915b505097505050505050505060405180910390a16000848152610108602052604081208054600160a060020a03191681556001810182905590610a1e6002830182611557565b5050600192505b5b5b5b5050919050565b6002819055610a3c6114dc565b6004555b50565b600036604051808383808284378201915050925050506040518091039020610a6a8161112b565b156106d15760028290555b5b5b5050565b60006000610a883361057d565b15610d505782158015610a9f5750610a9f856114eb565b5b80610aad57506000546001145b15610bef57600160a060020a0386161515610b0357610afc8585858080601f016020809104026020016040519081016040528093929190818152602001838380828437506114c2945050505050565b9050610b43565b85600160a060020a03168585856040518083838082843782019150509250505060006040518083038185876185025a03f1925050501515610b4357610000565b5b7f9738cd1a8777c86b011f7b01d87d484217dc6ab5154a9d41eda5d14af8caf2923386888787866040518087600160a060020a0316600160a060020a0316815260200186815260200185600160a060020a0316600160a060020a031681526020018060200183600160a060020a0316600160a060020a0316815260200182810382528585828181526020019250808284376040519201829003995090975050505050505050a1610d50565b600036436040518084848082843791909101928352505060408051602092819003830190206000818152610108909352912054909450600160a060020a0316159150508015610c4e575060008281526101086020526040902060010154155b8015610c7b5750600082815261010860205260409020600290810154610100600182161502600019011604155b15610cbf576000828152610108602052604090208054600160a060020a031916600160a060020a03881617815560018101869055610cbd90600201858561159f565b505b610cc8826106dd565b1515610d505760408051838152600160a060020a033381811660208401529282018890528816606082015260a0608082018181529082018690527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32928592909189918b918a918a9160c082018484808284376040519201829003995090975050505050505050a15b5b5b5b5b50949350505050565b600160a060020a033316600090815261010560205260408120549080821515610d8557610e01565b50506000828152610106602052604081206001810154600284900a929083161115610e015780546001908101825581018054839003905560408051600160a060020a03331681526020810186905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5b50505050565b600036604051808383808284378201915050925050506040518091039020610e2f8161112b565b156106d157600154821115610e43576106d1565b6000829055610e50611296565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15b5b5b5050565b600082815261010660209081526040808320600160a060020a038516845261010590925282205482811515610ec25760009350610ed6565b8160020a9050808360010154166000141593505b50505092915050565b60006005600183016101008110610ef257fe5b0160005b505490505b919050565b815160019081018155600090600160a060020a033316906005905b0160005b505550600160a060020a033316600090815261010560205260408120600190555b8251811015610fc9578281815181101515610f5757fe5b60209081029091010151600160a060020a03166005600283016101008110610f7b57fe5b0160005b50819055508060020161010560008584815181101515610f9b57fe5b90602001906020020151600160a060020a03168152602001908152602001600020819055505b600101610f40565b60008290555b505050565b600036604051808383808284378201915050925050506040518091039020610ffb8161112b565b156106d15781600160a060020a0316ff5b5b5b5050565b61101b81610a2f565b6105768383610f00565b5b505050565b60006000366040518083838082843782019150509250505060405180910390206110548161112b565b15610e01576110628361057d565b1561106c57610e01565b600160a060020a03841660009081526101056020526040902054915081151561109457610e01565b61109c611296565b600160a060020a03831660058361010081106110b457fe5b0160005b5055600160a060020a0380851660008181526101056020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b5b5b50505050565b60025481565b600160a060020a0333166000908152610105602052604081205481808215156111535761128c565b600085815261010660205260409020805490925015156111b65760008054835560018084019190915561010780549161118e9190830161161e565b60028301819055610107805487929081106111a557fe5b906000526020600020900160005b50555b8260020a9050808260010154166000141561128c5760408051600160a060020a03331681526020810187905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a181546001901161127957600085815261010660205260409020600201546101078054909190811061123c57fe5b906000526020600020900160005b50600090819055858152610106602052604081208181556001808201839055600290910191909155935061128c565b8154600019018255600182018054821790555b5b5b505050919050565b6101075460005b81811015611374576101086000610107838154811015156112ba57fe5b906000526020600020900160005b50548152602081019190915260400160009081208054600160a060020a031916815560018101829055906112ff6002830182611557565b505061010780548290811061131057fe5b906000526020600020900160005b50541561136b5761010660006101078381548110151561133a57fe5b906000526020600020900160005b505481526020810191909152604001600090812081815560018101829055600201555b5b60010161129d565b6106d16101076000611648565b5b5050565b60015b6001548110156105dc575b600154811080156113b7575060058161010081106113ae57fe5b0160005b505415155b156113c457600101611394565b5b60016001541180156113eb575060015460059061010081106113e357fe5b0160005b5054155b156113ff57600180546000190190556113c4565b600154811080156114255750600154600590610100811061141c57fe5b0160005b505415155b80156114425750600581610100811061143a57fe5b0160005b5054155b156114b957600154600590610100811061145857fe5b0160005b5054600582610100811061146c57fe5b0160005b5055806101056000600583610100811061148657fe5b0160005b505481526020019081526020016000208190555060006005600154610100811015156114b257fe5b0160005b50555b611389565b5b50565b600081516020830184f09050803b15610000575b92915050565b600062015180425b0490505b90565b60006114f63361057d565b15610599576004546115066114dc565b111561151d5760006003556115196114dc565b6004555b600354828101108015906115375750600254826003540111155b1561154c575060038054820190556001610599565b5060005b5b5b919050565b50805460018160011615610100020316600290046000825580601f1061157d57506105dc565b601f0160209004906000526020600020908101906105dc919061166a565b5b50565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106115e05782800160ff1982351617855561160d565b8280016001018555821561160d579182015b8281111561160d5782358255916020019190600101906115f2565b5b5061161a92915061166a565b5090565b8154818355818115116105765760008381526020902061057691810190830161166a565b5b505050565b50805460008255906000526020600020908101906105dc919061166a565b5b50565b6114e891905b8082111561161a5760008155600101611670565b5090565b90565b6114e891905b8082111561161a5760008155600101611670565b5090565b905600a165627a7a723058206560ca68304798da7e3be68397368a30b63db1453ff138ff8f765e80080025af0029'; +export const wallet = '0x6060604052341561000c57fe5b60405161048538038061048583398101604090815281516020830151918301519201915b604080517f696e697457616c6c657428616464726573735b5d2c75696e743235362c75696e81527f7432353629000000000000000000000000000000000000000000000000000000602080830191909152915190819003602501902084516000829052909173_____________WalletLibrary______________91600281019160049182010290819038829003903960006000600483016000866127105a03f45b505050505050505b61039d806100e86000396000f300606060405236156100725763ffffffff60e060020a6000350416632f54bf6e811461012d5780634123cb6b1461015d578063523750931461017f578063659010e7146101a1578063746c9171146101c3578063c2cf7326146101e5578063c41a360a14610218578063f1736d8614610247575b61012b5b60003411156100c75760408051600160a060020a033316815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a1610127565b60003611156101275773_____________WalletLibrary______________600160a060020a0316600036600060405160200152604051808383808284378201915050925050506020604051808303818560325a03f4151561012457fe5b50505b5b5b565b005b341561013557fe5b610149600160a060020a0360043516610269565b604080519115158252519081900360200190f35b341561016557fe5b61016d6102cd565b60408051918252519081900360200190f35b341561018757fe5b61016d6102d3565b60408051918252519081900360200190f35b34156101a957fe5b61016d6102d9565b60408051918252519081900360200190f35b34156101cb57fe5b61016d6102df565b60408051918252519081900360200190f35b34156101ed57fe5b610149600435600160a060020a03602435166102e5565b604080519115158252519081900360200190f35b341561022057fe5b61022b60043561034a565b60408051600160a060020a039092168252519081900360200190f35b341561024f57fe5b61016d61036b565b60408051918252519081900360200190f35b600073_____________WalletLibrary______________600160a060020a0316600036600060405160200152604051808383808284378201915050925050506020604051808303818560325a03f415156102bf57fe5b50506040515190505b919050565b60015481565b60045481565b60035481565b60005481565b600073_____________WalletLibrary______________600160a060020a0316600036600060405160200152604051808383808284378201915050925050506020604051808303818560325a03f4151561033b57fe5b50506040515190505b92915050565b6000600560018301610100811061035d57fe5b0160005b505490505b919050565b600254815600a165627a7a72305820c20a8475c42598c198f6629bada37e1b234da85ac2c0cbac3d96089030b180400029'; +export const walletLibrary = '0x6060604052341561000c57fe5b5b61170f8061001c6000396000f300606060405236156101015763ffffffff60e060020a600035041663173825d981146101575780632f54bf6e146101755780634123cb6b146101a557806352375093146101c75780635c52c2f5146101e9578063659010e7146101fb5780637065cb481461021d578063746c91711461023b578063797af6271461025d5780639da5e0eb14610284578063b20d30a914610299578063b61d27f6146102ae578063b75c7dc6146102ec578063ba51a6df14610301578063c2cf732614610316578063c41a360a14610349578063c57c5f6014610378578063cbf0b0c0146103cf578063e46dcfeb146103ed578063f00d4b5d14610449578063f1736d861461046d575b6101555b60003411156101525760408051600160a060020a033316815234602082015281517fe1fffcc4923d04b559f4d29a8bfc6cda04eb5b0d3c460751c2402c5c5cc9109c929181900390910190a15b5b565b005b341561015f57fe5b610155600160a060020a036004351661048f565b005b341561017d57fe5b610191600160a060020a036004351661057d565b604080519115158252519081900360200190f35b34156101ad57fe5b6101b561059e565b60408051918252519081900360200190f35b34156101cf57fe5b6101b56105a4565b60408051918252519081900360200190f35b34156101f157fe5b6101556105aa565b005b341561020357fe5b6101b56105e1565b60408051918252519081900360200190f35b341561022557fe5b610155600160a060020a03600435166105e7565b005b341561024357fe5b6101b56106d7565b60408051918252519081900360200190f35b341561026557fe5b6101916004356106dd565b604080519115158252519081900360200190f35b341561028c57fe5b610155600435610a30565b005b34156102a157fe5b610155600435610a56565b005b34156102b657fe5b6101b560048035600160a060020a0316906024803591604435918201910135610a8e565b60408051918252519081900360200190f35b34156102f457fe5b610155600435610d71565b005b341561030957fe5b610155600435610e1c565b005b341561031e57fe5b610191600435600160a060020a0360243516610e9e565b604080519115158252519081900360200190f35b341561035157fe5b61035c600435610ef3565b60408051600160a060020a039092168252519081900360200190f35b341561038057fe5b6101556004808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437509496505093359350610f1492505050565b005b34156103d757fe5b610155600160a060020a0360043516610ff9565b005b34156103f557fe5b6101556004808035906020019082018035906020019080806020026020016040519081016040528093929190818152602001838360200280828437509496505084359460200135935061103792505050565b005b341561045157fe5b610155600160a060020a0360043581169060243516611062565b005b341561047557fe5b6101b561115c565b60408051918252519081900360200190f35b60006000366040518083838082843782019150509250505060405180910390206104b881611162565b1561057657600160a060020a0383166000908152610105602052604090205491508115156104e557610576565b60016001540360005411156104f957610576565b6000600583610100811061050957fe5b0160005b5055600160a060020a038316600090815261010560205260408120556105316112cd565b6105396113bd565b60408051600160a060020a038516815290517f58619076adf5bb0943d100ef88d52d7c3fd691b19d3a9071b555b651fbf418da9181900360200190a15b5b5b505050565b600160a060020a03811660009081526101056020526040812054115b919050565b60015481565b60045481565b6000366040518083838082843782019150509250505060405180910390206105d181611162565b156105dc5760006003555b5b5b50565b60035481565b60003660405180838380828437820191505092505050604051809103902061060e81611162565b156106d15761061c8261057d565b15610626576106d1565b61062e6112cd565b60015460fa9010610641576106416113bd565b5b60015460fa9010610652576106d1565b60018054810190819055600160a060020a03831690600590610100811061067557fe5b0160005b5055600154600160a060020a03831660008181526101056020908152604091829020939093558051918252517f994a936646fe87ffe4f1e469d3d6aa417d6b855598397f323de5b449f765f0c3929181900390910190a15b5b5b5050565b60005481565b60006000826106eb81611162565b15610a265760008481526101086020526040902054600160a060020a031615158061072757506000848152610108602052604090206001015415155b80610754575060008481526101086020526040902060029081015461010060018216150260001901160415155b15610a265760008481526101086020526040902054600160a060020a0316151561082c57600084815261010860209081526040918290206001808201546002928301805486516000199482161561010002949094011693909304601f810185900485028301850190955284825261082594909391929183018282801561081b5780601f106107f05761010080835404028352916020019161081b565b820191906000526020600020905b8154815290600101906020018083116107fe57829003601f168201915b50505050506114f9565b91506108e4565b60008481526101086020526040908190208054600180830154935160029384018054600160a060020a0390941695949093919283928592918116156101000260001901160480156108be5780601f10610893576101008083540402835291602001916108be565b820191906000526020600020905b8154815290600101906020018083116108a157829003601f168201915b505091505060006040518083038185876185025a03f19250505015156108e45760006000fd5b5b6000848152610108602090815260409182902060018082015482548551600160a060020a033381811683529682018c90529681018390529086166060820181905295881660a082015260c06080820181815260029586018054958616156101000260001901909516959095049082018190527fe3a3a4111a84df27d76b68dc721e65c7711605ea5eee4afd3a9c58195217365c968b959394909390928a9290919060e0830190859080156109da5780601f106109af576101008083540402835291602001916109da565b820191906000526020600020905b8154815290600101906020018083116109bd57829003601f168201915b505097505050505050505060405180910390a16000848152610108602052604081208054600160a060020a03191681556001810182905590610a1f600283018261158e565b5050600192505b5b5b5b5050919050565b60006001541115610a415760006000fd5b6002819055610a4e611513565b6004555b5b50565b600036604051808383808284378201915050925050506040518091039020610a7d81611162565b156106d15760028290555b5b5b5050565b60006000610a9b3361057d565b15610d645782158015610ab25750610ab285611522565b5b80610ac057506000546001145b15610c0357600160a060020a0386161515610b1657610b0f8585858080601f016020809104026020016040519081016040528093929190818152602001838380828437506114f9945050505050565b9050610b57565b85600160a060020a03168585856040518083838082843782019150509250505060006040518083038185876185025a03f1925050501515610b575760006000fd5b5b7f9738cd1a8777c86b011f7b01d87d484217dc6ab5154a9d41eda5d14af8caf2923386888787866040518087600160a060020a0316600160a060020a0316815260200186815260200185600160a060020a0316600160a060020a031681526020018060200183600160a060020a0316600160a060020a0316815260200182810382528585828181526020019250808284376040519201829003995090975050505050505050a1610d64565b600036436040518084848082843791909101928352505060408051602092819003830190206000818152610108909352912054909450600160a060020a0316159150508015610c62575060008281526101086020526040902060010154155b8015610c8f5750600082815261010860205260409020600290810154610100600182161502600019011604155b15610cd3576000828152610108602052604090208054600160a060020a031916600160a060020a03881617815560018101869055610cd19060020185856115d6565b505b610cdc826106dd565b1515610d645760408051838152600160a060020a033381811660208401529282018890528816606082015260a0608082018181529082018690527f1733cbb53659d713b79580f79f3f9ff215f78a7c7aa45890f3b89fc5cddfbf32928592909189918b918a918a9160c082018484808284376040519201829003995090975050505050505050a15b5b5b5b5b50949350505050565b600160a060020a033316600090815261010560205260408120549080821515610d9957610e15565b50506000828152610106602052604081206001810154600284900a929083161115610e155780546001908101825581018054839003905560408051600160a060020a03331681526020810186905281517fc7fb647e59b18047309aa15aad418e5d7ca96d173ad704f1031a2c3d7591734b929181900390910190a15b5b50505050565b600036604051808383808284378201915050925050506040518091039020610e4381611162565b156106d157600154821115610e57576106d1565b6000829055610e646112cd565b6040805183815290517facbdb084c721332ac59f9b8e392196c9eb0e4932862da8eb9beaf0dad4f550da9181900360200190a15b5b5b5050565b600082815261010660209081526040808320600160a060020a038516845261010590925282205482811515610ed65760009350610eea565b8160020a9050808360010154166000141593505b50505092915050565b60006005600183016101008110610f0657fe5b0160005b505490505b919050565b600060006001541115610f275760006000fd5b825160019081018155600160a060020a033316906005905b0160005b505550600160a060020a033316600090815261010560205260408120600190555b8251811015610fed578281815181101515610f7b57fe5b60209081029091010151600160a060020a03166005600283016101008110610f9f57fe5b0160005b50819055508060020161010560008584815181101515610fbf57fe5b90602001906020020151600160a060020a03168152602001908152602001600020819055505b600101610f64565b60008290555b5b505050565b60003660405180838380828437820191505092505050604051809103902061102081611162565b156106d15781600160a060020a0316ff5b5b5b5050565b600060015411156110485760006000fd5b61105181610a30565b6105768383610f14565b5b5b505050565b600060003660405180838380828437820191505092505050604051809103902061108b81611162565b15610e15576110998361057d565b156110a357610e15565b600160a060020a0384166000908152610105602052604090205491508115156110cb57610e15565b6110d36112cd565b600160a060020a03831660058361010081106110eb57fe5b0160005b5055600160a060020a0380851660008181526101056020908152604080832083905593871680835291849020869055835192835282015281517fb532073b38c83145e3e5135377a08bf9aab55bc0fd7c1179cd4fb995d2a5159c929181900390910190a15b5b5b50505050565b60025481565b600160a060020a03331660009081526101056020526040812054818082151561118a576112c3565b600085815261010660205260409020805490925015156111ed576000805483556001808401919091556101078054916111c591908301611655565b60028301819055610107805487929081106111dc57fe5b906000526020600020900160005b50555b8260020a905080826001015416600014156112c35760408051600160a060020a03331681526020810187905281517fe1c52dc63b719ade82e8bea94cc41a0d5d28e4aaf536adb5e9cccc9ff8c1aeda929181900390910190a18154600190116112b057600085815261010660205260409020600201546101078054909190811061127357fe5b906000526020600020900160005b5060009081905585815261010660205260408120818155600180820183905560029091019190915593506112c3565b8154600019018255600182018054821790555b5b5b505050919050565b6101075460005b818110156113ab576101086000610107838154811015156112f157fe5b906000526020600020900160005b50548152602081019190915260400160009081208054600160a060020a03191681556001810182905590611336600283018261158e565b505061010780548290811061134757fe5b906000526020600020900160005b5054156113a25761010660006101078381548110151561137157fe5b906000526020600020900160005b505481526020810191909152604001600090812081815560018101829055600201555b5b6001016112d4565b6106d1610107600061167f565b5b5050565b60015b6001548110156105dc575b600154811080156113ee575060058161010081106113e557fe5b0160005b505415155b156113fb576001016113cb565b5b60016001541180156114225750600154600590610100811061141a57fe5b0160005b5054155b1561143657600180546000190190556113fb565b6001548110801561145c5750600154600590610100811061145357fe5b0160005b505415155b80156114795750600581610100811061147157fe5b0160005b5054155b156114f057600154600590610100811061148f57fe5b0160005b505460058261010081106114a357fe5b0160005b505580610105600060058361010081106114bd57fe5b0160005b505481526020019081526020016000208190555060006005600154610100811015156114e957fe5b0160005b50555b6113c0565b5b50565b600081516020830184f09050803b15610000575b92915050565b600062015180425b0490505b90565b600061152d3361057d565b156105995760045461153d611513565b1115611554576000600355611550611513565b6004555b6003548281011080159061156e5750600254826003540111155b15611583575060038054820190556001610599565b5060005b5b5b919050565b50805460018160011615610100020316600290046000825580601f106115b457506105dc565b601f0160209004906000526020600020908101906105dc91906116a1565b5b50565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f106116175782800160ff19823516178555611644565b82800160010185558215611644579182015b82811115611644578235825591602001919060010190611629565b5b506116519291506116a1565b5090565b815481835581811511610576576000838152602090206105769181019083016116a1565b5b505050565b50805460008255906000526020600020908101906105dc91906116a1565b5b50565b61151f91905b8082111561165157600081556001016116a7565b5090565b90565b61151f91905b8082111561165157600081556001016116a7565b5090565b905600a165627a7a723058209a3af51063f944081cd5ee8601e4e655f25cf7bc219a7983cda60f163f1709a70029'; export const walletLibraryABI = '[{"constant":false,"inputs":[{"name":"_owner","type":"address"}],"name":"removeOwner","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"_addr","type":"address"}],"name":"isOwner","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"m_numOwners","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"m_lastDay","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[],"name":"resetSpentToday","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"m_spentToday","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_owner","type":"address"}],"name":"addOwner","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"m_required","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_h","type":"bytes32"}],"name":"confirm","outputs":[{"name":"o_success","type":"bool"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_limit","type":"uint256"}],"name":"initDaylimit","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_newLimit","type":"uint256"}],"name":"setDailyLimit","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"},{"name":"_value","type":"uint256"},{"name":"_data","type":"bytes"}],"name":"execute","outputs":[{"name":"o_hash","type":"bytes32"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_operation","type":"bytes32"}],"name":"revoke","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_newRequired","type":"uint256"}],"name":"changeRequirement","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"_operation","type":"bytes32"},{"name":"_owner","type":"address"}],"name":"hasConfirmed","outputs":[{"name":"","type":"bool"}],"payable":false,"type":"function"},{"constant":true,"inputs":[{"name":"ownerIndex","type":"uint256"}],"name":"getOwner","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_owners","type":"address[]"},{"name":"_required","type":"uint256"}],"name":"initMultiowned","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_to","type":"address"}],"name":"kill","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_owners","type":"address[]"},{"name":"_required","type":"uint256"},{"name":"_daylimit","type":"uint256"}],"name":"initWallet","outputs":[],"payable":false,"type":"function"},{"constant":false,"inputs":[{"name":"_from","type":"address"},{"name":"_to","type":"address"}],"name":"changeOwner","outputs":[],"payable":false,"type":"function"},{"constant":true,"inputs":[],"name":"m_dailyLimit","outputs":[{"name":"","type":"uint256"}],"payable":false,"type":"function"},{"payable":true,"type":"fallback"},{"anonymous":false,"inputs":[{"indexed":false,"name":"owner","type":"address"},{"indexed":false,"name":"operation","type":"bytes32"}],"name":"Confirmation","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"owner","type":"address"},{"indexed":false,"name":"operation","type":"bytes32"}],"name":"Revoke","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"oldOwner","type":"address"},{"indexed":false,"name":"newOwner","type":"address"}],"name":"OwnerChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"newOwner","type":"address"}],"name":"OwnerAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"oldOwner","type":"address"}],"name":"OwnerRemoved","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"newRequirement","type":"uint256"}],"name":"RequirementChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"_from","type":"address"},{"indexed":false,"name":"value","type":"uint256"}],"name":"Deposit","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"owner","type":"address"},{"indexed":false,"name":"value","type":"uint256"},{"indexed":false,"name":"to","type":"address"},{"indexed":false,"name":"data","type":"bytes"},{"indexed":false,"name":"created","type":"address"}],"name":"SingleTransact","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"owner","type":"address"},{"indexed":false,"name":"operation","type":"bytes32"},{"indexed":false,"name":"value","type":"uint256"},{"indexed":false,"name":"to","type":"address"},{"indexed":false,"name":"data","type":"bytes"},{"indexed":false,"name":"created","type":"address"}],"name":"MultiTransact","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"name":"operation","type":"bytes32"},{"indexed":false,"name":"initiator","type":"address"},{"indexed":false,"name":"value","type":"uint256"},{"indexed":false,"name":"to","type":"address"},{"indexed":false,"name":"data","type":"bytes"}],"name":"ConfirmationNeeded","type":"event"}]'; -export const walletSourceURL = 'https://github.com/paritytech/parity/blob/c4196a5de31e0b97ec42d5263d9db404cea4a776/js/src/contracts/snippets/enhanced-wallet.sol'; +export const walletSourceURL = 'https://github.com/paritytech/parity/blob/6b0e4f9098be6b841353e7c4f116aa86b7c2e3d6/js/src/contracts/snippets/enhanced-wallet.sol'; export const walletLibraryRegKey = 'walletLibrary.v.2'; // Used if no Wallet Library found in registry... diff --git a/js/src/shared/contracts/snippets/enhanced-wallet.sol b/js/src/shared/contracts/snippets/enhanced-wallet.sol index 1f89b1f6f..90a15c070 100644 --- a/js/src/shared/contracts/snippets/enhanced-wallet.sol +++ b/js/src/shared/contracts/snippets/enhanced-wallet.sol @@ -104,7 +104,7 @@ contract WalletLibrary is WalletEvents { // constructor is given number of sigs required to do protected "onlymanyowners" transactions // as well as the selection of addresses capable of confirming them. - function initMultiowned(address[] _owners, uint _required) { + function initMultiowned(address[] _owners, uint _required) only_uninitialized { m_numOwners = _owners.length + 1; m_owners[1] = uint(msg.sender); m_ownerIndex[uint(msg.sender)] = 1; @@ -198,7 +198,7 @@ contract WalletLibrary is WalletEvents { } // constructor - stores initial daily limit and records the present day's index. - function initDaylimit(uint _limit) { + function initDaylimit(uint _limit) only_uninitialized { m_dailyLimit = _limit; m_lastDay = today(); } @@ -211,9 +211,12 @@ contract WalletLibrary is WalletEvents { m_spentToday = 0; } + // throw unless the contract is not yet initialized. + modifier only_uninitialized { if (m_numOwners > 0) throw; _; } + // constructor - just pass on the owner array to the multiowned and // the limit to daylimit - function initWallet(address[] _owners, uint _required, uint _daylimit) { + function initWallet(address[] _owners, uint _required, uint _daylimit) only_uninitialized { initDaylimit(_daylimit); initMultiowned(_owners, _required); } diff --git a/js/src/views/Accounts/CreateWallet/createWalletStore.js b/js/src/views/Accounts/CreateWallet/createWalletStore.js index 0411aeeac..3f317efa3 100644 --- a/js/src/views/Accounts/CreateWallet/createWalletStore.js +++ b/js/src/views/Accounts/CreateWallet/createWalletStore.js @@ -183,6 +183,8 @@ export default class CreateWalletStore { return null; // exception when registry is not available }) .then((address) => { + console.warn('WalletLibrary address in registry', address); + if (!address || /^(0x)?0*$/.test(address)) { return null; } diff --git a/panic_hook/Cargo.toml b/panic_hook/Cargo.toml new file mode 100644 index 000000000..eb70c19f1 --- /dev/null +++ b/panic_hook/Cargo.toml @@ -0,0 +1,10 @@ +[package] +description = "Parity custom panic hook" +homepage = "http://parity.io" +license = "GPL-3.0" +name = "panic_hook" +version = "0.1.0" +authors = ["Parity Technologies "] + +[dependencies] +backtrace = "0.3.2" diff --git a/panic_hook/src/lib.rs b/panic_hook/src/lib.rs new file mode 100644 index 000000000..a1487eb78 --- /dev/null +++ b/panic_hook/src/lib.rs @@ -0,0 +1,69 @@ +// Copyright 2015-2017 Parity Technologies (UK) Ltd. +// This file is part of Parity. + +// Parity 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. + +// Parity 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 Parity. If not, see . + +//! Custom panic hook with bug report link + +extern crate backtrace; + +use backtrace::Backtrace; +use std::io::{self, Write}; +use std::panic::{self, PanicInfo}; +use std::thread; + +/// Set the panic hook +pub fn set() { + panic::set_hook(Box::new(panic_hook)); +} + +static ABOUT_PANIC: &str = " +This is a bug. Please report it at: + + https://github.com/paritytech/parity/issues/new +"; + +fn panic_hook(info: &PanicInfo) { + let location = info.location(); + let file = location.as_ref().map(|l| l.file()).unwrap_or(""); + let line = location.as_ref().map(|l| l.line()).unwrap_or(0); + + let msg = match info.payload().downcast_ref::<&'static str>() { + Some(s) => *s, + None => match info.payload().downcast_ref::() { + Some(s) => &s[..], + None => "Box", + } + }; + + let thread = thread::current(); + let name = thread.name().unwrap_or(""); + + let backtrace = Backtrace::new(); + + let mut stderr = io::stderr(); + + let _ = writeln!(stderr, ""); + let _ = writeln!(stderr, "===================="); + let _ = writeln!(stderr, ""); + let _ = writeln!(stderr, "{:?}", backtrace); + let _ = writeln!(stderr, ""); + let _ = writeln!( + stderr, + "Thread '{}' panicked at '{}', {}:{}", + name, msg, file, line + ); + + let _ = writeln!(stderr, "{}", ABOUT_PANIC); +} diff --git a/parity/blockchain.rs b/parity/blockchain.rs index fae9a3bfc..a70272931 100644 --- a/parity/blockchain.rs +++ b/parity/blockchain.rs @@ -531,10 +531,12 @@ pub fn kill_db(cmd: KillBlockchain) -> Result<(), String> { let genesis_hash = spec.genesis_header().hash(); let db_dirs = cmd.dirs.database(genesis_hash, None, spec.data_dir); let user_defaults_path = db_dirs.user_defaults_path(); - let user_defaults = UserDefaults::load(&user_defaults_path)?; + let mut user_defaults = UserDefaults::load(&user_defaults_path)?; let algorithm = cmd.pruning.to_algorithm(&user_defaults); let dir = db_dirs.db_path(algorithm); fs::remove_dir_all(&dir).map_err(|e| format!("Error removing database: {:?}", e))?; + user_defaults.is_first_launch = true; + user_defaults.save(&user_defaults_path)?; info!("Database deleted."); Ok(()) } diff --git a/parity/informant.rs b/parity/informant.rs index 4c3b4aca2..1935ec9b6 100644 --- a/parity/informant.rs +++ b/parity/informant.rs @@ -152,7 +152,7 @@ impl InformantData for FullNodeInformantData { max_peers: status.current_max_peers(net_config.min_peers, net_config.max_peers), })) } - _ => (is_major_importing(None, queue_info.clone()), None), + _ => (is_major_importing(self.sync.as_ref().map(|s| s.status().state), queue_info.clone()), None), }; Report { @@ -254,8 +254,6 @@ impl Informant { return; } - *self.last_tick.write() = Instant::now(); - let (client_report, full_report) = { let mut last_report = self.last_report.lock(); let full_report = self.target.report(); @@ -287,6 +285,8 @@ impl Informant { return; } + *self.last_tick.write() = Instant::now(); + let paint = |c: Style, t: String| match self.with_color && stdout_isatty() { true => format!("{}", c.paint(t)), false => t, diff --git a/parity/main.rs b/parity/main.rs index 72579be74..8bd6bf53f 100644 --- a/parity/main.rs +++ b/parity/main.rs @@ -57,6 +57,7 @@ extern crate ethcore_logger; extern crate ethcore_util as util; extern crate ethkey; extern crate ethsync; +extern crate panic_hook; extern crate parity_hash_fetch as hash_fetch; extern crate parity_ipfs_api; extern crate parity_local_store as local_store; @@ -315,8 +316,7 @@ macro_rules! trace_main { } fn main() { - // Always print backtrace on panic. - env::set_var("RUST_BACKTRACE", "1"); + panic_hook::set(); // assuming the user is not running with `--force-direct`, then: // if argv[0] == "parity" and this executable != ~/.parity-updates/parity, run that instead. diff --git a/parity/run.rs b/parity/run.rs index 15e09d74a..6f0b444a0 100644 --- a/parity/run.rs +++ b/parity/run.rs @@ -754,6 +754,7 @@ pub fn execute(cmd: RunCmd, can_restart: bool, logger: Arc) -> R service.register_io_handler(informant.clone()).map_err(|_| "Unable to register informant handler".to_owned())?; // save user defaults + user_defaults.is_first_launch = false; user_defaults.pruning = algorithm; user_defaults.tracing = tracing; user_defaults.fat_db = fat_db; diff --git a/parity/user_defaults.rs b/parity/user_defaults.rs index 12bb9937f..703b3bf16 100644 --- a/parity/user_defaults.rs +++ b/parity/user_defaults.rs @@ -41,6 +41,7 @@ impl Serialize for UserDefaults { fn serialize(&self, serializer: S) -> Result where S: Serializer { let mut map: BTreeMap = BTreeMap::new(); + map.insert("is_first_launch".into(), Value::Bool(self.is_first_launch)); map.insert("pruning".into(), Value::String(self.pruning.as_str().into())); map.insert("tracing".into(), Value::Bool(self.tracing)); map.insert("fat_db".into(), Value::Bool(self.fat_db)); diff --git a/rpc/src/v1/helpers/block_import.rs b/rpc/src/v1/helpers/block_import.rs index 076893df1..3c3f84635 100644 --- a/rpc/src/v1/helpers/block_import.rs +++ b/rpc/src/v1/helpers/block_import.rs @@ -21,9 +21,10 @@ use ethsync::SyncState; /// Check if client is during major sync or during block import. pub fn is_major_importing(sync_state: Option, queue_info: BlockQueueInfo) -> bool { - let is_syncing_state = sync_state.map_or(false, |s| - s != SyncState::Idle && s != SyncState::NewBlocks - ); + let is_syncing_state = sync_state.map_or(false, |s| match s { + SyncState::Idle | SyncState::NewBlocks | SyncState::WaitingPeers => false, + _ => true, + }); let is_verifying = queue_info.unverified_queue_size + queue_info.verified_queue_size > 3; is_verifying || is_syncing_state } diff --git a/rpc/src/v1/tests/helpers/snapshot_service.rs b/rpc/src/v1/tests/helpers/snapshot_service.rs index efecbcb9b..cfb80619a 100644 --- a/rpc/src/v1/tests/helpers/snapshot_service.rs +++ b/rpc/src/v1/tests/helpers/snapshot_service.rs @@ -41,7 +41,7 @@ impl TestSnapshotService { impl SnapshotService for TestSnapshotService { fn manifest(&self) -> Option { None } - fn min_supported_version(&self) -> Option { None } + fn supported_versions(&self) -> Option<(u64, u64)> { None } fn chunk(&self, _hash: H256) -> Option { None } fn status(&self) -> RestorationStatus { self.status.lock().clone() } fn begin_restore(&self, _manifest: ManifestData) { } diff --git a/scripts/aura-test.sh b/scripts/aura-test.sh new file mode 100755 index 000000000..bb152beba --- /dev/null +++ b/scripts/aura-test.sh @@ -0,0 +1,9 @@ +#!/bin/bash +cargo build -j $(nproc) --release --features final $CARGOFLAGS +git clone https://github.com/paritytech/parity-import-tests +cp target/release/parity parity-import-tests/aura/parity +cd parity-import-tests/aura +echo "Start Aura test" +parity import blocks.rlp --chain chain.json +parity restore snap --chain chain.json +echo "Aura test complete" diff --git a/scripts/deb-build.sh b/scripts/deb-build.sh old mode 100644 new mode 100755 diff --git a/scripts/deploy.sh b/scripts/deploy.sh old mode 100644 new mode 100755 diff --git a/scripts/docker-build.sh b/scripts/docker-build.sh old mode 100644 new mode 100755 index c83912080..ceb085f51 --- a/scripts/docker-build.sh +++ b/scripts/docker-build.sh @@ -1,5 +1,7 @@ #!/bin/bash cd docker/hub -if [ "$1" == "latest" ]; then DOCKER_BUILD_TAG="beta-release"; fi -docker build --build-arg BUILD_TAG=$DOCKER_BUILD_TAG --no-cache=true --tag $2/parity:$1 . -docker push $2/parity:$1 +DOCKER_BUILD_TAG=$1 +echo "Docker build tag: " $DOCKER_BUILD_TAG +docker build --build-arg BUILD_TAG=$DOCKER_BUILD_TAG --no-cache=true --tag parity/parity:$DOCKER_BUILD_TAG . +docker run -it parity/parity:$DOCKER_BUILD_TAG -v +docker push parity/parity:$DOCKER_BUILD_TAG diff --git a/scripts/targets.sh b/scripts/targets.sh old mode 100644 new mode 100755 diff --git a/sync/src/chain.rs b/sync/src/chain.rs index 1b31f9169..b3ca25328 100644 --- a/sync/src/chain.rs +++ b/sync/src/chain.rs @@ -504,7 +504,7 @@ impl ChainSync { } fn maybe_start_snapshot_sync(&mut self, io: &mut SyncIo) { - if !self.enable_warp_sync || io.snapshot_service().min_supported_version().is_none() { + if !self.enable_warp_sync || io.snapshot_service().supported_versions().is_none() { return; } if self.state != SyncState::WaitingPeers && self.state != SyncState::Blocks && self.state != SyncState::Waiting { @@ -1044,11 +1044,11 @@ impl ChainSync { Ok(manifest) => manifest, }; - let is_supported_version = io.snapshot_service().min_supported_version() - .map_or(false, |v| manifest.version >= v); + let is_supported_version = io.snapshot_service().supported_versions() + .map_or(false, |(l, h)| manifest.version >= l && manifest.version <= h); if !is_supported_version { - trace!(target: "sync", "{}: Snapshot manifest version too low: {}", peer_id, manifest.version); + trace!(target: "sync", "{}: Snapshot manifest version not supported: {}", peer_id, manifest.version); io.disable_peer(peer_id); self.continue_sync(io); return Ok(()); diff --git a/sync/src/tests/snapshot.rs b/sync/src/tests/snapshot.rs index 995d7a056..f52cdb39a 100644 --- a/sync/src/tests/snapshot.rs +++ b/sync/src/tests/snapshot.rs @@ -71,8 +71,8 @@ impl SnapshotService for TestSnapshotService { self.manifest.as_ref().cloned() } - fn min_supported_version(&self) -> Option { - Some(1) + fn supported_versions(&self) -> Option<(u64, u64)> { + Some((1, 2)) } fn chunk(&self, hash: H256) -> Option { diff --git a/util/network/src/host.rs b/util/network/src/host.rs index 50c721fb6..b0de67499 100644 --- a/util/network/src/host.rs +++ b/util/network/src/host.rs @@ -857,11 +857,16 @@ impl Host { // Add it to the node table if !s.info.originated { if let Ok(address) = s.remote_addr() { - let entry = NodeEntry { id: id, endpoint: NodeEndpoint { address: address, udp_port: address.port() } }; - self.nodes.write().add_node(Node::new(entry.id.clone(), entry.endpoint.clone())); - let mut discovery = self.discovery.lock(); - if let Some(ref mut discovery) = *discovery { - discovery.add_node(entry); + // We can't know remote listening ports, so just assume defaults and hope for the best. + let endpoint = NodeEndpoint { address: SocketAddr::new(address.ip(), DEFAULT_PORT), udp_port: DEFAULT_PORT }; + let entry = NodeEntry { id: id, endpoint: endpoint }; + let mut nodes = self.nodes.write(); + if !nodes.contains(&entry.id) { + nodes.add_node(Node::new(entry.id.clone(), entry.endpoint.clone())); + let mut discovery = self.discovery.lock(); + if let Some(ref mut discovery) = *discovery { + discovery.add_node(entry); + } } } } diff --git a/util/network/src/node_table.rs b/util/network/src/node_table.rs index 8498f4190..1481187d4 100644 --- a/util/network/src/node_table.rs +++ b/util/network/src/node_table.rs @@ -236,6 +236,11 @@ impl NodeTable { self.nodes.get_mut(id) } + /// Check if a node exists in the table. + pub fn contains(&self, id: &NodeId) -> bool { + self.nodes.contains_key(id) + } + /// Apply table changes coming from discovery pub fn update(&mut self, mut update: TableUpdates, reserved: &HashSet) { for (_, node) in update.added.drain() {